summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/option
Commit message (Collapse)AuthorAgeFilesLines
* option: No CMP077 warnings when both cache and local variable existsRobert Maynard2018-07-102-0/+15
| | | | | | Previously we would warn when the local and cache version of a variable exists, but this use case doesn't need a warning as it maintains backwards compatibility.
* option: respect existing normal variableRobert Maynard2018-07-096-0/+43
Add policy CMP0077 to change this behavior in a compatible way.
class='none' style='width: 99.8%;'/> -rw-r--r--.gitignore3
-rw-r--r--.gitlab-ci.yml320
-rw-r--r--.gitlab/.gitignore8
-rw-r--r--.gitlab/artifacts.yml9
-rw-r--r--[-rwxr-xr-x].gitlab/ci/borland-env.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/borland.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/clang-env.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/clang.ps10
-rw-r--r--.gitlab/ci/cmake-env.ps15
-rw-r--r--.gitlab/ci/cmake-env.sh3
-rw-r--r--[-rwxr-xr-x].gitlab/ci/cmake.ps10
-rw-r--r--.gitlab/ci/configure_cuda12.2_clang.cmake4
-rw-r--r--.gitlab/ci/configure_cuda12.2_nvidia.cmake5
-rw-r--r--.gitlab/ci/configure_debian12_aarch64_ninja.cmake7
-rw-r--r--.gitlab/ci/configure_debian12_makefiles_clang.cmake7
-rw-r--r--.gitlab/ci/configure_debian12_ninja.cmake2
-rw-r--r--.gitlab/ci/configure_debian12_ninja_clang.cmake4
-rw-r--r--.gitlab/ci/configure_debian12_ninja_common.cmake10
-rw-r--r--.gitlab/ci/configure_fedora39_asan.cmake4
-rw-r--r--.gitlab/ci/configure_fedora39_clang_analyzer.cmake3
-rw-r--r--.gitlab/ci/configure_fedora39_common_clang.cmake5
-rw-r--r--.gitlab/ci/configure_fedora39_makefiles.cmake103
-rw-r--r--.gitlab/ci/configure_fedora39_makefiles_clang.cmake5
-rw-r--r--.gitlab/ci/configure_fedora39_makefiles_symlinked.cmake2
-rw-r--r--.gitlab/ci/configure_fedora39_ninja.cmake14
-rw-r--r--.gitlab/ci/configure_fedora39_ninja_clang.cmake3
-rw-r--r--.gitlab/ci/configure_fedora39_ninja_multi.cmake5
-rw-r--r--.gitlab/ci/configure_fedora39_ninja_multi_clang.cmake3
-rw-r--r--.gitlab/ci/configure_fedora39_tidy.cmake5
-rw-r--r--.gitlab/ci/configure_fedora40_asan.cmake4
-rw-r--r--.gitlab/ci/configure_fedora40_clang_analyzer.cmake3
-rw-r--r--.gitlab/ci/configure_fedora40_common.cmake (renamed from .gitlab/ci/configure_fedora39_common.cmake)0
-rw-r--r--.gitlab/ci/configure_fedora40_common_clang.cmake17
-rw-r--r--.gitlab/ci/configure_fedora40_extdeps.cmake (renamed from .gitlab/ci/configure_fedora39_extdeps.cmake)0
-rw-r--r--.gitlab/ci/configure_fedora40_makefiles.cmake115
-rw-r--r--.gitlab/ci/configure_fedora40_makefiles_clang.cmake5
-rw-r--r--.gitlab/ci/configure_fedora40_makefiles_symlinked.cmake2
-rw-r--r--.gitlab/ci/configure_fedora40_ninja.cmake16
-rw-r--r--.gitlab/ci/configure_fedora40_ninja_clang.cmake3
-rw-r--r--.gitlab/ci/configure_fedora40_ninja_multi.cmake6
-rw-r--r--.gitlab/ci/configure_fedora40_ninja_multi_clang.cmake3
-rw-r--r--.gitlab/ci/configure_fedora40_sphinx.cmake (renamed from .gitlab/ci/configure_fedora39_sphinx.cmake)0
-rw-r--r--.gitlab/ci/configure_fedora40_sphinx_package.cmake (renamed from .gitlab/ci/configure_fedora39_sphinx_package.cmake)0
-rw-r--r--.gitlab/ci/configure_fedora40_tidy.cmake6
-rw-r--r--.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake3
-rw-r--r--.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake3
-rw-r--r--.gitlab/ci/configure_macos_arm64_ninja.cmake5
-rw-r--r--.gitlab/ci/configure_macos_x86_64_makefiles.cmake1
-rw-r--r--.gitlab/ci/configure_macos_x86_64_ninja.cmake4
-rw-r--r--.gitlab/ci/configure_windows_arm64_vs2022_ninja.cmake5
-rw-r--r--.gitlab/ci/configure_windows_clang_common.cmake13
-rw-r--r--.gitlab/ci/configure_windows_i386_package.cmake3
-rw-r--r--.gitlab/ci/configure_windows_intelcompiler_common.cmake4
-rw-r--r--.gitlab/ci/configure_windows_msvc_common.cmake2
-rw-r--r--.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake2
-rw-r--r--.gitlab/ci/configure_windows_package_common.cmake2
-rw-r--r--.gitlab/ci/configure_windows_vs2019_x64.cmake1
-rw-r--r--.gitlab/ci/configure_windows_vs2022_x64.cmake4
-rw-r--r--.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake7
-rw-r--r--.gitlab/ci/configure_windows_wix_common.cmake5
-rw-r--r--.gitlab/ci/configure_windows_x86_64_package.cmake3
-rw-r--r--.gitlab/ci/ctest_build.cmake1
-rw-r--r--.gitlab/ci/ctest_exclusions.cmake7
-rw-r--r--.gitlab/ci/ctest_memcheck_fedora40_asan.lsan.supp (renamed from .gitlab/ci/ctest_memcheck_fedora39_asan.lsan.supp)0
-rw-r--r--.gitlab/ci/docker/cuda12.2/Dockerfile9
-rwxr-xr-x.gitlab/ci/docker/cuda12.2/install_deps.sh20
-rw-r--r--.gitlab/ci/docker/cuda12.2/llvm-snapshot.gpg.key52
-rw-r--r--.gitlab/ci/docker/cuda12.2/llvm.list2
-rw-r--r--.gitlab/ci/docker/debian12-x86_64/deps_packages.lst3
-rw-r--r--.gitlab/ci/docker/fedora39-hip/Dockerfile27
-rw-r--r--.gitlab/ci/docker/fedora39-hip/deps_packages.lst15
-rwxr-xr-x.gitlab/ci/docker/fedora39-hip/install_deps.sh10
-rw-r--r--.gitlab/ci/docker/fedora39/Dockerfile58
-rw-r--r--.gitlab/ci/docker/fedora39/deps_packages.lst124
-rwxr-xr-x.gitlab/ci/docker/fedora39/install_iwyu.sh42
-rw-r--r--.gitlab/ci/docker/fedora40/Dockerfile58
-rw-r--r--.gitlab/ci/docker/fedora40/deps_packages.lst125
-rwxr-xr-x.gitlab/ci/docker/fedora40/install_deps.sh (renamed from .gitlab/ci/docker/fedora39/install_deps.sh)0
-rwxr-xr-x.gitlab/ci/docker/fedora40/install_iwyu.sh42
-rwxr-xr-x.gitlab/ci/docker/fedora40/install_rvm.sh (renamed from .gitlab/ci/docker/fedora39/install_rvm.sh)0
-rw-r--r--.gitlab/ci/docker/fedora40/iwyu_packages.lst (renamed from .gitlab/ci/docker/fedora39/iwyu_packages.lst)0
-rw-r--r--.gitlab/ci/docker/fedora40/rvm_packages.lst (renamed from .gitlab/ci/docker/fedora39/rvm_packages.lst)0
-rw-r--r--.gitlab/ci/docker/gcc_cxx_modules/Dockerfile9
-rwxr-xr-x.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh7
-rwxr-xr-x.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh25
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env.ps18
-rw-r--r--.gitlab/ci/env_cuda12.2_clang.sh3
-rw-r--r--.gitlab/ci/env_debian12_makefiles_clang.sh4
-rw-r--r--.gitlab/ci/env_debian12_ninja_clang.sh4
-rw-r--r--.gitlab/ci/env_fedora39_common_clang.sh3
-rw-r--r--.gitlab/ci/env_fedora39_makefiles_clang.sh1
-rw-r--r--.gitlab/ci/env_fedora39_makefiles_symlinked.cmake1
-rw-r--r--.gitlab/ci/env_fedora39_makefiles_symlinked.sh1
-rw-r--r--.gitlab/ci/env_fedora39_ninja_clang.sh1
-rw-r--r--.gitlab/ci/env_fedora39_ninja_multi_clang.sh1
-rw-r--r--.gitlab/ci/env_fedora40_asan.sh (renamed from .gitlab/ci/env_fedora39_asan.sh)0
-rw-r--r--.gitlab/ci/env_fedora40_clang_analyzer.sh (renamed from .gitlab/ci/env_fedora39_clang_analyzer.sh)0
-rw-r--r--.gitlab/ci/env_fedora40_common_clang.sh3
-rw-r--r--.gitlab/ci/env_fedora40_extdeps.sh (renamed from .gitlab/ci/env_fedora39_extdeps.sh)0
-rw-r--r--.gitlab/ci/env_fedora40_makefiles.cmake (renamed from .gitlab/ci/env_fedora39_makefiles.cmake)0
-rw-r--r--.gitlab/ci/env_fedora40_makefiles.sh (renamed from .gitlab/ci/env_fedora39_makefiles.sh)0
-rw-r--r--.gitlab/ci/env_fedora40_makefiles_clang.sh1
-rw-r--r--.gitlab/ci/env_fedora40_makefiles_symlinked.cmake1
-rw-r--r--.gitlab/ci/env_fedora40_makefiles_symlinked.sh1
-rw-r--r--.gitlab/ci/env_fedora40_ninja.sh (renamed from .gitlab/ci/env_fedora39_ninja_multi.sh)0
-rw-r--r--.gitlab/ci/env_fedora40_ninja_clang.sh1
-rw-r--r--.gitlab/ci/env_fedora40_ninja_multi.sh (renamed from .gitlab/ci/env_fedora39_ninja.sh)0
-rw-r--r--.gitlab/ci/env_fedora40_ninja_multi_clang.sh1
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps10
-rw-r--r--.gitlab/ci/env_windows_arm64_package.ps11
-rw-r--r--.gitlab/ci/env_windows_arm64_vs2022_ninja.ps12
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_borland5.5.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_borland5.8.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_clang_ninja.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_clang_nmake.ps10
-rw-r--r--.gitlab/ci/env_windows_i386_package.ps11
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_intelclassic_ninja.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_inteloneapi_ninja.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_msvc_v71_nmake.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_openwatcom1.9.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_orangec6.73.1.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_vs2022_x64.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_vs2022_x64_jom.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_vs2022_x64_ninja.ps14
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/env_windows_vs2022_x64_nmake.ps10
-rw-r--r--.gitlab/ci/env_windows_x86_64_package.ps11
-rw-r--r--[-rwxr-xr-x].gitlab/ci/innosetup-env.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/innosetup.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/intel-env.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/intel-vars.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/intel.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/ispc-env.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/ispc.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/jom.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/mingw-env.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/mingw.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/msvc.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/ninja-env.ps10
-rw-r--r--.gitlab/ci/ninja-env.sh3
-rw-r--r--[-rwxr-xr-x].gitlab/ci/ninja-nightly.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/ninja.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/openwatcom-env.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/openwatcom.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/orangec-env.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/orangec.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/package_windows.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/post_build.ps10
-rw-r--r--.gitlab/ci/post_build_fedora40_tidy.sh21
-rw-r--r--[-rwxr-xr-x].gitlab/ci/post_build_windows_arm64_package.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/post_build_windows_i386_package.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/post_build_windows_x86_64_package.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/pre_build.ps10
-rw-r--r--.gitlab/ci/pre_build_fedora40_tidy.sh (renamed from .gitlab/ci/pre_build_fedora39_tidy.sh)0
-rw-r--r--[-rwxr-xr-x].gitlab/ci/python-env.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/python.ps10
-rw-r--r--[-rwxr-xr-x].gitlab/ci/qt-env.ps10
-rw-r--r--.gitlab/ci/repackage/wix.ps155
-rw-r--r--.gitlab/ci/sccache-env.ps11
-rw-r--r--.gitlab/ci/sccache-env.sh2
-rw-r--r--.gitlab/ci/swift-env.ps16
-rw-r--r--.gitlab/ci/swift.ps138
-rw-r--r--.gitlab/ci/ticlang-env.sh2
-rwxr-xr-x.gitlab/ci/ticlang.sh28
-rw-r--r--[-rwxr-xr-x].gitlab/ci/vcvarsall.ps10
-rwxr-xr-x.gitlab/ci/wix.ps119
-rw-r--r--.gitlab/ci/wix3-env.ps16
-rw-r--r--.gitlab/ci/wix3.ps121
-rw-r--r--.gitlab/ci/wix4.ps120
-rw-r--r--.gitlab/os-linux.yml158
-rw-r--r--.gitlab/os-macos.yml8
-rw-r--r--.gitlab/os-windows.yml24
-rw-r--r--.gitlab/rules.yml6
-rw-r--r--.gitlab/upload.yml4
-rw-r--r--Auxiliary/cmake-mode.el23
-rw-r--r--Auxiliary/vim/indent/cmake.vim2
-rw-r--r--Auxiliary/vim/syntax/cmake.vim14
-rw-r--r--CMakeCPack.cmake9
-rw-r--r--CMakeCPackOptions.cmake.in7
-rw-r--r--CMakeLists.txt3
-rw-r--r--CONTRIBUTING.rst2
-rw-r--r--CTestCustom.cmake.in6
-rw-r--r--Copyright.txt2
-rw-r--r--Help/command/add_custom_command.rst18
-rw-r--r--Help/command/add_custom_target.rst4
-rw-r--r--Help/command/add_dependencies.rst11
-rw-r--r--Help/command/add_executable.rst77
-rw-r--r--Help/command/add_library.rst316
-rw-r--r--Help/command/add_test.rst34
-rw-r--r--Help/command/cmake_host_system_information.rst2
-rw-r--r--Help/command/cmake_language.rst25
-rw-r--r--Help/command/cmake_path.rst2
-rw-r--r--Help/command/configure_file.rst140
-rw-r--r--Help/command/create_test_sourcelist.rst85
-rw-r--r--Help/command/ctest_test.rst25
-rw-r--r--Help/command/define_property.rst36
-rw-r--r--Help/command/enable_language.rst16
-rw-r--r--Help/command/export.rst90
-rw-r--r--Help/command/file.rst691
-rw-r--r--Help/command/if.rst40
-rw-r--r--Help/command/install.rst82
-rw-r--r--Help/command/project.rst12
-rw-r--r--Help/command/qt_wrap_cpp.rst2
-rw-r--r--Help/command/return.rst2
-rw-r--r--Help/command/string.rst15
-rw-r--r--Help/command/target_compile_definitions.rst2
-rw-r--r--Help/command/target_compile_options.rst2
-rw-r--r--Help/command/target_include_directories.rst2
-rw-r--r--Help/command/target_link_directories.rst2
-rw-r--r--Help/command/target_link_libraries.rst2
-rw-r--r--Help/command/target_link_options.rst2
-rw-r--r--Help/command/target_precompile_headers.rst2
-rw-r--r--Help/command/target_sources.rst2
-rw-r--r--Help/command/try_compile.rst12
-rw-r--r--Help/command/try_run.rst1
-rw-r--r--Help/cpack_gen/deb.rst34
-rw-r--r--Help/cpack_gen/innosetup.rst6
-rw-r--r--Help/cpack_gen/productbuild.rst5
-rw-r--r--Help/cpack_gen/rpm.rst15
-rw-r--r--Help/cpack_gen/wix.rst187
-rw-r--r--Help/dev/documentation.rst8
-rw-r--r--Help/dev/experimental.rst46
-rw-r--r--Help/dev/maint.rst16
-rw-r--r--Help/dev/source.rst2
-rw-r--r--Help/dev/try_compile-linker-language.rst6
-rw-r--r--Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst4
-rw-r--r--Help/envvar/CMAKE_INSTALL_PREFIX.rst11
-rw-r--r--Help/envvar/CMAKE_TEST_LAUNCHER.rst11
-rw-r--r--Help/envvar/CMAKE_TLS_VERIFY.rst15
-rw-r--r--Help/envvar/CMAKE_TLS_VERSION.rst16
-rw-r--r--Help/envvar/CTEST_PARALLEL_LEVEL.rst19
-rw-r--r--Help/envvar/OBJCFLAGS.rst14
-rw-r--r--Help/envvar/OBJCXXFLAGS.rst14
-rw-r--r--Help/guide/tutorial/Adding Generator Expressions.rst2
-rw-r--r--Help/guide/tutorial/Adding a Library.rst8
-rw-r--r--Help/guide/tutorial/Step12/CMakeLists.txt2
-rw-r--r--Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt4
-rw-r--r--Help/manual/CTEST_EXAMPLE_MAKEFILE_JOB_SERVER.make2
-rw-r--r--Help/manual/OPTIONS_BUILD.txt4
-rw-r--r--Help/manual/cmake-buildsystem.7.rst423
-rw-r--r--Help/manual/cmake-compile-features.7.rst1
-rw-r--r--Help/manual/cmake-configure-log.7.rst2
-rw-r--r--Help/manual/cmake-cxxmodules.7.rst65
-rw-r--r--Help/manual/cmake-developer.7.rst3
-rw-r--r--Help/manual/cmake-env-variables.7.rst6
-rw-r--r--Help/manual/cmake-file-api.7.rst82
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst143
-rw-r--r--Help/manual/cmake-policies.7.rst31
-rw-r--r--Help/manual/cmake-presets.7.rst7
-rw-r--r--Help/manual/cmake-properties.7.rst9
-rw-r--r--Help/manual/cmake-qt.7.rst74
-rw-r--r--Help/manual/cmake-variables.7.rst107
-rw-r--r--Help/manual/cmake.1.rst5
-rw-r--r--Help/manual/ctest.1.rst118
-rw-r--r--Help/manual/presets/schema.json18
-rw-r--r--Help/policy/CMP0001.rst6
-rw-r--r--Help/policy/CMP0002.rst6
-rw-r--r--Help/policy/CMP0003.rst6
-rw-r--r--Help/policy/CMP0004.rst6
-rw-r--r--Help/policy/CMP0005.rst6
-rw-r--r--Help/policy/CMP0006.rst6
-rw-r--r--Help/policy/CMP0007.rst6
-rw-r--r--Help/policy/CMP0008.rst6
-rw-r--r--Help/policy/CMP0009.rst6
-rw-r--r--Help/policy/CMP0010.rst6
-rw-r--r--Help/policy/CMP0011.rst6
-rw-r--r--Help/policy/CMP0012.rst6
-rw-r--r--Help/policy/CMP0013.rst6
-rw-r--r--Help/policy/CMP0014.rst6
-rw-r--r--Help/policy/CMP0015.rst6
-rw-r--r--Help/policy/CMP0016.rst6
-rw-r--r--Help/policy/CMP0017.rst6
-rw-r--r--Help/policy/CMP0018.rst7
-rw-r--r--Help/policy/CMP0019.rst6
-rw-r--r--Help/policy/CMP0020.rst6
-rw-r--r--Help/policy/CMP0021.rst6
-rw-r--r--Help/policy/CMP0022.rst6
-rw-r--r--Help/policy/CMP0023.rst6
-rw-r--r--Help/policy/CMP0024.rst7
-rw-r--r--Help/policy/CMP0025.rst8
-rw-r--r--Help/policy/CMP0026.rst6
-rw-r--r--Help/policy/CMP0027.rst6
-rw-r--r--Help/policy/CMP0028.rst6
-rw-r--r--Help/policy/CMP0037.rst6
-rw-r--r--Help/policy/CMP0038.rst6
-rw-r--r--Help/policy/CMP0039.rst6
-rw-r--r--Help/policy/CMP0040.rst7
-rw-r--r--Help/policy/CMP0041.rst6
-rw-r--r--Help/policy/CMP0042.rst6
-rw-r--r--Help/policy/CMP0043.rst6
-rw-r--r--Help/policy/CMP0044.rst6
-rw-r--r--Help/policy/CMP0045.rst6
-rw-r--r--Help/policy/CMP0046.rst7
-rw-r--r--Help/policy/CMP0047.rst8
-rw-r--r--Help/policy/CMP0048.rst7
-rw-r--r--Help/policy/CMP0049.rst7
-rw-r--r--Help/policy/CMP0050.rst7
-rw-r--r--Help/policy/CMP0051.rst7
-rw-r--r--Help/policy/CMP0052.rst7
-rw-r--r--Help/policy/CMP0053.rst7
-rw-r--r--Help/policy/CMP0054.rst7
-rw-r--r--Help/policy/CMP0055.rst7
-rw-r--r--Help/policy/CMP0056.rst8
-rw-r--r--Help/policy/CMP0057.rst7
-rw-r--r--Help/policy/CMP0058.rst14
-rw-r--r--Help/policy/CMP0059.rst7
-rw-r--r--Help/policy/CMP0060.rst8
-rw-r--r--Help/policy/CMP0061.rst6
-rw-r--r--Help/policy/CMP0062.rst7
-rw-r--r--Help/policy/CMP0063.rst7
-rw-r--r--Help/policy/CMP0064.rst7
-rw-r--r--Help/policy/CMP0065.rst8
-rw-r--r--Help/policy/CMP0066.rst10
-rw-r--r--Help/policy/CMP0067.rst8
-rw-r--r--Help/policy/CMP0068.rst7
-rw-r--r--Help/policy/CMP0069.rst7
-rw-r--r--Help/policy/CMP0070.rst7
-rw-r--r--Help/policy/CMP0071.rst7
-rw-r--r--Help/policy/CMP0072.rst7
-rw-r--r--Help/policy/CMP0073.rst7
-rw-r--r--Help/policy/CMP0074.rst7
-rw-r--r--Help/policy/CMP0075.rst7
-rw-r--r--Help/policy/CMP0076.rst7
-rw-r--r--Help/policy/CMP0077.rst9
-rw-r--r--Help/policy/CMP0078.rst7
-rw-r--r--Help/policy/CMP0079.rst7
-rw-r--r--Help/policy/CMP0080.rst7
-rw-r--r--Help/policy/CMP0081.rst6
-rw-r--r--Help/policy/CMP0082.rst8
-rw-r--r--Help/policy/CMP0083.rst7
-rw-r--r--Help/policy/CMP0084.rst7
-rw-r--r--Help/policy/CMP0085.rst7
-rw-r--r--Help/policy/CMP0086.rst7
-rw-r--r--Help/policy/CMP0087.rst7
-rw-r--r--Help/policy/CMP0088.rst7
-rw-r--r--Help/policy/CMP0089.rst8
-rw-r--r--Help/policy/CMP0090.rst7
-rw-r--r--Help/policy/CMP0091.rst7
-rw-r--r--Help/policy/CMP0092.rst7
-rw-r--r--Help/policy/CMP0093.rst7
-rw-r--r--Help/policy/CMP0094.rst7
-rw-r--r--Help/policy/CMP0095.rst8
-rw-r--r--Help/policy/CMP0096.rst7
-rw-r--r--Help/policy/CMP0097.rst9
-rw-r--r--Help/policy/CMP0098.rst7
-rw-r--r--Help/policy/CMP0099.rst26
-rw-r--r--Help/policy/CMP0100.rst7
-rw-r--r--Help/policy/CMP0101.rst7
-rw-r--r--Help/policy/CMP0102.rst10
-rw-r--r--Help/policy/CMP0103.rst7
-rw-r--r--Help/policy/CMP0104.rst7
-rw-r--r--Help/policy/CMP0105.rst7
-rw-r--r--Help/policy/CMP0106.rst6
-rw-r--r--Help/policy/CMP0107.rst7
-rw-r--r--Help/policy/CMP0108.rst7
-rw-r--r--Help/policy/CMP0109.rst6
-rw-r--r--Help/policy/CMP0110.rst8
-rw-r--r--Help/policy/CMP0111.rst6
-rw-r--r--Help/policy/CMP0112.rst8
-rw-r--r--Help/policy/CMP0113.rst6
-rw-r--r--Help/policy/CMP0114.rst9
-rw-r--r--Help/policy/CMP0115.rst6
-rw-r--r--Help/policy/CMP0116.rst12
-rw-r--r--Help/policy/CMP0117.rst7
-rw-r--r--Help/policy/CMP0118.rst47
-rw-r--r--Help/policy/CMP0119.rst7
-rw-r--r--Help/policy/CMP0120.rst6
-rw-r--r--Help/policy/CMP0121.rst6
-rw-r--r--Help/policy/CMP0122.rst7
-rw-r--r--Help/policy/CMP0123.rst6
-rw-r--r--Help/policy/CMP0124.rst7
-rw-r--r--Help/policy/CMP0125.rst7
-rw-r--r--Help/policy/CMP0126.rst16
-rw-r--r--Help/policy/CMP0127.rst7
-rw-r--r--Help/policy/CMP0128.rst7
-rw-r--r--Help/policy/CMP0129.rst8
-rw-r--r--Help/policy/CMP0130.rst6
-rw-r--r--Help/policy/CMP0131.rst7
-rw-r--r--Help/policy/CMP0132.rst7
-rw-r--r--Help/policy/CMP0133.rst8
-rw-r--r--Help/policy/CMP0134.rst7
-rw-r--r--Help/policy/CMP0135.rst24
-rw-r--r--Help/policy/CMP0136.rst7
-rw-r--r--Help/policy/CMP0137.rst7
-rw-r--r--Help/policy/CMP0138.rst7
-rw-r--r--Help/policy/CMP0139.rst7
-rw-r--r--Help/policy/CMP0140.rst7
-rw-r--r--Help/policy/CMP0141.rst7
-rw-r--r--Help/policy/CMP0142.rst7
-rw-r--r--Help/policy/CMP0143.rst9
-rw-r--r--Help/policy/CMP0144.rst7
-rw-r--r--Help/policy/CMP0145.rst7
-rw-r--r--Help/policy/CMP0146.rst7
-rw-r--r--Help/policy/CMP0147.rst7
-rw-r--r--Help/policy/CMP0148.rst7
-rw-r--r--Help/policy/CMP0149.rst7
-rw-r--r--Help/policy/CMP0150.rst8
-rw-r--r--Help/policy/CMP0151.rst7
-rw-r--r--Help/policy/CMP0152.rst5
-rw-r--r--Help/policy/CMP0154.rst7
-rw-r--r--Help/policy/CMP0155.rst7
-rw-r--r--Help/policy/CMP0156.rst46
-rw-r--r--Help/policy/CMP0157.rst47
-rw-r--r--Help/policy/CMP0158.rst28
-rw-r--r--Help/policy/CMP0159.rst23
-rw-r--r--Help/policy/CMP0160.rst39
-rw-r--r--Help/policy/CMP0161.rst36
-rw-r--r--Help/policy/CMP0162.rst47
-rw-r--r--Help/policy/CMP0163.rst37
-rw-r--r--Help/policy/CMP0164.rst31
-rw-r--r--Help/policy/CMP0165.rst26
-rw-r--r--Help/policy/CMP0166.rst40
-rw-r--r--Help/policy/DISALLOWED_COMMAND.txt7
-rw-r--r--Help/policy/STANDARD_ADVICE.txt3
-rw-r--r--Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst2
-rw-r--r--Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst2
-rw-r--r--Help/prop_inst/CPACK_WIX_ACL.rst2
-rw-r--r--Help/prop_sf/GENERATED.rst19
-rw-r--r--Help/prop_test/FAIL_REGULAR_EXPRESSION.rst17
-rw-r--r--Help/prop_test/PASS_REGULAR_EXPRESSION.rst44
-rw-r--r--Help/prop_test/SKIP_REGULAR_EXPRESSION.rst32
-rw-r--r--Help/prop_test/SKIP_RETURN_CODE.rst38
-rw-r--r--Help/prop_test/WILL_FAIL.rst37
-rw-r--r--Help/prop_tgt/AUTOGEN_BETTER_GRAPH_MULTI_CONFIG.rst22
-rw-r--r--Help/prop_tgt/AUTOGEN_COMMAND_LINE_LENGTH_MAX.rst18
-rw-r--r--Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst42
-rw-r--r--Help/prop_tgt/AUTOGEN_PARALLEL.rst4
-rw-r--r--Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst30
-rw-r--r--Help/prop_tgt/AUTOMOC.rst14
-rw-r--r--Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst6
-rw-r--r--Help/prop_tgt/AUTORCC.rst4
-rw-r--r--Help/prop_tgt/AUTOUIC.rst10
-rw-r--r--Help/prop_tgt/AUTOUIC_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst4
-rw-r--r--Help/prop_tgt/CXX_MODULE_STD.rst41
-rw-r--r--Help/prop_tgt/EXPORT_FIND_PACKAGE_NAME.rst14
-rw-r--r--Help/prop_tgt/IMPORTED_LOCATION.rst2
-rw-r--r--Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/LANG_STANDARD.rst2
-rw-r--r--Help/prop_tgt/LANG_STANDARD_REQUIRED.rst2
-rw-r--r--Help/prop_tgt/LINKER_TYPE.rst28
-rw-r--r--Help/prop_tgt/OBJC_STANDARD.rst10
-rw-r--r--Help/prop_tgt/SOURCES.rst2
-rw-r--r--Help/prop_tgt/SOVERSION.rst6
-rw-r--r--Help/prop_tgt/Swift_COMPILATION_MODE-VALUES.txt19
-rw-r--r--Help/prop_tgt/Swift_COMPILATION_MODE.rst33
-rw-r--r--Help/prop_tgt/TEST_LAUNCHER.rst23
-rw-r--r--Help/prop_tgt/UNITY_BUILD.rst22
-rw-r--r--Help/prop_tgt/VERSION.rst6
-rw-r--r--Help/prop_tgt/VERSION_SOVERSION_EXAMPLE.txt9
-rw-r--r--Help/prop_tgt/VS_FILTER_PROPS.rst10
-rw-r--r--Help/prop_tgt/VS_USE_DEBUG_LIBRARIES-PURPOSE.txt18
-rw-r--r--Help/prop_tgt/VS_USE_DEBUG_LIBRARIES.rst28
-rw-r--r--Help/prop_tgt/XCODE_EMBED_type.rst22
-rw-r--r--Help/prop_tgt/XCODE_EMBED_type_PATH.rst3
-rw-r--r--Help/release/3.14.rst2
-rw-r--r--Help/release/3.20.rst5
-rw-r--r--Help/release/3.22.rst2
-rw-r--r--Help/release/3.25.rst4
-rw-r--r--Help/release/3.29.rst220
-rw-r--r--Help/release/3.6.rst2
-rw-r--r--Help/release/dev/0-sample-topic.rst7
-rw-r--r--Help/release/dev/CXX_MODULE_STD-property.rst5
-rw-r--r--Help/release/dev/FindBacktrace-imported-library.rst4
-rw-r--r--Help/release/dev/FindCUDAToolkit-nvfatbin.rst5
-rw-r--r--Help/release/dev/FindOpenMP-runtime-msvc.rst5
-rw-r--r--Help/release/dev/add_library-no-static-fallback.rst6
-rw-r--r--Help/release/dev/cpack-innosetup-linux.rst5
-rw-r--r--Help/release/dev/cpack-wix.rst5
-rw-r--r--Help/release/dev/curl-tls-version.rst26
-rw-r--r--Help/release/dev/cxx-26.rst8
-rw-r--r--Help/release/dev/enable_language-before-project.rst6
-rw-r--r--Help/release/dev/fileapi-provide-glob-dependent.rst9
-rw-r--r--Help/release/dev/genex-link-properties.rst8
-rw-r--r--Help/release/dev/genex-quote.rst4
-rw-r--r--Help/release/dev/lang-standard-latest.rst5
-rw-r--r--Help/release/dev/preset-includes-macro-expansion.rst7
-rw-r--r--Help/release/dev/prop-GENERATED-visibility.rst6
-rw-r--r--Help/release/dev/rel-win-PATH.rst8
-rw-r--r--Help/release/dev/rel-zip-newlines.rst6
-rw-r--r--Help/release/dev/vs-UseDebugLibraries.rst10
-rw-r--r--Help/release/dev/vs-filter-props.rst6
-rw-r--r--Help/release/index.rst3
-rw-r--r--Help/variable/BUILD_SHARED_LIBS.rst45
-rw-r--r--Help/variable/CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG.rst10
-rw-r--r--Help/variable/CMAKE_AUTOGEN_COMMAND_LINE_LENGTH_MAX.rst10
-rw-r--r--Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst9
-rw-r--r--Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst7
-rw-r--r--Help/variable/CMAKE_CXX_COMPILER_IMPORT_STD.rst14
-rw-r--r--Help/variable/CMAKE_CXX_MODULE_STD.rst15
-rw-r--r--Help/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst10
-rw-r--r--Help/variable/CMAKE_EXPORT_FIND_PACKAGE_NAME.rst8
-rw-r--r--Help/variable/CMAKE_FIND_LIBRARY_SUFFIXES.rst10
-rw-r--r--Help/variable/CMAKE_GENERATOR_TOOLSET.rst14
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst13
-rw-r--r--Help/variable/CMAKE_HOST_SYSTEM_NAME.rst2
-rw-r--r--Help/variable/CMAKE_INSTALL_PREFIX.rst15
-rw-r--r--Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst9
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_LINKER.rst15
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_LINKER_FRONTEND_VARIANT.rst18
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_LINKER_ID.rst33
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_LINKER_VERSION.rst10
-rw-r--r--Help/variable/CMAKE_LANG_FLAGS.rst4
-rw-r--r--Help/variable/CMAKE_LANG_STANDARD_LATEST.rst64
-rw-r--r--Help/variable/CMAKE_LANG_USING_LINKER_MODE.rst17
-rw-r--r--Help/variable/CMAKE_LANG_USING_LINKER_TYPE.rst44
-rw-r--r--Help/variable/CMAKE_LINKER_TYPE.rst14
-rw-r--r--Help/variable/CMAKE_MATCH_n.rst2
-rw-r--r--Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst10
-rw-r--r--Help/variable/CMAKE_PROJECT_INCLUDE.rst8
-rw-r--r--Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst8
-rw-r--r--Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst8
-rw-r--r--Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst8
-rw-r--r--Help/variable/CMAKE_PROJECT_TOP_LEVEL_INCLUDES.rst4
-rw-r--r--Help/variable/CMAKE_REQUIRE_FIND_PACKAGE_PackageName.rst31
-rw-r--r--Help/variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY.rst2
-rw-r--r--Help/variable/CMAKE_SKIP_TEST_ALL_DEPENDENCY.rst19
-rw-r--r--Help/variable/CMAKE_SYSTEM_NAME.rst83
-rw-r--r--Help/variable/CMAKE_Swift_COMPILATION_MODE.rst32
-rw-r--r--Help/variable/CMAKE_TEST_LAUNCHER.rst16
-rw-r--r--Help/variable/CMAKE_TLS_VERIFY.rst4
-rw-r--r--Help/variable/CMAKE_TLS_VERSION-VALUES.txt7
-rw-r--r--Help/variable/CMAKE_TLS_VERSION.rst17
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_TOOLSET_FORTRAN.rst12
-rw-r--r--Help/variable/CMAKE_VS_USE_DEBUG_LIBRARIES.rst29
-rw-r--r--Help/variable/CTEST_COVERAGE_COMMAND.rst2
-rw-r--r--Help/variable/CTEST_CURL_OPTIONS.rst4
-rw-r--r--Help/variable/CTEST_TLS_VERIFY.rst13
-rw-r--r--Help/variable/CTEST_TLS_VERSION.rst16
-rw-r--r--Help/variable/LINKER_PREDEFINED_TYPES.txt69
-rw-r--r--Modules/CMakeASMCompiler.cmake.in6
-rw-r--r--Modules/CMakeASM_MARMASMInformation.cmake2
-rw-r--r--Modules/CMakeASM_NASMInformation.cmake11
-rw-r--r--Modules/CMakeCCompiler.cmake.in7
-rw-r--r--Modules/CMakeCCompilerId.c.in17
-rw-r--r--Modules/CMakeCInformation.cmake2
-rw-r--r--Modules/CMakeCUDACompiler.cmake.in9
-rw-r--r--Modules/CMakeCUDACompilerId.cu.in28
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in13
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in69
-rw-r--r--Modules/CMakeCXXInformation.cmake4
-rw-r--r--Modules/CMakeCompilerIdDetection.cmake6
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake4
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake5
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake4
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake5
-rw-r--r--Modules/CMakeDetermineCompileFeatures.cmake246
-rw-r--r--Modules/CMakeDetermineCompiler.cmake10
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake100
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake75
-rw-r--r--Modules/CMakeDetermineCompilerSupport.cmake260
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake10
-rw-r--r--Modules/CMakeDetermineSystem.cmake36
-rw-r--r--Modules/CMakeFindBinUtils.cmake15
-rw-r--r--Modules/CMakeFindPackageMode.cmake7
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in4
-rw-r--r--Modules/CMakeFortranCompilerId.F.in2
-rw-r--r--Modules/CMakeFortranInformation.cmake2
-rw-r--r--Modules/CMakeGenericSystem.cmake25
-rw-r--r--Modules/CMakeHIPCompiler.cmake.in8
-rw-r--r--Modules/CMakeHIPCompilerId.hip.in21
-rw-r--r--Modules/CMakeOBJCCompiler.cmake.in7
-rw-r--r--Modules/CMakeOBJCCompilerId.m.in20
-rw-r--r--Modules/CMakeOBJCInformation.cmake2
-rw-r--r--Modules/CMakeOBJCXXCompiler.cmake.in9
-rw-r--r--Modules/CMakeOBJCXXCompilerId.mm.in23
-rw-r--r--Modules/CMakeOBJCXXInformation.cmake4
-rw-r--r--Modules/CMakePackageConfigHelpers.cmake457
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake225
-rw-r--r--Modules/CMakePlatformId.h.in8
-rw-r--r--Modules/CMakeSwiftInformation.cmake121
-rw-r--r--Modules/CMakeTestCCompiler.cmake4
-rw-r--r--Modules/CMakeTestCUDACompiler.cmake4
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake4
-rw-r--r--Modules/CMakeTestHIPCompiler.cmake4
-rw-r--r--Modules/CMakeTestOBJCCompiler.cmake4
-rw-r--r--Modules/CMakeTestOBJCXXCompiler.cmake4
-rw-r--r--Modules/CMakeVerifyManifest.cmake3
-rw-r--r--Modules/CPack.cmake19
-rw-r--r--Modules/CSharpUtilities.cmake4
-rw-r--r--Modules/CTestTargets.cmake34
-rw-r--r--Modules/CXX-DetectStdlib.h10
-rw-r--r--Modules/CheckForPthreads.c2
-rw-r--r--Modules/CheckIPOSupported/main.c2
-rw-r--r--Modules/CheckLibraryExists.lists.in8
-rw-r--r--Modules/CheckStructHasMember.cmake2
-rw-r--r--Modules/CheckSymbolExists.cmake24
-rw-r--r--Modules/CheckTypeSize.cmake1
-rw-r--r--Modules/Compiler/ADSP-ASM.cmake6
-rw-r--r--Modules/Compiler/ADSP-C.cmake2
-rw-r--r--Modules/Compiler/ADSP-CXX.cmake2
-rw-r--r--Modules/Compiler/ADSP.cmake2
-rw-r--r--Modules/Compiler/ARMClang-C.cmake10
-rw-r--r--Modules/Compiler/AppleClang-C.cmake4
-rw-r--r--Modules/Compiler/AppleClang-CXX.cmake9
-rw-r--r--Modules/Compiler/AppleClang-OBJC.cmake8
-rw-r--r--Modules/Compiler/AppleClang-OBJCXX.cmake7
-rw-r--r--Modules/Compiler/CMakeCommonCompilerMacros.cmake58
-rw-r--r--Modules/Compiler/Clang-C.cmake9
-rw-r--r--Modules/Compiler/Clang-CXX-CXXImportStd.cmake153
-rw-r--r--Modules/Compiler/Clang-OBJC.cmake6
-rw-r--r--Modules/Compiler/Clang.cmake28
-rw-r--r--Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake7
-rw-r--r--Modules/Compiler/Cray-C.cmake2
-rw-r--r--Modules/Compiler/Cray-CXX.cmake3
-rw-r--r--Modules/Compiler/CrayClang-C.cmake2
-rw-r--r--Modules/Compiler/CrayClang-CXX.cmake2
-rw-r--r--Modules/Compiler/Fujitsu-C.cmake2
-rw-r--r--Modules/Compiler/Fujitsu-CXX.cmake2
-rw-r--r--Modules/Compiler/GNU-C.cmake35
-rw-r--r--Modules/Compiler/GNU-CXX.cmake50
-rw-r--r--Modules/Compiler/GNU-Fortran.cmake4
-rw-r--r--Modules/Compiler/GNU-OBJC.cmake1
-rw-r--r--Modules/Compiler/GNU-OBJCXX.cmake1
-rw-r--r--Modules/Compiler/GNU.cmake158
-rw-r--r--Modules/Compiler/IBMClang-C.cmake3
-rw-r--r--Modules/Compiler/IBMClang-CXX.cmake3
-rw-r--r--Modules/Compiler/IBMClang.cmake4
-rw-r--r--Modules/Compiler/Intel-C.cmake28
-rw-r--r--Modules/Compiler/Intel-CXX.cmake87
-rw-r--r--Modules/Compiler/IntelLLVM-C.cmake35
-rw-r--r--Modules/Compiler/IntelLLVM-CXX.cmake18
-rw-r--r--Modules/Compiler/IntelLLVM.cmake10
-rw-r--r--Modules/Compiler/LCC-C.cmake35
-rw-r--r--Modules/Compiler/LCC-CXX.cmake38
-rw-r--r--Modules/Compiler/LCC.cmake4
-rw-r--r--Modules/Compiler/LLVMFlang-Fortran.cmake3
-rw-r--r--Modules/Compiler/MSVC-C.cmake4
-rw-r--r--Modules/Compiler/MSVC-CXX-CXXImportStd.cmake103
-rw-r--r--Modules/Compiler/MSVC-CXX.cmake12
-rw-r--r--Modules/Compiler/NAG-Fortran.cmake10
-rw-r--r--Modules/Compiler/NVHPC-C.cmake1
-rw-r--r--Modules/Compiler/NVHPC-CXX.cmake1
-rw-r--r--Modules/Compiler/NVIDIA.cmake12
-rw-r--r--Modules/Compiler/OrangeC-C.cmake2
-rw-r--r--Modules/Compiler/OrangeC-CXX.cmake2
-rw-r--r--Modules/Compiler/PGI-C.cmake3
-rw-r--r--Modules/Compiler/PGI-CXX.cmake4
-rw-r--r--Modules/Compiler/SunPro-C.cmake4
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake4
-rw-r--r--Modules/Compiler/TI-C.cmake5
-rw-r--r--Modules/Compiler/TI-CXX.cmake3
-rw-r--r--Modules/Compiler/TIClang-ASM.cmake9
-rw-r--r--Modules/Compiler/TIClang-C-FeatureTests.cmake1
-rw-r--r--Modules/Compiler/TIClang-C.cmake33
-rw-r--r--Modules/Compiler/TIClang-CXX-FeatureTests.cmake1
-rw-r--r--Modules/Compiler/TIClang-CXX.cmake38
-rw-r--r--Modules/Compiler/TIClang-DetermineCompiler.cmake10
-rw-r--r--Modules/Compiler/TIClang.cmake30
-rw-r--r--Modules/Compiler/Tasking-C.cmake2
-rw-r--r--Modules/Compiler/Tasking-CXX.cmake2
-rw-r--r--Modules/Compiler/XL-C.cmake3
-rw-r--r--Modules/Compiler/XL-CXX.cmake3
-rw-r--r--Modules/Compiler/XLClang-C.cmake3
-rw-r--r--Modules/Compiler/XLClang-CXX.cmake5
-rw-r--r--Modules/CompilerId/VS-Intel.vfproj.in2
-rw-r--r--Modules/DartConfiguration.tcl.in3
-rw-r--r--Modules/ExternalProject.cmake306
-rw-r--r--Modules/ExternalProject/download.cmake.in13
-rw-r--r--Modules/FetchContent.cmake70
-rw-r--r--Modules/FindALSA.cmake5
-rw-r--r--Modules/FindArmadillo.cmake5
-rw-r--r--Modules/FindBLAS.cmake6
-rw-r--r--Modules/FindBZip2.cmake5
-rw-r--r--Modules/FindBacktrace.cmake22
-rw-r--r--Modules/FindBoost.cmake5
-rw-r--r--Modules/FindCUDA.cmake23
-rw-r--r--Modules/FindCUDAToolkit.cmake70
-rw-r--r--Modules/FindCURL.cmake15
-rw-r--r--Modules/FindCups.cmake5
-rw-r--r--Modules/FindCxxTest.cmake2
-rw-r--r--Modules/FindEXPAT.cmake5
-rw-r--r--Modules/FindFontconfig.cmake4
-rw-r--r--Modules/FindFreetype.cmake5
-rw-r--r--Modules/FindGDAL.cmake5
-rw-r--r--Modules/FindGIF.cmake5
-rw-r--r--Modules/FindGLEW.cmake3
-rw-r--r--Modules/FindGSL.cmake5
-rw-r--r--Modules/FindGTK2.cmake27
-rw-r--r--Modules/FindGTest.cmake3
-rw-r--r--Modules/FindHDF5.cmake7
-rw-r--r--Modules/FindHSPELL.cmake5
-rw-r--r--Modules/FindICU.cmake115
-rw-r--r--Modules/FindIconv.cmake7
-rw-r--r--Modules/FindIntl.cmake5
-rw-r--r--Modules/FindJPEG.cmake5
-rw-r--r--Modules/FindJasper.cmake9
-rw-r--r--Modules/FindLAPACK.cmake6
-rw-r--r--Modules/FindLTTngUST.cmake5
-rw-r--r--Modules/FindLibArchive.cmake5
-rw-r--r--Modules/FindLibLZMA.cmake5
-rw-r--r--Modules/FindLibXml2.cmake5
-rw-r--r--Modules/FindLibXslt.cmake5
-rw-r--r--Modules/FindLua.cmake1
-rw-r--r--Modules/FindLua51.cmake5
-rw-r--r--Modules/FindMPI.cmake13
-rw-r--r--Modules/FindMatlab.cmake329
-rw-r--r--Modules/FindOpenACC.cmake10
-rw-r--r--Modules/FindOpenGL.cmake64
-rw-r--r--Modules/FindOpenMP.cmake28
-rw-r--r--Modules/FindOpenSP.cmake5
-rw-r--r--Modules/FindOpenSSL.cmake35
-rw-r--r--Modules/FindOpenSceneGraph.cmake5
-rw-r--r--Modules/FindOpenThreads.cmake30
-rw-r--r--Modules/FindPNG.cmake5
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake5
-rw-r--r--Modules/FindPackageMessage.cmake1
-rw-r--r--Modules/FindPerl.cmake17
-rw-r--r--Modules/FindPkgConfig.cmake34
-rw-r--r--Modules/FindPostgreSQL.cmake1
-rw-r--r--Modules/FindProtobuf.cmake5
-rw-r--r--Modules/FindPython/Support.cmake18
-rw-r--r--Modules/FindPythonLibs.cmake6
-rw-r--r--Modules/FindQt3.cmake6
-rw-r--r--Modules/FindRuby.cmake27
-rw-r--r--Modules/FindSDL.cmake5
-rw-r--r--Modules/FindSDL_gfx.cmake5
-rw-r--r--Modules/FindSDL_image.cmake5
-rw-r--r--Modules/FindSDL_mixer.cmake5
-rw-r--r--Modules/FindSDL_net.cmake5
-rw-r--r--Modules/FindSDL_sound.cmake5
-rw-r--r--Modules/FindSDL_ttf.cmake5
-rw-r--r--Modules/FindSQLite3.cmake18
-rw-r--r--Modules/FindSWIG.cmake74
-rw-r--r--Modules/FindTIFF.cmake1
-rw-r--r--Modules/FindVulkan.cmake24
-rw-r--r--Modules/FindX11.cmake12
-rw-r--r--Modules/FindXalanC.cmake5
-rw-r--r--Modules/FindXercesC.cmake5
-rw-r--r--Modules/FindZLIB.cmake5
-rw-r--r--Modules/FindwxWidgets.cmake82
-rw-r--r--Modules/FortranCInterface/CMakeLists.txt8
-rw-r--r--Modules/FortranCInterface/Detect.cmake6
-rw-r--r--Modules/GNUInstallDirs.cmake20
-rw-r--r--Modules/GenerateExportHeader.cmake4
-rw-r--r--Modules/GetPrerequisites.cmake4
-rw-r--r--Modules/GoogleTest.cmake80
-rw-r--r--Modules/GoogleTestAddTests.cmake1
-rw-r--r--Modules/Internal/AppleArchitectureSelection.cmake.in23
-rw-r--r--Modules/Internal/ApplePlatformSelection.cmake.in46
-rw-r--r--Modules/Internal/CMakeDetermineLinkerId.cmake107
-rw-r--r--Modules/Internal/CPack/CPack.NuGet.nuspec.in2
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake4
-rw-r--r--Modules/Internal/CPack/CPackNuGet.cmake21
-rw-r--r--Modules/Internal/CPack/CPackRPM.cmake10
-rw-r--r--Modules/Internal/CPack/CPackWIX.cmake28
-rw-r--r--Modules/Internal/CPack/WIX-v3/WIX.template.in53
-rw-r--r--Modules/Internal/CPack/WIX.template.in26
-rw-r--r--Modules/Internal/FeatureTesting.cmake3
-rw-r--r--Modules/KDE3Macros.cmake3
-rw-r--r--Modules/Platform/ADSP-Common.cmake11
-rw-r--r--Modules/Platform/ADSP-Determine.cmake4
-rw-r--r--Modules/Platform/AIX-GNU.cmake3
-rw-r--r--Modules/Platform/AIX-XL.cmake1
-rwxr-xr-xModules/Platform/AIX/ExportImportList2
-rw-r--r--Modules/Platform/ARTOS.cmake2
-rw-r--r--Modules/Platform/Android-Determine.cmake1
-rw-r--r--Modules/Platform/Android/Determine-Compiler-NDK.cmake5
-rw-r--r--Modules/Platform/Apple-Apple-Swift.cmake16
-rw-r--r--Modules/Platform/Apple-Clang.cmake9
-rw-r--r--Modules/Platform/Apple-GNU.cmake3
-rw-r--r--Modules/Platform/Apple-NAG-Fortran.cmake11
-rw-r--r--Modules/Platform/CYGWIN-GNU.cmake2
-rw-r--r--Modules/Platform/CrayLinuxEnvironment.cmake3
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake3
-rw-r--r--Modules/Platform/Darwin.cmake8
-rw-r--r--Modules/Platform/Linux-Apple-Swift.cmake7
-rw-r--r--Modules/Platform/Linux-Clang-CUDA.cmake2
-rw-r--r--Modules/Platform/Linux-GNU.cmake12
-rw-r--r--Modules/Platform/Linux-LLVMFlang-Fortran.cmake1
-rw-r--r--Modules/Platform/Linux-NVIDIA-CUDA.cmake9
-rw-r--r--Modules/Platform/Windows-Apple-Swift.cmake5
-rw-r--r--Modules/Platform/Windows-Clang-C.cmake2
-rw-r--r--Modules/Platform/Windows-Clang-CUDA.cmake16
-rw-r--r--Modules/Platform/Windows-Clang-CXX.cmake2
-rw-r--r--Modules/Platform/Windows-Clang-OBJC.cmake18
-rw-r--r--Modules/Platform/Windows-Clang-OBJCXX.cmake18
-rw-r--r--Modules/Platform/Windows-Clang.cmake37
-rw-r--r--Modules/Platform/Windows-GNU-OBJC-ABI.cmake1
-rw-r--r--Modules/Platform/Windows-GNU-OBJC.cmake2
-rw-r--r--Modules/Platform/Windows-GNU-OBJCXX-ABI.cmake1
-rw-r--r--Modules/Platform/Windows-GNU-OBJCXX.cmake2
-rw-r--r--Modules/Platform/Windows-GNU.cmake7
-rw-r--r--Modules/Platform/Windows-IntelLLVM.cmake35
-rw-r--r--Modules/Platform/Windows-LLVMFlang-Fortran.cmake27
-rw-r--r--Modules/Platform/Windows-MSVC.cmake52
-rw-r--r--Modules/Platform/Windows-NVIDIA-CUDA.cmake6
-rw-r--r--Modules/Platform/Windows.cmake11
-rw-r--r--Modules/Platform/Windows3x-OpenWatcom.cmake4
-rw-r--r--Modules/ProcessorCount.cmake3
-rw-r--r--Modules/TestBigEndian.cmake5
-rw-r--r--Modules/UseEcos.cmake40
-rw-r--r--Modules/UseJava/ClearClassFiles.cmake5
-rw-r--r--Modules/UseJava/javaTargets.cmake.in3
-rw-r--r--Modules/UseSWIG.cmake8
-rw-r--r--Modules/exportheader.cmake.in1
-rw-r--r--README.rst4
-rw-r--r--Source/CMakeLists.txt6
-rw-r--r--Source/CMakeVersion.cmake4
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx7
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx183
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.h5
-rw-r--r--Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx45
-rw-r--r--Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h14
-rw-r--r--Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx11
-rw-r--r--Source/CPack/WiX/cmWIXFeaturesSourceWriter.h3
-rw-r--r--Source/CPack/WiX/cmWIXFilesSourceWriter.cxx5
-rw-r--r--Source/CPack/WiX/cmWIXFilesSourceWriter.h3
-rw-r--r--Source/CPack/WiX/cmWIXSourceWriter.cxx30
-rw-r--r--Source/CPack/WiX/cmWIXSourceWriter.h8
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx153
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.h6
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackFreeBSDGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackGenerator.cxx331
-rw-r--r--Source/CPack/cmCPackGenerator.h12
-rw-r--r--Source/CPack/cmCPackInnoSetupGenerator.cxx36
-rw-r--r--Source/CPack/cmCPackInnoSetupGenerator.h9
-rw-r--r--Source/CPack/cmCPackLog.h2
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx4
-rw-r--r--Source/CPack/cpack.cxx37
-rw-r--r--Source/CTest/cmCTestBZR.cxx33
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx84
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.h6
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx291
-rw-r--r--Source/CTest/cmCTestBuildHandler.h6
-rw-r--r--Source/CTest/cmCTestCVS.cxx22
-rw-r--r--Source/CTest/cmCTestConfigureHandler.cxx2
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx109
-rw-r--r--Source/CTest/cmCTestCurl.cxx45
-rw-r--r--Source/CTest/cmCTestCurl.h24
-rw-r--r--Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx22
-rw-r--r--Source/CTest/cmCTestGIT.cxx141
-rw-r--r--Source/CTest/cmCTestGenericHandler.h2
-rw-r--r--Source/CTest/cmCTestHG.cxx41
-rw-r--r--Source/CTest/cmCTestLaunch.cxx121
-rw-r--r--Source/CTest/cmCTestLaunch.h5
-rw-r--r--Source/CTest/cmCTestLaunchReporter.cxx50
-rw-r--r--Source/CTest/cmCTestLaunchReporter.h4
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx527
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h105
-rw-r--r--Source/CTest/cmCTestP4.cxx92
-rw-r--r--Source/CTest/cmCTestP4.h2
-rw-r--r--Source/CTest/cmCTestRunTest.cxx19
-rw-r--r--Source/CTest/cmCTestRunTest.h21
-rw-r--r--Source/CTest/cmCTestSVN.cxx58
-rw-r--r--Source/CTest/cmCTestSVN.h2
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx124
-rw-r--r--Source/CTest/cmCTestScriptHandler.h7
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx44
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx57
-rw-r--r--Source/CTest/cmCTestSubmitHandler.h14
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx14
-rw-r--r--Source/CTest/cmCTestTestCommand.h6
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx107
-rw-r--r--Source/CTest/cmCTestTestHandler.h9
-rw-r--r--Source/CTest/cmCTestUploadHandler.cxx2
-rw-r--r--Source/CTest/cmCTestVC.cxx45
-rw-r--r--Source/CTest/cmCTestVC.h9
-rw-r--r--Source/CTest/cmUVJobServerClient.cxx518
-rw-r--r--Source/CTest/cmUVJobServerClient.h96
-rw-r--r--Source/Checks/Curses/CMakeLists.txt2
-rw-r--r--Source/Checks/Curses/CheckCurses.c2
-rw-r--r--Source/Checks/cm_cxx_features.cmake2
-rw-r--r--Source/Checks/cm_cxx_filesystem.cxx11
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.cxx2
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx5
-rw-r--r--Source/LexerParser/cmCTestResourceGroupsLexer.cxx4
-rw-r--r--Source/LexerParser/cmCTestResourceGroupsLexer.in.l4
-rw-r--r--Source/LexerParser/cmGccDepfileLexer.cxx92
-rw-r--r--Source/LexerParser/cmGccDepfileLexer.in.l4
-rw-r--r--Source/Modules/CMakeBuildUtilities.cmake2
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx2
-rw-r--r--Source/QtDialog/FirstConfigure.cxx4
-rw-r--r--Source/QtDialog/FirstConfigure.h1
-rw-r--r--Source/QtDialog/QCMake.cxx96
-rw-r--r--Source/QtDialog/QCMakeCacheView.h8
-rw-r--r--Source/cmAddCustomCommandCommand.cxx4
-rw-r--r--Source/cmAddLibraryCommand.cxx40
-rw-r--r--Source/cmArgumentParserTypes.h2
-rw-r--r--Source/cmBinUtilsMacOSMachOLinker.cxx14
-rw-r--r--Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx2
-rw-r--r--Source/cmBlockCommand.cxx4
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx6
-rw-r--r--Source/cmCMakeLanguageCommand.cxx47
-rw-r--r--Source/cmCMakePresetsGraph.cxx234
-rw-r--r--Source/cmCMakePresetsGraphInternal.h103
-rw-r--r--Source/cmCMakePresetsGraphReadJSON.cxx52
-rw-r--r--Source/cmCTest.cxx556
-rw-r--r--Source/cmCTest.h29
-rw-r--r--Source/cmCacheManager.cxx2
-rw-r--r--Source/cmCommonTargetGenerator.cxx5
-rw-r--r--Source/cmComputeLinkDepends.cxx380
-rw-r--r--Source/cmComputeLinkDepends.h2
-rw-r--r--Source/cmComputeLinkInformation.cxx16
-rw-r--r--Source/cmComputeTargetDepends.cxx2
-rw-r--r--Source/cmConditionEvaluator.cxx27
-rw-r--r--Source/cmConfigure.cmake.h.in7
-rw-r--r--Source/cmCoreTryCompile.cxx63
-rw-r--r--Source/cmCoreTryCompile.h1
-rw-r--r--Source/cmCreateTestSourceList.cxx16
-rw-r--r--Source/cmCryptoHash.cxx33
-rw-r--r--Source/cmCryptoHash.h4
-rw-r--r--Source/cmCurl.cxx51
-rw-r--r--Source/cmCurl.h5
-rw-r--r--Source/cmCustomCommandGenerator.cxx13
-rw-r--r--Source/cmDebugTools.h8
-rw-r--r--Source/cmDebuggerExceptionManager.cxx2
-rw-r--r--Source/cmDebuggerStackFrame.h4
-rw-r--r--Source/cmDebuggerThread.cxx4
-rw-r--r--Source/cmDyndepCollation.cxx6
-rw-r--r--Source/cmELF.cxx28
-rw-r--r--Source/cmEnableLanguageCommand.cxx26
-rw-r--r--Source/cmExecuteProcessCommand.cxx402
-rw-r--r--Source/cmExecutionStatus.h8
-rw-r--r--Source/cmExperimental.cxx32
-rw-r--r--Source/cmExperimental.h5
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.cxx4
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.h7
-rw-r--r--Source/cmExportBuildFileGenerator.cxx48
-rw-r--r--Source/cmExportBuildFileGenerator.h36
-rw-r--r--Source/cmExportCommand.cxx113
-rw-r--r--Source/cmExportFileGenerator.cxx258
-rw-r--r--Source/cmExportFileGenerator.h34
-rw-r--r--Source/cmExportInstallAndroidMKGenerator.cxx11
-rw-r--r--Source/cmExportInstallAndroidMKGenerator.h12
-rw-r--r--Source/cmExportInstallFileGenerator.cxx40
-rw-r--r--Source/cmExportInstallFileGenerator.h8
-rw-r--r--Source/cmExportSet.cxx25
-rw-r--r--Source/cmExportSet.h31
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx18
-rw-r--r--Source/cmFileAPI.cxx4
-rw-r--r--Source/cmFileAPICMakeFiles.cxx42
-rw-r--r--Source/cmFileAPICodemodel.cxx69
-rw-r--r--Source/cmFileCommand.cxx167
-rw-r--r--Source/cmFindCommon.cxx4
-rw-r--r--Source/cmFindPackageCommand.cxx40
-rw-r--r--Source/cmFindPackageStack.cxx7
-rw-r--r--Source/cmFindPackageStack.h33
-rw-r--r--Source/cmForEachCommand.cxx5
-rw-r--r--Source/cmFunctionCommand.cxx4
-rw-r--r--Source/cmGeneratorExpression.cxx9
-rw-r--r--Source/cmGeneratorExpression.h5
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx135
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h49
-rw-r--r--Source/cmGeneratorExpressionNode.cxx92
-rw-r--r--Source/cmGeneratorTarget.cxx441
-rw-r--r--Source/cmGeneratorTarget.h38
-rw-r--r--Source/cmGetPropertyCommand.cxx56
-rw-r--r--Source/cmGetSourceFilePropertyCommand.cxx51
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx17
-rw-r--r--Source/cmGlobCacheEntry.h30
-rw-r--r--Source/cmGlobVerificationManager.cxx29
-rw-r--r--Source/cmGlobVerificationManager.h9
-rw-r--r--Source/cmGlobalGenerator.cxx142
-rw-r--r--Source/cmGlobalGenerator.h3
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx8
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx44
-rw-r--r--Source/cmGlobalNinjaGenerator.h8
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx2
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx40
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h7
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx6
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h6
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx126
-rw-r--r--Source/cmGlobalXCodeGenerator.h2
-rw-r--r--Source/cmGraphVizWriter.cxx3
-rw-r--r--Source/cmIfCommand.cxx4
-rw-r--r--Source/cmInstallCommand.cxx13
-rw-r--r--Source/cmInstallExportGenerator.cxx4
-rw-r--r--Source/cmInstallExportGenerator.h4
-rw-r--r--Source/cmJSONState.cxx6
-rw-r--r--Source/cmLinkItem.cxx30
-rw-r--r--Source/cmLinkItem.h14
-rw-r--r--Source/cmLinkItemGraphVisitor.cxx2
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx4
-rw-r--r--Source/cmList.h4
-rw-r--r--Source/cmLocalGenerator.cxx216
-rw-r--r--Source/cmLocalGenerator.h20
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx6
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx28
-rw-r--r--Source/cmMacroCommand.cxx4
-rw-r--r--Source/cmMakefile.cxx96
-rw-r--r--Source/cmMakefile.h24
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx3
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx9
-rw-r--r--Source/cmMakefileTargetGenerator.cxx66
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx29
-rw-r--r--Source/cmNinjaTargetGenerator.cxx425
-rw-r--r--Source/cmNinjaTargetGenerator.h11
-rw-r--r--Source/cmPlaceholderExpander.cxx4
-rw-r--r--Source/cmPolicies.h63
-rw-r--r--Source/cmProcessTools.cxx82
-rw-r--r--Source/cmProcessTools.h8
-rw-r--r--Source/cmProjectCommand.cxx65
-rw-r--r--Source/cmQtAutoGen.cxx7
-rw-r--r--Source/cmQtAutoGen.h22
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.cxx107
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.h11
-rw-r--r--Source/cmQtAutoGenInitializer.cxx438
-rw-r--r--Source/cmQtAutoGenInitializer.h38
-rw-r--r--Source/cmQtAutoGenerator.cxx4
-rw-r--r--Source/cmQtAutoGenerator.h8
-rw-r--r--Source/cmQtAutoMocUic.cxx172
-rw-r--r--Source/cmQtAutoMocUic.h3
-rw-r--r--Source/cmQtAutoRcc.cxx58
-rw-r--r--Source/cmQtAutoRcc.h3
-rw-r--r--Source/cmRST.cxx5
-rw-r--r--Source/cmRulePlaceholderExpander.cxx25
-rw-r--r--Source/cmRulePlaceholderExpander.h1
-rw-r--r--Source/cmSetPropertyCommand.cxx114
-rw-r--r--Source/cmSourceFile.cxx31
-rw-r--r--Source/cmStandardLevelResolver.cxx31
-rw-r--r--Source/cmStandardLevelResolver.h3
-rw-r--r--Source/cmState.cxx22
-rw-r--r--Source/cmState.h7
-rw-r--r--Source/cmStateDirectory.cxx2
-rw-r--r--Source/cmStringAlgorithms.h5
-rw-r--r--Source/cmStringCommand.cxx3
-rw-r--r--Source/cmSystemTools.cxx351
-rw-r--r--Source/cmSystemTools.h21
-rw-r--r--Source/cmTarget.cxx217
-rw-r--r--Source/cmTarget.h4
-rw-r--r--Source/cmTargetExport.h2
-rw-r--r--Source/cmTest.cxx3
-rw-r--r--Source/cmTest.h8
-rw-r--r--Source/cmTestGenerator.cxx34
-rw-r--r--Source/cmTransformDepfile.cxx7
-rw-r--r--Source/cmUVHandlePtr.cxx78
-rw-r--r--Source/cmUVHandlePtr.h54
-rw-r--r--Source/cmUVProcessChain.cxx29
-rw-r--r--Source/cmUVProcessChain.h5
-rw-r--r--Source/cmUVSignalHackRAII.h45
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx120
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h2
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx23
-rw-r--r--Source/cmVisualStudioGeneratorOptions.h5
-rw-r--r--Source/cmWhileCommand.cxx4
-rw-r--r--Source/cmWorkerPool.cxx7
-rw-r--r--Source/cmXCodeScheme.cxx34
-rw-r--r--Source/cmXCodeScheme.h6
-rw-r--r--Source/cmXMLParser.cxx6
-rw-r--r--Source/cmXMLParser.h4
-rw-r--r--Source/cmake.cxx62
-rw-r--r--Source/cmake.h13
-rw-r--r--Source/cmakemain.cxx11
-rw-r--r--Source/cmcmd.cxx123
-rw-r--r--Source/ctest.cxx12
-rw-r--r--Source/kwsys/CMakeLists.txt8
-rw-r--r--Source/kwsys/CONTRIBUTING.rst2
-rw-r--r--Source/kwsys/CommandLineArguments.cxx16
-rw-r--r--Source/kwsys/Directory.cxx2
-rw-r--r--Source/kwsys/MD5.c2
-rw-r--r--Source/kwsys/SystemInformation.cxx8
-rw-r--r--Source/kwsys/SystemTools.cxx70
-rw-r--r--Source/kwsys/Terminal.c4
-rw-r--r--Source/kwsys/testSystemTools.cxx4
-rw-r--r--Tests/Architecture/CMakeLists.txt36
-rw-r--r--Tests/Architecture/bar.c2
-rw-r--r--Tests/BuildDepends/CMakeLists.txt4
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt18
-rw-r--r--Tests/BuildDepends/Project/link_depends_no_shared_exe.c2
-rw-r--r--Tests/CMakeCommands/target_compile_definitions/consumer.c2
-rw-r--r--Tests/CMakeCommands/target_compile_features/main.c2
-rw-r--r--Tests/CMakeCommands/target_compile_features/restrict_user.c2
-rw-r--r--Tests/CMakeCommands/target_compile_options/consumer.c2
-rw-r--r--Tests/CMakeCommands/target_include_directories/consumer.c2
-rw-r--r--Tests/CMakeLib/CMakeLists.txt4
-rw-r--r--Tests/CMakeLib/PseudoMemcheck/NoLog/CMakeLists.txt2
-rw-r--r--Tests/CMakeLib/testDebuggerNamedPipe.cxx2
-rw-r--r--Tests/CMakeLib/testDebuggerThread.cxx33
-rw-r--r--Tests/CMakeLib/testUVHandlePtr.cxx153
-rw-r--r--Tests/CMakeLib/testUVJobServerClient.cxx179
-rw-r--r--Tests/CMakeLib/testUVProcessChain.cxx53
-rw-r--r--Tests/CMakeLib/testUVRAII.cxx7
-rw-r--r--Tests/CMakeLists.txt112
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt3
-rw-r--r--Tests/COnly/conly.c2
-rw-r--r--Tests/COnly/libc1.c2
-rw-r--r--Tests/COnly/libc2.c2
-rw-r--r--Tests/CPackInnoSetupGenerator/main.c2
-rw-r--r--Tests/CPackWiXGenerator/CMakeLists.txt119
-rw-r--r--Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake79
-rw-r--r--Tests/CTestTestResourceLock/CMakeLists.txt13
-rw-r--r--Tests/CTestTestResourceLock/CTestConfig.cmake4
-rw-r--r--Tests/CTestTestResourceLock/lockFile.c27
-rw-r--r--Tests/CTestTestResourceLock/test.cmake.in21
-rw-r--r--Tests/CTestTestSerialOrder/CMakeLists.txt40
-rw-r--r--Tests/CTestTestSerialOrder/test.cmake31
-rw-r--r--Tests/CTestTestSkipReturnCode/CMakeLists.txt8
-rw-r--r--Tests/CTestTestSkipReturnCode/CTestConfig.cmake4
-rw-r--r--Tests/CTestTestSkipReturnCode/test.cmake.in23
-rw-r--r--Tests/CTestTestVerboseOutput/nop.c2
-rw-r--r--Tests/CTestUpdateGIT.cmake.in4
-rw-r--r--Tests/CommandLength/test.c2
-rw-r--r--Tests/CompatibleInterface/CMakeLists.txt121
-rw-r--r--Tests/CompatibleInterface/main.cpp112
-rw-r--r--Tests/CompileDefinitions/runtest.c2
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt36
-rw-r--r--Tests/CompileFeatures/c_std.h8
-rw-r--r--Tests/CompileFeatures/c_std_11.c5
-rw-r--r--Tests/CompileFeatures/c_std_17.c4
-rw-r--r--Tests/CompileFeatures/c_std_23.c5
-rw-r--r--Tests/CompileFeatures/c_std_90.c (renamed from Tests/CPackWiXGenerator/file with spaces.h)0
-rw-r--r--Tests/CompileFeatures/c_std_99.c4
-rw-r--r--Tests/CompileFeatures/c_variadic_macros.c2
-rw-r--r--Tests/CompileFeatures/cuda_std_03.cu0
-rw-r--r--Tests/CompileFeatures/cuda_std_11.cu4
-rw-r--r--Tests/CompileFeatures/cuda_std_14.cu4
-rw-r--r--Tests/CompileFeatures/cuda_std_17.cu4
-rw-r--r--Tests/CompileFeatures/cuda_std_20.cu4
-rw-r--r--Tests/CompileFeatures/cuda_std_23.cu4
-rw-r--r--Tests/CompileFeatures/cuda_std_26.cu4
-rw-r--r--Tests/CompileFeatures/cxx_std.h54
-rw-r--r--Tests/CompileFeatures/cxx_std_11.cpp6
-rw-r--r--Tests/CompileFeatures/cxx_std_14.cpp9
-rw-r--r--Tests/CompileFeatures/cxx_std_17.cpp4
-rw-r--r--Tests/CompileFeatures/cxx_std_20.cpp4
-rw-r--r--Tests/CompileFeatures/cxx_std_23.cpp4
-rw-r--r--Tests/CompileFeatures/cxx_std_26.cpp4
-rw-r--r--Tests/CompileFeatures/cxx_std_98.cpp0
-rw-r--r--Tests/CompileFeatures/default_dialect.c11
-rw-r--r--Tests/CompileFeatures/default_dialect.cpp35
-rw-r--r--Tests/CompileFeatures/default_dialect.cu1
-rw-r--r--Tests/CompileFeatures/genex_test.c2
-rw-r--r--Tests/Complex/Executable/Sub1/NameConflictTest.c2
-rw-r--r--Tests/Complex/Executable/Sub2/NameConflictTest.c2
-rw-r--r--Tests/Complex/Library/TestLink.c2
-rw-r--r--Tests/Complex/Library/testConly.c2
-rw-r--r--Tests/ComplexOneConfig/Executable/Sub1/NameConflictTest.c2
-rw-r--r--Tests/ComplexOneConfig/Executable/Sub2/NameConflictTest.c2
-rw-r--r--Tests/ComplexOneConfig/Library/TestLink.c2
-rw-r--r--Tests/ComplexOneConfig/Library/testConly.c2
-rw-r--r--Tests/ConfigSources/CMakeLists.txt8
-rw-r--r--Tests/ConfigSources/main_one_config.cpp8
-rw-r--r--Tests/Cuda/CMakeLists.txt6
-rw-r--r--Tests/Cuda/Complex/main.cpp2
-rw-r--r--Tests/Cuda/ObjectLibrary/main.cpp3
-rw-r--r--Tests/Cuda/ProperLinkFlags/main.cxx3
-rw-r--r--Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp1
-rw-r--r--Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp1
-rw-r--r--Tests/Cuda/Toolkit/CMakeLists.txt6
-rw-r--r--Tests/Cuda/WithC/main.c2
-rw-r--r--Tests/CudaOnly/CMakeLists.txt5
-rw-r--r--Tests/CudaOnly/DeviceLTO/file1.cu8
-rw-r--r--Tests/CudaOnly/DeviceLTO/main.cu8
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/main.cu3
-rw-r--r--Tests/CudaOnly/EnableStandard/main.cu3
-rw-r--r--Tests/CudaOnly/ExportPTX/main.cu3
-rw-r--r--Tests/CudaOnly/SeparateCompilation/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/SeparateCompilation/file4.cu3
-rw-r--r--Tests/CudaOnly/SeparateCompilation/file5.cu3
-rw-r--r--Tests/CudaOnly/SeparateCompilationTargetObjects/bar.cu3
-rw-r--r--Tests/CudaOnly/SeparateCompilationTargetObjects/foo.cu3
-rw-r--r--Tests/CudaOnly/SeparateCompilationTargetObjects/main.cu3
-rw-r--r--Tests/CudaOnly/SharedRuntimePlusToolkit/nppif.cu1
-rw-r--r--Tests/CudaOnly/StaticRuntimePlusToolkit/nppif.cu1
-rw-r--r--Tests/CudaOnly/Toolkit/CMakeLists.txt8
-rw-r--r--Tests/CudaOnly/TryCompileTargetStatic/CMakeLists.txt6
-rw-r--r--Tests/CudaOnly/TryCompileTargetStatic/main.cu5
-rw-r--r--Tests/CustomCommand/CMakeLists.txt4
-rw-r--r--Tests/CustomCommand/gen_redirect_in.c2
-rw-r--r--Tests/CustomCommandWorkingDirectory/customTarget.c2
-rw-r--r--Tests/Dependency/1/OneSrc.c2
-rw-r--r--Tests/Dependency/Case1/a.c2
-rw-r--r--Tests/Dependency/Case1/b.c4
-rw-r--r--Tests/Dependency/Case1/b2.c2
-rw-r--r--Tests/Dependency/Case1/c.c4
-rw-r--r--Tests/Dependency/Case1/c2.c4
-rw-r--r--Tests/Dependency/Case1/d.c4
-rw-r--r--Tests/Dependency/Case1/main.c2
-rw-r--r--Tests/Dependency/Case4/bar.c4
-rw-r--r--Tests/Dependency/Case4/foo.c2
-rw-r--r--Tests/Dependency/Eight/EightSrc.c4
-rw-r--r--Tests/Dependency/Exec/ExecMain.c2
-rw-r--r--Tests/Dependency/Exec2/ExecMain.c2
-rw-r--r--Tests/Dependency/Exec3/ExecMain.c2
-rw-r--r--Tests/Dependency/Exec4/ExecMain.c2
-rw-r--r--Tests/Dependency/Five/FiveSrc.c4
-rw-r--r--Tests/Dependency/Four/FourSrc.c8
-rw-r--r--Tests/Dependency/NoDepA/NoDepASrc.c2
-rw-r--r--Tests/Dependency/NoDepB/NoDepBSrc.c4
-rw-r--r--Tests/Dependency/NoDepC/NoDepCSrc.c4
-rw-r--r--Tests/Dependency/Seven/SevenSrc.c4
-rw-r--r--Tests/Dependency/Six/SixASrc.c6
-rw-r--r--Tests/Dependency/Six/SixBSrc.c8
-rw-r--r--Tests/Dependency/Three/ThreeSrc.c6
-rw-r--r--Tests/Dependency/Two/TwoCustomSrc.c4
-rw-r--r--Tests/Dependency/Two/TwoSrc.c2
-rw-r--r--Tests/DoubleProject/silly.c2
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt6
-rw-r--r--Tests/ExportImport/Export/testExe2.c2
-rw-r--r--Tests/ExportImport/External/FooConfig.cmake3
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt87
-rw-r--r--Tests/ExportImport/Import/A/deps_iface.c2
-rw-r--r--Tests/ExportImport/Import/A/imp_mod1.c2
-rw-r--r--Tests/ExportImport/Import/A/imp_testExe1.c2
-rw-r--r--Tests/ExportImport/Import/A/imp_testExeAbs1.c2
-rw-r--r--Tests/ExportImport/Import/A/imp_testLib8.c2
-rw-r--r--Tests/ExportImport/Import/A/imp_testLib9.c2
-rw-r--r--Tests/ExportImport/Import/CMakeLists.txt1
-rw-r--r--Tests/ExportImport/Import/imp_testTransExe1.c2
-rw-r--r--Tests/ExportImport/InitialCache.cmake.in1
-rw-r--r--Tests/ExportImport/main.c2
-rw-r--r--Tests/FindALSA/Test/main.c2
-rw-r--r--Tests/FindBLAS/Test/main.c2
-rw-r--r--Tests/FindBZip2/Test/main.c2
-rw-r--r--Tests/FindBacktrace/CMakeLists.txt10
-rw-r--r--Tests/FindBacktrace/Test/CMakeLists.txt11
-rw-r--r--Tests/FindBacktrace/Test/backtrace.c56
-rw-r--r--Tests/FindCURL/Test/main.c2
-rw-r--r--Tests/FindCups/Test/main.c2
-rw-r--r--Tests/FindDevIL/Test/main.c2
-rw-r--r--Tests/FindDevIL/Test/main_ilu.c2
-rw-r--r--Tests/FindEXPAT/Test/main.c2
-rw-r--r--Tests/FindFontconfig/Test/main.c2
-rw-r--r--Tests/FindFreetype/Test/main.c2
-rw-r--r--Tests/FindGDAL/Test/main.c2
-rw-r--r--Tests/FindGIF/Test/main.c2
-rw-r--r--Tests/FindGLUT/Test/main.c2
-rw-r--r--Tests/FindGTK2/gdk/main.c2
-rw-r--r--Tests/FindGnuTLS/Test/main.c2
-rw-r--r--Tests/FindImageMagick/Test/main_magick_wand.c2
-rw-r--r--Tests/FindJPEG/Test/main.c2
-rw-r--r--Tests/FindJasper/Test/CMakeLists.txt2
-rw-r--r--Tests/FindJasper/Test/main.c20
-rw-r--r--Tests/FindLAPACK/Test/main.c2
-rw-r--r--Tests/FindLibLZMA/Test/main.c2
-rw-r--r--Tests/FindLibRHash/Test/main.c2
-rw-r--r--Tests/FindLibUV/Test/main.c2
-rw-r--r--Tests/FindLibXml2/Test/main.c2
-rw-r--r--Tests/FindLibXslt/Test/libexslt.c2
-rw-r--r--Tests/FindLibXslt/Test/libxslt.c2
-rw-r--r--Tests/FindLibinput/Test/main.c2
-rw-r--r--Tests/FindODBC/Test/main.c2
-rw-r--r--Tests/FindOpenACC/CMakeLists.txt10
-rw-r--r--Tests/FindOpenACC/CTest/main.c2
-rw-r--r--Tests/FindOpenCL/Test/main.c2
-rw-r--r--Tests/FindOpenGL/Test/main.c2
-rw-r--r--Tests/FindOpenGL/Test/main_gles2.c2
-rw-r--r--Tests/FindOpenGL/Test/main_gles3.c2
-rw-r--r--Tests/FindOpenMP/Test/CMakeLists.txt13
-rw-r--r--Tests/FindOpenMP/Test/main.c2
-rw-r--r--Tests/FindOpenMP/Test/scaltest.c2
-rw-r--r--Tests/FindPNG/Test/main.c2
-rw-r--r--Tests/FindPackageTest/Exporter/dummy.c2
-rw-r--r--Tests/FindPostgreSQL/Test/main.c2
-rw-r--r--Tests/FindPython/display_time.c2
-rw-r--r--Tests/FindPython/main.c2
-rw-r--r--Tests/FindSDL/Test/main.c2
-rw-r--r--Tests/FindSQLite3/Test/main.c2
-rw-r--r--Tests/FindTIFF/Test/main.c2
-rw-r--r--Tests/FindVulkan/CMakeLists.txt3
-rw-r--r--Tests/FindVulkan/Test/Run-glslangValidator.cmake6
-rw-r--r--Tests/FindVulkan/Test/main-SPIRV-Tools.c2
-rw-r--r--Tests/FindVulkan/Test/main.c2
-rw-r--r--Tests/Fortran/mainc.c2
-rw-r--r--Tests/Fortran/maincxx.c2
-rw-r--r--Tests/FortranModules/Issue25252-iface-sources/lib.c2
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt1
-rw-r--r--Tests/GeneratorExpression/check-part1.cmake1
-rw-r--r--Tests/GeneratorExpression/objlib1.c2
-rw-r--r--Tests/GeneratorExpression/objlib2.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c2
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c2
-rw-r--r--Tests/GoogleTest/Test/CMakeLists.txt22
-rw-r--r--Tests/IncludeDirectories/StandardIncludeDirectories/main.c2
-rw-r--r--Tests/IncludeDirectories/SystemIncludeDirectoriesPerLang/main.c2
-rw-r--r--Tests/JavaExportImport/main.c2
-rw-r--r--Tests/LibName/bar.c2
-rw-r--r--Tests/LibName/foo.c4
-rw-r--r--Tests/LibName/foobar.c2
-rw-r--r--Tests/LinkLanguage/LinkLanguage.c2
-rw-r--r--Tests/LinkLine/Exec.c2
-rw-r--r--Tests/LinkLine/One.c4
-rw-r--r--Tests/LinkLine/Two.c4
-rw-r--r--Tests/LinkLineOrder/Exec1.c2
-rw-r--r--Tests/LinkLineOrder/Exec2.c2
-rw-r--r--Tests/LinkLineOrder/NoDepA.c4
-rw-r--r--Tests/LinkLineOrder/NoDepB.c2
-rw-r--r--Tests/LinkLineOrder/NoDepC.c4
-rw-r--r--Tests/LinkLineOrder/NoDepE.c4
-rw-r--r--Tests/LinkLineOrder/NoDepF.c4
-rw-r--r--Tests/LinkLineOrder/NoDepX.c4
-rw-r--r--Tests/LinkLineOrder/NoDepY.c2
-rw-r--r--Tests/LinkLineOrder/NoDepZ.c4
-rw-r--r--Tests/LinkLineOrder/One.c6
-rw-r--r--Tests/LinkLineOrder/Two.c6
-rw-r--r--Tests/MSVCDebugInformationFormat/override-CUDA.cmake1
-rw-r--r--Tests/MSVCRuntimeLibrary/CMakeLists.txt4
-rw-r--r--Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt8
-rw-r--r--Tests/Module/CheckIPOSupported-C/bar.c2
-rw-r--r--Tests/Module/CheckIPOSupported-C/foo.c2
-rw-r--r--Tests/Module/CheckIPOSupported-C/main.c2
-rw-r--r--Tests/Module/CheckTypeSize/CheckTypeSize.c2
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/c_undefined.c2
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/main.c2
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/main_multi.c2
-rw-r--r--Tests/NasmOnly/CMakeLists.txt7
-rw-r--r--Tests/NasmOnly/libnasm1.nasm6
-rw-r--r--Tests/NasmOnly/nasmonly.nasm19
-rw-r--r--Tests/OutOfBinary/outlib.c2
-rw-r--r--Tests/PDBDirectoryAndName/myexe.c10
-rw-r--r--Tests/PDBDirectoryAndName/myexe2.c6
-rw-r--r--Tests/PDBDirectoryAndName/mylibA.c2
-rw-r--r--Tests/PDBDirectoryAndName/mylibB.c2
-rw-r--r--Tests/PDBDirectoryAndName/mylibC.c2
-rw-r--r--Tests/PDBDirectoryAndName/mylibD.c2
-rw-r--r--Tests/PerConfig/perconfig.c2
-rw-r--r--Tests/PolicyScope/main.c2
-rw-r--r--Tests/PrecompiledHeader/foo1.c2
-rw-r--r--Tests/PrecompiledHeader/foo2.c2
-rw-r--r--Tests/RunCMake/AppleTextStubs/SUBDIR/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/AppleTextStubs/Simple.cmake12
-rw-r--r--Tests/RunCMake/AppleTextStubs/foo.c2
-rw-r--r--Tests/RunCMake/AppleTextStubs/main.c2
-rw-r--r--Tests/RunCMake/AutoExportDll/foo.c4
-rw-r--r--Tests/RunCMake/AutoExportDll/hello2.c2
-rw-r--r--Tests/RunCMake/AutoExportDll/objlib.c2
-rw-r--r--Tests/RunCMake/Autogen/RccExample.cmake4
-rw-r--r--Tests/RunCMake/Autogen/RunCMakeTest.cmake389
-rw-r--r--Tests/RunCMake/Autogen/data.qrc4
-rw-r--r--Tests/RunCMake/Autogen/example.cpp5
-rw-r--r--Tests/RunCMake/Autogen/example.h12
-rw-r--r--Tests/RunCMake/Autogen/example_ui.cpp5
-rw-r--r--Tests/RunCMake/Autogen/example_ui.h14
-rw-r--r--Tests/RunCMake/Autogen/exe.cpp4
-rw-r--r--Tests/RunCMake/Autogen/exe_common.h48
-rw-r--r--Tests/RunCMake/Autogen/exe_debug.cpp10
-rw-r--r--Tests/RunCMake/Autogen/exe_release.cpp10
-rw-r--r--Tests/RunCMake/Autogen/exe_relwithdebinfo.cpp10
-rw-r--r--Tests/RunCMake/Autogen/uiA.ui24
-rw-r--r--Tests/RunCMake/BuildDepends/MakeInProjectOnly.c2
-rw-r--r--Tests/RunCMake/BuiltinTargets/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake19
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-Default-build-check.cmake1
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-Default.cmake1
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-No-build-check.cmake3
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake2
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake3
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake2
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-common.cmake3
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test16.cmake38
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test1b.cmake9
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test2b.cmake12
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test2c.cmake12
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test2d.cmake12
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake4
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake4
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake4
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake4
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake4
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test8b.cmake51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test9b.cmake51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-stderr.txt27
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test16.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt30
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt30
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt28
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-stderr.txt61
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-stderr.txt38
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test16.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-stderr.txt21
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b-stderr.txt12
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c-stderr.txt12
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d-stderr.txt12
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt30
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt30
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt28
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-stderr.txt56
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-stderr.txt72
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt8
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt8
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt8
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-stderr.txt27
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test16.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt30
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt30
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt52
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt8
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-stderr.txt45
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt8
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-stderr.txt61
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMP0118/RunCMakeTest.cmake21
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test16/CMakeLists.txt10
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test8b/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test9b/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/CMP0126/CMP0126-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0126/CMP0126-OLD_CL-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-Common.cmake27
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-NEW-AppleClang.cmake5
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-NEW.cmake4
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-result.txt1
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-stdout.txt3
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang.cmake5
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-OLD.cmake4
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-WARN-stderr.txt35
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-WARN.cmake4
-rw-r--r--Tests/RunCMake/CMP0156/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0156/RunCMakeTest.cmake26
-rw-r--r--Tests/RunCMake/CMP0156/lib1.c7
-rw-r--r--Tests/RunCMake/CMP0156/lib2.c7
-rw-r--r--Tests/RunCMake/CMP0156/lib3.c7
-rw-r--r--Tests/RunCMake/CMP0156/lib4.c9
-rw-r--r--Tests/RunCMake/CMP0156/main.c9
-rw-r--r--Tests/RunCMake/CMP0156/main2.c9
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt233
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-NEW.cmake4
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt1
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt104
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-OLD.cmake4
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt1
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt297
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-WARN.cmake3
-rw-r--r--Tests/RunCMake/CMP0160/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake52
-rw-r--r--Tests/RunCMake/CMP0160/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test10-stderr.txt42
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test10.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test11-stderr.txt55
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test11.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13-stderr.txt64
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test14-stderr.txt42
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test14.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test15-stderr.txt55
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test15.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16-stderr.txt27
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b.cmake6
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2a.cmake3
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2b-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2c-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2c.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2d-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2d.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4-stderr.txt167
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b-stderr.txt135
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5-stderr.txt126
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test6-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test6.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8b-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-stderr.txt61
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test10-stderr.txt42
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test10.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test11-stderr.txt55
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test11.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13-stderr.txt64
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test14-stderr.txt42
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test14.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test15-stderr.txt55
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test15.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16-stderr.txt27
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b.cmake6
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2a.cmake3
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2b-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2c-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2c.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2d-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2d.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4-stderr.txt167
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b-stderr.txt135
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5-stderr.txt126
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test6-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test6.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8b-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-stderr.txt61
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test10-stderr.txt42
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test10.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test11-stderr.txt55
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test11.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13-stderr.txt64
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test14-stderr.txt42
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test14.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test15-stderr.txt55
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test15.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16-stderr.txt27
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b.cmake6
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2a.cmake3
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2b-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2c-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2c.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2d-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2d.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4-stderr.txt167
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b-stderr.txt135
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5-stderr.txt126
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test6-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test6.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8b-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-stderr.txt61
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test10-stderr.txt42
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test10.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test11-stderr.txt55
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test11.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13-stderr.txt64
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test14-stderr.txt42
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test14.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test15-stderr.txt55
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test15.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16-stderr.txt27
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b.cmake6
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2a.cmake3
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2b-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2c-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2c.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2d-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2d.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4-stderr.txt126
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b-stderr.txt135
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5-stderr.txt126
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test6-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test6.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8b-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-stderr.txt61
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-stderr.txt90
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-stderr.txt90
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16-stderr.txt27
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b.cmake6
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2a.cmake2
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2b-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2c-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2c.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2d-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2d.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4-stderr.txt212
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b-stderr.txt212
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5-stderr.txt205
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6-stderr.txt45
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-stderr.txt100
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8-stderr.txt45
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b-stderr.txt45
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-stderr.txt84
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-stderr.txt61
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-stderr.txt90
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-stderr.txt90
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16-stderr.txt27
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b.cmake6
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2a.cmake2
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2b-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2c-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2c.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2d-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2d.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b-stderr.txt79
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4-stderr.txt212
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b-stderr.txt212
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5-stderr.txt205
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6-stderr.txt45
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-stderr.txt100
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8-stderr.txt45
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b-stderr.txt45
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-stderr.txt84
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-stderr.txt61
-rw-r--r--Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b.cmake7
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Helper.cmake14
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test1.cmake9
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test10.cmake65
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test11.cmake65
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test12.cmake65
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test13.cmake65
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test14.cmake65
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test15.cmake65
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test16.cmake38
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test1b.cmake9
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test2.cmake12
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test2b.cmake12
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test2c.cmake12
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test2d.cmake12
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test3.cmake66
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test3b.cmake66
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test4.cmake66
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test4b.cmake66
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test5.cmake78
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test6.cmake44
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test7.cmake44
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test8.cmake51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test8b.cmake51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test9.cmake51
-rw-r--r--Tests/RunCMake/CMP0163/CMP0163-Common-Test9b.cmake51
-rw-r--r--Tests/RunCMake/CMP0163/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/CMP0163/RunCMakeTest.cmake147
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test10/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test11/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test12/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test13/CMakeLists.txt36
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test14/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test15/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test16/CMakeLists.txt10
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test6/CMakeLists.txt16
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test7/CMakeLists.txt16
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test8/CMakeLists.txt31
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test8b/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test9/CMakeLists.txt31
-rw-r--r--Tests/RunCMake/CMP0163/subdir-Common-Test9b/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/CMP0165/CMP0165-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0165/CMP0165-NEW-stderr.txt4
-rw-r--r--Tests/RunCMake/CMP0165/CMP0165-NEW.cmake2
-rw-r--r--Tests/RunCMake/CMP0165/CMP0165-OLD.cmake2
-rw-r--r--Tests/RunCMake/CMP0165/CMP0165-WARN-stderr.txt5
-rw-r--r--Tests/RunCMake/CMP0165/CMP0165-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0165/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/CMP0165/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-OLD-stderr.txt9
-rw-r--r--Tests/RunCMake/CMakeLists.txt207
-rw-r--r--Tests/RunCMake/CMakePackage/ApplePlatformGenSubdir-stdout.txt3
-rw-r--r--Tests/RunCMake/CMakePackage/ApplePlatformGenSubdir.cmake50
-rw-r--r--Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-result.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-stderr.txt6
-rw-r--r--Tests/RunCMake/CMakePackage/ApplePlatformMissingDest.cmake4
-rw-r--r--Tests/RunCMake/CMakePackage/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMakePackage/NestedConfigFile-stdout.txt6
-rw-r--r--Tests/RunCMake/CMakePackage/NestedConfigFile.cmake43
-rw-r--r--Tests/RunCMake/CMakePackage/RunCMakeTest.cmake138
-rw-r--r--Tests/RunCMake/CMakePackage/apple-common.cmake15
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-common.cmake29
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios-simulator-arm64.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake16
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios-simulator-x86_64.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios-simulator.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-macos.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-tvos-simulator.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-tvos.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-unsupported-capture.cmake16
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-unsupported-fatal.cmake14
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-visionos-simulator.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-visionos.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-watchos-simulator.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-watchos.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-common.cmake7
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-macos-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-macos.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-tvos-simulator-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-tvos-simulator.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-tvos-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-tvos.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-unsupported-capture-stdout.txt2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-unsupported-capture.cmake11
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture-result.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture-stderr.txt6
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture.cmake4
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform-result.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform-stderr.txt6
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform.cmake4
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-visionos-simulator-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-visionos-simulator.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-visionos-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-visionos.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-watchos-simulator-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-watchos-simulator.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-watchos-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-watchos.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/include/mylib.h3
-rw-r--r--Tests/RunCMake/CMakePackage/src/myexe.c6
-rw-r--r--Tests/RunCMake/CMakePackage/src/mylib.c4
-rw-r--r--Tests/RunCMake/CMakePresets/IncludeExpansionOtherMacros-stdout.txt5
-rw-r--r--Tests/RunCMake/CMakePresets/IncludeExpansionOtherMacros.json.in10
-rw-r--r--Tests/RunCMake/CMakePresets/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CPack/External/Prerequirements.cmake4
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake8
-rw-r--r--Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake5
-rw-r--r--Tests/RunCMake/CPack/tests/DUPLICATE_FILE/ExpectedFiles.cmake16
-rw-r--r--Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_file-stderr.txt1
-rw-r--r--Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_symlink-stderr.txt1
-rw-r--r--Tests/RunCMake/CPack/tests/DUPLICATE_FILE/test.cmake74
-rw-r--r--Tests/RunCMake/CPackConfig/CMP0161-NEW-check.cmake3
-rw-r--r--Tests/RunCMake/CPackConfig/CMP0161-NEW.cmake2
-rw-r--r--Tests/RunCMake/CPackConfig/CMP0161-OLD-check.cmake5
-rw-r--r--Tests/RunCMake/CPackConfig/CMP0161-OLD.cmake2
-rw-r--r--Tests/RunCMake/CPackConfig/CMP0161-WARN-check.cmake5
-rw-r--r--Tests/RunCMake/CPackConfig/CMP0161-WARN-stderr-darwin.txt12
-rw-r--r--Tests/RunCMake/CPackConfig/CMP0161-WARN.cmake1
-rw-r--r--Tests/RunCMake/CPackConfig/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/CPack_WIX/3-AppWiX-cpack-WIX-check.cmake1
-rw-r--r--Tests/RunCMake/CPack_WIX/3-AppWiX-cpack-WIX-stdout.txt11
-rw-r--r--Tests/RunCMake/CPack_WIX/3-AppWiX-verify-stdout.txt33
-rw-r--r--Tests/RunCMake/CPack_WIX/4-AppWiX-cpack-WIX-check.cmake1
-rw-r--r--Tests/RunCMake/CPack_WIX/4-AppWiX-cpack-WIX-stdout.txt11
-rw-r--r--Tests/RunCMake/CPack_WIX/4-AppWiX-verify-stdout.txt34
-rw-r--r--Tests/RunCMake/CPack_WIX/RunCMakeTest.cmake24
-rw-r--r--Tests/RunCMake/CPack_WIX/cpack-check-common.cmake6
-rw-r--r--Tests/RunCMake/CPack_WIX/print-msi.ps129
-rw-r--r--Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake.cmake1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-env-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-env-ctest-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-env-ctest-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-env.cmake1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF.cmake1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-cmake-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-cmake-ctest-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-cmake-ctest-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-cmake.cmake1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-ctest-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-ctest-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-env-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-env-ctest-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-env-ctest-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON-env.cmake1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-ON.cmake1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-cmake-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-cmake-ctest-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-cmake-ctest-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-cmake.cmake1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-ctest-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-ctest-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-env-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-env-ctest-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-env-ctest-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1-env.cmake1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-TLSVersion-1.1.cmake1
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailDrop-common.cmake3
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-0-stdout.txt9
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-4-stdout.txt7
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-N-stdout.txt10
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-bad-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-bad-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-empty-stdout.txt5
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-env-0-stdout.txt9
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-env-3-stdout.txt6
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-env-bad-stdout.txt4
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-env-empty-stdout.txt5
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-j-bad-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-j-bad-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/Parallel-j-stdout.txt5
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake118
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestOutputSize-check.cmake2
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-TestList-empty.txt0
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-TestList.txt5
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-empty-stdout.txt10
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-missing-stdout.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-exclude-stdout.txt9
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-include-empty-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-include-missing-stdout.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/TestsFromFile-include-stdout.txt7
-rw-r--r--Tests/RunCMake/CTestCommandLine/invalid-ctest-argument-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/invalid-ctest-argument-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py12
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt21
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-load-wait0-stdout.txt21
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-load-wait1-stdout.txt21
-rw-r--r--Tests/RunCMake/CTestCommandLine/testDir-presets.json.in20
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-ctest-s-stderr.txt6
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/dynamic-resource-circular-no-required-fixtures-ctest-s-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/dynamic-resource-conflicting-spec-ctest-s-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-generators-ctest-s-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/dynamic-resource-multiple-setup-fixtures-ctest-s-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-required-fixture-ctest-s-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/dynamic-resource-no-setup-fixture-ctest-s-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/dynamic-resource-relative-path-ctest-s-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/invalid-nofile-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/invalid-nofile-ctest-stderr.txt8
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/invalid-not-json-ctest-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/invalid-not-json-ctest-stderr.txt15
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/invalid.json1
-rw-r--r--Tests/RunCMake/CXXModules/CMP0155-NEW.cmake3
-rw-r--r--Tests/RunCMake/CXXModules/CMP0155-OLD.cmake3
-rw-r--r--Tests/RunCMake/CXXModules/CXXImportStdConfig-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/CXXImportStdConfig-stderr.txt3
-rw-r--r--Tests/RunCMake/CXXModules/CXXImportStdConfig.cmake10
-rw-r--r--Tests/RunCMake/CXXModules/CXXImportStdHeadTarget-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/CXXImportStdHeadTarget-stderr.txt9
-rw-r--r--Tests/RunCMake/CXXModules/CXXImportStdHeadTarget.cmake10
-rw-r--r--Tests/RunCMake/CXXModules/CXXImportStdInvalidGenex.cmake11
-rw-r--r--Tests/RunCMake/CXXModules/CXXImportStdLinkLanguage-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/CXXImportStdLinkLanguage-stderr.txt7
-rw-r--r--Tests/RunCMake/CXXModules/CXXImportStdLinkLanguage.cmake10
-rw-r--r--Tests/RunCMake/CXXModules/ImplicitCXX20.cmake3
-rw-r--r--Tests/RunCMake/CXXModules/Inspect.cmake17
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX20.cmake3
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX23TargetNotRequired.cmake11
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX23TargetRequired-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX23TargetRequired-stderr.txt4
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX23TargetRequired.cmake11
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX23TargetUnset.cmake13
-rw-r--r--Tests/RunCMake/CXXModules/NoScanningVariable.cmake3
-rw-r--r--Tests/RunCMake/CXXModules/RunCMakeTest.cmake40
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-build-stderr.txt8
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-build/CMakeLists.txt59
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-build/impl-uses-std.cxx3
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-build/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-build/test/CMakeLists.txt45
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-build/uses-std.cxx8
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-install-stderr.txt8
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-install/CMakeLists.txt61
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-install/impl-uses-std.cxx3
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-install/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-install/test/CMakeLists.txt45
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-export-no-std-install/uses-std.cxx9
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-no-std-property-build-result.txt1
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-no-std-property-build-stdout.txt1
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-no-std-property-stderr.txt8
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-no-std-property/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-no-std-property/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-not-in-export-build-stderr.txt8
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-not-in-export-build/CMakeLists.txt54
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-not-in-export-build/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-not-in-export-build/test/CMakeLists.txt45
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-not-in-export-build/uses-std.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-not-in-export-install-stderr.txt8
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-not-in-export-install/CMakeLists.txt58
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-not-in-export-install/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-not-in-export-install/test/CMakeLists.txt45
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-not-in-export-install/uses-std.cxx7
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-stderr.txt8
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-transitive-not-in-export-build-stderr.txt8
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-transitive-not-in-export-install-stderr.txt8
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-transitive/CMakeLists.txt28
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std-transitive/main.cxx6
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std/CMakeLists.txt15
-rw-r--r--Tests/RunCMake/CXXModules/examples/import-std/main.cxx10
-rw-r--r--Tests/RunCMake/CXXModules/examples/vs-without-flags/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CXXModules/sources/c-anchor.c2
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake1
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesFortran.cmake8
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake1
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckSourceRunsFortran.cmake8
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-stdout.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_cat-stdin-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_cat-stdin.cmake10
-rw-r--r--Tests/RunCMake/CommandLine/EnvInstallPrefix-stdout.txt3
-rw-r--r--Tests/RunCMake/CommandLine/EnvInstallPrefix.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/EnvInstallPrefixOverrideWithCmdLineOpt-stdout.txt3
-rw-r--r--Tests/RunCMake/CommandLine/EnvInstallPrefixOverrideWithCmdLineOpt.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/EnvInstallPrefixOverrideWithVar-stdout.txt3
-rw-r--r--Tests/RunCMake/CommandLine/EnvInstallPrefixOverrideWithVar.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/CommandLine/trace-try_compile-redirect.cmake1
-rw-r--r--Tests/RunCMake/CompileDefinitions/foo.c2
-rw-r--r--Tests/RunCMake/CompileFeatures/CMP0128WarnMatch-stderr.txt11
-rw-r--r--Tests/RunCMake/CompileFeatures/CMP0128WarnUnset-stderr.txt11
-rw-r--r--Tests/RunCMake/CompileFeatures/compiler_introspection.cmake4
-rw-r--r--Tests/RunCMake/CompileWarningAsError/warn.c2
-rw-r--r--Tests/RunCMake/CompilerChange/CompilerPath-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerChange/CompilerPath.cmake3
-rw-r--r--Tests/RunCMake/CompilerChange/EmptyCompiler-override.cmake3
-rw-r--r--Tests/RunCMake/CompilerChange/EmptyCompiler-stdout.txt3
-rw-r--r--Tests/RunCMake/CompilerChange/FirstCompiler-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerChange/FirstCompiler.cmake3
-rw-r--r--Tests/RunCMake/CompilerChange/RunCMakeTest.cmake49
-rw-r--r--Tests/RunCMake/CompilerChange/SecondCompiler-stdout.txt4
-rw-r--r--Tests/RunCMake/CompilerChange/SecondCompiler.cmake3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-NMake.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt6
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt6
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt6
-rw-r--r--Tests/RunCMake/Configure/ReadOnly-result.txt1
-rw-r--r--Tests/RunCMake/Configure/ReadOnly-stderr.txt8
-rw-r--r--Tests/RunCMake/Configure/ReadOnly.cmake1
-rw-r--r--Tests/RunCMake/Configure/RunCMakeTest.cmake103
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand-build-check.cmake5
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddCustomCommand.cmake19
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg-build-check.cmake3
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddCustomCommandWithArg.cmake5
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddCustomTarget.cmake17
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddCustomTargetWithArg.cmake5
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-NEW-check.cmake34
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-NEW-test-stdout.txt46
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-NEW.cmake27
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD-check.cmake34
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD-test-stdout.txt48
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD.cmake26
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake39
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-test-stdout.txt68
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake28
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake8
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake19
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/TryRun.cmake7
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/emulator_unexpected.c10
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/generated_exe_emulator_unexpected.cxx9
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/main.c4
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/simple_src_exiterror.c4
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/simple_src_exiterror.cxx4
-rw-r--r--Tests/RunCMake/DependencyProviders/ProviderFirst-stdout.txt6
-rw-r--r--Tests/RunCMake/DependencyProviders/ProviderFirst.cmake8
-rw-r--r--Tests/RunCMake/DependencyProviders/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/ExcludeFromAll/main.c2
-rw-r--r--Tests/RunCMake/ExternalProject/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/ExternalProject/TLSVersionBadArg-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/TLSVersionBadArg-stderr.txt10
-rw-r--r--Tests/RunCMake/ExternalProject/TLSVersionBadArg.cmake4
-rw-r--r--Tests/RunCMake/ExternalProject/TLSVersionBadEnv-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/TLSVersionBadEnv-stderr.txt10
-rw-r--r--Tests/RunCMake/ExternalProject/TLSVersionBadEnv.cmake3
-rw-r--r--Tests/RunCMake/ExternalProject/TLSVersionBadVar-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/TLSVersionBadVar-stderr.txt10
-rw-r--r--Tests/RunCMake/ExternalProject/TLSVersionBadVar.cmake4
-rw-r--r--Tests/RunCMake/FPHSA/BadFoundVar-stderr.txt6
-rw-r--r--Tests/RunCMake/FPHSA/BeforeProject-Error-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/BeforeProject-Error-stderr.txt12
-rw-r--r--Tests/RunCMake/FPHSA/BeforeProject-Error.cmake2
-rw-r--r--Tests/RunCMake/FPHSA/BeforeProject-Missing-stdout.txt2
-rw-r--r--Tests/RunCMake/FPHSA/BeforeProject-Missing.cmake2
-rw-r--r--Tests/RunCMake/FPHSA/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/FPHSA/FindBeforeProject.cmake3
-rw-r--r--Tests/RunCMake/FPHSA/NameMismatch-stderr.txt12
-rw-r--r--Tests/RunCMake/FPHSA/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/FetchContent/CMake/FindFDE-S.cmake6
-rw-r--r--Tests/RunCMake/FetchContent/CMake/FindFDE-U.cmake6
-rw-r--r--Tests/RunCMake/FetchContent/FindDependencyExport.cmake78
-rw-r--r--Tests/RunCMake/FetchContent/FindDependencyExport/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/FetchContent/FindDependencyExportDP.cmake11
-rw-r--r--Tests/RunCMake/FetchContent/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/FetchContent/VarPassthroughs.cmake5
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py44
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake10
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py31
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.cross.json16
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json5
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json7
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json16
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json16
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator.json105
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator_args.json109
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json105
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher_and_cross_emulator.json109
-rw-r--r--Tests/RunCMake/FileAPI/cxx/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/FileAPI/cxx/cross/CMakeLists.txt11
-rw-r--r--Tests/RunCMake/File_Generate/empty.c2
-rw-r--r--Tests/RunCMake/FindOpenGL/CMP0072-common.cmake1
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE-stdout.txt3
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE_MULTIPLE_VALUES.cmake31
-rw-r--r--Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/FindPkgConfig/pc-bletch/lib/pkgconfig/bletch.pc4
-rw-r--r--Tests/RunCMake/Framework/consumer.c2
-rw-r--r--Tests/RunCMake/Framework/foo.c2
-rw-r--r--Tests/RunCMake/Framework/foo.h2
-rw-r--r--Tests/RunCMake/Framework/main.c2
-rw-r--r--Tests/RunCMake/Framework/main2.c2
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/TransitiveBuild-check.cmake25
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/TransitiveBuild.cmake66
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/TransitiveLink-CMP0166-NEW-check.cmake8
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/TransitiveLink-CMP0166-NEW.cmake2
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/TransitiveLink-CMP0166-OLD-check.cmake8
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/TransitiveLink-CMP0166-OLD.cmake2
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/TransitiveLink-check-common.cmake12
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/TransitiveLink-common.cmake42
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/empty.h0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/empty1.c0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/empty1.h0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/empty2.h0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/empty3.h0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/main.c4
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/Cygwin/libshared_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/Cygwin/libstatic_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/Empty/libshared_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/Empty/libstatic_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/MinGW/libshared_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/MinGW/libstatic_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/UNIX/libshared_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/UNIX/libstatic_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libshared_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/UNIX_DeprecatedOnly/libstatic_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/Win32-Clang/libshared_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/Win32-Clang/libstatic_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/Win32/libshared_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/Win32/libstatic_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/WinEmpty/libshared_export.h1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/reference/WinEmpty/libstatic_export.h1
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetFortran-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetFortran-stderr.txt11
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetFortran.cmake1
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFORT-stdout.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFORT.cmake1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFX-stdout.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFX.cmake1
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-stdout.txt1
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stderr.txt1
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTestListScoped.cmake13
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTestListScoped/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestLauncher-test-stdout.txt17
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestLauncher.cmake29
-rw-r--r--Tests/RunCMake/GoogleTest/RunCMakeTest.cmake67
-rw-r--r--Tests/RunCMake/GoogleTest/launcher_test.c24
-rw-r--r--Tests/RunCMake/GoogleTest/test_launcher.c71
-rw-r--r--Tests/RunCMake/Graphviz/test_project/core_library.c2
-rw-r--r--Tests/RunCMake/Graphviz/test_project/graphic_library.c2
-rw-r--r--Tests/RunCMake/Graphviz/test_project/module.c2
-rw-r--r--Tests/RunCMake/Graphviz/test_project/system_library.c2
-rw-r--r--Tests/RunCMake/IAR/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/IAR/RunCMakeTest.cmake73
-rw-r--r--Tests/RunCMake/IAR/iar-asm.cmake4
-rw-r--r--Tests/RunCMake/IAR/iar-c.cmake5
-rw-r--r--Tests/RunCMake/IAR/iar-cxx.cmake5
-rw-r--r--Tests/RunCMake/IAR/iar-lib.cmake9
-rw-r--r--Tests/RunCMake/IAR/libmod.c4
-rw-r--r--Tests/RunCMake/IAR/module.asm41
-rw-r--r--Tests/RunCMake/IAR/module.c14
-rw-r--r--Tests/RunCMake/IAR/module.cxx7
-rw-r--r--Tests/RunCMake/IAR/module.h14
-rw-r--r--Tests/RunCMake/LanguageStandards/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/LanguageStandards/Inspect.cmake14
-rw-r--r--Tests/RunCMake/LanguageStandards/RunCMakeTest.cmake32
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-C-stdout.txt1
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-C.c4
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-C.cmake4
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-CUDA-stdout.txt1
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-CUDA.cmake4
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-CUDA.cu4
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-CXX-stdout.txt1
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-CXX.cmake5
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-CXX.cxx4
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-HIP-stdout.txt1
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-HIP.cmake4
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-HIP.hip4
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-OBJC-stdout.txt1
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-OBJC.cmake4
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-OBJC.m4
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-OBJCXX-stdout.txt1
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-OBJCXX.cmake4
-rw-r--r--Tests/RunCMake/LanguageStandards/StdLatest-OBJCXX.mm4
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1-stderr.txt7
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2-stderr.txt7
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3-stderr.txt7
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-stderr.txt8
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER-stderr.txt7
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-stderr.txt7
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/lib.c4
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/main.c5
-rw-r--r--Tests/RunCMake/LinkerSelection/AppleClassic.cmake12
-rw-r--r--Tests/RunCMake/LinkerSelection/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/LinkerSelection/CustomLinkerType-build-check.cmake2
-rw-r--r--Tests/RunCMake/LinkerSelection/CustomLinkerType.cmake53
-rw-r--r--Tests/RunCMake/LinkerSelection/InvalidLinkerType1-result.txt1
-rw-r--r--Tests/RunCMake/LinkerSelection/InvalidLinkerType1-stderr.txt2
-rw-r--r--Tests/RunCMake/LinkerSelection/InvalidLinkerType1.cmake5
-rw-r--r--Tests/RunCMake/LinkerSelection/InvalidLinkerType2-result.txt1
-rw-r--r--Tests/RunCMake/LinkerSelection/InvalidLinkerType2-stderr.txt3
-rw-r--r--Tests/RunCMake/LinkerSelection/InvalidLinkerType2.cmake5
-rw-r--r--Tests/RunCMake/LinkerSelection/LinkerType-validation.cmake9
-rw-r--r--Tests/RunCMake/LinkerSelection/RunCMakeTest.cmake45
-rw-r--r--Tests/RunCMake/LinkerSelection/UnsupportedLinkerType-result.txt1
-rw-r--r--Tests/RunCMake/LinkerSelection/UnsupportedLinkerType-stderr.txt3
-rw-r--r--Tests/RunCMake/LinkerSelection/UnsupportedLinkerType.cmake5
-rw-r--r--Tests/RunCMake/LinkerSelection/ValidLinkerType-build-check.cmake2
-rw-r--r--Tests/RunCMake/LinkerSelection/ValidLinkerType.cmake45
-rw-r--r--Tests/RunCMake/LinkerSelection/main.c4
-rw-r--r--Tests/RunCMake/LinkerSelection/main.cu5
-rw-r--r--Tests/RunCMake/LinkerSelection/main.swift1
-rw-r--r--Tests/RunCMake/Make/CTestJobServer-NoPipe-j2-stdout.txt9
-rw-r--r--Tests/RunCMake/Make/CTestJobServer-NoTests-j2-stderr.txt1
-rw-r--r--Tests/RunCMake/Make/CTestJobServer-NoTests-j2-stdout.txt3
-rw-r--r--Tests/RunCMake/Make/CTestJobServer-Tests-j2-stdout.txt6
-rw-r--r--Tests/RunCMake/Make/CTestJobServer-Tests-j3-stdout.txt7
-rw-r--r--Tests/RunCMake/Make/CTestJobServer.cmake4
-rw-r--r--Tests/RunCMake/Make/CTestJobServer.make11
-rw-r--r--Tests/RunCMake/Make/RunCMakeTest.cmake23
-rw-r--r--Tests/RunCMake/Ninja/CheckNoPrefixSubDirScript.cmake2
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake35
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfileAsByproduct-check.cmake47
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfileAsByproduct.cmake24
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfileAsOutput-check.cmake47
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfileAsOutput.cmake24
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/Ninja/dep.c2
-rw-r--r--Tests/RunCMake/Ninja/top.c2
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Common.cmake2
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfile-check.cmake35
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsByproduct-check.cmake47
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsByproduct.cmake22
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsOutput-check.cmake47
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsOutput.cmake22
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/QtX-debug-in-release-graph-build-check.cmake7
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/QtX.cmake36
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake66
-rw-r--r--Tests/RunCMake/ObjectLibrary/exe.c2
-rw-r--r--Tests/RunCMake/ParseImplicitData/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/ParseImplicitData/aix-C-IBMClang-17.1.1.2.input43
-rw-r--r--Tests/RunCMake/ParseImplicitData/aix-CXX-IBMClang-17.1.1.2.input44
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-C-GNU-12.2.0.input74
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-C-Intel-2021.10.0.20230609.input41
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-C-IntelLLVM-2023.2.0.input59
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CXX-GNU-12.2.0.input78
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CXX-Intel-2021.10.0.20230609.input44
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CXX-IntelLLVM-2023.2.0.input62
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-Fortran-GNU-12.2.0.input93
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-Fortran-Intel-2021.10.0.20230609.input63
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-Fortran-IntelLLVM-2023.2.0.input58
-rw-r--r--Tests/RunCMake/ParseImplicitData/sunos5.10_sparc32-C-GNU-5.5.0.input66
-rw-r--r--Tests/RunCMake/ParseImplicitData/sunos5.10_sparc32-CXX-GNU-5.5.0.input69
-rw-r--r--Tests/RunCMake/ParseImplicitData/sunos5.10_sparc32-Fortran-GNU-5.5.0.input70
-rw-r--r--Tests/RunCMake/ParseImplicitData/sunos5.11_i386-C-GNU-5.5.0.input66
-rw-r--r--Tests/RunCMake/ParseImplicitData/sunos5.11_i386-CXX-GNU-5.5.0.input69
-rw-r--r--Tests/RunCMake/ParseImplicitData/sunos5.11_i386-Fortran-GNU-5.5.0.input70
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-C-Intel-2021.9.0.20230302.input19
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-C-IntelLLVM-2023.1.0.input19
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-C-MSVC-19.36.32543.0.input19
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-C-MSVC-19.38.33130.0-VS.input48
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-CXX-Intel-2021.9.0.20230302.input19
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-CXX-IntelLLVM-2023.1.0.input19
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-CXX-MSVC-19.36.32543.0.input19
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-CXX-MSVC-19.38.33130.0-VS.input48
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-Intel-2021.9.0.20230302.input21
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-IntelLLVM-2023.1.0.input21
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.input20
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake38
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-C-IBMClang-17.1.1.2.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-CXX-IBMClang-17.1.1.2.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-GNU-12.2.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-Intel-2021.10.0.20230609.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-IntelLLVM-2023.2.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-GNU-12.2.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-Intel-2021.10.0.20230609.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-IntelLLVM-2023.2.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-GNU-12.2.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-Intel-2021.10.0.20230609.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-IntelLLVM-2023.2.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos5.10_sparc32-C-GNU-5.5.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos5.10_sparc32-CXX-GNU-5.5.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos5.10_sparc32-Fortran-GNU-5.5.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos5.11_i386-C-GNU-5.5.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos5.11_i386-CXX-GNU-5.5.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos5.11_i386-Fortran-GNU-5.5.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/DetermineLinkerId.cmake37
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/Inspect.cmake9
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake112
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/RunCMakeTest.cmake33
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/aix7.3-ld.bash2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/aix7.3-ld.cmake1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/aix7.3-ld.txt2
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/debian12-ld.bfd.bash2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/debian12-ld.bfd.txt3
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/debian12-ld.gold.bash2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/debian12-ld.gold.txt3
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/debian12-ld.lld.bash2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/debian12-ld.lld.txt3
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/debian12-ld.mold.bash2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/debian12-ld.mold.txt3
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/fedora39-ld.bfd.bash2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/fedora39-ld.bfd.txt3
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/fedora39-ld.gold.bash2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/fedora39-ld.gold.txt3
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/fedora39-ld.lld.bash2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/fedora39-ld.lld.txt3
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/fedora39-ld.mold.bash2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/fedora39-ld.mold.txt3
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/msvc14.36-link.bash5
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/msvc14.36-link.txt3
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/sunos5.11-ld.bash2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/sunos5.11-ld.cmake1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/sunos5.11-ld.txt2
-rwxr-xr-xTests/RunCMake/ParseImplicitLinkInfo/ld-v/xcode15.1-ld.bash9
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/xcode15.1-ld.cmake1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ld-v/xcode15.1-ld.txt3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-IBMClang-17.1.1.2.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-XL-13.1.3.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-XLClang-16.1.0.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-IBMClang-17.1.1.2.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-XL-13.1.3.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-XLClang-16.1.0.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Cray-8.7.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Cray-9.0-hlist-ad.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Intel-18.0.2.20180210.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Cray-8.7.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Cray-9.0-hlist-ad.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Intel-18.0.2.20180210.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-8.7.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-9.0-hlist-ad.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Intel-18.0.2.20180210.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/darwin-C-AppleClang-8.0.0.8000042.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/darwin-CXX-AppleClang-8.0.0.8000042.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-C-Clang-3.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-CXX-Clang-3.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-Fortran-GNU-4.6.4.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/hand-C-empty.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/hand-C-relative.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/hand-CXX-empty.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/hand-CXX-relative.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-10.2.1-static-libgcc.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-12.2.0.output4
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-18.0.0.20170811.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-2021.10.0.20230609.output4
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-IntelLLVM-2023.2.0.output4
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-NVHPC-21.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-16.1.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-10.2.1-static-libstdc++.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-12.2.0.output4
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-18.0.0.20170811.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-2021.10.0.20230609.output4
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-IntelLLVM-2023.2.0.output4
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-NVHPC-21.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-16.1.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-10.2.1-static-libgfortran.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-12.2.0.output4
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-Intel-2021.10.0.20230609.output4
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-IntelLLVM-2023.2.0.output4
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-LLVMFlang-15.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-XL-14.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-custom_clang-C-Clang-13.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-custom_clang-CXX-Clang-13.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc_i-C-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/mingw.org-C-GNU-4.9.3.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/mingw.org-CXX-GNU-4.9.3.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd-C-GNU-4.8.5.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd-CXX-GNU-4.8.5.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd_nostdinc-C-GNU-4.8.5.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd_nostdinc-CXX-GNU-4.8.5.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/openbsd-C-Clang-5.0.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/openbsd-CXX-Clang-5.0.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-C-SunPro-5.13.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-CXX-SunPro-5.13.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-Fortran-SunPro-8.8.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos5.10_sparc32-C-GNU-5.5.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos5.10_sparc32-CXX-GNU-5.5.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos5.10_sparc32-Fortran-GNU-5.5.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos5.11_i386-C-GNU-5.5.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos5.11_i386-CXX-GNU-5.5.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos5.11_i386-Fortran-GNU-5.5.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_arm64-C-Clang-17.0.1-MSVC.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_arm64-CXX-Clang-17.0.1-MSVC.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_arm64-Fortran-LLVMFlang-17.0.1-MSVC.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-C-Clang-17.0.1-MSVC.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-C-Intel-2021.9.0.20230302.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-C-IntelLLVM-2023.1.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-C-MSVC-19.36.32543.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-C-MSVC-19.38.33130.0-VS.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-CXX-Clang-17.0.1-MSVC.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-CXX-Intel-2021.9.0.20230302.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-CXX-IntelLLVM-2023.1.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-CXX-MSVC-19.36.32543.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-CXX-MSVC-19.38.33130.0-VS.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-Intel-2021.9.0.20230302.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-IntelLLVM-2023.1.0.output3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-LLVMFlang-17.0.1-MSVC.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.output3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/foo.c4
-rw-r--r--Tests/RunCMake/PrecompileHeaders/foobar.c2
-rw-r--r--Tests/RunCMake/PrecompileHeaders/include/bar.h2
-rw-r--r--Tests/RunCMake/PrintHelpers/nothing.c2
-rw-r--r--Tests/RunCMake/PrintHelpers/something.c2
-rw-r--r--Tests/RunCMake/README.rst12
-rw-r--r--Tests/RunCMake/RunCMake.cmake24
-rw-r--r--Tests/RunCMake/RunCPack.cmake112
-rw-r--r--Tests/RunCMake/RunCPack/AppWiX/CMakeLists.txt124
-rw-r--r--Tests/RunCMake/RunCPack/AppWiX/file with spaces.h0
-rw-r--r--Tests/RunCMake/RunCPack/AppWiX/license.txt (renamed from Tests/CPackWiXGenerator/license.txt)0
-rw-r--r--Tests/RunCMake/RunCPack/AppWiX/mylib.cpp (renamed from Tests/CPackWiXGenerator/mylib.cpp)0
-rw-r--r--Tests/RunCMake/RunCPack/AppWiX/mylib.h (renamed from Tests/CPackWiXGenerator/mylib.h)0
-rw-r--r--Tests/RunCMake/RunCPack/AppWiX/mylibapp.cpp (renamed from Tests/CPackWiXGenerator/mylibapp.cpp)0
-rw-r--r--Tests/RunCMake/RunCPack/AppWiX/myotherapp.cpp (renamed from Tests/CPackWiXGenerator/myotherapp.cpp)0
-rw-r--r--Tests/RunCMake/RunCPack/AppWiX/patch.xml (renamed from Tests/CPackWiXGenerator/patch.xml)0
-rw-r--r--Tests/RunCMake/RunCPack/verify.cmake14
-rw-r--r--Tests/RunCMake/RunCTest.cmake3
-rw-r--r--Tests/RunCMake/RuntimePath/RunCMakeTest.cmake41
-rw-r--r--Tests/RunCMake/RuntimePath/Stub-fail-result.txt1
-rw-r--r--Tests/RunCMake/RuntimePath/Stub-fail-stderr.txt1
-rw-r--r--Tests/RunCMake/RuntimePath/Stub.c4
-rw-r--r--Tests/RunCMake/RuntimePath/Stub.cmake25
-rw-r--r--Tests/RunCMake/RuntimePath/StubExe.c5
-rw-r--r--Tests/RunCMake/RuntimePath/StubUse.c5
-rw-r--r--Tests/RunCMake/SourceProperties/empty.c2
-rw-r--r--Tests/RunCMake/Swift/CMP0157-NEW-stderr.txt3
-rw-r--r--Tests/RunCMake/Swift/CMP0157-NEW.cmake4
-rw-r--r--Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt1
-rw-r--r--Tests/RunCMake/Swift/CMP0157-OLD.cmake4
-rw-r--r--Tests/RunCMake/Swift/CMP0157-WARN.cmake3
-rw-r--r--Tests/RunCMake/Swift/CMP0157-common.cmake19
-rw-r--r--Tests/RunCMake/Swift/CompileCommands-check.cmake30
-rw-r--r--Tests/RunCMake/Swift/CompileCommands.cmake9
-rw-r--r--Tests/RunCMake/Swift/ForceResponseFile-check-stdout.txt2
-rw-r--r--Tests/RunCMake/Swift/ForceResponseFile.cmake13
-rw-r--r--Tests/RunCMake/Swift/ImportLibraryFlags-check-stdout.txt1
-rw-r--r--Tests/RunCMake/Swift/ImportLibraryFlags.cmake6
-rw-r--r--Tests/RunCMake/Swift/IncrementalSwift-second-stderr.txt2
-rw-r--r--Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt6
-rw-r--r--Tests/RunCMake/Swift/IncrementalSwift.cmake1
-rw-r--r--Tests/RunCMake/Swift/NoWorkToDo-norelink-stdout.txt2
-rw-r--r--Tests/RunCMake/Swift/NoWorkToDo.cmake8
-rw-r--r--Tests/RunCMake/Swift/RunCMakeTest.cmake69
-rw-r--r--Tests/RunCMake/Swift/SwiftLibraryModuleCommand-check-stdout.txt5
-rw-r--r--Tests/RunCMake/Swift/SwiftLibraryModuleCommand.cmake12
-rw-r--r--Tests/RunCMake/Swift/Win32ExecutableIgnored.cmake1
-rw-r--r--Tests/RunCMake/TIClang/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/TIClang/RunCMakeTest.cmake61
-rw-r--r--Tests/RunCMake/TIClang/libmod.c4
-rw-r--r--Tests/RunCMake/TIClang/module.c14
-rw-r--r--Tests/RunCMake/TIClang/module.cxx7
-rw-r--r--Tests/RunCMake/TIClang/module.h12
-rw-r--r--Tests/RunCMake/TIClang/module.s9
-rw-r--r--Tests/RunCMake/TIClang/ticlang-asm.cmake5
-rw-r--r--Tests/RunCMake/TIClang/ticlang-c.cmake5
-rw-r--r--Tests/RunCMake/TIClang/ticlang-cxx.cmake5
-rw-r--r--Tests/RunCMake/TIClang/ticlang-lib.cmake10
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt4
-rw-r--r--Tests/RunCMake/ToolchainFile/CMP0126-OLD-stderr.txt13
-rw-r--r--Tests/RunCMake/TransformDepfile/noexist-gcc-stderr.txt4
-rw-r--r--Tests/RunCMake/UnityBuild/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_and_objc_and_objcxx.cmake25
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_objc.cmake12
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_objc_group.cmake27
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_objcxx.cmake12
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_objcxx_group.cmake27
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake2
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake2
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0122-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/VS10Project/RuntimeLibrary-check.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/VsCharacterSet-check.cmake49
-rw-r--r--Tests/RunCMake/VS10Project/VsCharacterSet.cmake17
-rw-r--r--Tests/RunCMake/VS10Project/VsCustomProps-check.cmake45
-rw-r--r--Tests/RunCMake/VS10Project/VsCustomProps.cmake3
-rw-r--r--Tests/RunCMake/VS10Project/VsJustMyCode-check.cmake2
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/CMP0091-OLD-check.cmake8
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/CMP0091-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/CMP0091-OLD.cmake2
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Default-CMP0162-NEW-check.cmake8
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Default-CMP0162-NEW.cmake2
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Default-CMP0162-WARN-check.cmake8
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Default-CMP0162-WARN.cmake2
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Default-common.cmake10
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Explicit-CMP0162-NEW-check.cmake1
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Explicit-CMP0162-NEW.cmake2
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Explicit-CMP0162-OLD-check.cmake1
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Explicit-CMP0162-OLD.cmake2
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Explicit-check-common.cmake10
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/Explicit-common.cmake20
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/check-common.cmake42
-rw-r--r--Tests/RunCMake/VS10ProjectUseDebugLibraries/empty.cxx0
-rw-r--r--Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets-check.cmake2
-rw-r--r--Tests/RunCMake/XcFramework/RunCMakeTest.cmake170
-rw-r--r--Tests/RunCMake/XcFramework/export-common.cmake46
-rw-r--r--Tests/RunCMake/XcFramework/export-ios-simulator.cmake3
-rw-r--r--Tests/RunCMake/XcFramework/export-ios.cmake3
-rw-r--r--Tests/RunCMake/XcFramework/export-macos.cmake3
-rw-r--r--Tests/RunCMake/XcFramework/import-common.cmake5
-rw-r--r--Tests/RunCMake/XcFramework/import-genex-common.cmake5
-rw-r--r--Tests/RunCMake/XcFramework/import-ios-install-general.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-general-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-general.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-specific-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-specific-genex-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-specific-genex.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-specific.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-general-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-general.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific-genex-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific-genex.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific-no-xcframework-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific-no-xcframework.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/mylib-config.cmake.in3
-rw-r--r--Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c2
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS-check.cmake3
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices.cmake17
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/XPCService.Info.plist.in24
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake2
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeSchemaGeneration-check.cmake19
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeXCConfig.c2
-rw-r--r--Tests/RunCMake/add_compile_definitions/foo.c2
-rw-r--r--Tests/RunCMake/add_custom_command/CommentGenex-build-stdout.txt2
-rw-r--r--Tests/RunCMake/add_custom_command/CommentGenex.cmake2
-rw-r--r--Tests/RunCMake/add_custom_command/a.c2
-rw-r--r--Tests/RunCMake/add_dependencies/a.c2
-rw-r--r--Tests/RunCMake/add_dependencies/b.c2
-rw-r--r--Tests/RunCMake/add_dependencies/c.c2
-rw-r--r--Tests/RunCMake/add_library/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/add_library/TARGET_SUPPORTS_SHARED_LIBS_CMP0164_NEW-result.txt1
-rw-r--r--Tests/RunCMake/add_library/TARGET_SUPPORTS_SHARED_LIBS_CMP0164_NEW-stderr.txt5
-rw-r--r--Tests/RunCMake/add_library/TARGET_SUPPORTS_SHARED_LIBS_CMP0164_NEW.cmake4
-rw-r--r--Tests/RunCMake/add_library/TARGET_SUPPORTS_SHARED_LIBS_CMP0164_OLD.cmake9
-rw-r--r--Tests/RunCMake/add_library/TARGET_SUPPORTS_SHARED_LIBS_CMP0164_WARN-stderr.txt7
-rw-r--r--Tests/RunCMake/add_library/TARGET_SUPPORTS_SHARED_LIBS_CMP0164_WARN.cmake3
-rw-r--r--Tests/RunCMake/add_test/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/add_test/TestLauncher-check.cmake38
-rw-r--r--Tests/RunCMake/add_test/TestLauncher-test-stdout.txt58
-rw-r--r--Tests/RunCMake/add_test/TestLauncher.cmake28
-rw-r--r--Tests/RunCMake/add_test/TestLauncher/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/add_test/TestLauncherProperty.cmake38
-rw-r--r--Tests/RunCMake/add_test/main.c4
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/CxxImportStd-set-stderr.txt6
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/CxxImportStd-set.cmake11
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/CxxImportStd-unset.cmake8
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/ExportPackageDependencies-set-stderr.txt6
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/ExportPackageDependencies-set.cmake11
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/ExportPackageDependencies-unset.cmake8
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/Unknown-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/Unknown-stderr.txt4
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/Unknown.cmake8
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/WindowsKernelModeDriver-set-stderr.txt6
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/WindowsKernelModeDriver-set.cmake11
-rw-r--r--Tests/RunCMake/cmake_language/Experimental/WindowsKernelModeDriver-unset.cmake8
-rw-r--r--Tests/RunCMake/cmake_language/RunCMakeTest.cmake22
-rw-r--r--Tests/RunCMake/cmake_language/exit_0-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_0-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_language/exit_0.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/exit_0_script.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/exit_0_script_with_command.cmake3
-rw-r--r--Tests/RunCMake/cmake_language/exit_5-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_5-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_language/exit_5.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/exit_5_script-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_5_script.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/exit_5_script_with_command-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_5_script_with_command.cmake3
-rw-r--r--Tests/RunCMake/cmake_language/exit_7_script_in_include-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_7_script_in_include.cmake3
-rw-r--r--Tests/RunCMake/cmake_language/exit_7_script_included_with_exit.cmake3
-rw-r--r--Tests/RunCMake/cmake_language/exit_8_script_in_recursive_cmake_language-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_8_script_in_recursive_cmake_language.cmake3
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_block-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_block.cmake5
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_control-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_control.cmake24
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_foreach-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_foreach.cmake5
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_function-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_function.cmake6
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_if-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_if.cmake5
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_macro-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_macro.cmake6
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_while-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/exit_9_script_while.cmake5
-rw-r--r--Tests/RunCMake/ctest_cmake_error/CMakeLists.txt.in2
-rw-r--r--Tests/RunCMake/ctest_empty_binary_directory/CMakeLists.txt.in2
-rw-r--r--Tests/RunCMake/ctest_empty_binary_directory/NoCache-result.txt1
-rw-r--r--Tests/RunCMake/ctest_empty_binary_directory/NoCache-stderr.txt12
-rw-r--r--Tests/RunCMake/ctest_empty_binary_directory/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/ctest_empty_binary_directory/test.cmake.in5
-rw-r--r--Tests/RunCMake/ctest_fixtures/cyclicCleanup-stderr.txt5
-rw-r--r--Tests/RunCMake/ctest_fixtures/cyclicSetup-stderr.txt5
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/thirdparty.c2
-rw-r--r--Tests/RunCMake/ctest_submit/CDashSubmitHeaders-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/CDashSubmitQuiet-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/CDashSubmitVerbose-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/CDashSubmitVerbose-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/CMakeLists.txt.in2
-rw-r--r--Tests/RunCMake/ctest_submit/CTestConfig.cmake.in4
-rw-r--r--Tests/RunCMake/ctest_submit/FILESNoBuildId-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FILESNoBuildId-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-OFF-cmake-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-OFF-cmake-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-OFF-cmake-stdout.txt4
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-OFF-env-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-OFF-env-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-OFF-env-stdout.txt4
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-OFF-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-OFF-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-OFF-stdout.txt4
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-ON-cmake-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-ON-cmake-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-ON-cmake-stdout.txt4
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-ON-env-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-ON-env-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-ON-env-stdout.txt4
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-ON-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-ON-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVerify-ON-stdout.txt4
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVersion-1.1-cmake-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVersion-1.1-cmake-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVersion-1.1-cmake-stdout.txt4
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVersion-1.1-env-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVersion-1.1-env-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVersion-1.1-env-stdout.txt4
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVersion-1.1-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVersion-1.1-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-TLSVersion-1.1-stdout.txt4
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-http-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-http-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-https-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-https-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/RunCMakeTest.cmake33
-rw-r--r--Tests/RunCMake/ctest_submit/test.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_test/CTestTestLoadWait-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_test/CTestTestLoadWait0-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_test/CTestTestLoadWait1-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_test/Parallel0-stdout.txt9
-rw-r--r--Tests/RunCMake/ctest_test/Parallel4-stdout.txt7
-rw-r--r--Tests/RunCMake/ctest_test/ParallelBad-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/ParallelBad-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_test/ParallelEmpty-stdout.txt5
-rw-r--r--Tests/RunCMake/ctest_test/ParallelEnv0-stdout.txt9
-rw-r--r--Tests/RunCMake/ctest_test/ParallelEnv3-stdout.txt6
-rw-r--r--Tests/RunCMake/ctest_test/ParallelEnvBad-stdout.txt4
-rw-r--r--Tests/RunCMake/ctest_test/ParallelEnvEmpty-stdout.txt5
-rw-r--r--Tests/RunCMake/ctest_test/ParallelOmit-stdout.txt5
-rw-r--r--Tests/RunCMake/ctest_test/ResourceLock-stdout.txt12
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake104
-rw-r--r--Tests/RunCMake/ctest_test/SerialOrder-stdout.txt16
-rw-r--r--Tests/RunCMake/ctest_test/SkipReturnCode-stdout.txt8
-rw-r--r--Tests/RunCMake/ctest_test/TestLoadWait-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_test/TestLoadWait0-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_test/TestLoadWait1-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-TestList-empty.txt0
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-TestList.txt5
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-exclude-empty-stdout.txt12
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-exclude-missing-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-exclude-stdout.txt11
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-include-empty-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-include-empty-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-include-missing-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-include-missing-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-include-missing-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_test/TestsFromFile-include-stdout.txt7
-rw-r--r--Tests/RunCMake/ctest_test/test.cmake.in2
-rw-r--r--Tests/RunCMake/ctest_upload/UploadQuiet-check.cmake12
-rw-r--r--Tests/RunCMake/define_property/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/define_property/define_property-redefine.cmake88
-rw-r--r--Tests/RunCMake/detect_jobserver.c3
-rw-r--r--Tests/RunCMake/export/CMake/FindHasDeps.cmake17
-rw-r--r--Tests/RunCMake/export/CMake/FindP1.cmake2
-rw-r--r--Tests/RunCMake/export/CMake/FindP2.cmake2
-rw-r--r--Tests/RunCMake/export/CMake/FindP3.cmake2
-rw-r--r--Tests/RunCMake/export/CMake/FindP4.cmake2
-rw-r--r--Tests/RunCMake/export/CMake/FindP9.cmake2
-rw-r--r--Tests/RunCMake/export/DependOnDoubleExport-stderr.txt4
-rw-r--r--Tests/RunCMake/export/FindDependencyExport-check.cmake35
-rw-r--r--Tests/RunCMake/export/FindDependencyExport-stderr.txt6
-rw-r--r--Tests/RunCMake/export/FindDependencyExport.cmake31
-rw-r--r--Tests/RunCMake/export/FindDependencyExportFetchContent-check.cmake14
-rw-r--r--Tests/RunCMake/export/FindDependencyExportFetchContent-stderr.txt6
-rw-r--r--Tests/RunCMake/export/FindDependencyExportFetchContent.cmake38
-rw-r--r--Tests/RunCMake/export/FindDependencyExportGate-result.txt1
-rw-r--r--Tests/RunCMake/export/FindDependencyExportGate-stderr.txt4
-rw-r--r--Tests/RunCMake/export/FindDependencyExportGate.cmake1
-rw-r--r--Tests/RunCMake/export/FindDependencyExportShared-check.cmake4
-rw-r--r--Tests/RunCMake/export/FindDependencyExportShared-stderr.txt6
-rw-r--r--Tests/RunCMake/export/FindDependencyExportShared.cmake15
-rw-r--r--Tests/RunCMake/export/FindDependencyExportStatic-check.cmake13
-rw-r--r--Tests/RunCMake/export/FindDependencyExportStatic-stderr.txt6
-rw-r--r--Tests/RunCMake/export/FindDependencyExportStatic.cmake15
-rw-r--r--Tests/RunCMake/export/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/file-DOWNLOAD/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/file-DOWNLOAD/TLS_VERIFY-bad-stdout.txt8
-rw-r--r--Tests/RunCMake/file-DOWNLOAD/TLS_VERIFY-bad.cmake40
-rw-r--r--Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad-result.txt1
-rw-r--r--Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad-stderr.txt14
-rw-r--r--Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-bad.cmake10
-rw-r--r--Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-good.cmake6
-rw-r--r--Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing-result.txt1
-rw-r--r--Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing-stderr.txt4
-rw-r--r--Tests/RunCMake/file-DOWNLOAD/TLS_VERSION-missing.cmake1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-parent-rpath-propagation.cmake44
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/parent-rpath-propagation/main.c8
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/parent-rpath-propagation/one.c6
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/parent-rpath-propagation/three.c3
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/parent-rpath-propagation/two.c6
-rw-r--r--Tests/RunCMake/file-RPATH/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/file-RPATH/LargeELF.c26
-rw-r--r--Tests/RunCMake/file-RPATH/LargeELF.cmake5
-rw-r--r--Tests/RunCMake/file-RPATH/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/file-STRINGS/CMP0159-Common.cmake12
-rw-r--r--Tests/RunCMake/file-STRINGS/CMP0159-NEW-stdout.txt5
-rw-r--r--Tests/RunCMake/file-STRINGS/CMP0159-NEW.cmake4
-rw-r--r--Tests/RunCMake/file-STRINGS/CMP0159-OLD-stdout.txt5
-rw-r--r--Tests/RunCMake/file-STRINGS/CMP0159-OLD.cmake4
-rw-r--r--Tests/RunCMake/file-STRINGS/CMP0159-WARN-stderr.txt10
-rw-r--r--Tests/RunCMake/file-STRINGS/CMP0159-WARN-stdout.txt5
-rw-r--r--Tests/RunCMake/file-STRINGS/CMP0159-WARN.cmake4
-rw-r--r--Tests/RunCMake/file-STRINGS/CMP0159.txt3
-rw-r--r--Tests/RunCMake/file-STRINGS/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/file-STRINGS/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing-result.txt1
-rw-r--r--Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing-stderr.txt4
-rw-r--r--Tests/RunCMake/file/UPLOAD-TLS_VERSION-missing.cmake1
-rw-r--r--Tests/RunCMake/find_file/NO_CACHE-stderr.txt10
-rw-r--r--Tests/RunCMake/find_library/NO_CACHE-stderr.txt10
-rw-r--r--Tests/RunCMake/find_library/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC-stdout.txt3
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC.cmake10
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC/libmeson_static.a0
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib0
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC/rustc_import.lib0
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC/static.lib0
-rw-r--r--Tests/RunCMake/find_path/NO_CACHE-stderr.txt10
-rw-r--r--Tests/RunCMake/find_program/NO_CACHE-stderr.txt10
-rw-r--r--Tests/RunCMake/foreach/foreach-var-scope-CMP0124-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/if/FilePermissions.cmake179
-rw-r--r--Tests/RunCMake/if/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/install/EXPORT-FindDependencyExport-all-check.cmake4
-rw-r--r--Tests/RunCMake/install/EXPORT-FindDependencyExport-stderr.txt6
-rw-r--r--Tests/RunCMake/install/EXPORT-FindDependencyExport.cmake19
-rw-r--r--Tests/RunCMake/install/EXPORT-FindDependencyExportGate-result.txt1
-rw-r--r--Tests/RunCMake/install/EXPORT-FindDependencyExportGate-stderr.txt4
-rw-r--r--Tests/RunCMake/install/EXPORT-FindDependencyExportGate.cmake1
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/install/cmake/FindP1.cmake2
-rw-r--r--Tests/RunCMake/install/cmake/FindP2.cmake2
-rw-r--r--Tests/RunCMake/install/cmake/FindP3.cmake2
-rw-r--r--Tests/RunCMake/print_stdin.c2
-rw-r--r--Tests/RunCMake/project/CodeInjection-stdout.txt10
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_include.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_include_before.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_includes_1.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_includes_2.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_includes_before_1.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_includes_before_2.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_include.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_include_before.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_1.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_2.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_before_1.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_before_2.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/initial_cache.cmake10
-rw-r--r--Tests/RunCMake/project/CodeInjection/initial_cache_1.cmake9
-rw-r--r--Tests/RunCMake/project/CodeInjection/initial_cache_2.cmake27
-rw-r--r--Tests/RunCMake/project/CodeInjection/initial_cache_3.cmake28
-rw-r--r--Tests/RunCMake/project/CodeInjection1-stdout.txt9
-rw-r--r--Tests/RunCMake/project/CodeInjection1.cmake (renamed from Tests/RunCMake/project/CodeInjection.cmake)0
-rw-r--r--Tests/RunCMake/project/CodeInjection2-stdout.txt16
-rw-r--r--Tests/RunCMake/project/CodeInjection2.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection3-stdout.txt16
-rw-r--r--Tests/RunCMake/project/CodeInjection3.cmake1
-rw-r--r--Tests/RunCMake/project/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/property_init/CompileSources.cmake1
-rw-r--r--Tests/RunCMake/property_init/Executable.cmake1
-rw-r--r--Tests/RunCMake/pseudo_emulator.c12
-rw-r--r--Tests/RunCMake/separate_arguments/ProgramCommand.cmake17
-rw-r--r--Tests/RunCMake/separate_arguments/ProgramCommandWithSeparateArgs.cmake13
-rw-r--r--Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt4
-rw-r--r--Tests/RunCMake/showIncludes.c2
-rw-r--r--Tests/RunCMake/target_compile_definitions/foo.c2
-rw-r--r--Tests/RunCMake/target_compile_features/empty.c2
-rw-r--r--Tests/RunCMake/target_compile_options/CMP0101.c2
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/func.c2
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/lib.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/main.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/base.c2
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/func1.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/func2.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/func3.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/lib.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/main.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.c2
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/lib.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c6
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.c2
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/lib.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-consuming_LINK_LIBRARIES_DIRECT-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-consuming_LINK_LIBRARIES_DIRECT-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature1-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group2-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-with-DEFAULT-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items1-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features4-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items2-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features3-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items3-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items3-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items3-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items4-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items4-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items4-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features1-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features2-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features2-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features3-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features3-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features3-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group1-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature2-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features1-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items4-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features2-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features2-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items3-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features3-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features3-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features4-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features4-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-with-DEFAULT-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-with-DEFAULT-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple1-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-consuming_LINK_LIBRARIES_DIRECT-check.cmake3
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-consuming_LINK_LIBRARIES_DIRECT-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group1-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group2-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items1-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items2-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items3-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items3-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items4-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items4-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features2-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features3-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features3-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features3-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature1-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature2-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features3-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features4-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features3-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features1-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features3-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features4-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features4-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-with-DEFAULT-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-with-DEFAULT-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-with-DEFAULT-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple1-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple2-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features1-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY.cmake14
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake52
-rw-r--r--Tests/RunCMake/target_link_libraries/lib.c4
-rw-r--r--Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt2
-rw-r--r--Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/LinkOptions.cmake3
-rw-r--r--Tests/RunCMake/try_compile/ProjectVars-stdout.txt8
-rw-r--r--Tests/RunCMake/try_compile/ProjectVars.cmake18
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/try_compile/lib.c2
-rw-r--r--Tests/RunCMake/try_compile/main.c2
-rw-r--r--Tests/RunCMake/try_compile/proj_vars/CMakeLists.txt12
-rw-r--r--Tests/RunCMake/try_run/ConfigureLog-test.c2
-rw-r--r--Tests/RunCMake/try_run/Inspect.cmake22
-rw-r--r--Tests/RunCMake/try_run/LinkOptions.cmake3
-rw-r--r--Tests/RunCMake/try_run/LinkerLanguage.cmake29
-rw-r--r--Tests/RunCMake/try_run/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/try_run/lib.c2
-rw-r--r--Tests/RunCMake/try_run/lib.cxx4
-rw-r--r--Tests/RunCMake/try_run/main.c2
-rw-r--r--Tests/RunCMake/try_run/main.f9012
-rw-r--r--Tests/RuntimePath/bar1.c4
-rw-r--r--Tests/RuntimePath/bar2.c4
-rw-r--r--Tests/RuntimePath/foo1.c2
-rw-r--r--Tests/RuntimePath/foo2.c2
-rw-r--r--Tests/RuntimePath/main.c4
-rw-r--r--Tests/SetLang/bar.c2
-rw-r--r--Tests/Simple/simpleCLib.c2
-rw-r--r--Tests/SimpleCOnly/bar.c2
-rw-r--r--Tests/SimpleCOnly/foo.c2
-rw-r--r--Tests/SimpleCOnly/main.c2
-rw-r--r--Tests/SourceFileIncludeDirProperty/main.c2
-rw-r--r--Tests/SourceFileProperty/ICaseTest.c2
-rw-r--r--Tests/SourceGroups/main.c2
-rw-r--r--Tests/SourceGroups/sub2/main.c2
-rw-r--r--Tests/SubDir/AnotherSubdir/pair+int.int.c2
-rw-r--r--Tests/SubDir/AnotherSubdir/pair_int.int.c2
-rw-r--r--Tests/SubDir/AnotherSubdir/secondone.c2
-rw-r--r--Tests/SubDir/AnotherSubdir/testfromsubdir.c2
-rw-r--r--Tests/SubDir/ThirdSubDir/pair+int.int1.c2
-rw-r--r--Tests/SubDir/ThirdSubDir/pair_int.int1.c2
-rw-r--r--Tests/SubDir/ThirdSubDir/pair_p_int.int1.c2
-rw-r--r--Tests/SubDir/ThirdSubDir/testfromauxsubdir.c2
-rw-r--r--Tests/SubDir/ThirdSubDir/thirdone.c2
-rw-r--r--Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c2
-rw-r--r--Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c2
-rw-r--r--Tests/SubDirSpaces/Another Subdir/pair+int.int.c2
-rw-r--r--Tests/SubDirSpaces/Another Subdir/pair_int.int.c2
-rw-r--r--Tests/SubDirSpaces/Another Subdir/secondone.c2
-rw-r--r--Tests/SubDirSpaces/Another Subdir/testfromsubdir.c2
-rw-r--r--Tests/SubDirSpaces/Some(x86) Sources/test.c2
-rw-r--r--Tests/SubDirSpaces/ThirdSubDir/pair+int.int1.c2
-rw-r--r--Tests/SubDirSpaces/ThirdSubDir/pair_int.int1.c2
-rw-r--r--Tests/SubDirSpaces/ThirdSubDir/pair_p_int.int1.c2
-rw-r--r--Tests/SubDirSpaces/ThirdSubDir/testfromauxsubdir.c2
-rw-r--r--Tests/SubDirSpaces/ThirdSubDir/thirdone.c2
-rw-r--r--Tests/SubDirSpaces/vcl_algorithm+vcl_pair+double.foo.c2
-rw-r--r--Tests/SubDirSpaces/vcl_algorithm_vcl_pair_double.foo.c2
-rw-r--r--Tests/SwiftMix/CMakeLists.txt5
-rw-r--r--Tests/SwiftMixLib/CMakeLists.txt3
-rw-r--r--Tests/SwiftMixPCH/CMain.c9
-rw-r--r--Tests/SwiftMixPCH/CMakeLists.txt15
-rw-r--r--Tests/SwiftMixPCH/SwiftFunc.swift4
-rw-r--r--Tests/SwiftMixPCH/pch.h1
-rw-r--r--Tests/SwiftOnly/CMakeLists.txt44
-rw-r--r--Tests/SwiftOnly/O.swift0
-rw-r--r--Tests/SwiftOnly/SubA/SubA.swift1
-rw-r--r--Tests/SwiftOnly/SubB/SubB.swift2
-rw-r--r--Tests/SwiftOnly/SwiftPlugin/CMakeLists.txt2
-rw-r--r--Tests/SwiftOnly/SwiftPlugin/main.swift3
-rw-r--r--Tests/SwiftOnly/SwiftPlugin/plugin.swift2
-rw-r--r--Tests/TestsWorkingDirectory/CMakeLists.txt14
-rw-r--r--Tests/TestsWorkingDirectory/subdir/CMakeLists.txt14
-rw-r--r--Tests/TryCompile/Inner/innerexe.c2
-rw-r--r--Tests/TryCompile/check_a_b.c2
-rw-r--r--Tests/TryCompile/exit_success.c2
-rw-r--r--Tests/TryCompile/exit_with_error.c2
-rw-r--r--Tests/TryCompile/pass.c2
-rw-r--r--Tests/TryCompile/pass2a.c2
-rw-r--r--Tests/TryCompile/stdout_and_stderr.c2
-rw-r--r--Tests/Unset/unset.c2
-rw-r--r--Tests/UseSWIG/CMakeLists.txt1
-rw-r--r--Tests/VSAndroid/CMakeLists.txt2
-rw-r--r--Tests/VSGNUFortran/c_code/main.c2
-rw-r--r--Tests/Visibility/bar.c2
-rw-r--r--Tests/X11/X11.c4
-rw-r--r--Tests/XCTest/FrameworkExample/FrameworkExample.c2
-rw-r--r--Utilities/CMakeLists.txt2
-rw-r--r--Utilities/ClangTidyModule/UsePragmaOnceCheck.cxx17
-rw-r--r--Utilities/Doxygen/CMakeLists.txt2
-rw-r--r--Utilities/IWYU/mapping.imp4
-rw-r--r--Utilities/Release/WiX/WIX.template.in13
-rw-r--r--Utilities/Release/WiX/cmake_extra_dialog.wxs36
-rw-r--r--Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs36
-rw-r--r--Utilities/Release/WiX/custom_action_dll.wxs.in8
-rw-r--r--Utilities/Release/WiX/install_dir.wxs110
-rw-r--r--Utilities/Release/WiX/options.wxs36
-rw-r--r--Utilities/Release/WiX/options_dlg.wxs28
-rw-r--r--Utilities/Release/WiX/patch_desktop_shortcut.xml2
-rw-r--r--Utilities/Release/WiX/patch_path_env.xml11
-rw-r--r--[-rwxr-xr-x]Utilities/Release/win/qt-5.15.10-win-x86-msvc.ps10
-rw-r--r--[-rwxr-xr-x]Utilities/Release/win/sign-package.ps10
-rwxr-xr-xUtilities/Scripts/update-curl.bash11
-rwxr-xr-xUtilities/Scripts/update-libarchive.bash2
-rwxr-xr-xUtilities/Scripts/update-librhash.bash3
-rwxr-xr-xUtilities/Scripts/update-zlib.bash4
-rwxr-xr-xUtilities/Scripts/update-zstd.bash2
-rw-r--r--Utilities/Sphinx/CMakeLists.txt2
-rw-r--r--Utilities/Sphinx/CTestCustom.cmake.in1
-rw-r--r--Utilities/Sphinx/conf.py.in7
-rw-r--r--Utilities/cmThirdPartyChecks.cmake12
-rw-r--r--Utilities/cmcppdap/include/dap/any.h2
-rw-r--r--Utilities/cmcurl/CMake/CurlTests.c271
-rw-r--r--Utilities/cmcurl/CMake/FindZstd.cmake7
-rw-r--r--Utilities/cmcurl/CMake/Macros.cmake52
-rw-r--r--Utilities/cmcurl/CMake/OtherTests.cmake175
-rw-r--r--Utilities/cmcurl/CMake/PickyWarnings.cmake65
-rw-r--r--Utilities/cmcurl/CMake/Platforms/WindowsCache.cmake255
-rw-r--r--Utilities/cmcurl/CMake/Utilities.cmake2
-rw-r--r--Utilities/cmcurl/CMake/curl-config.cmake.in4
-rw-r--r--Utilities/cmcurl/CMakeLists.txt786
-rw-r--r--Utilities/cmcurl/COPYING2
-rw-r--r--Utilities/cmcurl/include/curl/curl.h37
-rw-r--r--Utilities/cmcurl/include/curl/curlver.h8
-rw-r--r--Utilities/cmcurl/include/curl/mprintf.h18
-rw-r--r--Utilities/cmcurl/include/curl/system.h49
-rw-r--r--Utilities/cmcurl/include/curl/urlapi.h1
-rw-r--r--Utilities/cmcurl/lib/CMakeLists.txt21
-rw-r--r--Utilities/cmcurl/lib/Makefile.inc14
-rw-r--r--Utilities/cmcurl/lib/altsvc.c35
-rw-r--r--Utilities/cmcurl/lib/arpa_telnet.h9
-rw-r--r--Utilities/cmcurl/lib/asyn-ares.c41
-rw-r--r--Utilities/cmcurl/lib/asyn-thread.c237
-rw-r--r--Utilities/cmcurl/lib/base64.c1
-rw-r--r--Utilities/cmcurl/lib/bufq.c23
-rw-r--r--Utilities/cmcurl/lib/bufq.h7
-rw-r--r--Utilities/cmcurl/lib/bufref.c6
-rw-r--r--Utilities/cmcurl/lib/c-hyper.c427
-rw-r--r--Utilities/cmcurl/lib/c-hyper.h8
-rw-r--r--Utilities/cmcurl/lib/cf-h1-proxy.c147
-rw-r--r--Utilities/cmcurl/lib/cf-h2-proxy.c90
-rw-r--r--Utilities/cmcurl/lib/cf-haproxy.c47
-rw-r--r--Utilities/cmcurl/lib/cf-https-connect.c56
-rw-r--r--Utilities/cmcurl/lib/cf-socket.c253
-rw-r--r--Utilities/cmcurl/lib/cf-socket.h26
-rw-r--r--Utilities/cmcurl/lib/cfilters.c264
-rw-r--r--Utilities/cmcurl/lib/cfilters.h142
-rw-r--r--Utilities/cmcurl/lib/conncache.c29
-rw-r--r--Utilities/cmcurl/lib/connect.c190
-rw-r--r--Utilities/cmcurl/lib/connect.h3
-rw-r--r--Utilities/cmcurl/lib/content_encoding.c329
-rw-r--r--Utilities/cmcurl/lib/content_encoding.h9
-rw-r--r--Utilities/cmcurl/lib/cookie.c71
-rw-r--r--Utilities/cmcurl/lib/curl_config.h.cmake48
-rw-r--r--Utilities/cmcurl/lib/curl_des.c2
-rw-r--r--Utilities/cmcurl/lib/curl_get_line.c55
-rw-r--r--Utilities/cmcurl/lib/curl_get_line.h7
-rw-r--r--Utilities/cmcurl/lib/curl_hmac.h3
-rw-r--r--Utilities/cmcurl/lib/curl_memory.h6
-rw-r--r--Utilities/cmcurl/lib/curl_multibyte.c4
-rw-r--r--Utilities/cmcurl/lib/curl_multibyte.h8
-rw-r--r--Utilities/cmcurl/lib/curl_ntlm_core.c9
-rw-r--r--Utilities/cmcurl/lib/curl_ntlm_wb.c18
-rw-r--r--Utilities/cmcurl/lib/curl_path.h2
-rw-r--r--Utilities/cmcurl/lib/curl_printf.h4
-rw-r--r--Utilities/cmcurl/lib/curl_rtmp.c18
-rw-r--r--Utilities/cmcurl/lib/curl_sasl.c22
-rw-r--r--Utilities/cmcurl/lib/curl_setup.h235
-rw-r--r--Utilities/cmcurl/lib/curl_setup_once.h8
-rw-r--r--Utilities/cmcurl/lib/curl_sha512_256.c844
-rw-r--r--Utilities/cmcurl/lib/curl_sha512_256.h44
-rw-r--r--Utilities/cmcurl/lib/curl_sspi.h16
-rw-r--r--Utilities/cmcurl/lib/curl_trc.c63
-rw-r--r--Utilities/cmcurl/lib/curl_trc.h117
-rw-r--r--Utilities/cmcurl/lib/cw-out.c437
-rw-r--r--Utilities/cmcurl/lib/cw-out.h53
-rw-r--r--Utilities/cmcurl/lib/dict.c26
-rw-r--r--Utilities/cmcurl/lib/doh.c93
-rw-r--r--Utilities/cmcurl/lib/doh.h2
-rw-r--r--Utilities/cmcurl/lib/dynbuf.c13
-rw-r--r--Utilities/cmcurl/lib/dynbuf.h4
-rw-r--r--Utilities/cmcurl/lib/dynhds.c29
-rw-r--r--Utilities/cmcurl/lib/dynhds.h9
-rw-r--r--Utilities/cmcurl/lib/easy.c150
-rw-r--r--Utilities/cmcurl/lib/easy_lock.h9
-rw-r--r--Utilities/cmcurl/lib/easygetopt.c2
-rw-r--r--Utilities/cmcurl/lib/easyif.h2
-rw-r--r--Utilities/cmcurl/lib/easyoptions.c6
-rw-r--r--Utilities/cmcurl/lib/file.c64
-rw-r--r--Utilities/cmcurl/lib/fopen.c82
-rw-r--r--Utilities/cmcurl/lib/formdata.c16
-rw-r--r--Utilities/cmcurl/lib/ftp.c417
-rw-r--r--Utilities/cmcurl/lib/ftplistparser.c3
-rw-r--r--Utilities/cmcurl/lib/functypes.h2
-rw-r--r--Utilities/cmcurl/lib/getenv.c5
-rw-r--r--Utilities/cmcurl/lib/getinfo.c31
-rw-r--r--Utilities/cmcurl/lib/gopher.c14
-rw-r--r--Utilities/cmcurl/lib/headers.c96
-rw-r--r--Utilities/cmcurl/lib/headers.h7
-rw-r--r--Utilities/cmcurl/lib/hostip.c117
-rw-r--r--Utilities/cmcurl/lib/hostip.h4
-rw-r--r--Utilities/cmcurl/lib/hostip6.c7
-rw-r--r--Utilities/cmcurl/lib/hsts.c65
-rw-r--r--Utilities/cmcurl/lib/http.c3074
-rw-r--r--Utilities/cmcurl/lib/http.h77
-rw-r--r--Utilities/cmcurl/lib/http2.c519
-rw-r--r--Utilities/cmcurl/lib/http_aws_sigv4.c30
-rw-r--r--Utilities/cmcurl/lib/http_chunks.c568
-rw-r--r--Utilities/cmcurl/lib/http_chunks.h67
-rw-r--r--Utilities/cmcurl/lib/http_proxy.c6
-rw-r--r--Utilities/cmcurl/lib/idn.c2
-rw-r--r--Utilities/cmcurl/lib/imap.c133
-rw-r--r--Utilities/cmcurl/lib/inet_pton.c3
-rw-r--r--Utilities/cmcurl/lib/inet_pton.h3
-rw-r--r--Utilities/cmcurl/lib/krb5.c66
-rw-r--r--Utilities/cmcurl/lib/ldap.c42
-rw-r--r--Utilities/cmcurl/lib/md4.c12
-rw-r--r--Utilities/cmcurl/lib/memdebug.c39
-rw-r--r--Utilities/cmcurl/lib/memdebug.h6
-rw-r--r--Utilities/cmcurl/lib/mime.c253
-rw-r--r--Utilities/cmcurl/lib/mime.h16
-rw-r--r--Utilities/cmcurl/lib/mprintf.c1223
-rw-r--r--Utilities/cmcurl/lib/mqtt.c53
-rw-r--r--Utilities/cmcurl/lib/mqtt.h1
-rw-r--r--Utilities/cmcurl/lib/multi.c673
-rw-r--r--Utilities/cmcurl/lib/multihandle.h24
-rw-r--r--Utilities/cmcurl/lib/multiif.h49
-rw-r--r--Utilities/cmcurl/lib/netrc.c12
-rw-r--r--Utilities/cmcurl/lib/noproxy.c1
-rw-r--r--Utilities/cmcurl/lib/openldap.c75
-rw-r--r--Utilities/cmcurl/lib/pingpong.c299
-rw-r--r--Utilities/cmcurl/lib/pingpong.h22
-rw-r--r--Utilities/cmcurl/lib/pop3.c113
-rw-r--r--Utilities/cmcurl/lib/progress.c18
-rw-r--r--Utilities/cmcurl/lib/progress.h3
-rw-r--r--Utilities/cmcurl/lib/rand.c34
-rw-r--r--Utilities/cmcurl/lib/rand.h2
-rw-r--r--Utilities/cmcurl/lib/rename.c2
-rw-r--r--Utilities/cmcurl/lib/request.c409
-rw-r--r--Utilities/cmcurl/lib/request.h227
-rw-r--r--Utilities/cmcurl/lib/rtsp.c515
-rw-r--r--Utilities/cmcurl/lib/rtsp.h9
-rw-r--r--Utilities/cmcurl/lib/select.c2
-rw-r--r--Utilities/cmcurl/lib/sendf.c1598
-rw-r--r--Utilities/cmcurl/lib/sendf.h369
-rw-r--r--Utilities/cmcurl/lib/setopt.c288
-rw-r--r--Utilities/cmcurl/lib/setup-win32.h73
-rw-r--r--Utilities/cmcurl/lib/share.c8
-rw-r--r--Utilities/cmcurl/lib/share.h10
-rw-r--r--Utilities/cmcurl/lib/smb.c64
-rw-r--r--Utilities/cmcurl/lib/smb.h1
-rw-r--r--Utilities/cmcurl/lib/smtp.c384
-rw-r--r--Utilities/cmcurl/lib/smtp.h13
-rw-r--r--Utilities/cmcurl/lib/socketpair.c9
-rw-r--r--Utilities/cmcurl/lib/socketpair.h17
-rw-r--r--Utilities/cmcurl/lib/socks.c113
-rw-r--r--Utilities/cmcurl/lib/socks_gssapi.c9
-rw-r--r--Utilities/cmcurl/lib/socks_sspi.c12
-rw-r--r--Utilities/cmcurl/lib/strdup.c24
-rw-r--r--Utilities/cmcurl/lib/strdup.h3
-rw-r--r--Utilities/cmcurl/lib/strerror.c78
-rw-r--r--Utilities/cmcurl/lib/strerror.h2
-rw-r--r--Utilities/cmcurl/lib/strtoofft.c21
-rw-r--r--Utilities/cmcurl/lib/system_win32.c35
-rw-r--r--Utilities/cmcurl/lib/system_win32.h34
-rw-r--r--Utilities/cmcurl/lib/telnet.c123
-rw-r--r--Utilities/cmcurl/lib/tftp.c31
-rw-r--r--Utilities/cmcurl/lib/tftp.h3
-rw-r--r--Utilities/cmcurl/lib/timediff.c2
-rw-r--r--Utilities/cmcurl/lib/timeval.c7
-rw-r--r--Utilities/cmcurl/lib/transfer.c1227
-rw-r--r--Utilities/cmcurl/lib/transfer.h54
-rw-r--r--Utilities/cmcurl/lib/url.c1281
-rw-r--r--Utilities/cmcurl/lib/url.h15
-rw-r--r--Utilities/cmcurl/lib/urlapi.c208
-rw-r--r--Utilities/cmcurl/lib/urldata.h308
-rw-r--r--Utilities/cmcurl/lib/vauth/digest.c68
-rw-r--r--Utilities/cmcurl/lib/vauth/digest_sspi.c4
-rw-r--r--Utilities/cmcurl/lib/vauth/krb5_gssapi.c3
-rw-r--r--Utilities/cmcurl/lib/vauth/krb5_sspi.c3
-rw-r--r--Utilities/cmcurl/lib/vauth/ntlm.c6
-rw-r--r--Utilities/cmcurl/lib/vauth/ntlm_sspi.c8
-rw-r--r--Utilities/cmcurl/lib/version.c26
-rw-r--r--Utilities/cmcurl/lib/version_win32.c4
-rw-r--r--Utilities/cmcurl/lib/version_win32.h4
-rw-r--r--Utilities/cmcurl/lib/vquic/curl_msh3.c64
-rw-r--r--Utilities/cmcurl/lib/vquic/curl_ngtcp2.c990
-rw-r--r--Utilities/cmcurl/lib/vquic/curl_osslq.c2295
-rw-r--r--Utilities/cmcurl/lib/vquic/curl_osslq.h51
-rw-r--r--Utilities/cmcurl/lib/vquic/curl_quiche.c483
-rw-r--r--Utilities/cmcurl/lib/vquic/vquic-tls.c613
-rw-r--r--Utilities/cmcurl/lib/vquic/vquic-tls.h98
-rw-r--r--Utilities/cmcurl/lib/vquic/vquic.c65
-rw-r--r--Utilities/cmcurl/lib/vquic/vquic_int.h10
-rw-r--r--Utilities/cmcurl/lib/vssh/libssh.c124
-rw-r--r--Utilities/cmcurl/lib/vssh/libssh2.c370
-rw-r--r--Utilities/cmcurl/lib/vssh/ssh.h1
-rw-r--r--Utilities/cmcurl/lib/vssh/wolfssh.c47
-rw-r--r--Utilities/cmcurl/lib/vtls/bearssl.c86
-rw-r--r--Utilities/cmcurl/lib/vtls/gtls.c135
-rw-r--r--Utilities/cmcurl/lib/vtls/gtls.h6
-rw-r--r--Utilities/cmcurl/lib/vtls/keylog.c9
-rw-r--r--Utilities/cmcurl/lib/vtls/mbedtls.c110
-rw-r--r--Utilities/cmcurl/lib/vtls/mbedtls_threadlock.c14
-rw-r--r--Utilities/cmcurl/lib/vtls/mbedtls_threadlock.h4
-rw-r--r--Utilities/cmcurl/lib/vtls/openssl.c630
-rw-r--r--Utilities/cmcurl/lib/vtls/openssl.h21
-rw-r--r--Utilities/cmcurl/lib/vtls/rustls.c198
-rw-r--r--Utilities/cmcurl/lib/vtls/schannel.c244
-rw-r--r--Utilities/cmcurl/lib/vtls/schannel_int.h17
-rw-r--r--Utilities/cmcurl/lib/vtls/schannel_verify.c68
-rw-r--r--Utilities/cmcurl/lib/vtls/sectransp.c56
-rw-r--r--Utilities/cmcurl/lib/vtls/vtls.c492
-rw-r--r--Utilities/cmcurl/lib/vtls/vtls.h82
-rw-r--r--Utilities/cmcurl/lib/vtls/vtls_int.h41
-rw-r--r--Utilities/cmcurl/lib/vtls/wolfssl.c70
-rw-r--r--Utilities/cmcurl/lib/vtls/x509asn1.c899
-rw-r--r--Utilities/cmcurl/lib/warnless.c12
-rw-r--r--Utilities/cmcurl/lib/warnless.h21
-rw-r--r--Utilities/cmcurl/lib/ws.c388
-rw-r--r--Utilities/cmcurl/lib/ws.h15
-rw-r--r--Utilities/cmjsoncpp/include/json/value.h4
-rw-r--r--Utilities/cmlibarchive/CMakeLists.txt66
-rw-r--r--Utilities/cmlibarchive/build/cmake/FindMbedTLS.cmake2
-rw-r--r--Utilities/cmlibarchive/build/cmake/config.h.in69
-rw-r--r--Utilities/cmlibarchive/build/version2
-rw-r--r--Utilities/cmlibarchive/libarchive/CMakeLists.txt22
-rw-r--r--Utilities/cmlibarchive/libarchive/archive.h4
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_digest.c60
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_digest_private.h10
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_entry.h2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_getdate.c119
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_hmac.c15
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_hmac_private.h2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_openssl_evp_private.h3
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_random.c35
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_data_into_fd.c7
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c28
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_disk_windows.c72
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_open_file.c4
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_set_options.321
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_bzip2.c4
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_lz4.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_uu.c50
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_filter_zstd.c14
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_7zip.c280
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_cab.c8
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_cpio.c6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c12
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_lha.c20
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_mtree.c8
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_rar.c21
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_rar5.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_xar.c8
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_string.c4
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_util.c57
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_windows.c35
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write.c31
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_bzip2.c6
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_compress.c2
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_lz4.c8
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_add_filter_zstd.c273
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c72
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk_windows.c79
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_private.h1
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_7zip.c43
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c32
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c62
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_warc.c25
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_xar.c14
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_zip.c19
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_options.39
-rw-r--r--Utilities/cmlibarchive/libarchive/config_freebsd.h7
-rw-r--r--Utilities/cmlibarchive/libarchive/filter_fork_windows.c9
-rw-r--r--Utilities/cmlibarchive/libarchive/xxhash.c4
-rw-r--r--Utilities/cmliblzma/common/sysdefs.h4
-rw-r--r--Utilities/cmlibrhash/CMakeLists.txt2
-rw-r--r--Utilities/cmlibrhash/librhash/algorithms.c103
-rw-r--r--Utilities/cmlibrhash/librhash/algorithms.h40
-rw-r--r--Utilities/cmlibrhash/librhash/byte_order.c6
-rw-r--r--Utilities/cmlibrhash/librhash/byte_order.h17
-rw-r--r--Utilities/cmlibrhash/librhash/hex.c6
-rw-r--r--Utilities/cmlibrhash/librhash/md5.c6
-rw-r--r--Utilities/cmlibrhash/librhash/md5.h2
-rw-r--r--Utilities/cmlibrhash/librhash/rhash.c395
-rw-r--r--Utilities/cmlibrhash/librhash/rhash.h198
-rw-r--r--Utilities/cmlibrhash/librhash/sha1.c246
-rw-r--r--Utilities/cmlibrhash/librhash/sha256.c8
-rw-r--r--Utilities/cmlibrhash/librhash/sha256.h2
-rw-r--r--Utilities/cmlibrhash/librhash/sha512.c6
-rw-r--r--Utilities/cmlibrhash/librhash/util.c61
-rw-r--r--Utilities/cmlibrhash/librhash/util.h49
-rw-r--r--Utilities/cmlibuv/CMakeLists.txt4
-rw-r--r--Utilities/cmlibuv/include/uv/darwin.h9
-rw-r--r--Utilities/cmlibuv/src/unix/darwin.c2
-rw-r--r--Utilities/cmlibuv/src/unix/process.c6
-rw-r--r--Utilities/cmzlib/Copyright.txt4
-rw-r--r--Utilities/cmzlib/README19
-rw-r--r--Utilities/cmzlib/adler32.c32
-rw-r--r--Utilities/cmzlib/compress.c21
-rw-r--r--Utilities/cmzlib/crc32.c248
-rw-r--r--Utilities/cmzlib/deflate.c612
-rw-r--r--Utilities/cmzlib/deflate.h51
-rw-r--r--Utilities/cmzlib/gzclose.c4
-rw-r--r--Utilities/cmzlib/gzguts.h31
-rw-r--r--Utilities/cmzlib/gzlib.c113
-rw-r--r--Utilities/cmzlib/gzread.c88
-rw-r--r--Utilities/cmzlib/gzwrite.c84
-rw-r--r--Utilities/cmzlib/inffast.c5
-rw-r--r--Utilities/cmzlib/inffast.h2
-rw-r--r--Utilities/cmzlib/inflate.c131
-rw-r--r--Utilities/cmzlib/inftrees.c17
-rw-r--r--Utilities/cmzlib/inftrees.h10
-rw-r--r--Utilities/cmzlib/trees.c542
-rw-r--r--Utilities/cmzlib/uncompr.c16
-rw-r--r--Utilities/cmzlib/zconf.h18
-rw-r--r--Utilities/cmzlib/zlib.h391
-rw-r--r--Utilities/cmzlib/zutil.c60
-rw-r--r--Utilities/cmzlib/zutil.h47
-rw-r--r--Utilities/cmzstd/CMakeLists.txt9
-rw-r--r--Utilities/cmzstd/LICENSE8
-rw-r--r--Utilities/cmzstd/README.md88
-rw-r--r--Utilities/cmzstd/lib/common/allocations.h55
-rw-r--r--Utilities/cmzstd/lib/common/bits.h200
-rw-r--r--Utilities/cmzstd/lib/common/bitstream.h92
-rw-r--r--Utilities/cmzstd/lib/common/compiler.h163
-rw-r--r--Utilities/cmzstd/lib/common/cpu.h2
-rw-r--r--Utilities/cmzstd/lib/common/debug.c2
-rw-r--r--Utilities/cmzstd/lib/common/debug.h2
-rw-r--r--Utilities/cmzstd/lib/common/entropy_common.c52
-rw-r--r--Utilities/cmzstd/lib/common/error_private.c11
-rw-r--r--Utilities/cmzstd/lib/common/error_private.h81
-rw-r--r--Utilities/cmzstd/lib/common/fse.h91
-rw-r--r--Utilities/cmzstd/lib/common/fse_decompress.c108
-rw-r--r--Utilities/cmzstd/lib/common/huf.h253
-rw-r--r--Utilities/cmzstd/lib/common/mem.h103
-rw-r--r--Utilities/cmzstd/lib/common/pool.c53
-rw-r--r--Utilities/cmzstd/lib/common/pool.h12
-rw-r--r--Utilities/cmzstd/lib/common/portability_macros.h156
-rw-r--r--Utilities/cmzstd/lib/common/threading.c82
-rw-r--r--Utilities/cmzstd/lib/common/threading.h15
-rw-r--r--Utilities/cmzstd/lib/common/xxhash.c814
-rw-r--r--Utilities/cmzstd/lib/common/xxhash.h5733
-rw-r--r--Utilities/cmzstd/lib/common/zstd_common.c37
-rw-r--r--Utilities/cmzstd/lib/common/zstd_deps.h2
-rw-r--r--Utilities/cmzstd/lib/common/zstd_internal.h192
-rw-r--r--Utilities/cmzstd/lib/common/zstd_trace.h15
-rw-r--r--Utilities/cmzstd/lib/compress/clevels.h134
-rw-r--r--Utilities/cmzstd/lib/compress/fse_compress.c223
-rw-r--r--Utilities/cmzstd/lib/compress/hist.c2
-rw-r--r--Utilities/cmzstd/lib/compress/hist.h2
-rw-r--r--Utilities/cmzstd/lib/compress/huf_compress.c978
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_compress.c2325
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_compress_internal.h519
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_compress_literals.c153
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_compress_literals.h22
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_compress_sequences.c35
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_compress_sequences.h2
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_compress_superblock.c51
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_compress_superblock.h2
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_cwksp.h248
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_double_fast.c501
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_double_fast.h5
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_fast.c978
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_fast.h5
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_lazy.c1252
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_lazy.h6
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_ldm.c24
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_ldm.h4
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_ldm_geartab.h7
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_opt.c521
-rw-r--r--Utilities/cmzstd/lib/compress/zstd_opt.h2
-rw-r--r--Utilities/cmzstd/lib/compress/zstdmt_compress.c132
-rw-r--r--Utilities/cmzstd/lib/compress/zstdmt_compress.h7
-rw-r--r--Utilities/cmzstd/lib/decompress/huf_decompress.c1569
-rw-r--r--Utilities/cmzstd/lib/decompress/zstd_ddict.c8
-rw-r--r--Utilities/cmzstd/lib/decompress/zstd_ddict.h2
-rw-r--r--Utilities/cmzstd/lib/decompress/zstd_decompress.c354
-rw-r--r--Utilities/cmzstd/lib/decompress/zstd_decompress_block.c1198
-rw-r--r--Utilities/cmzstd/lib/decompress/zstd_decompress_block.h17
-rw-r--r--Utilities/cmzstd/lib/decompress/zstd_decompress_internal.h43
-rw-r--r--Utilities/cmzstd/lib/deprecated/zbuff.h2
-rw-r--r--Utilities/cmzstd/lib/deprecated/zbuff_common.c2
-rw-r--r--Utilities/cmzstd/lib/deprecated/zbuff_compress.c28
-rw-r--r--Utilities/cmzstd/lib/deprecated/zbuff_decompress.c4
-rw-r--r--Utilities/cmzstd/lib/dictBuilder/cover.c45
-rw-r--r--Utilities/cmzstd/lib/dictBuilder/cover.h2
-rw-r--r--Utilities/cmzstd/lib/dictBuilder/fastcover.c19
-rw-r--r--Utilities/cmzstd/lib/dictBuilder/zdict.c159
-rw-r--r--Utilities/cmzstd/lib/zdict.h92
-rw-r--r--Utilities/cmzstd/lib/zstd.h996
-rw-r--r--Utilities/cmzstd/lib/zstd_errors.h35
-rwxr-xr-xbootstrap20
3591 files changed, 82429 insertions, 30481 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 03e6a51..6d2edd4 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -5,12 +5,16 @@ bugprone-*,\
-bugprone-easily-swappable-parameters,\
-bugprone-empty-catch,\
-bugprone-implicit-widening-of-multiplication-result,\
+-bugprone-inc-dec-in-conditions,\
-bugprone-macro-parentheses,\
-bugprone-misplaced-widening-cast,\
+-bugprone-multi-level-implicit-pointer-conversion,\
-bugprone-narrowing-conversions,\
-bugprone-switch-missing-default-case,\
-bugprone-too-small-loop-variable,\
-bugprone-unchecked-optional-access,\
+-bugprone-unused-local-non-trivial-variable,\
+-bugprone-unused-return-value,\
misc-*,\
-misc-confusable-identifiers,\
-misc-const-correctness,\
@@ -31,9 +35,12 @@ modernize-*,\
-modernize-use-transparent-functors,\
performance-*,\
-performance-avoid-endl,\
+-performance-enum-size,\
-performance-inefficient-vector-operation,\
-performance-noexcept-swap,\
readability-*,\
+-readability-avoid-nested-conditional-operator,\
+-readability-avoid-return-with-void-value,\
-readability-avoid-unconditional-preprocessor-if,\
-readability-convert-member-functions-to-static,\
-readability-function-cognitive-complexity,\
@@ -45,8 +52,11 @@ readability-*,\
-readability-magic-numbers,\
-readability-make-member-function-const,\
-readability-named-parameter,\
+-readability-redundant-casting,\
-readability-redundant-declaration,\
+-readability-redundant-inline-specifier,\
-readability-redundant-member-init,\
+-readability-reference-to-constructed-temporary,\
-readability-simplify-boolean-expr,\
-readability-static-accessed-through-instance,\
-readability-suspicious-call-argument,\
diff --git a/.gitignore b/.gitignore
index 816dced..1780a41 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,6 @@
/.vs/
# Visual Studio build directory
/out/
+
+# clang-tidy output
+/clang-tidy-fixes.patch
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b8bb4ab..a3d959c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -59,7 +59,7 @@ p:source-package:
p:doc-package:
extends:
- - .fedora39_sphinx_package
+ - .fedora40_sphinx_package
- .cmake_prep_doc_linux
- .linux_x86_64_tags
- .cmake_doc_artifacts
@@ -108,17 +108,18 @@ l:iwyu-debian12:
- .cmake_cdash_artifacts
- .run_automatically
-l:tidy-fedora39:
+l:tidy-fedora40:
extends:
- - .fedora39_tidy
+ - .fedora40_tidy
- .cmake_build_linux
+ - .cmake_tidy_artifacts
- .linux_x86_64_tags
- .cmake_cdash_artifacts
- .run_automatically
-l:sphinx-fedora39:
+l:sphinx-fedora40:
extends:
- - .fedora39_sphinx
+ - .fedora40_sphinx
- .cmake_build_linux
- .cmake_sphinx_artifacts
- .linux_x86_64_tags
@@ -127,9 +128,9 @@ l:sphinx-fedora39:
CMAKE_CI_JOB_CONTINUOUS: "true"
CMAKE_CI_JOB_HELP: "true"
-l:clang-analyzer-fedora39:
+l:clang-analyzer-fedora40:
extends:
- - .fedora39_clang_analyzer
+ - .fedora40_clang_analyzer
- .cmake_build_linux
- .linux_x86_64_tags
- .run_automatically
@@ -221,7 +222,7 @@ t:debian12-hip-radeon:
- .run_dependent
- .needs_centos7_x86_64
variables:
- CMAKE_CI_NO_MR: "true"
+ CMAKE_CI_JOB_NIGHTLY: "true"
t:fedora39-hip-radeon:
extends:
@@ -231,11 +232,11 @@ t:fedora39-hip-radeon:
- .run_dependent
- .needs_centos7_x86_64
variables:
- CMAKE_CI_NO_MR: "true"
+ CMAKE_CI_JOB_NIGHTLY: "true"
-t:fedora39-ninja-clang:
+t:fedora40-ninja-clang:
extends:
- - .fedora39_ninja_clang
+ - .fedora40_ninja_clang
- .cmake_test_linux_release
- .linux_x86_64_tags
- .run_dependent
@@ -243,9 +244,9 @@ t:fedora39-ninja-clang:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-t:fedora39-ninja-multi-clang:
+t:fedora40-ninja-multi-clang:
extends:
- - .fedora39_ninja_multi_clang
+ - .fedora40_ninja_multi_clang
- .cmake_test_linux_release
- .linux_x86_64_tags
- .run_dependent
@@ -253,9 +254,9 @@ t:fedora39-ninja-multi-clang:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-t:fedora39-makefiles-clang:
+t:fedora40-makefiles-clang:
extends:
- - .fedora39_makefiles_clang
+ - .fedora40_makefiles_clang
- .cmake_test_linux_release
- .linux_x86_64_tags
- .run_dependent
@@ -263,17 +264,17 @@ t:fedora39-makefiles-clang:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-t:fedora39-makefiles:
+t:fedora40-makefiles:
extends:
- - .fedora39_makefiles
+ - .fedora40_makefiles
- .cmake_test_linux_release
- .linux_x86_64_tags
- .run_dependent
- .needs_centos7_x86_64
-t:fedora39-makefiles-nospace:
+t:fedora40-makefiles-nospace:
extends:
- - .fedora39_makefiles
+ - .fedora40_makefiles
- .cmake_test_linux_release
- .linux_x86_64_tags
- .cmake_junit_artifacts
@@ -281,7 +282,7 @@ t:fedora39-makefiles-nospace:
- .needs_centos7_x86_64
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake-ci"
- CMAKE_CI_BUILD_NAME: fedora39_makefiles_nospace
+ CMAKE_CI_BUILD_NAME: fedora40_makefiles_nospace
CMAKE_CI_JOB_NIGHTLY: "true"
t:nvhpc22.11-ninja:
@@ -302,7 +303,7 @@ t:cuda9.2-nvidia:
- .run_dependent
- .needs_centos7_x86_64
variables:
- CMAKE_CI_NO_MR: "true"
+ CMAKE_CI_JOB_NIGHTLY: "true"
t:cuda10.2-nvidia:
extends:
@@ -312,6 +313,8 @@ t:cuda10.2-nvidia:
- .cmake_junit_artifacts
- .run_dependent
- .needs_centos7_x86_64
+ variables:
+ CMAKE_CI_JOB_NIGHTLY: "true"
t:cuda10.2-clang:
extends:
@@ -321,7 +324,7 @@ t:cuda10.2-clang:
- .run_dependent
- .needs_centos7_x86_64
variables:
- CMAKE_CI_NO_MR: "true"
+ CMAKE_CI_JOB_NIGHTLY: "true"
t:cuda11.6-nvidia:
extends:
@@ -331,6 +334,8 @@ t:cuda11.6-nvidia:
- .cmake_junit_artifacts
- .run_dependent
- .needs_centos7_x86_64
+ variables:
+ CMAKE_CI_JOB_NIGHTLY: "true"
t:cuda11.6-clang:
extends:
@@ -340,7 +345,7 @@ t:cuda11.6-clang:
- .run_dependent
- .needs_centos7_x86_64
variables:
- CMAKE_CI_NO_MR: "true"
+ CMAKE_CI_JOB_NIGHTLY: "true"
t:cuda11.8-minimal-ninja:
extends:
@@ -350,7 +355,7 @@ t:cuda11.8-minimal-ninja:
- .run_dependent
- .needs_centos7_x86_64
variables:
- CMAKE_CI_NO_MR: "true"
+ CMAKE_CI_JOB_NIGHTLY: "true"
t:cuda11.8-minimal-splayed-ninja:
extends:
@@ -360,43 +365,42 @@ t:cuda11.8-minimal-splayed-ninja:
- .run_dependent
- .needs_centos7_x86_64
variables:
- CMAKE_CI_NO_MR: "true"
+ CMAKE_CI_JOB_NIGHTLY: "true"
-t:hip5.5-nvidia:
+t:cuda12.2-nvidia:
extends:
- - .hip5.5_nvidia
+ - .cuda12.2_nvidia
- .cmake_test_linux_release
- .linux_x86_64_tags_cuda
+ - .cmake_junit_artifacts
- .run_dependent
- .needs_centos7_x86_64
- variables:
- CMAKE_CI_NO_MR: "true"
-t:hip5.5-radeon:
+t:cuda12.2-clang:
extends:
- - .hip5.5_radeon
+ - .cuda12.2_clang
- .cmake_test_linux_release
- - .linux_x86_64_tags_radeon
+ - .linux_x86_64_tags_cuda
- .run_dependent
- .needs_centos7_x86_64
variables:
- CMAKE_CI_NO_MR: "true"
+ CMAKE_CI_JOB_NIGHTLY: "true"
-t:linux-gcc-cxx-modules-ninja:
+t:hip5.5-nvidia:
extends:
- - .gcc_cxx_modules_ninja
+ - .hip5.5_nvidia
- .cmake_test_linux_release
- - .linux_x86_64_tags
+ - .linux_x86_64_tags_cuda
- .run_dependent
- .needs_centos7_x86_64
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-t:linux-gcc-cxx-modules-ninja-multi:
+t:hip5.5-radeon:
extends:
- - .gcc_cxx_modules_ninja_multi
+ - .hip5.5_radeon
- .cmake_test_linux_release
- - .linux_x86_64_tags
+ - .linux_x86_64_tags_radeon
- .run_dependent
- .needs_centos7_x86_64
variables:
@@ -413,9 +417,9 @@ t:debian10-legacy:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-b:fedora39-ninja:
+b:fedora40-ninja:
extends:
- - .fedora39_ninja
+ - .fedora40_ninja
- .cmake_build_linux
- .cmake_build_artifacts
- .linux_x86_64_tags
@@ -423,9 +427,9 @@ b:fedora39-ninja:
variables:
CMAKE_CI_JOB_CONTINUOUS: "true"
-b:fedora39-makefiles-symlinked:
+b:fedora40-makefiles-symlinked:
extends:
- - .fedora39_makefiles_symlinked
+ - .fedora40_makefiles_symlinked
- .cmake_build_linux
- .cmake_build_artifacts
- .linux_x86_64_tags
@@ -460,68 +464,54 @@ b:debian12-aarch64-extdeps:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-b:fedora39-extdeps:
+b:fedora40-extdeps:
extends:
- - .fedora39_extdeps
+ - .fedora40_extdeps
- .cmake_build_linux_standalone
- .linux_x86_64_tags
- .run_manually
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-t:fedora39-ninja:
+t:fedora40-ninja:
extends:
- - .fedora39_ninja
+ - .fedora40_ninja
- .cmake_test_linux
- .linux_x86_64_tags_x11
- .cmake_test_artifacts
- .run_dependent
dependencies:
- - b:fedora39-ninja
+ - b:fedora40-ninja
needs:
- - b:fedora39-ninja
+ - b:fedora40-ninja
variables:
CMAKE_CI_JOB_CONTINUOUS: "true"
-t:fedora39-makefiles-symlinked:
+t:fedora40-makefiles-symlinked:
extends:
- - .fedora39_makefiles_symlinked
+ - .fedora40_makefiles_symlinked
- .cmake_test_linux
- .linux_x86_64_tags_x11
- .cmake_test_artifacts
- .run_dependent
dependencies:
- - b:fedora39-makefiles-symlinked
+ - b:fedora40-makefiles-symlinked
needs:
- - b:fedora39-makefiles-symlinked
+ - b:fedora40-makefiles-symlinked
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-t:fedora39-ninja-multi:
+t:fedora40-ninja-multi:
extends:
- - .fedora39_ninja_multi
+ - .fedora40_ninja_multi
- .cmake_test_linux_external
- .linux_x86_64_tags
- .cmake_junit_artifacts
- .run_dependent
dependencies:
- - t:fedora39-ninja
+ - t:fedora40-ninja
needs:
- - t:fedora39-ninja
-
-t:intel2016-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2016_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2016-el7
-
-t:intel2016u1-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2016u1_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2016u1-el7
+ - t:fedora40-ninja
t:intel2016u2-makefiles:
extends:
@@ -530,62 +520,6 @@ t:intel2016u2-makefiles:
CMAKE_CI_BUILD_NAME: intel2016u2_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2016u2-el7
-t:intel2017-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2017_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017-el7
-
-t:intel2017u1-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2017u1_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u1-el7
-
-t:intel2017u2-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2017u2_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u2-el7
-
-t:intel2017u3-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2017u3_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u3-el7
-
-t:intel2017u4-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2017u4_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u4-el7
-
-t:intel2017u5-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2017u5_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u5-el7
-
-t:intel2017u6-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2017u6_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u6-el7
-
-t:intel2017u7-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2017u7_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u7-el7
-
t:intel2017u8-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
@@ -593,34 +527,6 @@ t:intel2017u8-makefiles:
CMAKE_CI_BUILD_NAME: intel2017u8_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u8-el7
-t:intel2018-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2018_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018-el7
-
-t:intel2018u1-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2018u1_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u1-el7
-
-t:intel2018u2-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2018u2_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u2-el7
-
-t:intel2018u3-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2018u3_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u3-el7
-
t:intel2018u4-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
@@ -628,34 +534,6 @@ t:intel2018u4-makefiles:
CMAKE_CI_BUILD_NAME: intel2018u4_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u4-el7
-t:intel2019-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2019_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019-el7
-
-t:intel2019u1-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2019u1_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u1-el7
-
-t:intel2019u2-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2019u2_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u2-el7
-
-t:intel2019u3-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2019u3_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u3-el7
-
t:intel2019u4-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
@@ -663,20 +541,6 @@ t:intel2019u4-makefiles:
CMAKE_CI_BUILD_NAME: intel2019u4_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u4-el7
-t:intel2020-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2020_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2020-el8
-
-t:intel2020u2-makefiles:
- extends:
- - .cmake_test_linux_intelclassic_makefiles
- variables:
- CMAKE_CI_BUILD_NAME: intel2020u2_makefiles
- CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2020u2-el8
-
t:intel2020u4-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
@@ -754,6 +618,13 @@ t:intel2021.9.0-makefiles:
CMAKE_CI_BUILD_NAME: intel2021.9.0_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2023.1.0-el8
+t:intel2021.10.0-makefiles:
+ extends:
+ - .cmake_test_linux_intelclassic_makefiles
+ variables:
+ CMAKE_CI_BUILD_NAME: intel2021.10.0_makefiles
+ CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2023.2.1-el8
+
t:oneapi2021.1.1-makefiles:
extends:
- .cmake_test_linux_inteloneapi_makefiles
@@ -824,6 +695,27 @@ t:oneapi2023.1.0-makefiles:
CMAKE_CI_BUILD_NAME: oneapi2023.1.0_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2023.1.0-el8
+t:oneapi2023.2.0-makefiles:
+ extends:
+ - .cmake_test_linux_inteloneapi_makefiles
+ variables:
+ CMAKE_CI_BUILD_NAME: oneapi2023.2.1_makefiles
+ CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2023.2.1-el8
+
+t:oneapi2024.0.0-makefiles:
+ extends:
+ - .cmake_test_linux_inteloneapi_makefiles
+ variables:
+ CMAKE_CI_BUILD_NAME: oneapi2024.0.0_makefiles
+ CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2024.0.0-el8
+
+t:oneapi2024.1.0-makefiles:
+ extends:
+ - .cmake_test_linux_inteloneapi_makefiles
+ variables:
+ CMAKE_CI_BUILD_NAME: oneapi2024.1.0_makefiles
+ CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2024.1.0-el8
+
b:linux-x86_64-package:
extends:
- .linux_package
@@ -874,9 +766,9 @@ u:linux-aarch64-package:
## Sanitizer builds
-b:fedora39-asan:
+b:fedora40-asan:
extends:
- - .fedora39_asan
+ - .fedora40_asan
- .cmake_build_linux
- .cmake_build_artifacts
- .linux_x86_64_tags
@@ -884,16 +776,16 @@ b:fedora39-asan:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-t:fedora39-asan:
+t:fedora40-asan:
extends:
- - .fedora39_asan
+ - .fedora40_asan
- .cmake_memcheck_linux
- .linux_x86_64_tags
- .run_dependent
dependencies:
- - b:fedora39-asan
+ - b:fedora40-asan
needs:
- - b:fedora39-asan
+ - b:fedora40-asan
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
@@ -1138,6 +1030,8 @@ b:windows-vs2022-x64-ninja:
- .cmake_build_artifacts
- .windows_x86_64_tags_nonconcurrent_vs2022
- .run_manually
+ variables:
+ CMAKE_CI_JOB_CONTINUOUS: "true"
b:windows-vs2022-x64-pch:
extends:
@@ -1160,6 +1054,7 @@ t:windows-vs2022-x64-ninja:
needs:
- b:windows-vs2022-x64-ninja
variables:
+ CMAKE_CI_JOB_CONTINUOUS: "true"
CMAKE_CI_JOB_NIGHTLY_NINJA: "true"
t:windows-vs2022-x64-ninja-multi:
@@ -1176,11 +1071,10 @@ t:windows-vs2022-x64-ninja-multi:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-t:windows-vs2022-x64:
+.t:windows-vs2022-x64:
extends:
- .windows_vs2022_x64
- .cmake_test_windows_external
- - .windows_x86_64_tags_concurrent_vs2022
- .cmake_junit_artifacts
- .run_dependent
dependencies:
@@ -1188,11 +1082,25 @@ t:windows-vs2022-x64:
needs:
- t:windows-vs2022-x64-ninja
+t:windows-vs2022-x64:
+ extends:
+ - .t:windows-vs2022-x64
+ - .windows_x86_64_tags_concurrent_vs2022
+ variables:
+ CMAKE_CI_JOB_NIGHTLY: "false"
+
+t:windows-vs2022-x64-nightly:
+ extends:
+ - .t:windows-vs2022-x64
+ - .windows_x86_64_tags_concurrent_vs2022_android
+ variables:
+ CMAKE_CI_JOB_NIGHTLY: "true"
+
t:windows-vs2019-x64:
extends:
- .windows_vs2019_x64
- .cmake_test_windows_external
- - .windows_x86_64_tags_concurrent_vs2019
+ - .windows_x86_64_tags_concurrent_vs2019_android
- .cmake_junit_artifacts
- .run_dependent
dependencies:
diff --git a/.gitlab/.gitignore b/.gitlab/.gitignore
index 19796ef..552c02c 100644
--- a/.gitlab/.gitignore
+++ b/.gitlab/.gitignore
@@ -16,6 +16,12 @@
/python*
/qt*
/sccache*
+/swift
+/ticlang
+/tmp
/unstable-jom*
/watcom
-/wix*
+/wix3
+/wix4
+/clang-tidy-fixes
+/num_warnings.txt
diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml
index 2326bcf..b2315be 100644
--- a/.gitlab/artifacts.yml
+++ b/.gitlab/artifacts.yml
@@ -119,6 +119,8 @@
# Take the sphinx logs.
- ${CMAKE_CI_BUILD_DIR}/build-*.log
- ${CMAKE_CI_BUILD_DIR}/linkcheck/output.*
+ # Take the HTML output.
+ - ${CMAKE_CI_BUILD_DIR}/html/
.cmake_test_artifacts:
artifacts:
@@ -151,3 +153,10 @@
- ${CMAKE_CI_BUILD_DIR}/html
exclude:
- ${CMAKE_CI_BUILD_DIR}/html/.buildinfo
+
+.cmake_tidy_artifacts:
+ artifacts:
+ expire_in: 1d
+ when: always
+ paths:
+ - clang-tidy-fixes.patch
diff --git a/.gitlab/ci/borland-env.ps1 b/.gitlab/ci/borland-env.ps1
index b3b532e..b3b532e 100755..100644
--- a/.gitlab/ci/borland-env.ps1
+++ b/.gitlab/ci/borland-env.ps1
diff --git a/.gitlab/ci/borland.ps1 b/.gitlab/ci/borland.ps1
index 146a047..146a047 100755..100644
--- a/.gitlab/ci/borland.ps1
+++ b/.gitlab/ci/borland.ps1
diff --git a/.gitlab/ci/clang-env.ps1 b/.gitlab/ci/clang-env.ps1
index 451fca3..451fca3 100755..100644
--- a/.gitlab/ci/clang-env.ps1
+++ b/.gitlab/ci/clang-env.ps1
diff --git a/.gitlab/ci/clang.ps1 b/.gitlab/ci/clang.ps1
index e455ebc..e455ebc 100755..100644
--- a/.gitlab/ci/clang.ps1
+++ b/.gitlab/ci/clang.ps1
diff --git a/.gitlab/ci/cmake-env.ps1 b/.gitlab/ci/cmake-env.ps1
new file mode 100644
index 0000000..505fa44
--- /dev/null
+++ b/.gitlab/ci/cmake-env.ps1
@@ -0,0 +1,5 @@
+$pwdpath = $pwd.Path
+& "$pwsh" -File ".gitlab/ci/cmake.ps1"
+Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH"
+cmake --version
+$cmake = "cmake"
diff --git a/.gitlab/ci/cmake-env.sh b/.gitlab/ci/cmake-env.sh
new file mode 100644
index 0000000..686a78f
--- /dev/null
+++ b/.gitlab/ci/cmake-env.sh
@@ -0,0 +1,3 @@
+.gitlab/ci/cmake.sh
+export PATH="$PWD/.gitlab/cmake/bin:$PATH"
+cmake --version
diff --git a/.gitlab/ci/cmake.ps1 b/.gitlab/ci/cmake.ps1
index f6b5cc7..f6b5cc7 100755..100644
--- a/.gitlab/ci/cmake.ps1
+++ b/.gitlab/ci/cmake.ps1
diff --git a/.gitlab/ci/configure_cuda12.2_clang.cmake b/.gitlab/ci/configure_cuda12.2_clang.cmake
new file mode 100644
index 0000000..8f10f86
--- /dev/null
+++ b/.gitlab/ci/configure_cuda12.2_clang.cmake
@@ -0,0 +1,4 @@
+set(CMake_TEST_CUDA "Clang" CACHE STRING "")
+set(CMake_TEST_CUDA_STANDARDS "03;11;14;17;20;23" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_cuda12.2_nvidia.cmake b/.gitlab/ci/configure_cuda12.2_nvidia.cmake
new file mode 100644
index 0000000..51a2511
--- /dev/null
+++ b/.gitlab/ci/configure_cuda12.2_nvidia.cmake
@@ -0,0 +1,5 @@
+set(CMake_TEST_CUDA "NVIDIA" CACHE STRING "")
+set(CMake_TEST_CUDA_CUPTI "ON" CACHE STRING "")
+set(CMake_TEST_CUDA_STANDARDS "03;11;14;17;20" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_debian12_aarch64_ninja.cmake b/.gitlab/ci/configure_debian12_aarch64_ninja.cmake
index 5b97e4f..24be975 100644
--- a/.gitlab/ci/configure_debian12_aarch64_ninja.cmake
+++ b/.gitlab/ci/configure_debian12_aarch64_ninja.cmake
@@ -1,3 +1,6 @@
+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(CMake_TEST_CTestUpdate_BZR "ON" CACHE BOOL "")
set(CMake_TEST_CTestUpdate_CVS "ON" CACHE BOOL "")
set(CMake_TEST_CTestUpdate_GIT "ON" CACHE BOOL "")
@@ -61,6 +64,9 @@ set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "")
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 "")
@@ -92,6 +98,7 @@ set(CMake_TEST_IPO_WORKS_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_JQ "/usr/bin/jq" CACHE PATH "")
set(CMake_TEST_Qt5 "ON" CACHE BOOL "")
set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION "1.3" CACHE STRING "")
set(CMake_TEST_UseSWIG "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_debian12_makefiles_clang.cmake b/.gitlab/ci/configure_debian12_makefiles_clang.cmake
index 20863a2..7cba6f3 100644
--- a/.gitlab/ci/configure_debian12_makefiles_clang.cmake
+++ b/.gitlab/ci/configure_debian12_makefiles_clang.cmake
@@ -1 +1,8 @@
+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 "")
+
+if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
+ set(CMake_TEST_TICLANG_TOOLCHAINS "$ENV{CI_PROJECT_DIR}/.gitlab/ticlang" CACHE PATH "")
+endif()
+
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_debian12_ninja.cmake b/.gitlab/ci/configure_debian12_ninja.cmake
index 89c1108..efca7a1 100644
--- a/.gitlab/ci/configure_debian12_ninja.cmake
+++ b/.gitlab/ci/configure_debian12_ninja.cmake
@@ -1,2 +1,4 @@
+set(CMake_TEST_ASM_NASM "ON" CACHE BOOL "")
+
include("${CMAKE_CURRENT_LIST_DIR}/configure_debian12_ninja_common.cmake")
set(CMake_TEST_UseSWIG "ON" CACHE BOOL "")
diff --git a/.gitlab/ci/configure_debian12_ninja_clang.cmake b/.gitlab/ci/configure_debian12_ninja_clang.cmake
index 20863a2..69f1e7c 100644
--- a/.gitlab/ci/configure_debian12_ninja_clang.cmake
+++ b/.gitlab/ci/configure_debian12_ninja_clang.cmake
@@ -1 +1,5 @@
+if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
+ set(CMake_TEST_TICLANG_TOOLCHAINS "$ENV{CI_PROJECT_DIR}/.gitlab/ticlang" CACHE PATH "")
+endif()
+
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_debian12_ninja_common.cmake b/.gitlab/ci/configure_debian12_ninja_common.cmake
index d4d117b..98ae771 100644
--- a/.gitlab/ci/configure_debian12_ninja_common.cmake
+++ b/.gitlab/ci/configure_debian12_ninja_common.cmake
@@ -1,3 +1,6 @@
+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(CMake_TEST_CTestUpdate_BZR "ON" CACHE BOOL "")
set(CMake_TEST_CTestUpdate_CVS "ON" CACHE BOOL "")
set(CMake_TEST_CTestUpdate_GIT "ON" CACHE BOOL "")
@@ -8,6 +11,7 @@ if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
endif()
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 "")
@@ -65,6 +69,9 @@ set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "")
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 "")
@@ -90,6 +97,8 @@ 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 "")
@@ -97,6 +106,7 @@ set(CMake_TEST_IPO_WORKS_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_JQ "/usr/bin/jq" CACHE PATH "")
set(CMake_TEST_Qt5 "ON" CACHE BOOL "")
set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION "1.3" CACHE STRING "")
if (NOT "$ENV{SWIFTC}" STREQUAL "")
set(CMAKE_Swift_COMPILER "$ENV{SWIFTC}" CACHE FILEPATH "")
diff --git a/.gitlab/ci/configure_fedora39_asan.cmake b/.gitlab/ci/configure_fedora39_asan.cmake
deleted file mode 100644
index 872517c..0000000
--- a/.gitlab/ci/configure_fedora39_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_fedora39_common.cmake")
diff --git a/.gitlab/ci/configure_fedora39_clang_analyzer.cmake b/.gitlab/ci/configure_fedora39_clang_analyzer.cmake
deleted file mode 100644
index 1bfb3fb..0000000
--- a/.gitlab/ci/configure_fedora39_clang_analyzer.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(configure_no_sccache 1)
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common.cmake")
diff --git a/.gitlab/ci/configure_fedora39_common_clang.cmake b/.gitlab/ci/configure_fedora39_common_clang.cmake
deleted file mode 100644
index 1b3835a..0000000
--- a/.gitlab/ci/configure_fedora39_common_clang.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-set(CMAKE_Fortran_COMPILER "/usr/bin/flang-new" CACHE FILEPATH "")
-set(CMAKE_Fortran_COMPILER_ID "LLVMFlang" CACHE STRING "")
-set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 "1" CACHE BOOL "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora39_makefiles.cmake b/.gitlab/ci/configure_fedora39_makefiles.cmake
deleted file mode 100644
index 953b2a8..0000000
--- a/.gitlab/ci/configure_fedora39_makefiles.cmake
+++ /dev/null
@@ -1,103 +0,0 @@
-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_FindALSA "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_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_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_FindPython2 "ON" CACHE BOOL "")
-set(CMake_TEST_FindPython3 "ON" CACHE BOOL "")
-set(CMake_TEST_FindPython2_NumPy "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_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_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_UseSWIG "ON" CACHE BOOL "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora39_makefiles_clang.cmake b/.gitlab/ci/configure_fedora39_makefiles_clang.cmake
deleted file mode 100644
index a85ae70..0000000
--- a/.gitlab/ci/configure_fedora39_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_fedora39_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora39_makefiles_symlinked.cmake b/.gitlab/ci/configure_fedora39_makefiles_symlinked.cmake
deleted file mode 100644
index b53ab66..0000000
--- a/.gitlab/ci/configure_fedora39_makefiles_symlinked.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake")
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common.cmake")
diff --git a/.gitlab/ci/configure_fedora39_ninja.cmake b/.gitlab/ci/configure_fedora39_ninja.cmake
deleted file mode 100644
index ff233a3..0000000
--- a/.gitlab/ci/configure_fedora39_ninja.cmake
+++ /dev/null
@@ -1,14 +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_TLS_VERIFY_URL "https://gitlab.kitware.com" 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_fedora39_common.cmake")
diff --git a/.gitlab/ci/configure_fedora39_ninja_clang.cmake b/.gitlab/ci/configure_fedora39_ninja_clang.cmake
deleted file mode 100644
index 79d3eaa..0000000
--- a/.gitlab/ci/configure_fedora39_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" CACHE STRING "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora39_ninja_multi.cmake b/.gitlab/ci/configure_fedora39_ninja_multi.cmake
deleted file mode 100644
index 94af721..0000000
--- a/.gitlab/ci/configure_fedora39_ninja_multi.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
- set(CMake_TEST_ISPC "ON" CACHE STRING "")
-endif()
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora39_ninja_multi_clang.cmake b/.gitlab/ci/configure_fedora39_ninja_multi_clang.cmake
deleted file mode 100644
index 79d3eaa..0000000
--- a/.gitlab/ci/configure_fedora39_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" CACHE STRING "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora39_tidy.cmake b/.gitlab/ci/configure_fedora39_tidy.cmake
deleted file mode 100644
index 4ed1eb3..0000000
--- a/.gitlab/ci/configure_fedora39_tidy.cmake
+++ /dev/null
@@ -1,5 +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 "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common.cmake")
diff --git a/.gitlab/ci/configure_fedora40_asan.cmake b/.gitlab/ci/configure_fedora40_asan.cmake
new file mode 100644
index 0000000..ccdba4e
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_asan.cmake
@@ -0,0 +1,4 @@
+set(CMAKE_C_FLAGS "-fsanitize=address" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "-fsanitize=address" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora40_common.cmake")
diff --git a/.gitlab/ci/configure_fedora40_clang_analyzer.cmake b/.gitlab/ci/configure_fedora40_clang_analyzer.cmake
new file mode 100644
index 0000000..c210126
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_clang_analyzer.cmake
@@ -0,0 +1,3 @@
+set(configure_no_sccache 1)
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora40_common.cmake")
diff --git a/.gitlab/ci/configure_fedora39_common.cmake b/.gitlab/ci/configure_fedora40_common.cmake
index 4484e26..4484e26 100644
--- a/.gitlab/ci/configure_fedora39_common.cmake
+++ b/.gitlab/ci/configure_fedora40_common.cmake
diff --git a/.gitlab/ci/configure_fedora40_common_clang.cmake b/.gitlab/ci/configure_fedora40_common_clang.cmake
new file mode 100644
index 0000000..a4ae3f3
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_common_clang.cmake
@@ -0,0 +1,17 @@
+set(CMAKE_Fortran_COMPILER "/usr/bin/flang-new" CACHE FILEPATH "")
+set(CMAKE_Fortran_COMPILER_ID "LLVMFlang" CACHE STRING "")
+set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 "1" CACHE BOOL "")
+
+set(CMake_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_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 "OFF" CACHE BOOL "") # flang-new fails producing LLVM IR
+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 "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora39_extdeps.cmake b/.gitlab/ci/configure_fedora40_extdeps.cmake
index 8e545f5..8e545f5 100644
--- a/.gitlab/ci/configure_fedora39_extdeps.cmake
+++ b/.gitlab/ci/configure_fedora40_extdeps.cmake
diff --git a/.gitlab/ci/configure_fedora40_makefiles.cmake b/.gitlab/ci/configure_fedora40_makefiles.cmake
new file mode 100644
index 0000000..478ba11
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_makefiles.cmake
@@ -0,0 +1,115 @@
+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_FindPython2 "ON" CACHE BOOL "")
+set(CMake_TEST_FindPython3 "ON" CACHE BOOL "")
+set(CMake_TEST_FindPython2_NumPy "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_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_VERSION "1.3" CACHE STRING "")
+set(CMake_TEST_UseSWIG "ON" CACHE BOOL "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora40_makefiles_clang.cmake b/.gitlab/ci/configure_fedora40_makefiles_clang.cmake
new file mode 100644
index 0000000..d5739c3
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_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_fedora40_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora40_makefiles_symlinked.cmake b/.gitlab/ci/configure_fedora40_makefiles_symlinked.cmake
new file mode 100644
index 0000000..6a677fd
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_makefiles_symlinked.cmake
@@ -0,0 +1,2 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora40_common.cmake")
diff --git a/.gitlab/ci/configure_fedora40_ninja.cmake b/.gitlab/ci/configure_fedora40_ninja.cmake
new file mode 100644
index 0000000..b16e928
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_ninja.cmake
@@ -0,0 +1,16 @@
+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" CACHE STRING "")
+set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION "1.3" 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_fedora40_common.cmake")
diff --git a/.gitlab/ci/configure_fedora40_ninja_clang.cmake b/.gitlab/ci/configure_fedora40_ninja_clang.cmake
new file mode 100644
index 0000000..c760603
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_ninja_clang.cmake
@@ -0,0 +1,3 @@
+set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora40_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora40_ninja_multi.cmake b/.gitlab/ci/configure_fedora40_ninja_multi.cmake
new file mode 100644
index 0000000..f77606e
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_ninja_multi.cmake
@@ -0,0 +1,6 @@
+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" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora40_ninja_multi_clang.cmake b/.gitlab/ci/configure_fedora40_ninja_multi_clang.cmake
new file mode 100644
index 0000000..c760603
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_ninja_multi_clang.cmake
@@ -0,0 +1,3 @@
+set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora40_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora39_sphinx.cmake b/.gitlab/ci/configure_fedora40_sphinx.cmake
index 90d159b..90d159b 100644
--- a/.gitlab/ci/configure_fedora39_sphinx.cmake
+++ b/.gitlab/ci/configure_fedora40_sphinx.cmake
diff --git a/.gitlab/ci/configure_fedora39_sphinx_package.cmake b/.gitlab/ci/configure_fedora40_sphinx_package.cmake
index e839de8..e839de8 100644
--- a/.gitlab/ci/configure_fedora39_sphinx_package.cmake
+++ b/.gitlab/ci/configure_fedora40_sphinx_package.cmake
diff --git a/.gitlab/ci/configure_fedora40_tidy.cmake b/.gitlab/ci/configure_fedora40_tidy.cmake
new file mode 100644
index 0000000..037732c
--- /dev/null
+++ b/.gitlab/ci/configure_fedora40_tidy.cmake
@@ -0,0 +1,6 @@
+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_fedora40_common.cmake")
diff --git a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake
deleted file mode 100644
index f0ba9eb..0000000
--- a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,bmionly" CACHE STRING "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake
deleted file mode 100644
index f0ba9eb..0000000
--- a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,bmionly" CACHE STRING "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_macos_arm64_ninja.cmake b/.gitlab/ci/configure_macos_arm64_ninja.cmake
index f2068a1..672f5d4 100644
--- a/.gitlab/ci/configure_macos_arm64_ninja.cmake
+++ b/.gitlab/ci/configure_macos_arm64_ninja.cmake
@@ -1,8 +1,13 @@
+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(CMake_TEST_FindOpenAL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
set(CMake_TEST_GUI "ON" CACHE BOOL "")
set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION "1.3" CACHE STRING "")
+
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_macos_x86_64_makefiles.cmake b/.gitlab/ci/configure_macos_x86_64_makefiles.cmake
index 5d1620d..f0bf1c0 100644
--- a/.gitlab/ci/configure_macos_x86_64_makefiles.cmake
+++ b/.gitlab/ci/configure_macos_x86_64_makefiles.cmake
@@ -7,6 +7,7 @@ if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
endif()
set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION "1.3" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_macos_x86_64_ninja.cmake b/.gitlab/ci/configure_macos_x86_64_ninja.cmake
index 5d1620d..8fdaba8 100644
--- a/.gitlab/ci/configure_macos_x86_64_ninja.cmake
+++ b/.gitlab/ci/configure_macos_x86_64_ninja.cmake
@@ -1,3 +1,6 @@
+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(CMake_TEST_FindOpenAL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
@@ -7,6 +10,7 @@ if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
endif()
set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION "1.3" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_windows_arm64_vs2022_ninja.cmake b/.gitlab/ci/configure_windows_arm64_vs2022_ninja.cmake
index a12ee6c..cd9780b 100644
--- a/.gitlab/ci/configure_windows_arm64_vs2022_ninja.cmake
+++ b/.gitlab/ci/configure_windows_arm64_vs2022_ninja.cmake
@@ -1,8 +1,11 @@
# Qt host tools are not yet available natively on windows-arm64.
set(CMake_TEST_GUI "OFF" CACHE BOOL "")
-set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
set(BUILD_QtDialog "OFF" CACHE BOOL "")
set(CMAKE_PREFIX_PATH "" CACHE STRING "")
+set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION "1.2" CACHE STRING "")
+
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_cxx_modules_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_wix_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common_ninja.cmake")
diff --git a/.gitlab/ci/configure_windows_clang_common.cmake b/.gitlab/ci/configure_windows_clang_common.cmake
index 55dce1d..89d0c9c 100644
--- a/.gitlab/ci/configure_windows_clang_common.cmake
+++ b/.gitlab/ci/configure_windows_clang_common.cmake
@@ -1,3 +1,16 @@
+if("$ENV{CMAKE_CI_BUILD_NAME}" MATCHES "(^|_)gnu(_|$)")
+ 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 and C++23 support for clang-cl.
+ set(CMake_TEST_C_STANDARDS "90;99;11;17" CACHE STRING "")
+ set(CMake_TEST_CXX_STANDARDS "98;11;14;17;20" CACHE STRING "")
+endif()
+
+set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenMP_Fortran "OFF" CACHE BOOL "")
set(CMake_TEST_Java OFF CACHE BOOL "")
set(configure_no_sccache 1)
diff --git a/.gitlab/ci/configure_windows_i386_package.cmake b/.gitlab/ci/configure_windows_i386_package.cmake
index 65e1dcb..c80ebcc 100644
--- a/.gitlab/ci/configure_windows_i386_package.cmake
+++ b/.gitlab/ci/configure_windows_i386_package.cmake
@@ -1,6 +1,9 @@
# CPack package file name component for this platform.
set(CPACK_SYSTEM_NAME "windows-i386" CACHE STRING "")
+# Tell WiX to package for this architecture.
+set(CPACK_WIX_ARCHITECTURE "x86" CACHE STRING "")
+
# Use APIs from at most Windows 7
set(CMAKE_C_FLAGS "-D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-GR -EHsc -D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000" CACHE STRING "")
diff --git a/.gitlab/ci/configure_windows_intelcompiler_common.cmake b/.gitlab/ci/configure_windows_intelcompiler_common.cmake
index 55dce1d..0777eaf 100644
--- a/.gitlab/ci/configure_windows_intelcompiler_common.cmake
+++ b/.gitlab/ci/configure_windows_intelcompiler_common.cmake
@@ -1,3 +1,7 @@
+set(CMake_TEST_FindOpenMP "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_Java OFF CACHE BOOL "")
set(configure_no_sccache 1)
diff --git a/.gitlab/ci/configure_windows_msvc_common.cmake b/.gitlab/ci/configure_windows_msvc_common.cmake
index 6d66a05..946eca7 100644
--- a/.gitlab/ci/configure_windows_msvc_common.cmake
+++ b/.gitlab/ci/configure_windows_msvc_common.cmake
@@ -1,2 +1,4 @@
+set(CMake_TEST_Java OFF CACHE BOOL "")
+
set(configure_no_sccache 1)
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake b/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake
index e378d62..207f2a5 100644
--- a/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake
+++ b/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake
@@ -1 +1 @@
-set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,shared,export_bmi,install_bmi,bmionly" CACHE STRING "")
+set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,shared,export_bmi,install_bmi,bmionly,import_std23" CACHE STRING "")
diff --git a/.gitlab/ci/configure_windows_package_common.cmake b/.gitlab/ci/configure_windows_package_common.cmake
index 541a541..11bfad5 100644
--- a/.gitlab/ci/configure_windows_package_common.cmake
+++ b/.gitlab/ci/configure_windows_package_common.cmake
@@ -19,6 +19,8 @@ set(CMake_TEST_Qt5 OFF CACHE BOOL "")
set(CMake_TEST_Qt6 OFF CACHE BOOL "")
set(Python_FIND_REGISTRY NEVER CACHE STRING "")
+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/configure_windows_vs2019_x64.cmake b/.gitlab/ci/configure_windows_vs2019_x64.cmake
index b859525..e4795b9 100644
--- a/.gitlab/ci/configure_windows_vs2019_x64.cmake
+++ b/.gitlab/ci/configure_windows_vs2019_x64.cmake
@@ -1,4 +1,5 @@
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
+ set(CMake_TEST_ANDROID_VS16 ON CACHE BOOL "")
set(CMAKE_TESTS_CDASH_SERVER "https://open.cdash.org" CACHE STRING "")
endif()
diff --git a/.gitlab/ci/configure_windows_vs2022_x64.cmake b/.gitlab/ci/configure_windows_vs2022_x64.cmake
index 51ee514..c29a9ec 100644
--- a/.gitlab/ci/configure_windows_vs2022_x64.cmake
+++ b/.gitlab/ci/configure_windows_vs2022_x64.cmake
@@ -1,3 +1,7 @@
+if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
+ set(CMake_TEST_ANDROID_VS17 ON CACHE BOOL "")
+endif()
+
set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions,shared" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_cxx_modules_common.cmake")
diff --git a/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake b/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake
index 54abf72..e449d80 100644
--- a/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake
+++ b/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake
@@ -1,8 +1,15 @@
+set(CMake_TEST_C_STANDARDS "90;99;11;17" CACHE STRING "")
+set(CMake_TEST_CXX_STANDARDS "98;11;14;17;20;23" CACHE STRING "")
+
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_CPACK_INNOSETUP "ON" CACHE STRING "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
+ set(CMake_TEST_Swift "ON" CACHE STRING "")
endif()
+
set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION "1.2" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_cxx_modules_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_wix_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common_ninja.cmake")
diff --git a/.gitlab/ci/configure_windows_wix_common.cmake b/.gitlab/ci/configure_windows_wix_common.cmake
new file mode 100644
index 0000000..4219c41
--- /dev/null
+++ b/.gitlab/ci/configure_windows_wix_common.cmake
@@ -0,0 +1,5 @@
+get_filename_component(wix3_dir "${CMAKE_CURRENT_LIST_DIR}/../wix3" ABSOLUTE)
+set(CMake_TEST_CPACK_WIX3 "${wix3_dir}" CACHE PATH "")
+
+get_filename_component(wix4_dir "${CMAKE_CURRENT_LIST_DIR}/../wix4" ABSOLUTE)
+set(CMake_TEST_CPACK_WIX4 "${wix4_dir}" CACHE PATH "")
diff --git a/.gitlab/ci/configure_windows_x86_64_package.cmake b/.gitlab/ci/configure_windows_x86_64_package.cmake
index 3a141a7..051e3fc 100644
--- a/.gitlab/ci/configure_windows_x86_64_package.cmake
+++ b/.gitlab/ci/configure_windows_x86_64_package.cmake
@@ -1,6 +1,9 @@
# CPack package file name component for this platform.
set(CPACK_SYSTEM_NAME "windows-x86_64" CACHE STRING "")
+# Tell WiX to package for this architecture.
+set(CPACK_WIX_ARCHITECTURE "x64" CACHE STRING "")
+
# Use APIs from at most Windows 7
set(CMAKE_C_FLAGS "-D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-GR -EHsc -D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000" CACHE STRING "")
diff --git a/.gitlab/ci/ctest_build.cmake b/.gitlab/ci/ctest_build.cmake
index b1b9830..4a18cf9 100644
--- a/.gitlab/ci/ctest_build.cmake
+++ b/.gitlab/ci/ctest_build.cmake
@@ -65,6 +65,7 @@ if ("$ENV{CTEST_NO_WARNINGS_ALLOWED}" AND num_warnings GREATER 0)
message(FATAL_ERROR
"Found ${num_warnings} warnings (treating as fatal).")
endif ()
+file(WRITE "$ENV{CI_PROJECT_DIR}/.gitlab/num_warnings.txt" "${num_warnings}\n")
if (ctest_build_args)
message(FATAL_ERROR
diff --git a/.gitlab/ci/ctest_exclusions.cmake b/.gitlab/ci/ctest_exclusions.cmake
index a2789c3..ed5e1dd 100644
--- a/.gitlab/ci/ctest_exclusions.cmake
+++ b/.gitlab/ci/ctest_exclusions.cmake
@@ -34,6 +34,13 @@ if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "nvhpc_")
)
endif()
+if ("$ENV{CMAKE_CONFIGURATION}" STREQUAL "windows_vs2022_x64_ninja")
+ list(APPEND test_exclusions
+ # FIXME(#25573): This test failure needs further investigation.
+ "^SwiftMixLib$"
+ )
+endif()
+
string(REPLACE ";" "|" test_exclusions "${test_exclusions}")
if (test_exclusions)
set(test_exclusions "(${test_exclusions})")
diff --git a/.gitlab/ci/ctest_memcheck_fedora39_asan.lsan.supp b/.gitlab/ci/ctest_memcheck_fedora40_asan.lsan.supp
index 8ec1a03..8ec1a03 100644
--- a/.gitlab/ci/ctest_memcheck_fedora39_asan.lsan.supp
+++ b/.gitlab/ci/ctest_memcheck_fedora40_asan.lsan.supp
diff --git a/.gitlab/ci/docker/cuda12.2/Dockerfile b/.gitlab/ci/docker/cuda12.2/Dockerfile
new file mode 100644
index 0000000..e46f228
--- /dev/null
+++ b/.gitlab/ci/docker/cuda12.2/Dockerfile
@@ -0,0 +1,9 @@
+FROM kitware/nvidia-cuda:12.2.2-devel-ubuntu22.04
+MAINTAINER Brad King <brad.king@kitware.com>
+
+COPY llvm.list /etc/apt/sources.list.d/llvm.list
+COPY llvm-snapshot.gpg.key /root/llvm-snapshot.gpg.key
+RUN apt-key add /root/llvm-snapshot.gpg.key
+
+COPY install_deps.sh /root/install_deps.sh
+RUN sh /root/install_deps.sh
diff --git a/.gitlab/ci/docker/cuda12.2/install_deps.sh b/.gitlab/ci/docker/cuda12.2/install_deps.sh
new file mode 100755
index 0000000..94fbd98
--- /dev/null
+++ b/.gitlab/ci/docker/cuda12.2/install_deps.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+apt-get update
+
+# Install dependency without interaction.
+env DEBIAN_FRONTEND=noninteractive \
+ TZ=America/New_York \
+ apt-get install -y \
+ tzdata
+
+# Install development tools.
+apt-get install -y \
+ g++ \
+ clang-18 \
+ curl \
+ git
+
+apt-get clean
diff --git a/.gitlab/ci/docker/cuda12.2/llvm-snapshot.gpg.key b/.gitlab/ci/docker/cuda12.2/llvm-snapshot.gpg.key
new file mode 100644
index 0000000..aa6b105
--- /dev/null
+++ b/.gitlab/ci/docker/cuda12.2/llvm-snapshot.gpg.key
@@ -0,0 +1,52 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.12 (GNU/Linux)
+
+mQINBFE9lCwBEADi0WUAApM/mgHJRU8lVkkw0CHsZNpqaQDNaHefD6Rw3S4LxNmM
+EZaOTkhP200XZM8lVdbfUW9xSjA3oPldc1HG26NjbqqCmWpdo2fb+r7VmU2dq3NM
+R18ZlKixiLDE6OUfaXWKamZsXb6ITTYmgTO6orQWYrnW6ckYHSeaAkW0wkDAryl2
+B5v8aoFnQ1rFiVEMo4NGzw4UX+MelF7rxaaregmKVTPiqCOSPJ1McC1dHFN533FY
+Wh/RVLKWo6npu+owtwYFQW+zyQhKzSIMvNujFRzhIxzxR9Gn87MoLAyfgKEzrbbT
+DhqqNXTxS4UMUKCQaO93TzetX/EBrRpJj+vP640yio80h4Dr5pAd7+LnKwgpTDk1
+G88bBXJAcPZnTSKu9I2c6KY4iRNbvRz4i+ZdwwZtdW4nSdl2792L7Sl7Nc44uLL/
+ZqkKDXEBF6lsX5XpABwyK89S/SbHOytXv9o4puv+65Ac5/UShspQTMSKGZgvDauU
+cs8kE1U9dPOqVNCYq9Nfwinkf6RxV1k1+gwtclxQuY7UpKXP0hNAXjAiA5KS5Crq
+7aaJg9q2F4bub0mNU6n7UI6vXguF2n4SEtzPRk6RP+4TiT3bZUsmr+1ktogyOJCc
+Ha8G5VdL+NBIYQthOcieYCBnTeIH7D3Sp6FYQTYtVbKFzmMK+36ERreL/wARAQAB
+tD1TeWx2ZXN0cmUgTGVkcnUgLSBEZWJpYW4gTExWTSBwYWNrYWdlcyA8c3lsdmVz
+dHJlQGRlYmlhbi5vcmc+iQI4BBMBAgAiBQJRPZQsAhsDBgsJCAcDAgYVCAIJCgsE
+FgIDAQIeAQIXgAAKCRAVz00Yr090Ibx+EADArS/hvkDF8juWMXxh17CgR0WZlHCC
+9CTBWkg5a0bNN/3bb97cPQt/vIKWjQtkQpav6/5JTVCSx2riL4FHYhH0iuo4iAPR
+udC7Cvg8g7bSPrKO6tenQZNvQm+tUmBHgFiMBJi92AjZ/Qn1Shg7p9ITivFxpLyX
+wpmnF1OKyI2Kof2rm4BFwfSWuf8Fvh7kDMRLHv+MlnK/7j/BNpKdozXxLcwoFBmn
+l0WjpAH3OFF7Pvm1LJdf1DjWKH0Dc3sc6zxtmBR/KHHg6kK4BGQNnFKujcP7TVdv
+gMYv84kun14pnwjZcqOtN3UJtcx22880DOQzinoMs3Q4w4o05oIF+sSgHViFpc3W
+R0v+RllnH05vKZo+LDzc83DQVrdwliV12eHxrMQ8UYg88zCbF/cHHnlzZWAJgftg
+hB08v1BKPgYRUzwJ6VdVqXYcZWEaUJmQAPuAALyZESw94hSo28FAn0/gzEc5uOYx
+K+xG/lFwgAGYNb3uGM5m0P6LVTfdg6vDwwOeTNIExVk3KVFXeSQef2ZMkhwA7wya
+KJptkb62wBHFE+o9TUdtMCY6qONxMMdwioRE5BYNwAsS1PnRD2+jtlI0DzvKHt7B
+MWd8hnoUKhMeZ9TNmo+8CpsAtXZcBho0zPGz/R8NlJhAWpdAZ1CmcPo83EW86Yq7
+BxQUKnNHcwj2ebkCDQRRPZQsARAA4jxYmbTHwmMjqSizlMJYNuGOpIidEdx9zQ5g
+zOr431/VfWq4S+VhMDhs15j9lyml0y4ok215VRFwrAREDg6UPMr7ajLmBQGau0Fc
+bvZJ90l4NjXp5p0NEE/qOb9UEHT7EGkEhaZ1ekkWFTWCgsy7rRXfZLxB6sk7pzLC
+DshyW3zjIakWAnpQ5j5obiDy708pReAuGB94NSyb1HoW/xGsGgvvCw4r0w3xPStw
+F1PhmScE6NTBIfLliea3pl8vhKPlCh54Hk7I8QGjo1ETlRP4Qll1ZxHJ8u25f/ta
+RES2Aw8Hi7j0EVcZ6MT9JWTI83yUcnUlZPZS2HyeWcUj+8nUC8W4N8An+aNps9l/
+21inIl2TbGo3Yn1JQLnA1YCoGwC34g8QZTJhElEQBN0X29ayWW6OdFx8MDvllbBV
+ymmKq2lK1U55mQTfDli7S3vfGz9Gp/oQwZ8bQpOeUkc5hbZszYwP4RX+68xDPfn+
+M9udl+qW9wu+LyePbW6HX90LmkhNkkY2ZzUPRPDHZANU5btaPXc2H7edX4y4maQa
+xenqD0lGh9LGz/mps4HEZtCI5CY8o0uCMF3lT0XfXhuLksr7Pxv57yue8LLTItOJ
+d9Hmzp9G97SRYYeqU+8lyNXtU2PdrLLq7QHkzrsloG78lCpQcalHGACJzrlUWVP/
+fN3Ht3kAEQEAAYkCHwQYAQIACQUCUT2ULAIbDAAKCRAVz00Yr090IbhWEADbr50X
+OEXMIMGRLe+YMjeMX9NG4jxs0jZaWHc/WrGR+CCSUb9r6aPXeLo+45949uEfdSsB
+pbaEdNWxF5Vr1CSjuO5siIlgDjmT655voXo67xVpEN4HhMrxugDJfCa6z97P0+ML
+PdDxim57uNqkam9XIq9hKQaurxMAECDPmlEXI4QT3eu5qw5/knMzDMZj4Vi6hovL
+wvvAeLHO/jsyfIdNmhBGU2RWCEZ9uo/MeerPHtRPfg74g+9PPfP6nyHD2Wes6yGd
+oVQwtPNAQD6Cj7EaA2xdZYLJ7/jW6yiPu98FFWP74FN2dlyEA2uVziLsfBrgpS4l
+tVOlrO2YzkkqUGrybzbLpj6eeHx+Cd7wcjI8CalsqtL6cG8cUEjtWQUHyTbQWAgG
+5VPEgIAVhJ6RTZ26i/G+4J8neKyRs4vz+57UGwY6zI4AB1ZcWGEE3Bf+CDEDgmnP
+LSwbnHefK9IljT9XU98PelSryUO/5UPw7leE0akXKB4DtekToO226px1VnGp3Bov
+1GBGvpHvL2WizEwdk+nfk8LtrLzej+9FtIcq3uIrYnsac47Pf7p0otcFeTJTjSq3
+krCaoG4Hx0zGQG2ZFpHrSrZTVy6lxvIdfi0beMgY6h78p6M9eYZHQHc02DjFkQXN
+bXb5c6gCHESH5PXwPU4jQEE7Ib9J6sbk7ZT2Mw==
+=j+4q
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/.gitlab/ci/docker/cuda12.2/llvm.list b/.gitlab/ci/docker/cuda12.2/llvm.list
new file mode 100644
index 0000000..350a712
--- /dev/null
+++ b/.gitlab/ci/docker/cuda12.2/llvm.list
@@ -0,0 +1,2 @@
+deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
+deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
diff --git a/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst b/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst
index a59f2c9..014c7ea 100644
--- a/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst
+++ b/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst
@@ -32,6 +32,9 @@ cvs
subversion
mercurial
+# Install ASM_NASM language toolchain.
+nasm
+
# Install HIP language toolchain.
hipcc
diff --git a/.gitlab/ci/docker/fedora39-hip/Dockerfile b/.gitlab/ci/docker/fedora39-hip/Dockerfile
new file mode 100644
index 0000000..0347cc4
--- /dev/null
+++ b/.gitlab/ci/docker/fedora39-hip/Dockerfile
@@ -0,0 +1,27 @@
+# syntax=docker/dockerfile:1
+
+ARG BASE_IMAGE=fedora:39
+
+FROM ${BASE_IMAGE} AS dnf-cache
+# Populate DNF cache w/ the fresh metadata and prefetch packages.
+RUN --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
+ --mount=type=tmpfs,target=/var/log \
+ --mount=type=tmpfs,target=/tmp \
+ dnf install \
+ --setopt=install_weak_deps=False \
+ --setopt=fastestmirror=True \
+ --setopt=max_parallel_downloads=10 \
+ --downloadonly \
+ -y \
+ $(grep -h '^[^#]\+$' /root/*.lst)
+
+FROM ${BASE_IMAGE}
+LABEL maintainer="Brad King <brad.king@kitware.com>"
+
+RUN --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/dnf,target=/var/cache/dnf,sharing=private \
+ --mount=type=cache,target=/var/cache/pip \
+ --mount=type=tmpfs,target=/var/log \
+ --mount=type=tmpfs,target=/tmp \
+ sh /root/install_deps.sh
diff --git a/.gitlab/ci/docker/fedora39-hip/deps_packages.lst b/.gitlab/ci/docker/fedora39-hip/deps_packages.lst
new file mode 100644
index 0000000..70b114c
--- /dev/null
+++ b/.gitlab/ci/docker/fedora39-hip/deps_packages.lst
@@ -0,0 +1,15 @@
+# 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/fedora39-hip/install_deps.sh b/.gitlab/ci/docker/fedora39-hip/install_deps.sh
new file mode 100755
index 0000000..eedff9c
--- /dev/null
+++ b/.gitlab/ci/docker/fedora39-hip/install_deps.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+dnf install \
+ --setopt=install_weak_deps=False \
+ --setopt=fastestmirror=True \
+ --setopt=max_parallel_downloads=10 \
+ -y \
+ $(grep '^[^#]\+$' /root/deps_packages.lst)
diff --git a/.gitlab/ci/docker/fedora39/Dockerfile b/.gitlab/ci/docker/fedora39/Dockerfile
deleted file mode 100644
index f14e017..0000000
--- a/.gitlab/ci/docker/fedora39/Dockerfile
+++ /dev/null
@@ -1,58 +0,0 @@
-# syntax=docker/dockerfile:1
-
-ARG BASE_IMAGE=fedora:39
-
-FROM ${BASE_IMAGE} AS dnf-cache
-# Populate DNF cache w/ the fresh metadata and prefetch packages.
-RUN --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=rvm_packages.lst,target=/root/rvm_packages.lst \
- --mount=type=tmpfs,target=/var/log \
- --mount=type=tmpfs,target=/tmp \
- dnf install \
- --setopt=install_weak_deps=False \
- --setopt=fastestmirror=True \
- --setopt=max_parallel_downloads=10 \
- --downloadonly \
- -y \
- $(grep -h '^[^#]\+$' /root/*.lst)
-
-
-FROM ${BASE_IMAGE} AS rvm-build
-LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
-
-RUN --mount=type=bind,source=install_rvm.sh,target=/root/install_rvm.sh \
- --mount=type=bind,source=rvm_packages.lst,target=/root/rvm_packages.lst \
- --mount=type=cache,from=dnf-cache,source=/var/cache/dnf,target=/var/cache/dnf,sharing=private \
- --mount=type=tmpfs,target=/var/log \
- --mount=type=tmpfs,target=/tmp \
- sh /root/install_rvm.sh
-
-
-FROM ${BASE_IMAGE} AS iwyu-build
-LABEL maintainer="Kyle Edwards <kyle.edwards@kitware.com>"
-
-RUN --mount=type=bind,source=install_iwyu.sh,target=/root/install_iwyu.sh \
- --mount=type=bind,source=iwyu_packages.lst,target=/root/iwyu_packages.lst \
- --mount=type=cache,from=dnf-cache,source=/var/cache/dnf,target=/var/cache/dnf,sharing=private \
- --mount=type=tmpfs,target=/var/log \
- --mount=type=tmpfs,target=/tmp \
- sh /root/install_iwyu.sh
-
-
-FROM ${BASE_IMAGE}
-LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
-
-RUN --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/dnf,target=/var/cache/dnf,sharing=private \
- --mount=type=cache,target=/var/cache/pip \
- --mount=type=tmpfs,target=/var/log \
- --mount=type=tmpfs,target=/tmp \
- sh /root/install_deps.sh
-
-RUN --mount=type=bind,from=rvm-build,source=/root,target=/root \
- tar -C /usr/local -xf /root/rvm.tar
-
-RUN --mount=type=bind,from=iwyu-build,source=/root,target=/root \
- tar -C / -xf /root/iwyu.tar
diff --git a/.gitlab/ci/docker/fedora39/deps_packages.lst b/.gitlab/ci/docker/fedora39/deps_packages.lst
deleted file mode 100644
index 7656cbc..0000000
--- a/.gitlab/ci/docker/fedora39/deps_packages.lst
+++ /dev/null
@@ -1,124 +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
-flang-devel
-gcc-c++
-git-core
-llvm-devel
-make
-
-# Install optional external build dependencies.
-bzip2-devel
-expat-devel
-jsoncpp-devel
-libarchive-devel
-libcurl-devel
-libuv-devel
-libuv-devel
-libzstd-devel
-rhash-devel
-xz-devel
-zlib-devel
-
-# Install documentation tools.
-python3-sphinx
-texinfo
-qt5-qttools-devel
-qt6-qttools-devel
-
-# Install lint tools.
-clang-analyzer
-codespell
-
-# Tools needed for the test suite.
-findutils
-file
-jq
-which
-
-# Install HIP language toolchain.
-hsakmt-devel
-lld
-rocm-comgr-devel
-rocm-hip-devel
-rocm-runtime-devel
-
-# Packages needed to test CTest.
-breezy
-subversion
-mercurial
-
-# 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
-java-11-openjdk-devel
-jsoncpp-devel
-lapack-devel
-libarchive-devel
-libcurl-devel
-libicu-devel
-libinput-devel systemd-devel
-libjpeg-turbo-devel
-libpng-devel
-opensp-devel
-postgresql-server-devel
-libtiff-devel
-libuv-devel
-libxml2-devel
-libxslt-devel
-mpich-devel
-openal-soft-devel
-openmpi-devel
-patch
-perl
-protobuf-devel protobuf-c-devel protobuf-lite-devel
-pypy2 pypy2-devel
-pypy3 pypy3-devel
-python2 python2-devel
-python3 python3-devel python3-numpy
-python3-jsmin python3-jsonschema
-ruby rubygems ruby-devel
-SDL-devel
-sqlite-devel
-swig
-unixODBC-devel
-wxGTK-devel
-xalan-c-devel
-xerces-c-devel
-xz-devel
diff --git a/.gitlab/ci/docker/fedora39/install_iwyu.sh b/.gitlab/ci/docker/fedora39/install_iwyu.sh
deleted file mode 100755
index 684e355..0000000
--- a/.gitlab/ci/docker/fedora39/install_iwyu.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# Install development tools.
-dnf install \
- --setopt=install_weak_deps=False \
- --setopt=fastestmirror=True \
- --setopt=max_parallel_downloads=10 \
- -y \
- $(grep '^[^#]\+$' /root/iwyu_packages.lst)
-
-cd /root
-git clone "https://github.com/include-what-you-use/include-what-you-use.git"
-cd include-what-you-use
-readonly llvm_full_version="$( clang --version | head -n1 | cut -d' ' -f3 )"
-readonly llvm_version="$( echo "$llvm_full_version" | cut -d. -f-1 )"
-git checkout "clang_$llvm_version"
-git apply <<EOF
-diff --git a/iwyu_driver.cc b/iwyu_driver.cc
-index 42fea35..fbb77a9 100644
---- a/iwyu_driver.cc
-+++ b/iwyu_driver.cc
-@@ -167,6 +167,7 @@ CompilerInstance* CreateCompilerInstance(int argc, const char **argv) {
- DiagnosticsEngine diagnostics(diagnostic_id, &*diagnostic_options,
- diagnostic_client);
- Driver driver(path, getDefaultTargetTriple(), diagnostics);
-+ driver.ResourceDir = "/usr/lib64/clang/$llvm_full_version";
- driver.setTitle("include what you use");
-
- // Expand out any response files passed on the command line
-EOF
-mkdir build
-cd build
-
-cmake -GNinja \
- -DCMAKE_BUILD_TYPE=Release \
- "-DCMAKE_INSTALL_PREFIX=/usr/local/lib64/llvm-$llvm_version" \
- ..
-ninja
-DESTDIR=/root/iwyu-destdir ninja install
-tar -C /root/iwyu-destdir -cf /root/iwyu.tar .
diff --git a/.gitlab/ci/docker/fedora40/Dockerfile b/.gitlab/ci/docker/fedora40/Dockerfile
new file mode 100644
index 0000000..896456c
--- /dev/null
+++ b/.gitlab/ci/docker/fedora40/Dockerfile
@@ -0,0 +1,58 @@
+# syntax=docker/dockerfile:1
+
+ARG BASE_IMAGE=fedora:40
+
+FROM ${BASE_IMAGE} AS dnf-cache
+# Populate DNF cache w/ the fresh metadata and prefetch packages.
+RUN --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=rvm_packages.lst,target=/root/rvm_packages.lst \
+ --mount=type=tmpfs,target=/var/log \
+ --mount=type=tmpfs,target=/tmp \
+ dnf install \
+ --setopt=install_weak_deps=False \
+ --setopt=fastestmirror=True \
+ --setopt=max_parallel_downloads=10 \
+ --downloadonly \
+ -y \
+ $(grep -h '^[^#]\+$' /root/*.lst)
+
+
+FROM ${BASE_IMAGE} AS rvm-build
+LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
+
+RUN --mount=type=bind,source=install_rvm.sh,target=/root/install_rvm.sh \
+ --mount=type=bind,source=rvm_packages.lst,target=/root/rvm_packages.lst \
+ --mount=type=cache,from=dnf-cache,source=/var/cache/dnf,target=/var/cache/dnf,sharing=private \
+ --mount=type=tmpfs,target=/var/log \
+ --mount=type=tmpfs,target=/tmp \
+ sh /root/install_rvm.sh
+
+
+FROM ${BASE_IMAGE} AS iwyu-build
+LABEL maintainer="Kyle Edwards <kyle.edwards@kitware.com>"
+
+RUN --mount=type=bind,source=install_iwyu.sh,target=/root/install_iwyu.sh \
+ --mount=type=bind,source=iwyu_packages.lst,target=/root/iwyu_packages.lst \
+ --mount=type=cache,from=dnf-cache,source=/var/cache/dnf,target=/var/cache/dnf,sharing=private \
+ --mount=type=tmpfs,target=/var/log \
+ --mount=type=tmpfs,target=/tmp \
+ sh /root/install_iwyu.sh
+
+
+FROM ${BASE_IMAGE}
+LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
+
+RUN --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/dnf,target=/var/cache/dnf,sharing=private \
+ --mount=type=cache,target=/var/cache/pip \
+ --mount=type=tmpfs,target=/var/log \
+ --mount=type=tmpfs,target=/tmp \
+ sh /root/install_deps.sh
+
+RUN --mount=type=bind,from=rvm-build,source=/root,target=/root \
+ tar -C /usr/local -xf /root/rvm.tar
+
+RUN --mount=type=bind,from=iwyu-build,source=/root,target=/root \
+ tar -C / -xf /root/iwyu.tar
diff --git a/.gitlab/ci/docker/fedora40/deps_packages.lst b/.gitlab/ci/docker/fedora40/deps_packages.lst
new file mode 100644
index 0000000..c7bad7c
--- /dev/null
+++ b/.gitlab/ci/docker/fedora40/deps_packages.lst
@@ -0,0 +1,125 @@
+# 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
+llvm-devel
+make
+
+# Install optional external build dependencies.
+bzip2-devel
+expat-devel
+jsoncpp-devel
+libarchive-devel
+libcurl-devel
+libuv-devel
+libuv-devel
+libzstd-devel
+rhash-devel
+xz-devel
+zlib-devel
+
+# Install documentation tools.
+python3-sphinx
+python3-sphinxcontrib-qthelp
+texinfo
+qt5-qttools-devel
+qt6-qttools-devel
+
+# Install lint tools.
+clang-analyzer
+codespell
+
+# Tools needed for the test suite.
+findutils
+file
+jq
+which
+
+# Install ASM_NASM language toolchain.
+nasm
+
+# Packages needed to test CTest.
+breezy
+subversion
+mercurial
+
+# 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 systemd-devel
+libjpeg-turbo-devel
+libomp-devel
+libpng-devel
+opensp-devel
+postgresql-server-devel
+libtiff-devel
+libuv-devel
+libxml2-devel
+libxslt-devel
+mpich-devel
+openal-soft-devel
+openmpi-devel
+patch
+perl
+protobuf-devel protobuf-c-devel protobuf-lite-devel
+pypy2 pypy2-devel
+pypy3 pypy3-devel
+python2 python2-devel
+python3 python3-devel python3-numpy
+python3-jsmin python3-jsonschema
+ruby rubygems ruby-devel
+SDL-devel
+sqlite-devel
+swig
+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/fedora39/install_deps.sh b/.gitlab/ci/docker/fedora40/install_deps.sh
index 70e2293..70e2293 100755
--- a/.gitlab/ci/docker/fedora39/install_deps.sh
+++ b/.gitlab/ci/docker/fedora40/install_deps.sh
diff --git a/.gitlab/ci/docker/fedora40/install_iwyu.sh b/.gitlab/ci/docker/fedora40/install_iwyu.sh
new file mode 100755
index 0000000..50ed612
--- /dev/null
+++ b/.gitlab/ci/docker/fedora40/install_iwyu.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+# Install development tools.
+dnf install \
+ --setopt=install_weak_deps=False \
+ --setopt=fastestmirror=True \
+ --setopt=max_parallel_downloads=10 \
+ -y \
+ $(grep '^[^#]\+$' /root/iwyu_packages.lst)
+
+cd /root
+git clone "https://github.com/include-what-you-use/include-what-you-use.git"
+cd include-what-you-use
+readonly llvm_full_version="$( clang --version | head -n1 | cut -d' ' -f3 )"
+readonly llvm_version="$( echo "$llvm_full_version" | cut -d. -f-1 )"
+git checkout "clang_$llvm_version"
+git apply <<EOF
+diff --git a/iwyu_driver.cc b/iwyu_driver.cc
+index dd4b046..cfd568a 100644
+--- a/iwyu_driver.cc
++++ b/iwyu_driver.cc
+@@ -249,6 +249,7 @@ bool ExecuteAction(int argc, const char** argv,
+ /*CodeGenOpts=*/nullptr);
+
+ Driver driver(path, getDefaultTargetTriple(), *diagnostics);
++ driver.ResourceDir = "/usr/lib64/clang/$llvm_full_version";
+ driver.setTitle("include what you use");
+
+ // Expand out any response files passed on the command line
+EOF
+mkdir build
+cd build
+
+cmake -GNinja \
+ -DCMAKE_BUILD_TYPE=Release \
+ "-DCMAKE_INSTALL_PREFIX=/usr/local/lib64/llvm-$llvm_version" \
+ ..
+ninja
+DESTDIR=/root/iwyu-destdir ninja install
+tar -C /root/iwyu-destdir -cf /root/iwyu.tar .
diff --git a/.gitlab/ci/docker/fedora39/install_rvm.sh b/.gitlab/ci/docker/fedora40/install_rvm.sh
index 10e7545..10e7545 100755
--- a/.gitlab/ci/docker/fedora39/install_rvm.sh
+++ b/.gitlab/ci/docker/fedora40/install_rvm.sh
diff --git a/.gitlab/ci/docker/fedora39/iwyu_packages.lst b/.gitlab/ci/docker/fedora40/iwyu_packages.lst
index e3551bd..e3551bd 100644
--- a/.gitlab/ci/docker/fedora39/iwyu_packages.lst
+++ b/.gitlab/ci/docker/fedora40/iwyu_packages.lst
diff --git a/.gitlab/ci/docker/fedora39/rvm_packages.lst b/.gitlab/ci/docker/fedora40/rvm_packages.lst
index 1dc852e..1dc852e 100644
--- a/.gitlab/ci/docker/fedora39/rvm_packages.lst
+++ b/.gitlab/ci/docker/fedora40/rvm_packages.lst
diff --git a/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile b/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile
deleted file mode 100644
index d8e8238..0000000
--- a/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile
+++ /dev/null
@@ -1,9 +0,0 @@
-FROM fedora:38
-MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
-
-# Install build dependencies for packages.
-COPY install_deps.sh /root/install_deps.sh
-RUN sh /root/install_deps.sh
-
-COPY install_gcc.sh /root/install_gcc.sh
-RUN sh /root/install_gcc.sh
diff --git a/.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh b/.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh
deleted file mode 100755
index b8b706b..0000000
--- a/.gitlab/ci/docker/gcc_cxx_modules/install_deps.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-set -e
-
-dnf install -y --setopt=install_weak_deps=False \
- gcc-c++ mpfr-devel libmpc-devel isl-devel flex bison file findutils diffutils git-core
-dnf clean all
diff --git a/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh b/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh
deleted file mode 100755
index 15cfe39..0000000
--- a/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-set -e
-
-readonly revision="29862e21f6d656eca59284c927d0c4c0698eb99c" # master as of 21 Sep 2023
-readonly tarball="git://gcc.gnu.org/git/gcc.git"
-
-readonly workdir="$HOME/gcc"
-readonly srcdir="$workdir/gcc"
-readonly builddir="$workdir/build"
-readonly njobs="$( nproc )"
-
-mkdir -p "$workdir"
-cd "$workdir"
-git clone "$tarball" "$srcdir"
-git -C "$srcdir" checkout "$revision"
-mkdir -p "$builddir"
-cd "$builddir"
-"$srcdir/configure" \
- --disable-multilib \
- --enable-languages=c,c++ \
- --prefix="/opt/gcc-p1689"
-make "-j$njobs"
-make "-j$njobs" install-strip
-rm -rf "$workdir"
diff --git a/.gitlab/ci/env.ps1 b/.gitlab/ci/env.ps1
index 72a8cb8..754521b 100755..100644
--- a/.gitlab/ci/env.ps1
+++ b/.gitlab/ci/env.ps1
@@ -1,4 +1,12 @@
$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().MainModule.FileName
+
+# Place temporary files inside job directory.
+$tmp = New-Item -Force -ItemType Directory -Path "$pwd\.gitlab\tmp"
+$tmp = (New-Object -ComObject Scripting.FileSystemObject).GetFolder("$tmp").ShortPath
+Set-Item -Force -Path "env:TEMP" -Value "$tmp"
+Set-Item -Force -Path "env:TMP" -Value "$tmp"
+$tmp = $null
+
if (Test-Path -Path ".gitlab/ci/env_$env:CMAKE_CONFIGURATION.ps1" -PathType Leaf) {
. ".gitlab/ci/env_$env:CMAKE_CONFIGURATION.ps1"
}
diff --git a/.gitlab/ci/env_cuda12.2_clang.sh b/.gitlab/ci/env_cuda12.2_clang.sh
new file mode 100644
index 0000000..4b71b42
--- /dev/null
+++ b/.gitlab/ci/env_cuda12.2_clang.sh
@@ -0,0 +1,3 @@
+export CC=/usr/bin/clang-18
+export CXX=/usr/bin/clang++-18
+export CUDACXX=/usr/bin/clang++-18
diff --git a/.gitlab/ci/env_debian12_makefiles_clang.sh b/.gitlab/ci/env_debian12_makefiles_clang.sh
index eda7c1f..e46aa29 100644
--- a/.gitlab/ci/env_debian12_makefiles_clang.sh
+++ b/.gitlab/ci/env_debian12_makefiles_clang.sh
@@ -1,2 +1,6 @@
+if test "$CMAKE_CI_NIGHTLY" = "true"; then
+ source .gitlab/ci/ticlang-env.sh
+fi
+
export CC=/usr/bin/clang-15
export CXX=/usr/bin/clang++-15
diff --git a/.gitlab/ci/env_debian12_ninja_clang.sh b/.gitlab/ci/env_debian12_ninja_clang.sh
index eda7c1f..e46aa29 100644
--- a/.gitlab/ci/env_debian12_ninja_clang.sh
+++ b/.gitlab/ci/env_debian12_ninja_clang.sh
@@ -1,2 +1,6 @@
+if test "$CMAKE_CI_NIGHTLY" = "true"; then
+ source .gitlab/ci/ticlang-env.sh
+fi
+
export CC=/usr/bin/clang-15
export CXX=/usr/bin/clang++-15
diff --git a/.gitlab/ci/env_fedora39_common_clang.sh b/.gitlab/ci/env_fedora39_common_clang.sh
deleted file mode 100644
index 076669b..0000000
--- a/.gitlab/ci/env_fedora39_common_clang.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-export CC=/usr/bin/clang-17
-export CXX=/usr/bin/clang++-17
-export FC=/usr/bin/flang-new
diff --git a/.gitlab/ci/env_fedora39_makefiles_clang.sh b/.gitlab/ci/env_fedora39_makefiles_clang.sh
deleted file mode 100644
index 6200f82..0000000
--- a/.gitlab/ci/env_fedora39_makefiles_clang.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora39_common_clang.sh
diff --git a/.gitlab/ci/env_fedora39_makefiles_symlinked.cmake b/.gitlab/ci/env_fedora39_makefiles_symlinked.cmake
deleted file mode 100644
index 052e9a7..0000000
--- a/.gitlab/ci/env_fedora39_makefiles_symlinked.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/env_fedora39_makefiles.cmake")
diff --git a/.gitlab/ci/env_fedora39_makefiles_symlinked.sh b/.gitlab/ci/env_fedora39_makefiles_symlinked.sh
deleted file mode 100644
index 39ac189..0000000
--- a/.gitlab/ci/env_fedora39_makefiles_symlinked.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora39_makefiles.sh
diff --git a/.gitlab/ci/env_fedora39_ninja_clang.sh b/.gitlab/ci/env_fedora39_ninja_clang.sh
deleted file mode 100644
index 6200f82..0000000
--- a/.gitlab/ci/env_fedora39_ninja_clang.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora39_common_clang.sh
diff --git a/.gitlab/ci/env_fedora39_ninja_multi_clang.sh b/.gitlab/ci/env_fedora39_ninja_multi_clang.sh
deleted file mode 100644
index 6200f82..0000000
--- a/.gitlab/ci/env_fedora39_ninja_multi_clang.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora39_common_clang.sh
diff --git a/.gitlab/ci/env_fedora39_asan.sh b/.gitlab/ci/env_fedora40_asan.sh
index e976486..e976486 100644
--- a/.gitlab/ci/env_fedora39_asan.sh
+++ b/.gitlab/ci/env_fedora40_asan.sh
diff --git a/.gitlab/ci/env_fedora39_clang_analyzer.sh b/.gitlab/ci/env_fedora40_clang_analyzer.sh
index d732c0b..d732c0b 100644
--- a/.gitlab/ci/env_fedora39_clang_analyzer.sh
+++ b/.gitlab/ci/env_fedora40_clang_analyzer.sh
diff --git a/.gitlab/ci/env_fedora40_common_clang.sh b/.gitlab/ci/env_fedora40_common_clang.sh
new file mode 100644
index 0000000..a3861d0
--- /dev/null
+++ b/.gitlab/ci/env_fedora40_common_clang.sh
@@ -0,0 +1,3 @@
+export CC=/usr/bin/clang-18
+export CXX=/usr/bin/clang++-18
+export FC=/usr/bin/flang-new
diff --git a/.gitlab/ci/env_fedora39_extdeps.sh b/.gitlab/ci/env_fedora40_extdeps.sh
index 7076e18..7076e18 100644
--- a/.gitlab/ci/env_fedora39_extdeps.sh
+++ b/.gitlab/ci/env_fedora40_extdeps.sh
diff --git a/.gitlab/ci/env_fedora39_makefiles.cmake b/.gitlab/ci/env_fedora40_makefiles.cmake
index ef13cda..ef13cda 100644
--- a/.gitlab/ci/env_fedora39_makefiles.cmake
+++ b/.gitlab/ci/env_fedora40_makefiles.cmake
diff --git a/.gitlab/ci/env_fedora39_makefiles.sh b/.gitlab/ci/env_fedora40_makefiles.sh
index c482642..c482642 100644
--- a/.gitlab/ci/env_fedora39_makefiles.sh
+++ b/.gitlab/ci/env_fedora40_makefiles.sh
diff --git a/.gitlab/ci/env_fedora40_makefiles_clang.sh b/.gitlab/ci/env_fedora40_makefiles_clang.sh
new file mode 100644
index 0000000..2021086
--- /dev/null
+++ b/.gitlab/ci/env_fedora40_makefiles_clang.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora40_common_clang.sh
diff --git a/.gitlab/ci/env_fedora40_makefiles_symlinked.cmake b/.gitlab/ci/env_fedora40_makefiles_symlinked.cmake
new file mode 100644
index 0000000..d381807
--- /dev/null
+++ b/.gitlab/ci/env_fedora40_makefiles_symlinked.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/env_fedora40_makefiles.cmake")
diff --git a/.gitlab/ci/env_fedora40_makefiles_symlinked.sh b/.gitlab/ci/env_fedora40_makefiles_symlinked.sh
new file mode 100644
index 0000000..5a7584a
--- /dev/null
+++ b/.gitlab/ci/env_fedora40_makefiles_symlinked.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora40_makefiles.sh
diff --git a/.gitlab/ci/env_fedora39_ninja_multi.sh b/.gitlab/ci/env_fedora40_ninja.sh
index 217ff30..217ff30 100644
--- a/.gitlab/ci/env_fedora39_ninja_multi.sh
+++ b/.gitlab/ci/env_fedora40_ninja.sh
diff --git a/.gitlab/ci/env_fedora40_ninja_clang.sh b/.gitlab/ci/env_fedora40_ninja_clang.sh
new file mode 100644
index 0000000..2021086
--- /dev/null
+++ b/.gitlab/ci/env_fedora40_ninja_clang.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora40_common_clang.sh
diff --git a/.gitlab/ci/env_fedora39_ninja.sh b/.gitlab/ci/env_fedora40_ninja_multi.sh
index 217ff30..217ff30 100644
--- a/.gitlab/ci/env_fedora39_ninja.sh
+++ b/.gitlab/ci/env_fedora40_ninja_multi.sh
diff --git a/.gitlab/ci/env_fedora40_ninja_multi_clang.sh b/.gitlab/ci/env_fedora40_ninja_multi_clang.sh
new file mode 100644
index 0000000..2021086
--- /dev/null
+++ b/.gitlab/ci/env_fedora40_ninja_multi_clang.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora40_common_clang.sh
diff --git a/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1 b/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1
index f6e1f0a..f6e1f0a 100755..100644
--- a/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1
+++ b/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1
diff --git a/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1 b/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1
index f6e1f0a..f6e1f0a 100755..100644
--- a/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1
+++ b/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1
diff --git a/.gitlab/ci/env_windows_arm64_package.ps1 b/.gitlab/ci/env_windows_arm64_package.ps1
new file mode 100644
index 0000000..a898007
--- /dev/null
+++ b/.gitlab/ci/env_windows_arm64_package.ps1
@@ -0,0 +1 @@
+. .gitlab/ci/wix3-env.ps1
diff --git a/.gitlab/ci/env_windows_arm64_vs2022_ninja.ps1 b/.gitlab/ci/env_windows_arm64_vs2022_ninja.ps1
new file mode 100644
index 0000000..eb7bf6e
--- /dev/null
+++ b/.gitlab/ci/env_windows_arm64_vs2022_ninja.ps1
@@ -0,0 +1,2 @@
+& "$pwsh" -File .gitlab/ci/wix3.ps1
+& "$pwsh" -File .gitlab/ci/wix4.ps1
diff --git a/.gitlab/ci/env_windows_borland5.5.ps1 b/.gitlab/ci/env_windows_borland5.5.ps1
index 0d2e46b..0d2e46b 100755..100644
--- a/.gitlab/ci/env_windows_borland5.5.ps1
+++ b/.gitlab/ci/env_windows_borland5.5.ps1
diff --git a/.gitlab/ci/env_windows_borland5.8.ps1 b/.gitlab/ci/env_windows_borland5.8.ps1
index 0d2e46b..0d2e46b 100755..100644
--- a/.gitlab/ci/env_windows_borland5.8.ps1
+++ b/.gitlab/ci/env_windows_borland5.8.ps1
diff --git a/.gitlab/ci/env_windows_clang_ninja.ps1 b/.gitlab/ci/env_windows_clang_ninja.ps1
index 17002ef..17002ef 100755..100644
--- a/.gitlab/ci/env_windows_clang_ninja.ps1
+++ b/.gitlab/ci/env_windows_clang_ninja.ps1
diff --git a/.gitlab/ci/env_windows_clang_nmake.ps1 b/.gitlab/ci/env_windows_clang_nmake.ps1
index 89fa360..89fa360 100755..100644
--- a/.gitlab/ci/env_windows_clang_nmake.ps1
+++ b/.gitlab/ci/env_windows_clang_nmake.ps1
diff --git a/.gitlab/ci/env_windows_i386_package.ps1 b/.gitlab/ci/env_windows_i386_package.ps1
new file mode 100644
index 0000000..a898007
--- /dev/null
+++ b/.gitlab/ci/env_windows_i386_package.ps1
@@ -0,0 +1 @@
+. .gitlab/ci/wix3-env.ps1
diff --git a/.gitlab/ci/env_windows_intelclassic_ninja.ps1 b/.gitlab/ci/env_windows_intelclassic_ninja.ps1
index 99f83b9..99f83b9 100755..100644
--- a/.gitlab/ci/env_windows_intelclassic_ninja.ps1
+++ b/.gitlab/ci/env_windows_intelclassic_ninja.ps1
diff --git a/.gitlab/ci/env_windows_inteloneapi_ninja.ps1 b/.gitlab/ci/env_windows_inteloneapi_ninja.ps1
index 3bd1d46..3bd1d46 100755..100644
--- a/.gitlab/ci/env_windows_inteloneapi_ninja.ps1
+++ b/.gitlab/ci/env_windows_inteloneapi_ninja.ps1
diff --git a/.gitlab/ci/env_windows_msvc_v71_nmake.ps1 b/.gitlab/ci/env_windows_msvc_v71_nmake.ps1
index cb3806d..cb3806d 100755..100644
--- a/.gitlab/ci/env_windows_msvc_v71_nmake.ps1
+++ b/.gitlab/ci/env_windows_msvc_v71_nmake.ps1
diff --git a/.gitlab/ci/env_windows_openwatcom1.9.ps1 b/.gitlab/ci/env_windows_openwatcom1.9.ps1
index 49c28f7..49c28f7 100755..100644
--- a/.gitlab/ci/env_windows_openwatcom1.9.ps1
+++ b/.gitlab/ci/env_windows_openwatcom1.9.ps1
diff --git a/.gitlab/ci/env_windows_orangec6.73.1.ps1 b/.gitlab/ci/env_windows_orangec6.73.1.ps1
index 96e36a1..96e36a1 100755..100644
--- a/.gitlab/ci/env_windows_orangec6.73.1.ps1
+++ b/.gitlab/ci/env_windows_orangec6.73.1.ps1
diff --git a/.gitlab/ci/env_windows_vs2022_x64.ps1 b/.gitlab/ci/env_windows_vs2022_x64.ps1
index 42aec11..42aec11 100755..100644
--- a/.gitlab/ci/env_windows_vs2022_x64.ps1
+++ b/.gitlab/ci/env_windows_vs2022_x64.ps1
diff --git a/.gitlab/ci/env_windows_vs2022_x64_jom.ps1 b/.gitlab/ci/env_windows_vs2022_x64_jom.ps1
index c933421..c933421 100755..100644
--- a/.gitlab/ci/env_windows_vs2022_x64_jom.ps1
+++ b/.gitlab/ci/env_windows_vs2022_x64_jom.ps1
diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1
index 50a03ca..ae4a058 100755..100644
--- a/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1
+++ b/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1
@@ -1,4 +1,8 @@
if ("$env:CMAKE_CI_NIGHTLY" -eq "true") {
. ".gitlab/ci/innosetup-env.ps1"
. ".gitlab/ci/ispc-env.ps1"
+ . ".gitlab/ci/swift-env.ps1"
}
+
+& "$pwsh" -File .gitlab/ci/wix3.ps1
+& "$pwsh" -File .gitlab/ci/wix4.ps1
diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1
index 44bb090..44bb090 100755..100644
--- a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1
+++ b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1
diff --git a/.gitlab/ci/env_windows_vs2022_x64_nmake.ps1 b/.gitlab/ci/env_windows_vs2022_x64_nmake.ps1
index 62463cd..62463cd 100755..100644
--- a/.gitlab/ci/env_windows_vs2022_x64_nmake.ps1
+++ b/.gitlab/ci/env_windows_vs2022_x64_nmake.ps1
diff --git a/.gitlab/ci/env_windows_x86_64_package.ps1 b/.gitlab/ci/env_windows_x86_64_package.ps1
new file mode 100644
index 0000000..a898007
--- /dev/null
+++ b/.gitlab/ci/env_windows_x86_64_package.ps1
@@ -0,0 +1 @@
+. .gitlab/ci/wix3-env.ps1
diff --git a/.gitlab/ci/innosetup-env.ps1 b/.gitlab/ci/innosetup-env.ps1
index 96e9d8c..96e9d8c 100755..100644
--- a/.gitlab/ci/innosetup-env.ps1
+++ b/.gitlab/ci/innosetup-env.ps1
diff --git a/.gitlab/ci/innosetup.ps1 b/.gitlab/ci/innosetup.ps1
index a7f4eb3..a7f4eb3 100755..100644
--- a/.gitlab/ci/innosetup.ps1
+++ b/.gitlab/ci/innosetup.ps1
diff --git a/.gitlab/ci/intel-env.ps1 b/.gitlab/ci/intel-env.ps1
index 75f7286..75f7286 100755..100644
--- a/.gitlab/ci/intel-env.ps1
+++ b/.gitlab/ci/intel-env.ps1
diff --git a/.gitlab/ci/intel-vars.ps1 b/.gitlab/ci/intel-vars.ps1
index dde0aa2..dde0aa2 100755..100644
--- a/.gitlab/ci/intel-vars.ps1
+++ b/.gitlab/ci/intel-vars.ps1
diff --git a/.gitlab/ci/intel.ps1 b/.gitlab/ci/intel.ps1
index 2262669..2262669 100755..100644
--- a/.gitlab/ci/intel.ps1
+++ b/.gitlab/ci/intel.ps1
diff --git a/.gitlab/ci/ispc-env.ps1 b/.gitlab/ci/ispc-env.ps1
index 816c485..816c485 100755..100644
--- a/.gitlab/ci/ispc-env.ps1
+++ b/.gitlab/ci/ispc-env.ps1
diff --git a/.gitlab/ci/ispc.ps1 b/.gitlab/ci/ispc.ps1
index 524896f..524896f 100755..100644
--- a/.gitlab/ci/ispc.ps1
+++ b/.gitlab/ci/ispc.ps1
diff --git a/.gitlab/ci/jom.ps1 b/.gitlab/ci/jom.ps1
index 6c28005..6c28005 100755..100644
--- a/.gitlab/ci/jom.ps1
+++ b/.gitlab/ci/jom.ps1
diff --git a/.gitlab/ci/mingw-env.ps1 b/.gitlab/ci/mingw-env.ps1
index d68a7f7..d68a7f7 100755..100644
--- a/.gitlab/ci/mingw-env.ps1
+++ b/.gitlab/ci/mingw-env.ps1
diff --git a/.gitlab/ci/mingw.ps1 b/.gitlab/ci/mingw.ps1
index a1b5b11..a1b5b11 100755..100644
--- a/.gitlab/ci/mingw.ps1
+++ b/.gitlab/ci/mingw.ps1
diff --git a/.gitlab/ci/msvc.ps1 b/.gitlab/ci/msvc.ps1
index e8388a4..e8388a4 100755..100644
--- a/.gitlab/ci/msvc.ps1
+++ b/.gitlab/ci/msvc.ps1
diff --git a/.gitlab/ci/ninja-env.ps1 b/.gitlab/ci/ninja-env.ps1
index 67c7036..67c7036 100755..100644
--- a/.gitlab/ci/ninja-env.ps1
+++ b/.gitlab/ci/ninja-env.ps1
diff --git a/.gitlab/ci/ninja-env.sh b/.gitlab/ci/ninja-env.sh
new file mode 100644
index 0000000..744b9f3
--- /dev/null
+++ b/.gitlab/ci/ninja-env.sh
@@ -0,0 +1,3 @@
+.gitlab/ci/ninja.sh
+export PATH=$PWD/.gitlab:$PATH
+ninja --version
diff --git a/.gitlab/ci/ninja-nightly.ps1 b/.gitlab/ci/ninja-nightly.ps1
index 071b077..071b077 100755..100644
--- a/.gitlab/ci/ninja-nightly.ps1
+++ b/.gitlab/ci/ninja-nightly.ps1
diff --git a/.gitlab/ci/ninja.ps1 b/.gitlab/ci/ninja.ps1
index 0af3b4f..0af3b4f 100755..100644
--- a/.gitlab/ci/ninja.ps1
+++ b/.gitlab/ci/ninja.ps1
diff --git a/.gitlab/ci/openwatcom-env.ps1 b/.gitlab/ci/openwatcom-env.ps1
index 14ea523..14ea523 100755..100644
--- a/.gitlab/ci/openwatcom-env.ps1
+++ b/.gitlab/ci/openwatcom-env.ps1
diff --git a/.gitlab/ci/openwatcom.ps1 b/.gitlab/ci/openwatcom.ps1
index 4f1012c..4f1012c 100755..100644
--- a/.gitlab/ci/openwatcom.ps1
+++ b/.gitlab/ci/openwatcom.ps1
diff --git a/.gitlab/ci/orangec-env.ps1 b/.gitlab/ci/orangec-env.ps1
index 3a5d232..3a5d232 100755..100644
--- a/.gitlab/ci/orangec-env.ps1
+++ b/.gitlab/ci/orangec-env.ps1
diff --git a/.gitlab/ci/orangec.ps1 b/.gitlab/ci/orangec.ps1
index 2201e12..2201e12 100755..100644
--- a/.gitlab/ci/orangec.ps1
+++ b/.gitlab/ci/orangec.ps1
diff --git a/.gitlab/ci/package_windows.ps1 b/.gitlab/ci/package_windows.ps1
index 9ec2942..9ec2942 100755..100644
--- a/.gitlab/ci/package_windows.ps1
+++ b/.gitlab/ci/package_windows.ps1
diff --git a/.gitlab/ci/post_build.ps1 b/.gitlab/ci/post_build.ps1
index fbd8ae8..fbd8ae8 100755..100644
--- a/.gitlab/ci/post_build.ps1
+++ b/.gitlab/ci/post_build.ps1
diff --git a/.gitlab/ci/post_build_fedora40_tidy.sh b/.gitlab/ci/post_build_fedora40_tidy.sh
new file mode 100644
index 0000000..a36663a
--- /dev/null
+++ b/.gitlab/ci/post_build_fedora40_tidy.sh
@@ -0,0 +1,21 @@
+git config user.name "Kitware Robot"
+git config user.email "kwrobot@kitware.com"
+
+clang-apply-replacements --style=file .gitlab/clang-tidy-fixes
+git add .
+
+if [ -n "$(git status --porcelain)" ]; then
+ quietly git commit --file=- <<EOF
+WIP: clang-tidy: <SHORT DESCRIPTION OF CHANGE HERE>
+
+<LONGER DESCRIPTION OF CHANGE HERE.>
+EOF
+ git format-patch --output=clang-tidy-fixes.patch -1 -N
+ echo "Patch from clang-tidy available, check artifacts of this CI job." >&2
+fi
+
+readonly num_warnings="$(cat .gitlab/num_warnings.txt)"
+if [ "$num_warnings" -ne 0 ]; then
+ echo "Found $num_warnings warnings (treating as fatal)." >&2
+ exit 1
+fi
diff --git a/.gitlab/ci/post_build_windows_arm64_package.ps1 b/.gitlab/ci/post_build_windows_arm64_package.ps1
index f98d995..f98d995 100755..100644
--- a/.gitlab/ci/post_build_windows_arm64_package.ps1
+++ b/.gitlab/ci/post_build_windows_arm64_package.ps1
diff --git a/.gitlab/ci/post_build_windows_i386_package.ps1 b/.gitlab/ci/post_build_windows_i386_package.ps1
index f98d995..f98d995 100755..100644
--- a/.gitlab/ci/post_build_windows_i386_package.ps1
+++ b/.gitlab/ci/post_build_windows_i386_package.ps1
diff --git a/.gitlab/ci/post_build_windows_x86_64_package.ps1 b/.gitlab/ci/post_build_windows_x86_64_package.ps1
index f98d995..f98d995 100755..100644
--- a/.gitlab/ci/post_build_windows_x86_64_package.ps1
+++ b/.gitlab/ci/post_build_windows_x86_64_package.ps1
diff --git a/.gitlab/ci/pre_build.ps1 b/.gitlab/ci/pre_build.ps1
index 3a56687..3a56687 100755..100644
--- a/.gitlab/ci/pre_build.ps1
+++ b/.gitlab/ci/pre_build.ps1
diff --git a/.gitlab/ci/pre_build_fedora39_tidy.sh b/.gitlab/ci/pre_build_fedora40_tidy.sh
index 7580ef1..7580ef1 100644
--- a/.gitlab/ci/pre_build_fedora39_tidy.sh
+++ b/.gitlab/ci/pre_build_fedora40_tidy.sh
diff --git a/.gitlab/ci/python-env.ps1 b/.gitlab/ci/python-env.ps1
index ce16493..ce16493 100755..100644
--- a/.gitlab/ci/python-env.ps1
+++ b/.gitlab/ci/python-env.ps1
diff --git a/.gitlab/ci/python.ps1 b/.gitlab/ci/python.ps1
index 27f1807..27f1807 100755..100644
--- a/.gitlab/ci/python.ps1
+++ b/.gitlab/ci/python.ps1
diff --git a/.gitlab/ci/qt-env.ps1 b/.gitlab/ci/qt-env.ps1
index 22b1099..22b1099 100755..100644
--- a/.gitlab/ci/qt-env.ps1
+++ b/.gitlab/ci/qt-env.ps1
diff --git a/.gitlab/ci/repackage/wix.ps1 b/.gitlab/ci/repackage/wix.ps1
new file mode 100644
index 0000000..6dbd466
--- /dev/null
+++ b/.gitlab/ci/repackage/wix.ps1
@@ -0,0 +1,55 @@
+# WiX Toolset 4+ is provided only via nuget packages.
+# Download the package artifacts, extract the parts we need, and repackage them.
+
+param (
+ [Parameter(Mandatory=$true)]
+ [string]$version
+ )
+
+$erroractionpreference = "stop"
+
+$version_major = $version.Substring(0, $version.IndexOf('.'))
+
+$release = "v" + $version
+$pkg_wix = "wix.$version.nupkg"
+$pkg_wixui = "WixToolset.UI.wixext.$version.nupkg"
+$packages = $pkg_wix, $pkg_wixui
+
+$wix_artifacts = "wix-artifacts.zip"
+
+$ProgressPreference = 'SilentlyContinue'
+Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix/releases/download/$release/artifacts.zip" -OutFile "$wix_artifacts"
+
+Add-Type -AssemblyName System.IO.Compression.FileSystem
+
+$zip = [System.IO.Compression.ZipFile]::Open("$wix_artifacts", "read")
+$zip.Entries | Where-Object FullName -in $packages | ForEach-Object {
+ [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, "$($_.Name)", $true)
+}
+$zip.Dispose()
+Remove-Item "$wix_artifacts"
+
+$wix_dir = "wix-$version-win-any-1"
+[System.IO.Compression.ZipFile]::ExtractToDirectory($pkg_wix, "wix-tmp")
+Move-Item -Path "wix-tmp/tools/net6.0/any" -Destination "$wix_dir"
+Remove-Item "wix-tmp" -Recurse -Force
+Remove-Item "$pkg_wix"
+
+$ext_dir = New-Item -Force -ItemType Directory -Path "$wix_dir/.wix/extensions/WixToolset.UI.wixext/$version/wixext$version_major"
+$zip = [System.IO.Compression.ZipFile]::Open($pkg_wixui, "read")
+$zip.Entries | Where-Object Name -eq "WixToolset.UI.wixext.dll" | ForEach-Object {
+ [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, (Join-Path $ext_dir $_.Name), $true)
+}
+$zip.Dispose()
+Remove-Item "$pkg_wixui"
+
+@"
+This was extracted from WiX Toolset nuget packages and repackaged.
+Point both PATH and WIX_EXTENSIONS environment variables at this directory.
+
+"@ | Add-Content -NoNewline "$wix_dir/README.txt"
+
+$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
+$includeBaseDirectory = $true
+[System.IO.Compression.ZipFile]::CreateFromDirectory("$wix_dir", "$wix_dir.zip", $compressionLevel, $includeBaseDirectory)
+Remove-Item "$wix_dir" -Recurse -Force
diff --git a/.gitlab/ci/sccache-env.ps1 b/.gitlab/ci/sccache-env.ps1
new file mode 100644
index 0000000..66dc6eb
--- /dev/null
+++ b/.gitlab/ci/sccache-env.ps1
@@ -0,0 +1 @@
+Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$env:SCCACHE_PATH"
diff --git a/.gitlab/ci/sccache-env.sh b/.gitlab/ci/sccache-env.sh
new file mode 100644
index 0000000..4b170a4
--- /dev/null
+++ b/.gitlab/ci/sccache-env.sh
@@ -0,0 +1,2 @@
+.gitlab/ci/sccache.sh
+export PATH="$PWD/.gitlab:$PATH"
diff --git a/.gitlab/ci/swift-env.ps1 b/.gitlab/ci/swift-env.ps1
new file mode 100644
index 0000000..871b31c
--- /dev/null
+++ b/.gitlab/ci/swift-env.ps1
@@ -0,0 +1,6 @@
+$pwdpath = $pwd.Path
+& "$pwsh" -File ".gitlab/ci/swift.ps1"
+Set-Item -Force -Path "env:DEVELOPER_DIR" -Value "$pwdpath\.gitlab\swift"
+Set-Item -Force -Path "env:SDKROOT" -Value "$pwdpath\.gitlab\swift\Platforms\Windows.platform\Developer\SDKs\Windows.sdk"
+Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\swift\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin;$env:PATH"
+swiftc --version
diff --git a/.gitlab/ci/swift.ps1 b/.gitlab/ci/swift.ps1
new file mode 100644
index 0000000..b970dce
--- /dev/null
+++ b/.gitlab/ci/swift.ps1
@@ -0,0 +1,38 @@
+$erroractionpreference = "stop"
+
+$version = "5.9.2"
+$sha256sum = "8C053108528EB2DAD84C33D6F0834A3A1444D21BA1A89D591AB149304A62F6B5"
+$filename = "swift-$version-win-x86_64-1"
+$tarball = "$filename.zip"
+
+$outdir = $pwd.Path
+$outdir = "$outdir\.gitlab"
+$ProgressPreference = 'SilentlyContinue'
+# This URL is only visible inside of Kitware's network. See above filename table.
+Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/internal/$tarball" -OutFile "$outdir\$tarball"
+$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
+if ($hash.Hash -ne $sha256sum) {
+ exit 1
+}
+
+Add-Type -AssemblyName System.IO.Compression.FileSystem
+[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
+Move-Item -Path "$outdir\$filename" -Destination "$outdir\swift"
+Remove-Item "$outdir\$tarball"
+
+$bin = "$outdir\swift\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin"
+$null = New-Item -ItemType HardLink -Path "$bin\clang++.exe" -Target "$bin\clang.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\clang-cl.exe" -Target "$bin\clang.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\clang-cpp.exe" -Target "$bin\clang.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\ld.lld.exe" -Target "$bin\lld.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\ld64.lld.exe" -Target "$bin\lld.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\lld-link.exe" -Target "$bin\lld.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\llvm-dlltool.exe" -Target "$bin\llvm-ar.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\llvm-lib.exe" -Target "$bin\llvm-ar.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\llvm-ranlib.exe" -Target "$bin\llvm-ar.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\llvm-objcopy.exe" -Target "$bin\llvm-strip.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\swiftc.exe" -Target "$bin\swift.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\swift-api-digester.exe" -Target "$bin\swift-frontend.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\swift-autolink-extract.exe" -Target "$bin\swift-frontend.exe"
+$null = New-Item -ItemType HardLink -Path "$bin\swift-symbolgraph-extract.exe" -Target "$bin\swift-frontend.exe"
+Clear-Variable -Name bin
diff --git a/.gitlab/ci/ticlang-env.sh b/.gitlab/ci/ticlang-env.sh
new file mode 100644
index 0000000..448c0d7
--- /dev/null
+++ b/.gitlab/ci/ticlang-env.sh
@@ -0,0 +1,2 @@
+.gitlab/ci/ticlang.sh
+.gitlab/ticlang/bin/tiarmclang --version
diff --git a/.gitlab/ci/ticlang.sh b/.gitlab/ci/ticlang.sh
new file mode 100755
index 0000000..66fa863
--- /dev/null
+++ b/.gitlab/ci/ticlang.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+case "$(uname -s)-$(uname -m)" in
+ Linux-x86_64)
+ shatool="sha256sum"
+ sha256sum="c69ac58e403b82eac1c407cc67b35fab5d95c5d8db75b019095f9412aacff27d"
+ filename="ti_cgt_armllvm_3.2.1.LTS_linux-x64_installer.bin"
+ dirname="ti-cgt-armllvm_3.2.1.LTS"
+ ;;
+ *)
+ echo "Unrecognized platform $(uname -s)-$(uname -m)"
+ exit 1
+ ;;
+esac
+readonly shatool
+readonly sha256sum
+
+cd .gitlab
+
+echo "$sha256sum $filename" > ticlang.sha256sum
+curl -OL "https://cmake.org/files/dependencies/internal/$filename"
+$shatool --check ticlang.sha256sum
+chmod +x "$filename"
+"./$filename" --mode unattended --prefix .
+mv "$dirname" ticlang
+rm -f "$filename" ticlang.sha256sum
diff --git a/.gitlab/ci/vcvarsall.ps1 b/.gitlab/ci/vcvarsall.ps1
index f91b100..f91b100 100755..100644
--- a/.gitlab/ci/vcvarsall.ps1
+++ b/.gitlab/ci/vcvarsall.ps1
diff --git a/.gitlab/ci/wix.ps1 b/.gitlab/ci/wix.ps1
deleted file mode 100755
index b7cb3f3..0000000
--- a/.gitlab/ci/wix.ps1
+++ /dev/null
@@ -1,19 +0,0 @@
-$erroractionpreference = "stop"
-
-$release = "v3.14.0.6526"
-$sha256sum = "4C89898DF3BCAB13E12F7CA54399C35AD273475AD2CB6284611D00AE2D063C2C"
-$filename = "wix-3.14.0.6526-win-i386"
-$tarball = "$filename.zip"
-
-$outdir = $pwd.Path
-$outdir = "$outdir\.gitlab"
-$ProgressPreference = 'SilentlyContinue'
-#Invoke-WebRequest -Uri "https://wixtoolset.org/downloads/$release/$tarball" -OutFile "$outdir\$tarball"
-Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/$tarball" -OutFile "$outdir\$tarball"
-$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
-if ($hash.Hash -ne $sha256sum) {
- exit 1
-}
-
-Add-Type -AssemblyName System.IO.Compression.FileSystem
-[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir\wix\bin")
diff --git a/.gitlab/ci/wix3-env.ps1 b/.gitlab/ci/wix3-env.ps1
new file mode 100644
index 0000000..a872b74
--- /dev/null
+++ b/.gitlab/ci/wix3-env.ps1
@@ -0,0 +1,6 @@
+& "$pwsh" -File .gitlab/ci/wix3.ps1
+
+$pwdpath = $pwd.Path
+Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\wix3;$env:PATH"
+
+light -help | Select -First 1
diff --git a/.gitlab/ci/wix3.ps1 b/.gitlab/ci/wix3.ps1
new file mode 100644
index 0000000..8f5ae4b
--- /dev/null
+++ b/.gitlab/ci/wix3.ps1
@@ -0,0 +1,21 @@
+$erroractionpreference = "stop"
+
+$release = "wix314rtm"
+$sha256sum = "13F067F38969FAF163D93A804B48EA0576790A202C8F10291F2000F0E356E934"
+#$filename = "wix314-binaries"
+$filename = "wix-3.14.0.8606-win-i386"
+$tarball = "$filename.zip"
+
+$outdir = $pwd.Path
+$outdir = "$outdir\.gitlab"
+$ProgressPreference = 'SilentlyContinue'
+#Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/$release/$tarball" -OutFile "$outdir\$tarball"
+Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/$tarball" -OutFile "$outdir\$tarball"
+$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
+if ($hash.Hash -ne $sha256sum) {
+ exit 1
+}
+
+Add-Type -AssemblyName System.IO.Compression.FileSystem
+[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir\wix3")
+Remove-Item "$outdir\$tarball"
diff --git a/.gitlab/ci/wix4.ps1 b/.gitlab/ci/wix4.ps1
new file mode 100644
index 0000000..6209f2b
--- /dev/null
+++ b/.gitlab/ci/wix4.ps1
@@ -0,0 +1,20 @@
+$erroractionpreference = "stop"
+
+$version = "4.0.4"
+$sha256sum = "FB6E94C89B12FB65D3AA0CF9E9C630DAFCC7D57F1E66C7D6035CAD37A38CC284"
+$filename = "wix-$version-win-any-1"
+$tarball = "$filename.zip"
+
+$outdir = $pwd.Path
+$outdir = "$outdir\.gitlab"
+$ProgressPreference = 'SilentlyContinue'
+Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/$tarball" -OutFile "$outdir\$tarball"
+$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
+if ($hash.Hash -ne $sha256sum) {
+ exit 1
+}
+
+Add-Type -AssemblyName System.IO.Compression.FileSystem
+[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
+Move-Item -Path "$outdir\$filename" -Destination "$outdir\wix4"
+Remove-Item "$outdir\$tarball"
diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml
index f529ab2..f9fd6c2 100644
--- a/.gitlab/os-linux.yml
+++ b/.gitlab/os-linux.yml
@@ -5,7 +5,7 @@
### Release
.linux_prep_source:
- image: "fedora:39"
+ image: "fedora:40"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
@@ -45,7 +45,7 @@
### Debian
.debian12:
- image: "kitware/cmake:ci-debian12-x86_64-2023-07-27"
+ image: "kitware/cmake:ci-debian12-x86_64-2024-03-04"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
@@ -68,46 +68,53 @@
### Fedora
-.fedora39:
- image: "kitware/cmake:ci-fedora39-x86_64-2023-11-16"
+.fedora40:
+ image: "kitware/cmake:ci-fedora40-x86_64-2024-04-24"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes"
CMAKE_ARCH: x86_64
+# FIXME(#25932): Our HIP tests do not fully work in CI with Fedora 40.
+.fedora39_hip:
+ image: "kitware/cmake:ci-fedora39-hip-x86_64-2024-04-24"
+
+ variables:
+ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
+ CMAKE_ARCH: x86_64
+
#### Lint builds
-.fedora39_tidy:
- extends: .fedora39
+.fedora40_tidy:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_tidy
- CTEST_NO_WARNINGS_ALLOWED: 1
+ CMAKE_CONFIGURATION: fedora40_tidy
CMAKE_CI_NO_INSTALL: 1
-.fedora39_clang_analyzer:
- extends: .fedora39
+.fedora40_clang_analyzer:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_clang_analyzer
+ CMAKE_CONFIGURATION: fedora40_clang_analyzer
CMAKE_CI_BUILD_TYPE: Debug
CTEST_NO_WARNINGS_ALLOWED: 1
CMAKE_CI_NO_INSTALL: 1
-.fedora39_sphinx:
- extends: .fedora39
+.fedora40_sphinx:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_sphinx
+ CMAKE_CONFIGURATION: fedora40_sphinx
CTEST_NO_WARNINGS_ALLOWED: 1
CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
CMAKE_CI_NO_INSTALL: 1
-.fedora39_sphinx_package:
- extends: .fedora39
+.fedora40_sphinx_package:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_sphinx_package
+ CMAKE_CONFIGURATION: fedora40_sphinx_package
CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
#### Build and test
@@ -163,43 +170,43 @@
CMAKE_CI_BUILD_TYPE: Release
CTEST_NO_WARNINGS_ALLOWED: 1
-.fedora39_extdeps:
- extends: .fedora39
+.fedora40_extdeps:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_extdeps
+ CMAKE_CONFIGURATION: fedora40_extdeps
CMAKE_CI_BUILD_TYPE: Release
CTEST_NO_WARNINGS_ALLOWED: 1
-.fedora39_ninja:
- extends: .fedora39
+.fedora40_ninja:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_ninja
+ CMAKE_CONFIGURATION: fedora40_ninja
CMAKE_CI_BUILD_TYPE: Release
CTEST_NO_WARNINGS_ALLOWED: 1
-.fedora39_ninja_multi:
- extends: .fedora39
+.fedora40_ninja_multi:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_ninja_multi
+ CMAKE_CONFIGURATION: fedora40_ninja_multi
CTEST_NO_WARNINGS_ALLOWED: 1
CMAKE_GENERATOR: "Ninja Multi-Config"
-.fedora39_makefiles:
- extends: .fedora39
+.fedora40_makefiles:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_makefiles
+ CMAKE_CONFIGURATION: fedora40_makefiles
CTEST_NO_WARNINGS_ALLOWED: 1
CMAKE_GENERATOR: "Unix Makefiles"
-.fedora39_makefiles_symlinked:
- extends: .fedora39
+.fedora40_makefiles_symlinked:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_makefiles_symlinked
+ CMAKE_CONFIGURATION: fedora40_makefiles_symlinked
CTEST_NO_WARNINGS_ALLOWED: 1
CMAKE_GENERATOR: "Unix Makefiles"
CMAKE_CI_IN_SYMLINK_TREE: 1
@@ -220,24 +227,24 @@
variables:
CMAKE_CONFIGURATION: debian12_ninja_clang
-.fedora39_makefiles_clang:
- extends: .fedora39
+.fedora40_makefiles_clang:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_makefiles_clang
+ CMAKE_CONFIGURATION: fedora40_makefiles_clang
CMAKE_GENERATOR: "Unix Makefiles"
-.fedora39_ninja_clang:
- extends: .fedora39
+.fedora40_ninja_clang:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_ninja_clang
+ CMAKE_CONFIGURATION: fedora40_ninja_clang
-.fedora39_ninja_multi_clang:
- extends: .fedora39
+.fedora40_ninja_multi_clang:
+ extends: .fedora40
variables:
- CMAKE_CONFIGURATION: fedora39_ninja_multi_clang
+ CMAKE_CONFIGURATION: fedora40_ninja_multi_clang
CMAKE_GENERATOR: "Ninja Multi-Config"
### Sanitizers
@@ -253,13 +260,13 @@
CTEST_MEMORYCHECK_TYPE: AddressSanitizer
CTEST_MEMORYCHECK_SANITIZER_OPTIONS: ""
-.fedora39_asan:
+.fedora40_asan:
extends:
- - .fedora39
+ - .fedora40
- .fedora_asan_addon
variables:
- CMAKE_CONFIGURATION: fedora39_asan
+ CMAKE_CONFIGURATION: fedora40_asan
### Intel Compiler
@@ -368,6 +375,24 @@
CMAKE_CONFIGURATION: cuda11.8_splayed_nvidia
CTEST_NO_WARNINGS_ALLOWED: 1
+.cuda12.2:
+ extends: .cuda
+ image: "kitware/cmake:ci-cuda12.2-x86_64-2024-04-05"
+ variables:
+ CMAKE_ARCH: x86_64
+
+.cuda12.2_nvidia:
+ extends: .cuda12.2
+ variables:
+ CMAKE_CONFIGURATION: cuda12.2_nvidia
+ CTEST_NO_WARNINGS_ALLOWED: 1
+
+.cuda12.2_clang:
+ extends: .cuda12.2
+ variables:
+ CMAKE_CONFIGURATION: cuda12.2_clang
+ CTEST_NO_WARNINGS_ALLOWED: 1
+
### HIP builds
.hip5.5:
@@ -393,7 +418,7 @@
CTEST_LABELS: "HIP"
.fedora39_hip_radeon:
- extends: .fedora39
+ extends: .fedora39_hip
variables:
CMAKE_CONFIGURATION: fedora39_hip_radeon
@@ -406,30 +431,6 @@
CMAKE_CONFIGURATION: hip5.5_nvidia
CTEST_LABELS: "HIP"
-### C++ modules
-
-.gcc_cxx_modules_x86_64:
- image: "kitware/cmake:ci-gcc_cxx_modules-x86_64-2023-09-21"
-
- variables:
- GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
- CMAKE_ARCH: x86_64
- CC: "/opt/gcc-p1689/bin/gcc"
- CXX: "/opt/gcc-p1689/bin/g++"
-
-.gcc_cxx_modules_ninja:
- extends: .gcc_cxx_modules_x86_64
-
- variables:
- CMAKE_CONFIGURATION: linux_gcc_cxx_modules_ninja
-
-.gcc_cxx_modules_ninja_multi:
- extends: .gcc_cxx_modules_x86_64
-
- variables:
- CMAKE_CONFIGURATION: linux_gcc_cxx_modules_ninja_multi
- CMAKE_GENERATOR: "Ninja Multi-Config"
-
### Debian 10 legacy packages
.debian10:
@@ -494,12 +495,8 @@
.before_script_linux: &before_script_linux
- source .gitlab/ci/env.sh
- - .gitlab/ci/cmake.sh
- - export PATH=$PWD/.gitlab/cmake/bin:$PATH
- - .gitlab/ci/ninja.sh
- - export PATH=$PWD/.gitlab:$PATH
- - cmake --version
- - ninja --version
+ - source .gitlab/ci/cmake-env.sh
+ - source .gitlab/ci/ninja-env.sh
.cmake_prep_source_linux:
stage: prep
@@ -509,8 +506,8 @@
- dnf install --setopt=install_weak_deps=False -y git-core
- v="$(.gitlab/ci/cmake_version.sh)"
- mkdir -p build/
- - git archive --format=tgz "--prefix=cmake-$v/" -o "build/cmake-$v.tar.gz" HEAD
- - git -c core.autocrlf=true -c core.eol=crlf archive --format=zip --prefix="cmake-$v/" -o "build/cmake-$v.zip" HEAD
+ - git archive --format=tgz --prefix="cmake-$v/" -o "build/cmake-$v.tar.gz" HEAD
+ - git archive --format=zip --prefix="cmake-$v/" -o "build/cmake-$v.zip" HEAD
interruptible: true
@@ -526,7 +523,7 @@
.cmake_codespell_linux:
stage: build
- extends: .fedora39
+ extends: .fedora40
script:
- .gitlab/ci/codespell.sh
interruptible: true
@@ -574,8 +571,7 @@
- mkdir -p build/
- cp Utilities/Release/linux/$CMAKE_ARCH/cache.txt build/CMakeCache.txt
# Make sccache available.
- - .gitlab/ci/sccache.sh
- - export PATH=$PWD/.gitlab:$PATH
+ - source .gitlab/ci/sccache-env.sh
# Append sccache settings to the cache.
- echo "CMAKE_C_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
- echo "CMAKE_CXX_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
@@ -670,7 +666,7 @@
.cmake_org_help:
stage: build
extends:
- - .fedora39
+ - .fedora40
- .linux_x86_64_tags
- .cmake_org_help_artifacts
script:
diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml
index 23c68d5..894d624 100644
--- a/.gitlab/os-macos.yml
+++ b/.gitlab/os-macos.yml
@@ -175,12 +175,8 @@
.before_script_macos: &before_script_macos
- source .gitlab/ci/env.sh
- - .gitlab/ci/cmake.sh
- - export PATH=$PWD/.gitlab/cmake/bin:$PATH
- - .gitlab/ci/ninja.sh
- - export PATH=$PWD/.gitlab:$PATH
- - cmake --version
- - ninja --version
+ - source .gitlab/ci/cmake-env.sh
+ - source .gitlab/ci/ninja-env.sh
# Download Qt
- cmake -P .gitlab/ci/download_qt.cmake
- export CMAKE_PREFIX_PATH=$PWD/.gitlab/qt${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}
diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml
index c449ab8..1372136 100644
--- a/.gitlab/os-windows.yml
+++ b/.gitlab/os-windows.yml
@@ -337,12 +337,23 @@
- msvc-19.36
- concurrent
-.windows_x86_64_tags_concurrent_vs2019:
+.windows_x86_64_tags_concurrent_vs2022_android:
+ tags:
+ - cmake # Since this is a bare runner, pin to a project.
+ - windows-x86_64
+ - shell
+ - vs2022
+ - vs17-android
+ - msvc-19.36
+ - concurrent
+
+.windows_x86_64_tags_concurrent_vs2019_android:
tags:
- cmake # Since this is a bare runner, pin to a project.
- windows-x86_64
- shell
- vs2019
+ - vs16-android
- msvc-19.29-16.11
- concurrent
@@ -375,15 +386,8 @@
.before_script_windows: &before_script_windows
- . .gitlab/ci/env.ps1
- - $pwdpath = $pwd.Path
- - (& "$pwsh" -File ".gitlab/ci/wix.ps1")
- - Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix"
- - (& "$pwsh" -File ".gitlab/ci/cmake.ps1")
- - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH"
- - $cmake = "cmake"
+ - . .gitlab/ci/cmake-env.ps1
- . .gitlab/ci/ninja-env.ps1
- - (& "$env:WIX\bin\light.exe" -help) | Select -First 1
- - cmake --version
- . .gitlab/ci/qt-env.ps1
- . .gitlab/ci/python-env.ps1
@@ -396,7 +400,7 @@
script:
- *before_script_windows
- - Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$env:SCCACHE_PATH"
+ - . .gitlab/ci/sccache-env.ps1
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- sccache --start-server
- sccache --show-stats
diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml
index b85b728..0402d33 100644
--- a/.gitlab/rules.yml
+++ b/.gitlab/rules.yml
@@ -4,6 +4,8 @@
rules:
- if: '$CMAKE_CI_PACKAGE != null'
when: never
+ - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false")'
+ when: never
- if: '$CMAKE_CI_NIGHTLY == "true"'
when: on_success
- if: '$CMAKE_CI_JOB_NIGHTLY == "true"'
@@ -25,6 +27,8 @@
rules:
- if: '$CMAKE_CI_PACKAGE != null'
when: never
+ - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false")'
+ when: never
- if: '$CMAKE_CI_NIGHTLY == "true"'
when: on_success
- if: '$CMAKE_CI_JOB_NIGHTLY == "true"'
@@ -46,6 +50,8 @@
rules:
- if: '$CMAKE_CI_PACKAGE != null'
when: never
+ - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false")'
+ when: never
- if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_NIGHTLY_IGNORE_DEPS == "true")'
when: always
- if: '$CMAKE_CI_NIGHTLY == "true"'
diff --git a/.gitlab/upload.yml b/.gitlab/upload.yml
index 56793af..6b46313 100644
--- a/.gitlab/upload.yml
+++ b/.gitlab/upload.yml
@@ -1,7 +1,7 @@
# Steps for uploading artifacts
.rsync_upload_package:
- image: "fedora:39"
+ image: "fedora:40"
stage: upload
tags:
- cmake
@@ -21,7 +21,7 @@
.rsync_upload_help:
stage: upload
- image: "fedora:39"
+ image: "fedora:40"
tags:
- cmake
- docker
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index 6bd23bf..cfa0173 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -1,4 +1,4 @@
-;;; cmake-mode.el --- major-mode for editing CMake sources
+;;; cmake-mode.el --- major-mode for editing CMake sources -*- lexical-binding: t; -*-
;; Package-Requires: ((emacs "24.1"))
@@ -258,15 +258,6 @@ Return t unless search stops due to end of buffer."
(forward-line)
t)))
-(defun cmake-mark-defun ()
- "Mark the current CMake function or macro.
-
-This puts the mark at the end, and point at the beginning."
- (interactive)
- (cmake-end-of-defun)
- (push-mark nil :nomsg :activate)
- (cmake-beginning-of-defun))
-
;------------------------------------------------------------------------------
@@ -346,6 +337,10 @@ This puts the mark at the end, and point at the beginning."
(define-derived-mode cmake-mode prog-mode "CMake"
"Major mode for editing CMake source files."
+ ;; Setup jumping to beginning/end of a CMake function/macro.
+ (set (make-local-variable 'beginning-of-defun-function) #'cmake-beginning-of-defun)
+ (set (make-local-variable 'end-of-defun-function) #'cmake-end-of-defun)
+
; Setup font-lock mode.
(set (make-local-variable 'font-lock-defaults) '(cmake-font-lock-keywords))
; Setup indentation function.
@@ -356,11 +351,6 @@ This puts the mark at the end, and point at the beginning."
(set (make-local-variable 'syntax-propertize-function) cmake--syntax-propertize-function)
(add-hook 'syntax-propertize-extend-region-functions #'syntax-propertize-multiline nil t))
-;; Default cmake-mode key bindings
-(define-key cmake-mode-map "\e\C-a" #'cmake-beginning-of-defun)
-(define-key cmake-mode-map "\e\C-e" #'cmake-end-of-defun)
-(define-key cmake-mode-map "\e\C-h" #'cmake-mark-defun)
-
; Help mode starts here
@@ -490,7 +480,8 @@ and store the result as a list in LISTVAR."
;;;###autoload
(defun cmake-help ()
- "Queries for any of the four available help topics and prints out the appropriate page."
+ "Queries for any of the four available help topics and prints out the
+appropriate page."
(interactive)
(let* ((default-entry (cmake-symbol-at-point))
(command-list (cmake-get-list "command"))
diff --git a/Auxiliary/vim/indent/cmake.vim b/Auxiliary/vim/indent/cmake.vim
index 0c662fa..28ecf84 100644
--- a/Auxiliary/vim/indent/cmake.vim
+++ b/Auxiliary/vim/indent/cmake.vim
@@ -17,6 +17,8 @@ let b:did_indent = 1
setlocal indentexpr=CMakeGetIndent(v:lnum)
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
+let b:undo_indent = "setl inde< indk<"
+
" Only define the function once.
if exists("*CMakeGetIndent")
finish
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index 4bbdc65..5d412c2 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -19,10 +19,10 @@ endif
let s:keepcpo= &cpo
set cpo&vim
-syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
+syn region cmakeBracketArgument start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
-syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell
-syn region cmakeBracketComment start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
+syn region cmakeComment start="#\(\[=*\[\)\@!" end="$" contains=cmakeTodo,@Spell
+syn region cmakeBracketComment start="#\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained
syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped
@@ -70,6 +70,7 @@ syn keyword cmakeProperty contained
\ ATTACHED_FILES
\ ATTACHED_FILES_ON_FAIL
\ AUTOGEN_BUILD_DIR
+ \ AUTOGEN_COMMAND_LINE_LENGTH_MAX
\ AUTOGEN_ORIGIN_DEPENDS
\ AUTOGEN_PARALLEL
\ AUTOGEN_SOURCE_GROUP
@@ -77,6 +78,7 @@ syn keyword cmakeProperty contained
\ AUTOGEN_TARGETS_FOLDER
\ AUTOGEN_TARGET_DEPENDS
\ AUTOGEN_USE_SYSTEM_INCLUDE
+ \ AUTOGEN_BETTER_GRAPH_MULTI_CONFIG
\ AUTOMOC
\ AUTOMOC_COMPILER_PREDEFINES
\ AUTOMOC_DEPEND_FILTERS
@@ -374,6 +376,7 @@ syn keyword cmakeProperty contained
\ Swift_LANGUAGE_VERSION
\ Swift_MODULE_DIRECTORY
\ Swift_MODULE_NAME
+ \ Swift_COMPILATION_MODE
\ TARGET_ARCHIVES_MAY_BE_SHARED_LIBS
\ TARGET_MESSAGES
\ TARGET_SUPPORTS_SHARED_LIBS
@@ -447,6 +450,7 @@ syn keyword cmakeProperty contained
\ VS_STARTUP_PROJECT
\ VS_TOOL_OVERRIDE
\ VS_USER_PROPS
+ \ VS_FILTER_PROPS
\ VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
\ VS_WINRT_COMPONENT
\ VS_WINRT_EXTENSIONS
@@ -764,6 +768,8 @@ syn keyword cmakeVariable contained
\ CMAKE_ASM_STANDARD_REQUIRED
\ CMAKE_ASM_SUPPORTED
\ CMAKE_ASM_VISIBILITY_PRESET
+ \ CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG
+ \ CMAKE_AUTOGEN_COMMAND_LINE_LENGTH_MAX
\ CMAKE_AUTOGEN_ORIGIN_DEPENDS
\ CMAKE_AUTOGEN_PARALLEL
\ CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE
@@ -1656,6 +1662,7 @@ syn keyword cmakeVariable contained
\ CMAKE_SKIP_INSTALL_RPATH
\ CMAKE_SKIP_INSTALL_RULES
\ CMAKE_SKIP_RPATH
+ \ CMAKE_SKIP_TEST_ALL_DEPENDENCY
\ CMAKE_SOURCE_DIR
\ CMAKE_STAGING_PREFIX
\ CMAKE_STATIC_LIBRARY_PREFIX
@@ -2760,7 +2767,6 @@ syn keyword cmakeKWcmake_language contained
\ DIRECTORY
\ EVAL
\ FALSE
- \ FETCHCONTENT_MAKEAVAILABE_SERIAL
\ FETCHCONTENT_MAKEAVAILABLE_SERIAL
\ FETCHCONTENT_SOURCE_DIR_
\ FETCHCONTENT_TRY_FIND_PACKAGE_MODE
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 798affd..a0c0e54 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -229,15 +229,12 @@ endif()
set(CPACK_WIX_UPGRADE_GUID "8ffd1d72-b7f1-11e2-8ee5-00238bca4991")
-if(MSVC AND NOT "$ENV{WIX}" STREQUAL "")
- set(WIX_CUSTOM_ACTION_ENABLED TRUE)
+if(CMake_BUILD_WIX_CUSTOM_ACTION)
if(CMAKE_CONFIGURATION_TYPES)
- set(WIX_CUSTOM_ACTION_MULTI_CONFIG TRUE)
+ set(CMake_BUILD_WIX_CUSTOM_ACTION_MULTI_CONFIG TRUE)
else()
- set(WIX_CUSTOM_ACTION_MULTI_CONFIG FALSE)
+ set(CMake_BUILD_WIX_CUSTOM_ACTION_MULTI_CONFIG FALSE)
endif()
-else()
- set(WIX_CUSTOM_ACTION_ENABLED FALSE)
endif()
# Set the options file that needs to be included inside CMakeCPackOptions.cmake
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index 7aacf8e..cbe73e7 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -265,17 +265,18 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX")
set(CPACK_WIX_EXTRA_SOURCES
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/install_dir.wxs"
- "@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_extra_dialog.wxs"
+ "@CMake_SOURCE_DIR@/Utilities/Release/WiX/options.wxs"
+ "@CMake_SOURCE_DIR@/Utilities/Release/WiX/options_dlg.wxs"
)
- set(_WIX_CUSTOM_ACTION_ENABLED "@WIX_CUSTOM_ACTION_ENABLED@")
+ set(_WIX_CUSTOM_ACTION_ENABLED "@CMake_BUILD_WIX_CUSTOM_ACTION@")
if(_WIX_CUSTOM_ACTION_ENABLED)
list(APPEND CPACK_WIX_EXTRA_SOURCES
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs"
)
list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dCHECK_NSIS=1)
- set(_WIX_CUSTOM_ACTION_MULTI_CONFIG "@WIX_CUSTOM_ACTION_MULTI_CONFIG@")
+ set(_WIX_CUSTOM_ACTION_MULTI_CONFIG "@CMake_BUILD_WIX_CUSTOM_ACTION_MULTI_CONFIG@")
if(_WIX_CUSTOM_ACTION_MULTI_CONFIG)
if(CPACK_BUILD_CONFIG)
set(_WIX_CUSTOM_ACTION_CONFIG "${CPACK_BUILD_CONFIG}")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2823ca4..5f661a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-cmake_minimum_required(VERSION 3.13...3.26 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.13...3.28 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)
@@ -140,6 +140,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
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()
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index a6a2082..81f26f5 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -14,7 +14,7 @@ collaboration with a productive community of contributors.
Please post to the ``Development`` category of the `CMake Forum`_ to raise
discussion of development topics.
-.. _`Kitware`: http://www.kitware.com/cmake
+.. _`Kitware`: https://www.kitware.com/cmake
.. _`CMake Forum`: https://discourse.cmake.org
Patches
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index 85af8ed..ae55715 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -12,11 +12,12 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"warning: \\(Long double usage is reported only once for each file"
"warning: To disable this warning use"
"could not be inlined"
- "libcmexpat.*has no symbols"
- "libcmcurl.*has no symbols"
+ "libcm(curl|expat).*has no symbols"
+ "cm(curl|expat).build/[^ ]*.o has no symbols"
"not sorted slower link editing will result"
"stl_deque.h:479"
"Utilities.cmzlib."
+ "Utilities.cmzstd."
"Utilities.cmbzip2."
"Source.CTest.Curl"
"Source.CursesDialog.form"
@@ -85,6 +86,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"[0-9]+ Warning\\(s\\) detected" # SunPro
# Ignore false positive on `cm::optional` usage from GCC
+ "cmFileCommand.cxx:[0-9]*:[0-9]*: warning: '\\*\\(\\(void\\*\\)& tls_verify \\+2\\)' may be used uninitialized in this function \\[-Wmaybe-uninitialized\\]"
"cmGlobalNinjaGenerator.cxx:[0-9]*:[0-9]*: warning: '.*cm::optional<CxxModuleMapFormat>::_mem\\)\\)' may be used uninitialized \\[-Wmaybe-uninitialized\\]"
"cmGlobalNinjaGenerator.cxx:[0-9]*:[0-9]*: note: '.*cm::optional<CxxModuleMapFormat>::_mem\\)\\)' was declared here"
"cmGlobalNinjaGenerator.cxx:[0-9]*:[0-9]*: warning: '\\*\\(\\(void\\*\\)& modmap_fmt \\+4\\)' may be used uninitialized in this function \\[-Wmaybe-uninitialized\\]"
diff --git a/Copyright.txt b/Copyright.txt
index 515e403..2074109 100644
--- a/Copyright.txt
+++ b/Copyright.txt
@@ -1,5 +1,5 @@
CMake - Cross Platform Makefile Generator
-Copyright 2000-2023 Kitware, Inc. and Contributors
+Copyright 2000-2024 Kitware, Inc. and Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index 5fe4326..c184a96 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -84,8 +84,8 @@ The options are:
.. versionadded:: 3.20
Arguments to ``BYPRODUCTS`` may use a restricted set of
:manual:`generator expressions <cmake-generator-expressions(7)>`.
- :ref:`Target-dependent expressions <Target-Dependent Queries>` are not
- permitted.
+ :ref:`Target-dependent expressions <Target-Dependent Expressions>`
+ are not permitted.
.. versionchanged:: 3.28
In targets using :ref:`file sets`, custom command byproducts are now
@@ -272,8 +272,8 @@ The options are:
.. versionadded:: 3.20
Arguments to ``OUTPUT`` may use a restricted set of
:manual:`generator expressions <cmake-generator-expressions(7)>`.
- :ref:`Target-dependent expressions <Target-Dependent Queries>` are not
- permitted.
+ :ref:`Target-dependent expressions <Target-Dependent Expressions>`
+ are not permitted.
.. versionchanged:: 3.28
In targets using :ref:`file sets`, custom command outputs are now
@@ -373,6 +373,11 @@ The options are:
:manual:`generator expressions <cmake-generator-expressions(7)>` was also
added.
+ .. versionadded:: 3.29
+ The :ref:`Ninja Generators` will now incorporate the dependencies into its
+ "deps log" database if the file is not listed in ``OUTPUTS`` or
+ ``BYPRODUCTS``.
+
Using ``DEPFILE`` with generators other than those listed above is an error.
If the ``DEPFILE`` argument is relative, it should be relative to
@@ -544,11 +549,14 @@ one of the keywords to make clear the behavior they expect.
lines or custom commands will be omitted for the specific
configuration and no "empty-string-command" will be added.
- This allows to add individual build events for every configuration.
+ This allows adding individual build events for every configuration.
.. versionadded:: 3.21
Support for target-dependent generator expressions.
+.. versionadded:: 3.29
+ The ``<target>`` may be an :ref:`ALIAS target <Alias Targets>`.
+
Examples: Build Events
^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst
index 0385a93..d88e0f0 100644
--- a/Help/command/add_custom_target.rst
+++ b/Help/command/add_custom_target.rst
@@ -60,8 +60,8 @@ The options are:
.. versionadded:: 3.20
Arguments to ``BYPRODUCTS`` may use a restricted set of
:manual:`generator expressions <cmake-generator-expressions(7)>`.
- :ref:`Target-dependent expressions <Target-Dependent Queries>` are not
- permitted.
+ :ref:`Target-dependent expressions <Target-Dependent Expressions>`
+ are not permitted.
.. versionchanged:: 3.28
In custom targets using :ref:`file sets`, byproducts are now
diff --git a/Help/command/add_dependencies.rst b/Help/command/add_dependencies.rst
index 23cb405..3a51a30 100644
--- a/Help/command/add_dependencies.rst
+++ b/Help/command/add_dependencies.rst
@@ -20,6 +20,17 @@ transitively in its place since the target itself does not build.
.. versionadded:: 3.3
Allow adding dependencies to interface libraries.
+.. versionadded:: 3.8
+ Dependencies will populate the :prop_tgt:`MANUALLY_ADDED_DEPENDENCIES`
+ property of ``<target>``.
+
+.. versionchanged:: 3.9
+ The :ref:`Ninja Generators` use weaker ordering than
+ other generators in order to improve available concurrency.
+ They only guarantee that the dependencies' custom commands are
+ finished before sources in ``<target>`` start compiling; this
+ ensures generated sources are available.
+
See Also
^^^^^^^^
diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst
index d9ea0da..b6833b4 100644
--- a/Help/command/add_executable.rst
+++ b/Help/command/add_executable.rst
@@ -10,15 +10,28 @@ Add an executable to the project using the specified source files.
Normal Executables
^^^^^^^^^^^^^^^^^^
-.. code-block:: cmake
+.. signature::
+ add_executable(<name> <options>... <sources>...)
+ :target: normal
- add_executable(<name> [WIN32] [MACOSX_BUNDLE]
- [EXCLUDE_FROM_ALL]
- [source1] [source2 ...])
+ Add an executable target called ``<name>`` to be built from the source
+ files listed in the command invocation.
-Adds an executable target called ``<name>`` to be built from the source
-files listed in the command invocation. The
-``<name>`` corresponds to the logical target name and must be globally
+ The options are:
+
+ ``WIN32``
+ Set the :prop_tgt:`WIN32_EXECUTABLE` target property automatically.
+ See documentation of that target property for details.
+
+ ``MACOSX_BUNDLE``
+ Set the :prop_tgt:`MACOSX_BUNDLE` target property automatically.
+ See documentation of that target property for details.
+
+ ``EXCLUDE_FROM_ALL``
+ Set the :prop_tgt:`EXCLUDE_FROM_ALL` target property automatically.
+ See documentation of that target property for details.
+
+The ``<name>`` corresponds to the logical target name and must be globally
unique within a project. The actual file name of the executable built is
constructed based on conventions of the native platform (such as
``<name>.exe`` or just ``<name>``).
@@ -39,18 +52,6 @@ command was invoked. See documentation of the
location. See documentation of the :prop_tgt:`OUTPUT_NAME` target property
to change the ``<name>`` part of the final file name.
-If ``WIN32`` is given the property :prop_tgt:`WIN32_EXECUTABLE` will be
-set on the target created. See documentation of that target property for
-details.
-
-If ``MACOSX_BUNDLE`` is given the corresponding property will be set on
-the created target. See documentation of the :prop_tgt:`MACOSX_BUNDLE`
-target property for details.
-
-If ``EXCLUDE_FROM_ALL`` is given the corresponding property will be set on
-the created target. See documentation of the :prop_tgt:`EXCLUDE_FROM_ALL`
-target property for details.
-
See the :manual:`cmake-buildsystem(7)` manual for more on defining
buildsystem properties.
@@ -61,17 +62,25 @@ within IDE.
Imported Executables
^^^^^^^^^^^^^^^^^^^^
-.. code-block:: cmake
-
+.. signature::
add_executable(<name> IMPORTED [GLOBAL])
+ :target: IMPORTED
+
+ Add an :ref:`IMPORTED executable target <Imported Targets>` to reference
+ an executable file located outside the project. The target name may be
+ referenced like any target built within the project, except that by
+ default it is visible only in the directory in which it is created,
+ and below.
+
+ The options are:
+
+ ``GLOBAL``
+ Make the target name globally visible.
+
+No rules are generated to build imported targets, and the :prop_tgt:`IMPORTED`
+target property is ``True``. Imported executables are useful for convenient
+reference from commands like :command:`add_custom_command`.
-An :ref:`IMPORTED executable target <Imported Targets>` references an
-executable file located outside the project. No rules are generated to
-build it, and the :prop_tgt:`IMPORTED` target property is ``True``. The
-target name has scope in the directory in which it is created and below, but
-the ``GLOBAL`` option extends visibility. It may be referenced like any
-target built within the project. ``IMPORTED`` executables are useful
-for convenient reference from commands like :command:`add_custom_command`.
Details about the imported executable are specified by setting properties
whose names begin in ``IMPORTED_``. The most important such property is
:prop_tgt:`IMPORTED_LOCATION` (and its per-configuration version
@@ -82,14 +91,14 @@ properties for more information.
Alias Executables
^^^^^^^^^^^^^^^^^
-.. code-block:: cmake
-
+.. signature::
add_executable(<name> ALIAS <target>)
+ :target: ALIAS
-Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can
-be used to refer to ``<target>`` in subsequent commands. The ``<name>``
-does not appear in the generated buildsystem as a make target. The
-``<target>`` may not be an ``ALIAS``.
+ Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can
+ be used to refer to ``<target>`` in subsequent commands. The ``<name>``
+ does not appear in the generated buildsystem as a make target. The
+ ``<target>`` may not be an ``ALIAS``.
.. versionadded:: 3.11
An ``ALIAS`` can target a ``GLOBAL`` :ref:`Imported Target <Imported Targets>`
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index 07c8bab..cab380e 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -10,18 +10,39 @@ Add a library to the project using the specified source files.
Normal Libraries
^^^^^^^^^^^^^^^^
-.. code-block:: cmake
+.. signature::
+ add_library(<name> [<type>] [EXCLUDE_FROM_ALL] <sources>...)
+ :target: normal
+
+ Add a library target called ``<name>`` to be built from the source files
+ listed in the command invocation.
+
+ The optional ``<type>`` specifies the type of library to be created:
+
+ ``STATIC``
+ An archive of object files for use when linking other targets.
+
+ ``SHARED``
+ A dynamic library that may be linked by other targets and loaded
+ at runtime.
+
+ ``MODULE``
+ A plugin that may not be linked by other targets, but may be
+ dynamically loaded at runtime using dlopen-like functionality.
+
+ If no ``<type>`` is given the default is ``STATIC`` or ``SHARED``
+ based on the value of the :variable:`BUILD_SHARED_LIBS` variable.
+
+ The options are:
- add_library(<name> [STATIC | SHARED | MODULE]
- [EXCLUDE_FROM_ALL]
- [<source>...])
+ ``EXCLUDE_FROM_ALL``
+ Set the :prop_tgt:`EXCLUDE_FROM_ALL` target property automatically.
+ See documentation of that target property for details.
-Adds a library target called ``<name>`` to be built from the source files
-listed in the command invocation. The ``<name>``
-corresponds to the logical target name and must be globally unique within
-a project. The actual file name of the library built is constructed based
-on conventions of the native platform (such as ``lib<name>.a`` or
-``<name>.lib``).
+The ``<name>`` corresponds to the logical target name and must be globally
+unique within a project. The actual file name of the library built is
+constructed based on conventions of the native platform (such as
+``lib<name>.a`` or ``<name>.lib``).
.. versionadded:: 3.1
Source arguments to ``add_library`` may use "generator expressions" with
@@ -32,15 +53,8 @@ on conventions of the native platform (such as ``lib<name>.a`` or
The source files can be omitted if they are added later using
:command:`target_sources`.
-``STATIC``, ``SHARED``, or ``MODULE`` may be given to specify the type of
-library to be created. ``STATIC`` libraries are archives of object files
-for use when linking other targets. ``SHARED`` libraries are linked
-dynamically and loaded at runtime. ``MODULE`` libraries are plugins that
-are not linked into other targets but may be loaded dynamically at runtime
-using dlopen-like functionality. If no type is given explicitly the
-type is ``STATIC`` or ``SHARED`` based on whether the current value of the
-variable :variable:`BUILD_SHARED_LIBS` is ``ON``. For ``SHARED`` and
-``MODULE`` libraries the :prop_tgt:`POSITION_INDEPENDENT_CODE` target
+For ``SHARED`` and ``MODULE`` libraries the
+:prop_tgt:`POSITION_INDEPENDENT_CODE` target
property is set to ``ON`` automatically.
A ``SHARED`` library may be marked with the :prop_tgt:`FRAMEWORK`
target property to create an macOS Framework.
@@ -63,10 +77,6 @@ invoked. See documentation of the :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY`,
location. See documentation of the :prop_tgt:`OUTPUT_NAME` target
property to change the ``<name>`` part of the final file name.
-If ``EXCLUDE_FROM_ALL`` is given the corresponding property will be set on
-the created target. See documentation of the :prop_tgt:`EXCLUDE_FROM_ALL`
-target property for details.
-
See the :manual:`cmake-buildsystem(7)` manual for more on defining
buildsystem properties.
@@ -74,17 +84,25 @@ See also :prop_sf:`HEADER_FILE_ONLY` on what to do if some sources are
pre-processed, and you want to have the original sources reachable from
within IDE.
+.. versionchanged:: 3.30
+
+ On platforms that do not support shared libraries, ``add_library``
+ now fails on calls creating ``SHARED`` libraries instead of
+ automatically converting them to ``STATIC`` libraries as before.
+ See policy :policy:`CMP0164`.
+
Object Libraries
^^^^^^^^^^^^^^^^
-.. code-block:: cmake
+.. signature::
+ add_library(<name> OBJECT <sources>...)
+ :target: OBJECT
- add_library(<name> OBJECT [<source>...])
+ Add an :ref:`Object Library <Object Libraries>` to compile source files
+ without archiving or linking their object files into a library.
-Creates an :ref:`Object Library <Object Libraries>`. An object library
-compiles source files but does not archive or link their object files into a
-library. Instead other targets created by ``add_library`` or
-:command:`add_executable` may reference the objects using an expression of the
+Other targets created by ``add_library`` or :command:`add_executable`
+may reference the objects using an expression of the
form :genex:`$\<TARGET_OBJECTS:objlib\> <TARGET_OBJECTS>` as a source, where
``objlib`` is the object library name. For example:
@@ -109,46 +127,48 @@ consider adding at least one real source file to any target that references
Interface Libraries
^^^^^^^^^^^^^^^^^^^
-.. code-block:: cmake
-
+.. signature::
add_library(<name> INTERFACE)
-
-Creates an :ref:`Interface Library <Interface Libraries>`.
-An ``INTERFACE`` library target does not compile sources and does
-not produce a library artifact on disk. However, it may have
-properties set on it and it may be installed and exported.
-Typically, ``INTERFACE_*`` properties are populated on an interface
-target using the commands:
-
-* :command:`set_property`,
-* :command:`target_link_libraries(INTERFACE)`,
-* :command:`target_link_options(INTERFACE)`,
-* :command:`target_include_directories(INTERFACE)`,
-* :command:`target_compile_options(INTERFACE)`,
-* :command:`target_compile_definitions(INTERFACE)`, and
-* :command:`target_sources(INTERFACE)`,
-
-and then it is used as an argument to :command:`target_link_libraries`
-like any other target.
-
-An interface library created with the above signature has no source files
-itself and is not included as a target in the generated buildsystem.
-
-.. versionadded:: 3.15
- An interface library can have :prop_tgt:`PUBLIC_HEADER` and
- :prop_tgt:`PRIVATE_HEADER` properties. The headers specified by those
- properties can be installed using the :command:`install(TARGETS)` command.
-
-.. versionadded:: 3.19
- An interface library target may be created with source files:
-
- .. code-block:: cmake
-
- add_library(<name> INTERFACE [<source>...] [EXCLUDE_FROM_ALL])
-
- Source files may be listed directly in the ``add_library`` call or added
- later by calls to :command:`target_sources` with the ``PRIVATE`` or
- ``PUBLIC`` keywords.
+ :target: INTERFACE
+
+ Add an :ref:`Interface Library <Interface Libraries>` target that may
+ specify usage requirements for dependents but does not compile sources
+ and does not produce a library artifact on disk.
+
+ An interface library with no source files is not included as a target
+ in the generated buildsystem. However, it may have
+ properties set on it and it may be installed and exported.
+ Typically, ``INTERFACE_*`` properties are populated on an interface
+ target using the commands:
+
+ * :command:`set_property`,
+ * :command:`target_link_libraries(INTERFACE)`,
+ * :command:`target_link_options(INTERFACE)`,
+ * :command:`target_include_directories(INTERFACE)`,
+ * :command:`target_compile_options(INTERFACE)`,
+ * :command:`target_compile_definitions(INTERFACE)`, and
+ * :command:`target_sources(INTERFACE)`,
+
+ and then it is used as an argument to :command:`target_link_libraries`
+ like any other target.
+
+ .. versionadded:: 3.15
+ An interface library can have :prop_tgt:`PUBLIC_HEADER` and
+ :prop_tgt:`PRIVATE_HEADER` properties. The headers specified by those
+ properties can be installed using the :command:`install(TARGETS)` command.
+
+.. signature::
+ add_library(<name> INTERFACE [EXCLUDE_FROM_ALL] <sources>...)
+ :target: INTERFACE-with-sources
+
+ .. versionadded:: 3.19
+
+ Add an :ref:`Interface Library <Interface Libraries>` target with
+ source files (in addition to usage requirements and properties as
+ documented by the :command:`above signature <add_library(INTERFACE)>`).
+ Source files may be listed directly in the ``add_library`` call
+ or added later by calls to :command:`target_sources` with the
+ ``PRIVATE`` or ``PUBLIC`` keywords.
If an interface library has source files (i.e. the :prop_tgt:`SOURCES`
target property is set), or header sets (i.e. the :prop_tgt:`HEADER_SETS`
@@ -158,92 +178,106 @@ itself and is not included as a target in the generated buildsystem.
but does contain build rules for custom commands created by the
:command:`add_custom_command` command.
-.. note::
- In most command signatures where the ``INTERFACE`` keyword appears,
- the items listed after it only become part of that target's usage
- requirements and are not part of the target's own settings. However,
- in this signature of ``add_library``, the ``INTERFACE`` keyword refers
- to the library type only. Sources listed after it in the ``add_library``
- call are ``PRIVATE`` to the interface library and do not appear in its
- :prop_tgt:`INTERFACE_SOURCES` target property.
+ The options are:
+
+ ``EXCLUDE_FROM_ALL``
+ Set the :prop_tgt:`EXCLUDE_FROM_ALL` target property automatically.
+ See documentation of that target property for details.
+
+ .. note::
+ In most command signatures where the ``INTERFACE`` keyword appears,
+ the items listed after it only become part of that target's usage
+ requirements and are not part of the target's own settings. However,
+ in this signature of ``add_library``, the ``INTERFACE`` keyword refers
+ to the library type only. Sources listed after it in the ``add_library``
+ call are ``PRIVATE`` to the interface library and do not appear in its
+ :prop_tgt:`INTERFACE_SOURCES` target property.
.. _`add_library imported libraries`:
Imported Libraries
^^^^^^^^^^^^^^^^^^
-.. code-block:: cmake
-
+.. signature::
add_library(<name> <type> IMPORTED [GLOBAL])
-
-Creates an :ref:`IMPORTED library target <Imported Targets>` called ``<name>``.
-No rules are generated to build it, and the :prop_tgt:`IMPORTED` target
-property is ``True``. The target name has scope in the directory in which
-it is created and below, but the ``GLOBAL`` option extends visibility.
-It may be referenced like any target built within the project.
-``IMPORTED`` libraries are useful for convenient reference from commands
-like :command:`target_link_libraries`. Details about the imported library
-are specified by setting properties whose names begin in ``IMPORTED_`` and
-``INTERFACE_``.
-
-The ``<type>`` must be one of:
-
-``STATIC``, ``SHARED``, ``MODULE``, ``UNKNOWN``
- References a library file located outside the project. The
- :prop_tgt:`IMPORTED_LOCATION` target property (or its per-configuration
- variant :prop_tgt:`IMPORTED_LOCATION_<CONFIG>`) specifies the
- location of the main library file on disk:
-
- * For a ``SHARED`` library on most non-Windows platforms, the main library
- file is the ``.so`` or ``.dylib`` file used by both linkers and dynamic
- loaders. If the referenced library file has a ``SONAME`` (or on macOS,
- has a ``LC_ID_DYLIB`` starting in ``@rpath/``), the value of that field
- should be set in the :prop_tgt:`IMPORTED_SONAME` target property.
- If the referenced library file does not have a ``SONAME``, but the
- platform supports it, then the :prop_tgt:`IMPORTED_NO_SONAME` target
- property should be set.
-
- * For a ``SHARED`` library on Windows, the :prop_tgt:`IMPORTED_IMPLIB`
- target property (or its per-configuration variant
- :prop_tgt:`IMPORTED_IMPLIB_<CONFIG>`) specifies the location of the
- DLL import library file (``.lib`` or ``.dll.a``) on disk, and the
- ``IMPORTED_LOCATION`` is the location of the ``.dll`` runtime
- library (and is optional, but needed by the :genex:`TARGET_RUNTIME_DLLS`
- generator expression).
-
- Additional usage requirements may be specified in ``INTERFACE_*`` properties.
-
- An ``UNKNOWN`` library type is typically only used in the implementation of
- :ref:`Find Modules`. It allows the path to an imported library (often found
- using the :command:`find_library` command) to be used without having to know
- what type of library it is. This is especially useful on Windows where a
- static library and a DLL's import library both have the same file extension.
-
-``OBJECT``
- References a set of object files located outside the project.
- The :prop_tgt:`IMPORTED_OBJECTS` target property (or its per-configuration
- variant :prop_tgt:`IMPORTED_OBJECTS_<CONFIG>`) specifies the locations of
- object files on disk.
- Additional usage requirements may be specified in ``INTERFACE_*`` properties.
-
-``INTERFACE``
- Does not reference any library or object files on disk, but may
- specify usage requirements in ``INTERFACE_*`` properties.
-
-See documentation of the ``IMPORTED_*`` and ``INTERFACE_*`` properties
-for more information.
+ :target: IMPORTED
+
+ Add an :ref:`IMPORTED library target <Imported Targets>` called ``<name>``.
+ The target name may be referenced like any target built within the project,
+ except that by default it is visible only in the directory in which it is
+ created, and below.
+
+ The ``<type>`` must be one of:
+
+ ``STATIC``, ``SHARED``, ``MODULE``, ``UNKNOWN``
+ References a library file located outside the project. The
+ :prop_tgt:`IMPORTED_LOCATION` target property (or its per-configuration
+ variant :prop_tgt:`IMPORTED_LOCATION_<CONFIG>`) specifies the
+ location of the main library file on disk:
+
+ * For a ``SHARED`` library on most non-Windows platforms, the main library
+ file is the ``.so`` or ``.dylib`` file used by both linkers and dynamic
+ loaders. If the referenced library file has a ``SONAME`` (or on macOS,
+ has a ``LC_ID_DYLIB`` starting in ``@rpath/``), the value of that field
+ should be set in the :prop_tgt:`IMPORTED_SONAME` target property.
+ If the referenced library file does not have a ``SONAME``, but the
+ platform supports it, then the :prop_tgt:`IMPORTED_NO_SONAME` target
+ property should be set.
+
+ * For a ``SHARED`` library on Windows, the :prop_tgt:`IMPORTED_IMPLIB`
+ target property (or its per-configuration variant
+ :prop_tgt:`IMPORTED_IMPLIB_<CONFIG>`) specifies the location of the
+ DLL import library file (``.lib`` or ``.dll.a``) on disk, and the
+ ``IMPORTED_LOCATION`` is the location of the ``.dll`` runtime
+ library (and is optional, but needed by the :genex:`TARGET_RUNTIME_DLLS`
+ generator expression).
+
+ Additional usage requirements may be specified in ``INTERFACE_*``
+ properties.
+
+ An ``UNKNOWN`` library type is typically only used in the implementation
+ of :ref:`Find Modules`. It allows the path to an imported library
+ (often found using the :command:`find_library` command) to be used
+ without having to know what type of library it is. This is especially
+ useful on Windows where a static library and a DLL's import library
+ both have the same file extension.
+
+ ``OBJECT``
+ References a set of object files located outside the project.
+ The :prop_tgt:`IMPORTED_OBJECTS` target property (or its per-configuration
+ variant :prop_tgt:`IMPORTED_OBJECTS_<CONFIG>`) specifies the locations of
+ object files on disk.
+ Additional usage requirements may be specified in ``INTERFACE_*``
+ properties.
+
+ ``INTERFACE``
+ Does not reference any library or object files on disk, but may
+ specify usage requirements in ``INTERFACE_*`` properties.
+
+ The options are:
+
+ ``GLOBAL``
+ Make the target name globally visible.
+
+No rules are generated to build imported targets, and the :prop_tgt:`IMPORTED`
+target property is ``True``. Imported libraries are useful for convenient
+reference from commands like :command:`target_link_libraries`.
+
+Details about the imported library are specified by setting properties whose
+names begin in ``IMPORTED_`` and ``INTERFACE_``. See documentation of
+such properties for more information.
Alias Libraries
^^^^^^^^^^^^^^^
-.. code-block:: cmake
-
+.. signature::
add_library(<name> ALIAS <target>)
+ :target: ALIAS
-Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can be
-used to refer to ``<target>`` in subsequent commands. The ``<name>`` does
-not appear in the generated buildsystem as a make target. The ``<target>``
-may not be an ``ALIAS``.
+ Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can be
+ used to refer to ``<target>`` in subsequent commands. The ``<name>`` does
+ not appear in the generated buildsystem as a make target. The ``<target>``
+ may not be an ``ALIAS``.
.. versionadded:: 3.11
An ``ALIAS`` can target a ``GLOBAL`` :ref:`Imported Target <Imported Targets>`
diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst
index 02dd3986..557c858 100644
--- a/Help/command/add_test.rst
+++ b/Help/command/add_test.rst
@@ -27,9 +27,37 @@ directory the test is created in.
``add_test`` options are:
``COMMAND``
- Specify the test command-line. If ``<command>`` specifies an executable
- target created by :command:`add_executable`, it will automatically be
- replaced by the location of the executable created at build time.
+ Specify the test command-line.
+
+ If ``<command>`` specifies an executable target created by
+ :command:`add_executable`:
+
+ * It will automatically be replaced by the location of the executable
+ created at build time.
+
+ * .. versionadded:: 3.3
+
+ The target's :prop_tgt:`CROSSCOMPILING_EMULATOR`, if set, will be
+ used to run the command on the host::
+
+ <emulator> <command>
+
+ .. versionchanged:: 3.29
+
+ The emulator is used only when
+ :variable:`cross-compiling <CMAKE_CROSSCOMPILING>`.
+ See policy :policy:`CMP0158`.
+
+ * .. versionadded:: 3.29
+
+ The target's :prop_tgt:`TEST_LAUNCHER`, if set, will be
+ used to launch the command::
+
+ <launcher> <command>
+
+ If the :prop_tgt:`CROSSCOMPILING_EMULATOR` is also set, both are used::
+
+ <launcher> <emulator> <command>
The command may be specified using
:manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst
index dad0833..0d2f75e 100644
--- a/Help/command/cmake_host_system_information.rst
+++ b/Help/command/cmake_host_system_information.rst
@@ -265,7 +265,7 @@ Example:
.. [#mebibytes] One MiB (mebibyte) is equal to 1024x1024 bytes.
-.. _man 5 os-release: https://www.freedesktop.org/software/systemd/man/os-release.html
+.. _man 5 os-release: https://www.freedesktop.org/software/systemd/man/latest/os-release.html
.. _various distribution-specific files: http://linuxmafia.com/faq/Admin/release-files.html
.. _Query Windows registry:
diff --git a/Help/command/cmake_language.rst b/Help/command/cmake_language.rst
index 3af6b9c..38d06bb 100644
--- a/Help/command/cmake_language.rst
+++ b/Help/command/cmake_language.rst
@@ -15,6 +15,7 @@ Synopsis
cmake_language(`DEFER`_ <options>... CALL <command> [<arg>...])
cmake_language(`SET_DEPENDENCY_PROVIDER`_ <command> SUPPORTED_METHODS <methods>...)
cmake_language(`GET_MESSAGE_LOG_LEVEL`_ <out-var>)
+ cmake_language(`EXIT`_ <exit-code>)
Introduction
^^^^^^^^^^^^
@@ -317,7 +318,7 @@ be one of the ``<methods>`` that was specified when setting the provider.
implementation as part of its processing, it can do so by including the
``BYPASS_PROVIDER`` keyword as one of the arguments.
-``FETCHCONTENT_MAKEAVAILABE_SERIAL``
+``FETCHCONTENT_MAKEAVAILABLE_SERIAL``
The ``<method-specific-args>`` will be everything passed to the
:command:`FetchContent_Declare` call that corresponds to the requested
dependency, with the following exceptions:
@@ -506,3 +507,25 @@ Getting current message log level
If both the command line option and the variable are set, the command line
option takes precedence. If neither are set, the default logging level
is returned.
+
+Terminating Scripts
+^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.29
+
+.. signature::
+ cmake_language(EXIT <exit-code>)
+
+ Terminate the current :option:`cmake -P` script and exit with ``<exit-code>``.
+
+ This command works only in :ref:`script mode <Script Processing Mode>`.
+ If used outside of that context, it will cause a fatal error.
+
+ The ``<exit-code>`` should be non-negative.
+ If ``<exit-code>`` is negative, then the behavior
+ is unspecified (e.g., on Windows the error code -1
+ becomes ``0xffffffff``, and on Linux it becomes 255).
+ Exit codes above 255 may not be supported by the underlying
+ shell or platform, and some shells may interpret values
+ above 125 specially. Therefore, it is advisable to only
+ specify an ``<exit-code>`` in the range 0 to 125.
diff --git a/Help/command/cmake_path.rst b/Help/command/cmake_path.rst
index 4e6bedb..39b7b99 100644
--- a/Help/command/cmake_path.rst
+++ b/Help/command/cmake_path.rst
@@ -600,7 +600,7 @@ For example:
# filename is now already empty, the following removes nothing
cmake_path(REMOVE_FILENAME path)
- message("Second path is \"${result}\"")
+ message("Second path is \"${path}\"")
Output::
diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst
index 07dc2e1..7200c24 100644
--- a/Help/command/configure_file.rst
+++ b/Help/command/configure_file.rst
@@ -1,6 +1,10 @@
configure_file
--------------
+.. only:: html
+
+ .. contents::
+
Copy a file to another location and modify its contents.
.. code-block:: cmake
@@ -11,11 +15,79 @@ Copy a file to another location and modify its contents.
[COPYONLY] [ESCAPE_QUOTES] [@ONLY]
[NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
-Copies an ``<input>`` file to an ``<output>`` file and substitutes
-variable values referenced as ``@VAR@``, ``${VAR}``, ``$CACHE{VAR}`` or
-``$ENV{VAR}`` in the input file content. Each variable reference will be
-replaced with the current value of the variable, or the empty string if
-the variable is not defined. Furthermore, input lines of the form
+Copies an ``<input>`` file to an ``<output>`` file while performing
+`transformations`_ of the input file content.
+
+If the input file is modified the build system will re-run CMake to
+re-configure the file and generate the build system again.
+The generated file is modified and its timestamp updated on subsequent
+cmake runs only if its content is changed.
+
+Options
+^^^^^^^
+
+The options are:
+
+``<input>``
+ Path to the input file. A relative path is treated with respect to
+ the value of :variable:`CMAKE_CURRENT_SOURCE_DIR`. The input path
+ must be a file, not a directory.
+
+``<output>``
+ Path to the output file or directory. A relative path is treated
+ with respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`.
+ If the path names an existing directory the output file is placed
+ in that directory with the same file name as the input file.
+ If the path contains non-existent directories, they are created.
+
+``NO_SOURCE_PERMISSIONS``
+ .. versionadded:: 3.19
+
+ Do not transfer the permissions of the input file to the output file.
+ The copied file permissions default to the standard 644 value
+ (-rw-r--r--).
+
+``USE_SOURCE_PERMISSIONS``
+ .. versionadded:: 3.20
+
+ Transfer the permissions of the input file to the output file.
+ This is already the default behavior if none of the three permissions-related
+ keywords are given (``NO_SOURCE_PERMISSIONS``, ``USE_SOURCE_PERMISSIONS``
+ or ``FILE_PERMISSIONS``). The ``USE_SOURCE_PERMISSIONS`` keyword mostly
+ serves as a way of making the intended behavior clearer at the call site.
+
+``FILE_PERMISSIONS <permissions>...``
+ .. versionadded:: 3.20
+
+ Ignore the input file's permissions and use the specified ``<permissions>``
+ for the output file instead.
+
+``COPYONLY``
+ Copy the file without replacing any variable references or other
+ content. This option may not be used with ``NEWLINE_STYLE``.
+
+``ESCAPE_QUOTES``
+ Escape any substituted quotes with backslashes (C-style).
+
+``@ONLY``
+ Restrict variable replacement to references of the form ``@VAR@``.
+ This is useful for configuring scripts that use ``${VAR}`` syntax.
+
+``NEWLINE_STYLE <style>``
+ Specify the newline style for the output file. Specify
+ ``UNIX`` or ``LF`` for ``\n`` newlines, or specify
+ ``DOS``, ``WIN32``, or ``CRLF`` for ``\r\n`` newlines.
+ This option may not be used with ``COPYONLY``.
+
+Transformations
+^^^^^^^^^^^^^^^
+
+:ref:`Variables <CMake Language Variables>` referenced in the input
+file content as ``@VAR@``, ``${VAR}``, ``$CACHE{VAR}``, and
+:ref:`environment variables <CMake Language Environment Variables>`
+referenced as ``$ENV{VAR}``, will each be replaced with the current value
+of the variable, or the empty string if the variable is not defined.
+Furthermore, input lines of the form
.. code-block:: c
@@ -79,64 +151,6 @@ which may lead to undefined behavior.
# define VAR
# define VAR 1
-If the input file is modified the build system will re-run CMake to
-re-configure the file and generate the build system again.
-The generated file is modified and its timestamp updated on subsequent
-cmake runs only if its content is changed.
-
-The arguments are:
-
-``<input>``
- Path to the input file. A relative path is treated with respect to
- the value of :variable:`CMAKE_CURRENT_SOURCE_DIR`. The input path
- must be a file, not a directory.
-
-``<output>``
- Path to the output file or directory. A relative path is treated
- with respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`.
- If the path names an existing directory the output file is placed
- in that directory with the same file name as the input file.
- If the path contains non-existent directories, they are created.
-
-``NO_SOURCE_PERMISSIONS``
- .. versionadded:: 3.19
-
- Do not transfer the permissions of the input file to the output file.
- The copied file permissions default to the standard 644 value
- (-rw-r--r--).
-
-``USE_SOURCE_PERMISSIONS``
- .. versionadded:: 3.20
-
- Transfer the permissions of the input file to the output file.
- This is already the default behavior if none of the three permissions-related
- keywords are given (``NO_SOURCE_PERMISSIONS``, ``USE_SOURCE_PERMISSIONS``
- or ``FILE_PERMISSIONS``). The ``USE_SOURCE_PERMISSIONS`` keyword mostly
- serves as a way of making the intended behavior clearer at the call site.
-
-``FILE_PERMISSIONS <permissions>...``
- .. versionadded:: 3.20
-
- Ignore the input file's permissions and use the specified ``<permissions>``
- for the output file instead.
-
-``COPYONLY``
- Copy the file without replacing any variable references or other
- content. This option may not be used with ``NEWLINE_STYLE``.
-
-``ESCAPE_QUOTES``
- Escape any substituted quotes with backslashes (C-style).
-
-``@ONLY``
- Restrict variable replacement to references of the form ``@VAR@``.
- This is useful for configuring scripts that use ``${VAR}`` syntax.
-
-``NEWLINE_STYLE <style>``
- Specify the newline style for the output file. Specify
- ``UNIX`` or ``LF`` for ``\n`` newlines, or specify
- ``DOS``, ``WIN32``, or ``CRLF`` for ``\r\n`` newlines.
- This option may not be used with ``COPYONLY``.
-
Example
^^^^^^^
diff --git a/Help/command/create_test_sourcelist.rst b/Help/command/create_test_sourcelist.rst
index 5f01a8b..d0b43c4 100644
--- a/Help/command/create_test_sourcelist.rst
+++ b/Help/command/create_test_sourcelist.rst
@@ -1,29 +1,62 @@
create_test_sourcelist
----------------------
-Create a test driver and source list for building test programs.
-
-.. code-block:: cmake
-
- create_test_sourcelist(<sourceListName> <driverName>
- <tests> ...
- [EXTRA_INCLUDE <include>]
- [FUNCTION <function>])
-
-A test driver is a program that links together many small tests into a single
-executable. This is useful when building static executables with large
-libraries to shrink the total required size. The list of source files needed
-to build the test driver will be in ``sourceListName``. ``driverName`` is the
-name of the test driver program. The rest of the arguments consist of a list
-of test source files and can be semicolon separated. Each test source file
-should have a function in it that is the same name as the file with no
-extension (``foo.cxx`` should have ``int foo(int, char*[]);``). ``driverName``
-will be able to call each of the tests by name on the command line. If
-``EXTRA_INCLUDE`` is specified, then the next argument is included into the
-generated file. If ``FUNCTION`` is specified, then the next argument is taken
-as a function name that is passed pointers to ``argc`` and ``argv``. This can
-be used to add extra command line processing to each test. The
-``CMAKE_TESTDRIVER_BEFORE_TESTMAIN`` cmake variable can be set to have code
-that will be placed directly before calling the test ``main`` function.
-``CMAKE_TESTDRIVER_AFTER_TESTMAIN`` can be set to have code that will be
-placed directly after the call to the test ``main`` function.
+Create a test driver program that links together many small tests into a
+single executable. This is useful when building static executables with
+large libraries to shrink the total required size.
+
+.. signature::
+ create_test_sourcelist(<sourceListName> <driverName> <test>... <options>...)
+ :target: original
+
+ Generate a test driver source file from a list of individual test sources
+ and provide a combined list of sources that can be built as an executable.
+
+ The options are:
+
+ ``<sourceListName>``
+ The name of a variable in which to store the list of source files needed
+ to build the test driver. The list will contain the ``<test>...`` sources
+ and the generated ``<driverName>`` source.
+
+ .. versionchanged:: 3.29
+
+ The test driver source is listed by absolute path in the build tree.
+ Previously it was listed only as ``<driverName>``.
+
+ ``<driverName>``
+ Name of the test driver source file to be generated into the build tree.
+ The source file will contain a ``main()`` program entry point that
+ dispatches to whatever test is named on the command line.
+
+ ``<test>...``
+ Test source files to be added to the driver binary. Each test source
+ file must have a function in it that is the same name as the file with the
+ extension removed. For example, a ``foo.cxx`` test source might contain:
+
+ .. code-block:: c++
+
+ int foo(int argc, char** argv)
+
+ ``EXTRA_INCLUDE <header>``
+ Specify a header file to ``#include`` in the generated test driver source.
+
+ ``FUNCTION <function>``
+ Specify a function to be called with pointers to ``argc`` and ``argv``.
+ The function may be provided in the ``EXTRA_INCLUDE`` header:
+
+ .. code-block:: c++
+
+ void function(int* pargc, char*** pargv)
+
+ This can be used to add extra command line processing to each test.
+
+Additionally, some CMake variables affect test driver generation:
+
+.. variable:: CMAKE_TESTDRIVER_BEFORE_TESTMAIN
+
+ Code to be placed directly before calling each test's function.
+
+.. variable:: CMAKE_TESTDRIVER_AFTER_TESTMAIN
+
+ Code to be placed directly after the call to each test's function.
diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst
index cf20ade..c1862df 100644
--- a/Help/command/ctest_test.rst
+++ b/Help/command/ctest_test.rst
@@ -13,10 +13,12 @@ Perform the :ref:`CTest Test Step` as a :ref:`Dashboard Client`.
[INCLUDE <include-regex>]
[EXCLUDE_LABEL <label-exclude-regex>]
[INCLUDE_LABEL <label-include-regex>]
+ [EXCLUDE_FROM_FILE <filename>]
+ [INCLUDE_FROM_FILE <filename>]
[EXCLUDE_FIXTURE <regex>]
[EXCLUDE_FIXTURE_SETUP <regex>]
[EXCLUDE_FIXTURE_CLEANUP <regex>]
- [PARALLEL_LEVEL <level>]
+ [PARALLEL_LEVEL [<level>]]
[RESOURCE_SPEC_FILE <file>]
[TEST_LOAD <threshold>]
[SCHEDULE_RANDOM <ON|OFF>]
@@ -72,6 +74,16 @@ The options are:
Specify a regular expression matching test labels to include.
Tests not matching this expression are excluded.
+``EXCLUDE_FROM_FILE <filename>``
+ .. versionadded:: 3.29
+
+ Do NOT run tests listed with their exact name in the given file.
+
+``INCLUDE_FROM_FILE <filename>``
+ .. versionadded:: 3.29
+
+ Only run the tests listed with their exact name in the given file.
+
``EXCLUDE_FIXTURE <regex>``
.. versionadded:: 3.7
@@ -92,9 +104,14 @@ The options are:
Same as ``EXCLUDE_FIXTURE`` except only matching cleanup tests are excluded.
-``PARALLEL_LEVEL <level>``
- Specify a positive number representing the number of tests to
- be run in parallel.
+``PARALLEL_LEVEL [<level>]``
+ Run tests in parallel, limited to a given level of parallelism.
+
+ .. versionadded:: 3.29
+
+ The ``<level>`` may be omitted, or ``0``, to let ctest use a default
+ level of parallelism, or unbounded parallelism, respectively, as
+ documented by the :option:`ctest --parallel` option.
``RESOURCE_SPEC_FILE <file>``
.. versionadded:: 3.16
diff --git a/Help/command/define_property.rst b/Help/command/define_property.rst
index 5278e30..06f2823 100644
--- a/Help/command/define_property.rst
+++ b/Help/command/define_property.rst
@@ -74,6 +74,42 @@ project via corresponding options to the :command:`get_property` command.
underscore. It is recommended that the property name have a prefix specific
to the project.
+Property Redefinition
+^^^^^^^^^^^^^^^^^^^^^
+
+Once a property is defined for a particular type of scope, it cannot be
+redefined. Attempts to redefine an existing property by calling
+:command:`define_property` with the same scope type and property name
+will be silently ignored. Defining the same property name for two different
+kinds of scope is valid.
+
+:command:`get_property` can be used to determine whether a property is
+already defined for a particular kind of scope, and if so, to examine its
+definition. For example:
+
+.. code-block:: cmake
+
+ # Initial definition
+ define_property(TARGET PROPERTY MY_NEW_PROP
+ BRIEF_DOCS "My new custom property"
+ )
+
+ # Later examination
+ get_property(my_new_prop_exists
+ TARGET NONE
+ PROPERTY MY_NEW_PROP
+ DEFINED
+ )
+
+ if(my_new_prop_exists)
+ get_property(my_new_prop_docs
+ TARGET NONE
+ PROPERTY MY_NEW_PROP
+ BRIEF_DOCS
+ )
+ # ${my_new_prop_docs} is now set to "My new custom property"
+ endif()
+
See Also
^^^^^^^^
diff --git a/Help/command/enable_language.rst b/Help/command/enable_language.rst
index 2f1cc23..d587310 100644
--- a/Help/command/enable_language.rst
+++ b/Help/command/enable_language.rst
@@ -9,15 +9,19 @@ Enable languages (CXX/C/OBJC/OBJCXX/Fortran/etc)
Enables support for the named languages in CMake. This is the same as
the :command:`project` command but does not create any of the extra
-variables that are created by the project command.
+variables that are created by the :command:`project` command.
.. include:: SUPPORTED_LANGUAGES.txt
-This command must be called in file scope, not in a function call.
-Furthermore, it must be called in the highest directory common to all
-targets using the named language directly for compiling sources or
-indirectly through link dependencies. It is simplest to enable all
-needed languages in the top-level directory of a project.
+The following restrictions apply to where ``enable_language()`` may be called:
+
+* It must be called in file scope, not in a function call.
+* It must not be called before the first call to :command:`project`.
+ See policy :policy:`CMP0165`.
+* It must be called in the highest directory common to all targets
+ using the named language directly for compiling sources or
+ indirectly through link dependencies. It is simplest to enable all
+ needed languages in the top-level directory of a project.
The ``OPTIONAL`` keyword is a placeholder for future implementation and
does not currently work. Instead you can use the :module:`CheckLanguage`
diff --git a/Help/command/export.rst b/Help/command/export.rst
index cc927bc..349522e 100644
--- a/Help/command/export.rst
+++ b/Help/command/export.rst
@@ -15,12 +15,13 @@ Synopsis
export(`TARGETS`_ <target>... [...])
export(`EXPORT`_ <export-name> [...])
export(`PACKAGE`_ <PackageName>)
+ export(`SETUP`_ <export-name> [...])
Exporting Targets
^^^^^^^^^^^^^^^^^
-.. _`export(TARGETS)`:
-.. _TARGETS:
+.. signature::
+ export(TARGETS <target>... [...])
.. code-block:: cmake
@@ -62,7 +63,7 @@ The options are:
This signature requires all targets to be listed explicitly. If a library
target is included in the export, but a target to which it links is not
-included, the behavior is unspecified. See the `export(EXPORT)`_ signature
+included, the behavior is unspecified. See the :command:`export(EXPORT)` signature
to automatically export the same targets from the build tree as
:command:`install(EXPORT)` would from an install tree.
@@ -102,27 +103,35 @@ that policy is set to OLD for one of the targets.
Exporting Targets matching install(EXPORT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. _`export(EXPORT)`:
-.. _EXPORT:
+.. signature::
+ export(EXPORT <export-name> [...])
.. code-block:: cmake
export(EXPORT <export-name> [NAMESPACE <namespace>] [FILE <filename>]
- [CXX_MODULES_DIRECTORY <directory>])
+ [CXX_MODULES_DIRECTORY <directory>] [EXPORT_PACKAGE_DEPENDENCIES])
Creates a file ``<filename>`` that may be included by outside projects to
import targets from the current project's build tree. This is the same
-as the `export(TARGETS)`_ signature, except that the targets are not
+as the :command:`export(TARGETS)` signature, except that the targets are not
explicitly listed. Instead, it exports the targets associated with
the installation export ``<export-name>``. Target installations may be
associated with the export ``<export-name>`` using the ``EXPORT`` option
of the :command:`install(TARGETS)` command.
+``EXPORT_PACKAGE_DEPENDENCIES``
+ .. note::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES``.
+
+ Specify that :command:`find_dependency` calls should be exported. See
+ :command:`install(EXPORT)` for details on how this works.
+
Exporting Packages
^^^^^^^^^^^^^^^^^^
-.. _`export(PACKAGE)`:
-.. _PACKAGE:
+.. signature::
+ export(PACKAGE <PackageName>)
.. code-block:: cmake
@@ -149,3 +158,66 @@ registry.
outside the source and build trees. Set the
:variable:`CMAKE_EXPORT_PACKAGE_REGISTRY` variable to add build directories
to the CMake user package registry.
+
+Configuring Exports
+^^^^^^^^^^^^^^^^^^^
+
+.. signature::
+ export(SETUP <export-name> [...])
+
+.. code-block:: cmake
+
+ export(SETUP <export-name>
+ [PACKAGE_DEPENDENCY <dep>
+ [ENABLED (<bool-true>|<bool-false>|AUTO)]
+ [EXTRA_ARGS <args>...]
+ ] [...]
+ [TARGET <target>
+ [XCFRAMEWORK_LOCATION <location>]
+ ] [...]
+ )
+
+.. versionadded:: 3.29
+
+Configure the parameters of an export. The arguments are as follows:
+
+``PACKAGE_DEPENDENCY <dep>``
+ .. note::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES``.
+
+ Specify a package dependency to configure. This changes how
+ :command:`find_dependency` calls are written during
+ :command:`export(EXPORT)` and :command:`install(EXPORT)`. ``<dep>`` is the
+ name of a package to export. This argument accepts the following additional
+ arguments:
+
+ ``ENABLED``
+ Manually control whether or not the dependency is exported. This accepts
+ the following values:
+
+ ``<bool-true>``
+ Any value that CMake recognizes as "true". Always export the dependency,
+ even if no exported targets depend on it. This can be used to manually
+ add :command:`find_dependency` calls to the export.
+
+ ``<bool-false>``
+ Any value that CMake recognizes as "false". Never export the dependency,
+ even if an exported target depends on it.
+
+ ``AUTO``
+ Only export the dependency if an exported target depends on it.
+
+ ``EXTRA_ARGS <args>``
+ Specify additional arguments to pass to :command:`find_dependency` after
+ the ``REQUIRED`` argument.
+
+``TARGET <target>``
+ Specify a target to configure in this export. This argument accepts the
+ following additional arguments:
+
+ ``XCFRAMEWORK_LOCATION``
+ Specify the location of an ``.xcframework`` which contains the library from
+ 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.
diff --git a/Help/command/file.rst b/Help/command/file.rst
index f9d1a79..ef49faa 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -28,18 +28,17 @@ Synopsis
file(`STRINGS`_ <filename> <out-var> [...])
file(`\<HASH\>`_ <filename> <out-var>)
file(`TIMESTAMP`_ <filename> <out-var> [...])
- file(`GET_RUNTIME_DEPENDENCIES`_ [...])
`Writing`_
file({`WRITE`_ | `APPEND`_} <filename> <content>...)
- file({`TOUCH`_ | `TOUCH_NOCREATE`_} [<file>...])
+ file({`TOUCH`_ | `TOUCH_NOCREATE`_} <file>...)
file(`GENERATE`_ OUTPUT <output-file> [...])
file(`CONFIGURE`_ OUTPUT <output-file> CONTENT <content> [...])
`Filesystem`_
- file({`GLOB`_ | `GLOB_RECURSE`_} <out-var> [...] [<globbing-expr>...])
- file(`MAKE_DIRECTORY`_ [<dir>...])
- file({`REMOVE`_ | `REMOVE_RECURSE`_ } [<files>...])
+ file({`GLOB`_ | `GLOB_RECURSE`_} <out-var> [...] <globbing-expr>...)
+ file(`MAKE_DIRECTORY`_ <directories>...)
+ file({`REMOVE`_ | `REMOVE_RECURSE`_ } <files>...)
file(`RENAME`_ <oldname> <newname> [...])
file(`COPY_FILE`_ <oldname> <newname> [...])
file({`COPY`_ | `INSTALL`_} <file>... DESTINATION <dir> [...])
@@ -65,6 +64,10 @@ Synopsis
file(`ARCHIVE_CREATE`_ OUTPUT <archive> PATHS <paths>... [...])
file(`ARCHIVE_EXTRACT`_ INPUT <archive> [...])
+ `Handling Runtime Binaries`_
+ file(`GET_RUNTIME_DEPENDENCIES`_ [...])
+
+
Reading
^^^^^^^
@@ -80,7 +83,7 @@ Reading
(``a`` through ``f``) are in lowercase.
.. signature::
- file(STRINGS <filename> <variable> [<options>...])
+ file(STRINGS <filename> <variable> <options>...)
Parse a list of ASCII strings from ``<filename>`` and store it in
``<variable>``. Binary data in the file are ignored. Carriage return
@@ -113,6 +116,11 @@ Reading
Consider only strings that match the given regular expression,
as described under :ref:`string(REGEX) <Regex Specification>`.
+ .. versionchanged:: 3.29
+ Capture groups from the last match in the file are stored in
+ :variable:`CMAKE_MATCH_<n>`, similar to
+ :command:`string(REGEX MATCHALL)`. See policy :policy:`CMP0159`.
+
``ENCODING <encoding-type>``
.. versionadded:: 3.1
@@ -152,323 +160,6 @@ Reading
See the :command:`string(TIMESTAMP)` command for documentation of
the ``<format>`` and ``UTC`` options.
-.. signature::
- file(GET_RUNTIME_DEPENDENCIES [...])
-
- .. versionadded:: 3.16
-
- Recursively get the list of libraries depended on by the given files:
-
- .. code-block:: cmake
-
- file(GET_RUNTIME_DEPENDENCIES
- [RESOLVED_DEPENDENCIES_VAR <deps_var>]
- [UNRESOLVED_DEPENDENCIES_VAR <unresolved_deps_var>]
- [CONFLICTING_DEPENDENCIES_PREFIX <conflicting_deps_prefix>]
- [EXECUTABLES [<executable_files>...]]
- [LIBRARIES [<library_files>...]]
- [MODULES [<module_files>...]]
- [DIRECTORIES [<directories>...]]
- [BUNDLE_EXECUTABLE <bundle_executable_file>]
- [PRE_INCLUDE_REGEXES [<regexes>...]]
- [PRE_EXCLUDE_REGEXES [<regexes>...]]
- [POST_INCLUDE_REGEXES [<regexes>...]]
- [POST_EXCLUDE_REGEXES [<regexes>...]]
- [POST_INCLUDE_FILES [<files>...]]
- [POST_EXCLUDE_FILES [<files>...]]
- )
-
- Please note that this sub-command is not intended to be used in project mode.
- It is intended for use at install time, either from code generated by the
- :command:`install(RUNTIME_DEPENDENCY_SET)` command, or from code provided by
- the project via :command:`install(CODE)` or :command:`install(SCRIPT)`.
- For example:
-
- .. code-block:: cmake
-
- install(CODE [[
- file(GET_RUNTIME_DEPENDENCIES
- # ...
- )
- ]])
-
- The arguments are as follows:
-
- ``RESOLVED_DEPENDENCIES_VAR <deps_var>``
- Name of the variable in which to store the list of resolved dependencies.
-
- ``UNRESOLVED_DEPENDENCIES_VAR <unresolved_deps_var>``
- Name of the variable in which to store the list of unresolved
- dependencies. If this variable is not specified, and there are any
- unresolved dependencies, an error is issued.
-
- ``CONFLICTING_DEPENDENCIES_PREFIX <conflicting_deps_prefix>``
- Variable prefix in which to store conflicting dependency information.
- Dependencies are conflicting if two files with the same name are found in
- two different directories. The list of filenames that conflict are stored
- in ``<conflicting_deps_prefix>_FILENAMES``. For each filename, the list
- of paths that were found for that filename are stored in
- ``<conflicting_deps_prefix>_<filename>``.
-
- ``EXECUTABLES <executable_files>``
- List of executable files to read for dependencies. These are executables
- that are typically created with :command:`add_executable`, but they do
- not have to be created by CMake. On Apple platforms, the paths to these
- files determine the value of ``@executable_path`` when recursively
- resolving the libraries. Specifying any kind of library (``STATIC``,
- ``MODULE``, or ``SHARED``) here will result in undefined behavior.
-
- ``LIBRARIES <library_files>``
- List of library files to read for dependencies. These are libraries that
- are typically created with :command:`add_library(SHARED)`, but they do
- not have to be created by CMake. Specifying ``STATIC`` libraries,
- ``MODULE`` libraries, or executables here will result in undefined
- behavior.
-
- ``MODULES <module_files>``
- List of loadable module files to read for dependencies. These are modules
- that are typically created with :command:`add_library(MODULE)`, but they
- do not have to be created by CMake. They are typically used by calling
- ``dlopen()`` at runtime rather than linked at link time with ``ld -l``.
- Specifying ``STATIC`` libraries, ``SHARED`` libraries, or executables
- here will result in undefined behavior.
-
- ``DIRECTORIES <directories>``
- List of additional directories to search for dependencies. On Linux
- platforms, these directories are searched if the dependency is not found
- in any of the other usual paths. If it is found in such a directory, a
- warning is issued, because it means that the file is incomplete (it does
- not list all of the directories that contain its dependencies).
- On Windows platforms, these directories are searched if the dependency
- is not found in any of the other search paths, but no warning is issued,
- because searching other paths is a normal part of Windows dependency
- resolution. On Apple platforms, this argument has no effect.
-
- ``BUNDLE_EXECUTABLE <bundle_executable_file>``
- Executable to treat as the "bundle executable" when resolving libraries.
- On Apple platforms, this argument determines the value of
- ``@executable_path`` when recursively resolving libraries for
- ``LIBRARIES`` and ``MODULES`` files. It has no effect on ``EXECUTABLES``
- files. On other platforms, it has no effect. This is typically (but not
- always) one of the executables in the ``EXECUTABLES`` argument which
- designates the "main" executable of the package.
-
- The following arguments specify filters for including or excluding libraries
- to be resolved. See below for a full description of how they work.
-
- ``PRE_INCLUDE_REGEXES <regexes>``
- List of pre-include regexes through which to filter the names of
- not-yet-resolved dependencies.
-
- ``PRE_EXCLUDE_REGEXES <regexes>``
- List of pre-exclude regexes through which to filter the names of
- not-yet-resolved dependencies.
-
- ``POST_INCLUDE_REGEXES <regexes>``
- List of post-include regexes through which to filter the names of
- resolved dependencies.
-
- ``POST_EXCLUDE_REGEXES <regexes>``
- List of post-exclude regexes through which to filter the names of
- resolved dependencies.
-
- ``POST_INCLUDE_FILES <files>``
- .. versionadded:: 3.21
-
- List of post-include filenames through which to filter the names of
- resolved dependencies. Symlinks are resolved when attempting to match
- these filenames.
-
- ``POST_EXCLUDE_FILES <files>``
- .. versionadded:: 3.21
-
- List of post-exclude filenames through which to filter the names of
- resolved dependencies. Symlinks are resolved when attempting to match
- these filenames.
-
- These arguments can be used to exclude unwanted system libraries when
- resolving the dependencies, or to include libraries from a specific
- directory. The filtering works as follows:
-
- 1. If the not-yet-resolved dependency matches any of the
- ``PRE_INCLUDE_REGEXES``, steps 2 and 3 are skipped, and the dependency
- resolution proceeds to step 4.
-
- 2. If the not-yet-resolved dependency matches any of the
- ``PRE_EXCLUDE_REGEXES``, dependency resolution stops for that dependency.
-
- 3. Otherwise, dependency resolution proceeds.
-
- 4. ``file(GET_RUNTIME_DEPENDENCIES)`` searches for the dependency according
- to the linking rules of the platform (see below).
-
- 5. If the dependency is found, and its full path matches one of the
- ``POST_INCLUDE_REGEXES`` or ``POST_INCLUDE_FILES``, the full path is added
- to the resolved dependencies, and ``file(GET_RUNTIME_DEPENDENCIES)``
- recursively resolves that library's own dependencies. Otherwise, resolution
- proceeds to step 6.
-
- 6. If the dependency is found, but its full path matches one of the
- ``POST_EXCLUDE_REGEXES`` or ``POST_EXCLUDE_FILES``, it is not added to the
- resolved dependencies, and dependency resolution stops for that dependency.
-
- 7. If the dependency is found, and its full path does not match either
- ``POST_INCLUDE_REGEXES``, ``POST_INCLUDE_FILES``, ``POST_EXCLUDE_REGEXES``,
- or ``POST_EXCLUDE_FILES``, the full path is added to the resolved
- dependencies, and ``file(GET_RUNTIME_DEPENDENCIES)`` recursively resolves
- that library's own dependencies.
-
- Different platforms have different rules for how dependencies are resolved.
- These specifics are described here.
-
- On Linux platforms, library resolution works as follows:
-
- 1. If the depending file does not have any ``RUNPATH`` entries, and the
- library exists in one of the depending file's ``RPATH`` entries, or its
- parents', in that order, the dependency is resolved to that file.
- 2. Otherwise, if the depending file has any ``RUNPATH`` entries, and the
- library exists in one of those entries, the dependency is resolved to that
- file.
- 3. Otherwise, if the library exists in one of the directories listed by
- ``ldconfig``, the dependency is resolved to that file.
- 4. Otherwise, if the library exists in one of the ``DIRECTORIES`` entries,
- the dependency is resolved to that file. In this case, a warning is
- issued, because finding a file in one of the ``DIRECTORIES`` means that
- the depending file is not complete (it does not list all the directories
- from which it pulls dependencies).
-
- 5. Otherwise, the dependency is unresolved.
-
- On Windows platforms, library resolution works as follows:
-
- 1. DLL dependency names are converted to lowercase for matching filters.
- Windows DLL names are case-insensitive, and some linkers mangle the
- case of the DLL dependency names. However, this makes it more difficult
- for ``PRE_INCLUDE_REGEXES``, ``PRE_EXCLUDE_REGEXES``,
- ``POST_INCLUDE_REGEXES``, and ``POST_EXCLUDE_REGEXES`` to properly
- filter DLL names - every regex would have to check for both uppercase
- and lowercase letters. For example:
-
- .. code-block:: cmake
-
- file(GET_RUNTIME_DEPENDENCIES
- # ...
- PRE_INCLUDE_REGEXES "^[Mm][Yy][Ll][Ii][Bb][Rr][Aa][Rr][Yy]\\.[Dd][Ll][Ll]$"
- )
-
- Converting the DLL name to lowercase allows the regexes to only match
- lowercase names, thus simplifying the regex. For example:
-
- .. code-block:: cmake
-
- file(GET_RUNTIME_DEPENDENCIES
- # ...
- PRE_INCLUDE_REGEXES "^mylibrary\\.dll$"
- )
-
- This regex will match ``mylibrary.dll`` regardless of how it is cased,
- either on disk or in the depending file. (For example, it will match
- ``mylibrary.dll``, ``MyLibrary.dll``, and ``MYLIBRARY.DLL``.)
-
- .. versionchanged:: 3.27
-
- The conversion to lowercase only applies while matching filters.
- Results reported after filtering case-preserve each DLL name as it is
- found on disk, if resolved, and otherwise as it is referenced by the
- dependent binary.
-
- Prior to CMake 3.27, the results were reported with lowercase DLL
- file names, but the directory portion retained its casing.
-
- 2. (**Not yet implemented**) If the depending file is a Windows Store app,
- and the dependency is listed as a dependency in the application's package
- manifest, the dependency is resolved to that file.
-
- 3. Otherwise, if the library exists in the same directory as the depending
- file, the dependency is resolved to that file.
-
- 4. Otherwise, if the library exists in either the operating system's
- ``system32`` directory or the ``Windows`` directory, in that order, the
- dependency is resolved to that file.
-
- 5. Otherwise, if the library exists in one of the directories specified by
- ``DIRECTORIES``, in the order they are listed, the dependency is resolved
- to that file. In this case, a warning is not issued, because searching
- other directories is a normal part of Windows library resolution.
-
- 6. Otherwise, the dependency is unresolved.
-
- On Apple platforms, library resolution works as follows:
-
- 1. If the dependency starts with ``@executable_path/``, and an
- ``EXECUTABLES`` argument is in the process of being resolved, and
- replacing ``@executable_path/`` with the directory of the executable
- yields an existing file, the dependency is resolved to that file.
-
- 2. Otherwise, if the dependency starts with ``@executable_path/``, and there
- is a ``BUNDLE_EXECUTABLE`` argument, and replacing ``@executable_path/``
- with the directory of the bundle executable yields an existing file, the
- dependency is resolved to that file.
-
- 3. Otherwise, if the dependency starts with ``@loader_path/``, and replacing
- ``@loader_path/`` with the directory of the depending file yields an
- existing file, the dependency is resolved to that file.
-
- 4. Otherwise, if the dependency starts with ``@rpath/``, and replacing
- ``@rpath/`` with one of the ``RPATH`` entries of the depending file
- yields an existing file, the dependency is resolved to that file.
- Note that ``RPATH`` entries that start with ``@executable_path/`` or
- ``@loader_path/`` also have these items replaced with the appropriate
- path.
-
- 5. Otherwise, if the dependency is an absolute file that exists,
- the dependency is resolved to that file.
-
- 6. Otherwise, the dependency is unresolved.
-
- This function accepts several variables that determine which tool is used for
- dependency resolution:
-
- .. variable:: CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM
-
- Determines which operating system and executable format the files are built
- for. This could be one of several values:
-
- * ``linux+elf``
- * ``windows+pe``
- * ``macos+macho``
-
- If this variable is not specified, it is determined automatically by system
- introspection.
-
- .. variable:: CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL
-
- Determines the tool to use for dependency resolution. It could be one of
- several values, depending on the value of
- :variable:`CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM`:
-
- ================================================= =============================================
- ``CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM`` ``CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL``
- ================================================= =============================================
- ``linux+elf`` ``objdump``
- ``windows+pe`` ``objdump`` or ``dumpbin``
- ``macos+macho`` ``otool``
- ================================================= =============================================
-
- If this variable is not specified, it is determined automatically by system
- introspection.
-
- .. variable:: CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND
-
- Determines the path to the tool to use for dependency resolution. This is
- the actual path to ``objdump``, ``dumpbin``, or ``otool``.
-
- If this variable is not specified, it is determined by the value of
- ``CMAKE_OBJDUMP`` if set, else by system introspection.
-
- .. versionadded:: 3.18
- Use ``CMAKE_OBJDUMP`` if set.
-
Writing
^^^^^^^
@@ -486,8 +177,8 @@ Writing
to update the file only when its content changes.
.. signature::
- file(TOUCH [<files>...])
- file(TOUCH_NOCREATE [<files>...])
+ file(TOUCH <files>...)
+ file(TOUCH_NOCREATE <files>...)
.. versionadded:: 3.12
@@ -638,10 +329,10 @@ Filesystem
.. signature::
file(GLOB <variable>
[LIST_DIRECTORIES true|false] [RELATIVE <path>] [CONFIGURE_DEPENDS]
- [<globbing-expressions>...])
+ <globbing-expressions>...)
file(GLOB_RECURSE <variable> [FOLLOW_SYMLINKS]
[LIST_DIRECTORIES true|false] [RELATIVE <path>] [CONFIGURE_DEPENDS]
- [<globbing-expressions>...])
+ <globbing-expressions>...)
Generate a list of files that match the ``<globbing-expressions>`` and
store it into the ``<variable>``. Globbing expressions are similar to
@@ -703,13 +394,13 @@ Filesystem
============== ======================================================
.. signature::
- file(MAKE_DIRECTORY [<directories>...])
+ file(MAKE_DIRECTORY <directories>...)
Create the given directories and their parents as needed.
.. signature::
- file(REMOVE [<files>...])
- file(REMOVE_RECURSE [<files>...])
+ file(REMOVE <files>...)
+ file(REMOVE_RECURSE <files>...)
Remove the given files. The ``REMOVE_RECURSE`` mode will remove the given
files and directories, including non-empty directories. No error is emitted
@@ -1012,8 +703,8 @@ Transfer
^^^^^^^^
.. signature::
- file(DOWNLOAD <url> [<file>] [<options>...])
- file(UPLOAD <file> <url> [<options>...])
+ file(DOWNLOAD <url> [<file>] <options>...)
+ file(UPLOAD <file> <url> <options>...)
The ``DOWNLOAD`` subcommand downloads the given ``<url>`` to a local
``<file>``. The ``UPLOAD`` mode uploads a local ``<file>`` to a given
@@ -1092,6 +783,15 @@ Transfer
is not specified, the value of the :variable:`CMAKE_NETRC_FILE` variable
will be used instead.
+ ``TLS_VERSION <min>``
+ .. versionadded:: 3.30
+
+ Specify minimum TLS version for ``https://`` URLs.
+ If this option is not specified, the value of the
+ :variable:`CMAKE_TLS_VERSION` variable or :envvar:`CMAKE_TLS_VERSION`
+ environment variable will be used instead.
+ See :variable:`CMAKE_TLS_VERSION` for allowed values.
+
``TLS_VERIFY <ON|OFF>``
Specify whether to verify the server certificate for ``https://`` URLs.
The default is to *not* verify. If this option is not specified, the
@@ -1249,8 +949,335 @@ Archiving
``LIST_ONLY`` will list the files in the archive rather than extract them.
+ .. note::
+ The working directory for this subcommand is the ``DESTINATION`` directory
+ (provided or computed) except when ``LIST_ONLY`` is specified. Therefore,
+ outside of script mode, it may be best to provide absolute paths to
+ ``INPUT`` archives as they are unlikely to be extracted where a relative
+ path works.
+
.. versionadded:: 3.24
The ``TOUCH`` option gives extracted files a current local
timestamp instead of extracting file timestamps from the archive.
With ``VERBOSE``, the command will produce verbose output.
+
+Handling Runtime Binaries
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. signature::
+ file(GET_RUNTIME_DEPENDENCIES [...])
+
+ .. versionadded:: 3.16
+
+ Recursively get the list of libraries depended on by the given files:
+
+ .. code-block:: cmake
+
+ file(GET_RUNTIME_DEPENDENCIES
+ [RESOLVED_DEPENDENCIES_VAR <deps_var>]
+ [UNRESOLVED_DEPENDENCIES_VAR <unresolved_deps_var>]
+ [CONFLICTING_DEPENDENCIES_PREFIX <conflicting_deps_prefix>]
+ [EXECUTABLES <executable_files>...]
+ [LIBRARIES <library_files>...]
+ [MODULES <module_files>...]
+ [DIRECTORIES <directories>...]
+ [BUNDLE_EXECUTABLE <bundle_executable_file>]
+ [PRE_INCLUDE_REGEXES <regexes>...]
+ [PRE_EXCLUDE_REGEXES <regexes>...]
+ [POST_INCLUDE_REGEXES <regexes>...]
+ [POST_EXCLUDE_REGEXES <regexes>...]
+ [POST_INCLUDE_FILES <files>...]
+ [POST_EXCLUDE_FILES <files>...]
+ )
+
+ Please note that this sub-command is not intended to be used in project mode.
+ It is intended for use at install time, either from code generated by the
+ :command:`install(RUNTIME_DEPENDENCY_SET)` command, or from code provided by
+ the project via :command:`install(CODE)` or :command:`install(SCRIPT)`.
+ For example:
+
+ .. code-block:: cmake
+
+ install(CODE [[
+ file(GET_RUNTIME_DEPENDENCIES
+ # ...
+ )
+ ]])
+
+ The arguments are as follows:
+
+ ``RESOLVED_DEPENDENCIES_VAR <deps_var>``
+ Name of the variable in which to store the list of resolved dependencies.
+
+ ``UNRESOLVED_DEPENDENCIES_VAR <unresolved_deps_var>``
+ Name of the variable in which to store the list of unresolved
+ dependencies. If this variable is not specified, and there are any
+ unresolved dependencies, an error is issued.
+
+ ``CONFLICTING_DEPENDENCIES_PREFIX <conflicting_deps_prefix>``
+ Variable prefix in which to store conflicting dependency information.
+ Dependencies are conflicting if two files with the same name are found in
+ two different directories. The list of filenames that conflict are stored
+ in ``<conflicting_deps_prefix>_FILENAMES``. For each filename, the list
+ of paths that were found for that filename are stored in
+ ``<conflicting_deps_prefix>_<filename>``.
+
+ ``EXECUTABLES <executable_files>...``
+ List of executable files to read for dependencies. These are executables
+ that are typically created with :command:`add_executable`, but they do
+ not have to be created by CMake. On Apple platforms, the paths to these
+ files determine the value of ``@executable_path`` when recursively
+ resolving the libraries. Specifying any kind of library (``STATIC``,
+ ``MODULE``, or ``SHARED``) here will result in undefined behavior.
+
+ ``LIBRARIES <library_files>...``
+ List of library files to read for dependencies. These are libraries that
+ are typically created with :command:`add_library(SHARED)`, but they do
+ not have to be created by CMake. Specifying ``STATIC`` libraries,
+ ``MODULE`` libraries, or executables here will result in undefined
+ behavior.
+
+ ``MODULES <module_files>...``
+ List of loadable module files to read for dependencies. These are modules
+ that are typically created with :command:`add_library(MODULE)`, but they
+ do not have to be created by CMake. They are typically used by calling
+ ``dlopen()`` at runtime rather than linked at link time with ``ld -l``.
+ Specifying ``STATIC`` libraries, ``SHARED`` libraries, or executables
+ here will result in undefined behavior.
+
+ ``DIRECTORIES <directories>...``
+ List of additional directories to search for dependencies. On Linux
+ platforms, these directories are searched if the dependency is not found
+ in any of the other usual paths. If it is found in such a directory, a
+ warning is issued, because it means that the file is incomplete (it does
+ not list all of the directories that contain its dependencies).
+ On Windows platforms, these directories are searched if the dependency
+ is not found in any of the other search paths, but no warning is issued,
+ because searching other paths is a normal part of Windows dependency
+ resolution. On Apple platforms, this argument has no effect.
+
+ ``BUNDLE_EXECUTABLE <bundle_executable_file>``
+ Executable to treat as the "bundle executable" when resolving libraries.
+ On Apple platforms, this argument determines the value of
+ ``@executable_path`` when recursively resolving libraries for
+ ``LIBRARIES`` and ``MODULES`` files. It has no effect on ``EXECUTABLES``
+ files. On other platforms, it has no effect. This is typically (but not
+ always) one of the executables in the ``EXECUTABLES`` argument which
+ designates the "main" executable of the package.
+
+ The following arguments specify filters for including or excluding libraries
+ to be resolved. See below for a full description of how they work.
+
+ ``PRE_INCLUDE_REGEXES <regexes>...``
+ List of pre-include regexes through which to filter the names of
+ not-yet-resolved dependencies.
+
+ ``PRE_EXCLUDE_REGEXES <regexes>...``
+ List of pre-exclude regexes through which to filter the names of
+ not-yet-resolved dependencies.
+
+ ``POST_INCLUDE_REGEXES <regexes>...``
+ List of post-include regexes through which to filter the names of
+ resolved dependencies.
+
+ ``POST_EXCLUDE_REGEXES <regexes>...``
+ List of post-exclude regexes through which to filter the names of
+ resolved dependencies.
+
+ ``POST_INCLUDE_FILES <files>...``
+ .. versionadded:: 3.21
+
+ List of post-include filenames through which to filter the names of
+ resolved dependencies. Symlinks are resolved when attempting to match
+ these filenames.
+
+ ``POST_EXCLUDE_FILES <files>...``
+ .. versionadded:: 3.21
+
+ List of post-exclude filenames through which to filter the names of
+ resolved dependencies. Symlinks are resolved when attempting to match
+ these filenames.
+
+ These arguments can be used to exclude unwanted system libraries when
+ resolving the dependencies, or to include libraries from a specific
+ directory. The filtering works as follows:
+
+ 1. If the not-yet-resolved dependency matches any of the
+ ``PRE_INCLUDE_REGEXES``, steps 2 and 3 are skipped, and the dependency
+ resolution proceeds to step 4.
+
+ 2. If the not-yet-resolved dependency matches any of the
+ ``PRE_EXCLUDE_REGEXES``, dependency resolution stops for that dependency.
+
+ 3. Otherwise, dependency resolution proceeds.
+
+ 4. ``file(GET_RUNTIME_DEPENDENCIES)`` searches for the dependency according
+ to the linking rules of the platform (see below).
+
+ 5. If the dependency is found, and its full path matches one of the
+ ``POST_INCLUDE_REGEXES`` or ``POST_INCLUDE_FILES``, the full path is added
+ to the resolved dependencies, and ``file(GET_RUNTIME_DEPENDENCIES)``
+ recursively resolves that library's own dependencies. Otherwise, resolution
+ proceeds to step 6.
+
+ 6. If the dependency is found, but its full path matches one of the
+ ``POST_EXCLUDE_REGEXES`` or ``POST_EXCLUDE_FILES``, it is not added to the
+ resolved dependencies, and dependency resolution stops for that dependency.
+
+ 7. If the dependency is found, and its full path does not match either
+ ``POST_INCLUDE_REGEXES``, ``POST_INCLUDE_FILES``, ``POST_EXCLUDE_REGEXES``,
+ or ``POST_EXCLUDE_FILES``, the full path is added to the resolved
+ dependencies, and ``file(GET_RUNTIME_DEPENDENCIES)`` recursively resolves
+ that library's own dependencies.
+
+ Different platforms have different rules for how dependencies are resolved.
+ These specifics are described here.
+
+ On Linux platforms, library resolution works as follows:
+
+ 1. If the depending file does not have any ``RUNPATH`` entries, and the
+ library exists in one of the depending file's ``RPATH`` entries, or its
+ parents', in that order, the dependency is resolved to that file.
+ 2. Otherwise, if the depending file has any ``RUNPATH`` entries, and the
+ library exists in one of those entries, the dependency is resolved to that
+ file.
+ 3. Otherwise, if the library exists in one of the directories listed by
+ ``ldconfig``, the dependency is resolved to that file.
+ 4. Otherwise, if the library exists in one of the ``DIRECTORIES`` entries,
+ the dependency is resolved to that file. In this case, a warning is
+ issued, because finding a file in one of the ``DIRECTORIES`` means that
+ the depending file is not complete (it does not list all the directories
+ from which it pulls dependencies).
+
+ 5. Otherwise, the dependency is unresolved.
+
+ On Windows platforms, library resolution works as follows:
+
+ 1. DLL dependency names are converted to lowercase for matching filters.
+ Windows DLL names are case-insensitive, and some linkers mangle the
+ case of the DLL dependency names. However, this makes it more difficult
+ for ``PRE_INCLUDE_REGEXES``, ``PRE_EXCLUDE_REGEXES``,
+ ``POST_INCLUDE_REGEXES``, and ``POST_EXCLUDE_REGEXES`` to properly
+ filter DLL names - every regex would have to check for both uppercase
+ and lowercase letters. For example:
+
+ .. code-block:: cmake
+
+ file(GET_RUNTIME_DEPENDENCIES
+ # ...
+ PRE_INCLUDE_REGEXES "^[Mm][Yy][Ll][Ii][Bb][Rr][Aa][Rr][Yy]\\.[Dd][Ll][Ll]$"
+ )
+
+ Converting the DLL name to lowercase allows the regexes to only match
+ lowercase names, thus simplifying the regex. For example:
+
+ .. code-block:: cmake
+
+ file(GET_RUNTIME_DEPENDENCIES
+ # ...
+ PRE_INCLUDE_REGEXES "^mylibrary\\.dll$"
+ )
+
+ This regex will match ``mylibrary.dll`` regardless of how it is cased,
+ either on disk or in the depending file. (For example, it will match
+ ``mylibrary.dll``, ``MyLibrary.dll``, and ``MYLIBRARY.DLL``.)
+
+ .. versionchanged:: 3.27
+
+ The conversion to lowercase only applies while matching filters.
+ Results reported after filtering case-preserve each DLL name as it is
+ found on disk, if resolved, and otherwise as it is referenced by the
+ dependent binary.
+
+ Prior to CMake 3.27, the results were reported with lowercase DLL
+ file names, but the directory portion retained its casing.
+
+ 2. (**Not yet implemented**) If the depending file is a Windows Store app,
+ and the dependency is listed as a dependency in the application's package
+ manifest, the dependency is resolved to that file.
+
+ 3. Otherwise, if the library exists in the same directory as the depending
+ file, the dependency is resolved to that file.
+
+ 4. Otherwise, if the library exists in either the operating system's
+ ``system32`` directory or the ``Windows`` directory, in that order, the
+ dependency is resolved to that file.
+
+ 5. Otherwise, if the library exists in one of the directories specified by
+ ``DIRECTORIES``, in the order they are listed, the dependency is resolved
+ to that file. In this case, a warning is not issued, because searching
+ other directories is a normal part of Windows library resolution.
+
+ 6. Otherwise, the dependency is unresolved.
+
+ On Apple platforms, library resolution works as follows:
+
+ 1. If the dependency starts with ``@executable_path/``, and an
+ ``EXECUTABLES`` argument is in the process of being resolved, and
+ replacing ``@executable_path/`` with the directory of the executable
+ yields an existing file, the dependency is resolved to that file.
+
+ 2. Otherwise, if the dependency starts with ``@executable_path/``, and there
+ is a ``BUNDLE_EXECUTABLE`` argument, and replacing ``@executable_path/``
+ with the directory of the bundle executable yields an existing file, the
+ dependency is resolved to that file.
+
+ 3. Otherwise, if the dependency starts with ``@loader_path/``, and replacing
+ ``@loader_path/`` with the directory of the depending file yields an
+ existing file, the dependency is resolved to that file.
+
+ 4. Otherwise, if the dependency starts with ``@rpath/``, and replacing
+ ``@rpath/`` with one of the ``RPATH`` entries of the depending file
+ yields an existing file, the dependency is resolved to that file.
+ Note that ``RPATH`` entries that start with ``@executable_path/`` or
+ ``@loader_path/`` also have these items replaced with the appropriate
+ path.
+
+ 5. Otherwise, if the dependency is an absolute file that exists,
+ the dependency is resolved to that file.
+
+ 6. Otherwise, the dependency is unresolved.
+
+ This function accepts several variables that determine which tool is used for
+ dependency resolution:
+
+ .. variable:: CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM
+
+ Determines which operating system and executable format the files are built
+ for. This could be one of several values:
+
+ * ``linux+elf``
+ * ``windows+pe``
+ * ``macos+macho``
+
+ If this variable is not specified, it is determined automatically by system
+ introspection.
+
+ .. variable:: CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL
+
+ Determines the tool to use for dependency resolution. It could be one of
+ several values, depending on the value of
+ :variable:`CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM`:
+
+ ================================================= =============================================
+ ``CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM`` ``CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL``
+ ================================================= =============================================
+ ``linux+elf`` ``objdump``
+ ``windows+pe`` ``objdump`` or ``dumpbin``
+ ``macos+macho`` ``otool``
+ ================================================= =============================================
+
+ If this variable is not specified, it is determined automatically by system
+ introspection.
+
+ .. variable:: CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND
+
+ Determines the path to the tool to use for dependency resolution. This is
+ the actual path to ``objdump``, ``dumpbin``, or ``otool``.
+
+ If this variable is not specified, it is determined by the value of
+ ``CMAKE_OBJDUMP`` if set, else by system introspection.
+
+ .. versionadded:: 3.18
+ Use ``CMAKE_OBJDUMP`` if set.
diff --git a/Help/command/if.rst b/Help/command/if.rst
index 5d85a1f..de25ad3 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -178,6 +178,46 @@ File Operations
False if the given path is an empty string.
+ .. note::
+ Prefer ``if(IS_READABLE)`` to check file readability. ``if(EXISTS)``
+ may be changed in the future to only check file existence.
+
+.. signature:: if(IS_READABLE <path-to-file-or-directory>)
+
+ .. versionadded:: 3.29
+
+ True if the named file or directory is readable. Behavior
+ is well-defined only for explicit full paths (a leading ``~/`` is not
+ expanded as a home directory and is considered a relative path).
+ Resolves symbolic links, i.e. if the named file or directory is a
+ symbolic link, returns true if the target of the symbolic link is readable.
+
+ False if the given path is an empty string.
+
+.. signature:: if(IS_WRITABLE <path-to-file-or-directory>)
+
+ .. versionadded:: 3.29
+
+ True if the named file or directory is writable. Behavior
+ is well-defined only for explicit full paths (a leading ``~/`` is not
+ expanded as a home directory and is considered a relative path).
+ Resolves symbolic links, i.e. if the named file or directory is a
+ symbolic link, returns true if the target of the symbolic link is writable.
+
+ False if the given path is an empty string.
+
+.. signature:: if(IS_EXECUTABLE <path-to-file-or-directory>)
+
+ .. versionadded:: 3.29
+
+ True if the named file or directory is executable. Behavior
+ is well-defined only for explicit full paths (a leading ``~/`` is not
+ expanded as a home directory and is considered a relative path).
+ Resolves symbolic links, i.e. if the named file or directory is a
+ symbolic link, returns true if the target of the symbolic link is executable.
+
+ False if the given path is an empty string.
+
.. signature:: if(<file1> IS_NEWER_THAN <file2>)
:target: IS_NEWER_THAN
diff --git a/Help/command/install.rst b/Help/command/install.rst
index b0698dd..b2742d6 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -47,23 +47,26 @@ signatures that specify them. The common options are:
``DESTINATION <dir>``
Specify the directory on disk to which a file will be installed.
- Arguments can be relative or absolute paths.
+ ``<dir>`` should be a relative path. An absolute path is allowed,
+ but not recommended.
- If a relative path is given it is interpreted relative to the value
+ When a relative path is given it is interpreted relative to the value
of the :variable:`CMAKE_INSTALL_PREFIX` variable.
The prefix can be relocated at install time using the ``DESTDIR``
mechanism explained in the :variable:`CMAKE_INSTALL_PREFIX` variable
documentation.
- If an absolute path (with a leading slash or drive letter) is given
- it is used verbatim.
-
- As absolute paths are not supported by :manual:`cpack <cpack(1)>` installer
- generators, it is preferable to use relative paths throughout.
+ As absolute paths do not work with the ``cmake --install`` command's
+ :option:`--prefix <cmake--install --prefix>` option, or with the
+ :manual:`cpack <cpack(1)>` installer generators, it is strongly recommended
+ to use relative paths throughout for best support by package maintainers.
In particular, there is no need to make paths absolute by prepending
:variable:`CMAKE_INSTALL_PREFIX`; this prefix is used by default if
the DESTINATION is a relative path.
+ If an absolute path (with a leading slash or drive letter) is given
+ it is used verbatim.
+
``PERMISSIONS <permission>...``
Specify permissions for installed files. Valid permissions are
``OWNER_READ``, ``OWNER_WRITE``, ``OWNER_EXECUTE``, ``GROUP_READ``,
@@ -280,8 +283,8 @@ Signatures
instead of being able to rely on the above (see next example below).
To make packages compliant with distribution filesystem layout policies, if
- projects must specify a ``DESTINATION``, it is recommended that they use a
- path that begins with the appropriate :module:`GNUInstallDirs` variable.
+ 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 following example shows a static library
being installed to the default destination provided by
@@ -572,8 +575,8 @@ Signatures
``DATA`` instead.
To make packages compliant with distribution filesystem layout policies, if
- projects must specify a ``DESTINATION``, it is recommended that they use a
- path that begins with the appropriate :module:`GNUInstallDirs` variable.
+ 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 following example shows how to follow
this advice while installing an image to a project-specific documentation
@@ -719,8 +722,8 @@ Signatures
``DATA`` instead.
To make packages compliant with distribution filesystem layout policies, if
- projects must specify a ``DESTINATION``, it is recommended that they use a
- path that begins with the appropriate :module:`GNUInstallDirs` variable.
+ 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.
@@ -784,7 +787,8 @@ Signatures
[CXX_MODULES_DIRECTORY <directory>]
[EXPORT_LINK_INTERFACE_LIBRARIES]
[COMPONENT <component>]
- [EXCLUDE_FROM_ALL])
+ [EXCLUDE_FROM_ALL]
+ [EXPORT_PACKAGE_DEPENDENCIES])
install(EXPORT_ANDROID_MK <export-name> DESTINATION <dir> [...])
The ``EXPORT`` form generates and installs a CMake file containing code to
@@ -848,6 +852,36 @@ Signatures
without this information, none of the C++ modules which are part of the
targets in the export set will support being imported in consuming targets.
+ ``EXPORT_PACKAGE_DEPENDENCIES``
+ .. note::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES``.
+
+ Specify that :command:`find_dependency` calls should be exported. If this
+ argument is specified, CMake examines all targets in the export set and
+ gathers their ``INTERFACE`` link targets. If any such targets either were
+ found with :command:`find_package` or have the
+ :prop_tgt:`EXPORT_FIND_PACKAGE_NAME` property set, and such package
+ dependency was not disabled by passing ``ENABLED OFF`` to
+ :command:`export(SETUP)`, then a :command:`find_dependency` call is
+ written with the target's corresponding package name, a ``REQUIRED``
+ argument, and any additional arguments specified by the ``EXTRA_ARGS``
+ argument of :command:`export(SETUP)`. Any package dependencies that were
+ manually specified by passing ``ENABLED ON`` to :command:`export(SETUP)`
+ are also added, even if the exported targets don't depend on any targets
+ from them.
+
+ The :command:`find_dependency` calls are written in the following order:
+
+ 1. Any package dependencies that were listed in :command:`export(SETUP)`
+ are written in the order they were first specified, regardless of
+ whether or not they contain ``INTERFACE`` dependencies of the
+ exported targets.
+ 2. Any package dependencies that contain ``INTERFACE`` link dependencies
+ of the exported targets and that were never specified in
+ :command:`export(SETUP)` are written in the order they were first
+ found.
+
The ``EXPORT`` form is useful to help outside projects use targets built
and installed by the current project. For example, the code
@@ -864,16 +898,6 @@ Signatures
executable from the installation tree using the imported target name
``mp_myexe`` as if the target were built in its own tree.
- .. note::
- This command supersedes the :command:`install_targets` command and
- the :prop_tgt:`PRE_INSTALL_SCRIPT` and :prop_tgt:`POST_INSTALL_SCRIPT`
- target properties. It also replaces the ``FILES`` forms of the
- :command:`install_files` and :command:`install_programs` commands.
- The processing order of these install rules relative to
- those generated by :command:`install_targets`,
- :command:`install_files`, and :command:`install_programs` commands
- is not defined.
-
.. signature::
install(RUNTIME_DEPENDENCY_SET <set-name> [...])
@@ -937,6 +961,16 @@ Signatures
* ``POST_INCLUDE_FILES <file>...``
* ``POST_EXCLUDE_FILES <file>...``
+.. note::
+ This command supersedes the :command:`install_targets` command and
+ the :prop_tgt:`PRE_INSTALL_SCRIPT` and :prop_tgt:`POST_INSTALL_SCRIPT`
+ target properties. It also replaces the ``FILES`` forms of the
+ :command:`install_files` and :command:`install_programs` commands.
+ The processing order of these install rules relative to
+ those generated by :command:`install_targets`,
+ :command:`install_files`, and :command:`install_programs` commands
+ is not defined.
+
Examples
^^^^^^^^
diff --git a/Help/command/project.rst b/Help/command/project.rst
index d695789..2b93880 100644
--- a/Help/command/project.rst
+++ b/Help/command/project.rst
@@ -123,12 +123,12 @@ The following outlines the steps performed during a ``project()`` call:
* .. versionadded:: 3.15
For every ``project()`` call regardless of the project
- name, include the file named by :variable:`CMAKE_PROJECT_INCLUDE_BEFORE`,
- if set.
+ name, include the file(s) and module(s) named by
+ :variable:`CMAKE_PROJECT_INCLUDE_BEFORE`, if set.
* .. versionadded:: 3.17
If the ``project()`` command specifies ``<PROJECT-NAME>`` as its project
- name, include the file named by
+ name, include the file(s) and module(s) named by
:variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE`, if set.
* Set the various project-specific variables detailed in the `Synopsis`_
@@ -156,11 +156,11 @@ The following outlines the steps performed during a ``project()`` call:
* .. versionadded:: 3.15
For every ``project()`` call regardless of the project
- name, include the file named by :variable:`CMAKE_PROJECT_INCLUDE`,
- if set.
+ name, include the file(s) and module(s) named by
+ :variable:`CMAKE_PROJECT_INCLUDE`, if set.
* If the ``project()`` command specifies ``<PROJECT-NAME>`` as its project
- name, include the file named by
+ name, include the file(s) and module(s) named by
:variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`, if set.
Usage
diff --git a/Help/command/qt_wrap_cpp.rst b/Help/command/qt_wrap_cpp.rst
index ce11c2d..02f7232 100644
--- a/Help/command/qt_wrap_cpp.rst
+++ b/Help/command/qt_wrap_cpp.rst
@@ -8,7 +8,7 @@ qt_wrap_cpp
: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()``).
+ `qt5_wrap_cpp() <https://doc.qt.io/qt-5/qtcore-cmake-qt5-wrap-cpp.html>`_).
Manually create Qt Wrappers.
diff --git a/Help/command/return.rst b/Help/command/return.rst
index bb6d87d..799d3e8 100644
--- a/Help/command/return.rst
+++ b/Help/command/return.rst
@@ -40,7 +40,7 @@ command. All arguments are ignored unless that policy is set to ``NEW``.
.. code-block:: cmake
:caption: CMakeLists.txt
- cmake_version_required(VERSION 3.25)
+ cmake_minimum_required(VERSION 3.25)
project(example)
set(var1 "top-value")
diff --git a/Help/command/string.rst b/Help/command/string.rst
index 2f01653..6bd56a1 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -136,15 +136,16 @@ The following characters have special meaning in regular expressions:
or ``\\`` for a literal backslash ``\``. Escaping a non-special
character is unnecessary but allowed, e.g. ``\a`` matches ``a``.
``[ ]``
- Matches any character(s) inside the brackets
+ Matches any character(s) inside the brackets.
+ To match a literal ``]``, make it the first character, e.g., ``[]ab]``.
``[^ ]``
- Matches any character(s) not inside the brackets
+ Matches any character(s) not inside the brackets.
+ To not match a literal ``]``, make it the first character, e.g., ``[^]ab]``.
``-``
- Inside brackets, specifies an inclusive range between
- characters on either side e.g. ``[a-f]`` is ``[abcdef]``
- To match a literal ``-`` using brackets, make it the first
- or the last character e.g. ``[+*/-]`` matches basic
- mathematical operators.
+ Inside brackets, specifies an inclusive range between characters on
+ either side, e.g., ``[a-f]`` is ``[abcdef]``.
+ To match a literal ``-`` using brackets, make it the first or the last
+ character, e.g., ``[+*/-]`` matches basic mathematical operators.
``*``
Matches preceding pattern zero or more times
``+``
diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst
index 2290efb..5796b00 100644
--- a/Help/command/target_compile_definitions.rst
+++ b/Help/command/target_compile_definitions.rst
@@ -15,7 +15,7 @@ named ``<target>`` must have been created by a command such as
:ref:`ALIAS target <Alias Targets>`.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the :ref:`scope <Target Usage Requirements>` of the following arguments.
+specify the :ref:`scope <Target Command Scope>` of the following arguments.
``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`COMPILE_DEFINITIONS`
property of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_COMPILE_DEFINITIONS` property of ``<target>``.
diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst
index 7cfb24b..64f45aa 100644
--- a/Help/command/target_compile_options.rst
+++ b/Help/command/target_compile_options.rst
@@ -28,7 +28,7 @@ instead of being appended. See policy :policy:`CMP0101` which affects
whether ``BEFORE`` will be ignored in certain cases.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the :ref:`scope <Target Usage Requirements>` of the following arguments.
+specify the :ref:`scope <Target Command Scope>` of the following arguments.
``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`COMPILE_OPTIONS`
property of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_COMPILE_OPTIONS` property of ``<target>``.
diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst
index 2a410ec..bb5f9c3 100644
--- a/Help/command/target_include_directories.rst
+++ b/Help/command/target_include_directories.rst
@@ -18,7 +18,7 @@ By using ``AFTER`` or ``BEFORE`` explicitly, you can select between appending
and prepending, independent of the default.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to specify
-the :ref:`scope <Target Usage Requirements>` of the following arguments.
+the :ref:`scope <Target Command Scope>` of the following arguments.
``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`INCLUDE_DIRECTORIES`
property of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` property of ``<target>``.
diff --git a/Help/command/target_link_directories.rst b/Help/command/target_link_directories.rst
index 2854c96..67d3352 100644
--- a/Help/command/target_link_directories.rst
+++ b/Help/command/target_link_directories.rst
@@ -21,7 +21,7 @@ The named ``<target>`` must have been created by a command such as
:ref:`ALIAS target <Alias Targets>`.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the :ref:`scope <Target Usage Requirements>` of the items that follow
+specify the :ref:`scope <Target Command Scope>` of the items that follow
them. ``PRIVATE`` and ``PUBLIC`` items will populate the
:prop_tgt:`LINK_DIRECTORIES` property of ``<target>``. ``PUBLIC`` and
``INTERFACE`` items will populate the :prop_tgt:`INTERFACE_LINK_DIRECTORIES`
diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index 68d3598..a82adda 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -153,7 +153,7 @@ Libraries for a Target and/or its Dependents
[<PRIVATE|PUBLIC|INTERFACE> <item>...]...)
The ``PUBLIC``, ``PRIVATE`` and ``INTERFACE``
-:ref:`scope <Target Usage Requirements>` keywords can be used to
+:ref:`scope <Target Command Scope>` keywords can be used to
specify both the link dependencies and the link interface in one command.
Libraries and targets following ``PUBLIC`` are linked to, and are made
diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst
index dca9598..7561c99 100644
--- a/Help/command/target_link_options.rst
+++ b/Help/command/target_link_options.rst
@@ -32,7 +32,7 @@ If ``BEFORE`` is specified, the content will be prepended to the property
instead of being appended.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the :ref:`scope <Target Usage Requirements>` of the following arguments.
+specify the :ref:`scope <Target Command Scope>` of the following arguments.
``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`LINK_OPTIONS`
property of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_LINK_OPTIONS` property of ``<target>``.
diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst
index 50eaf22..61ea0aa 100644
--- a/Help/command/target_precompile_headers.rst
+++ b/Help/command/target_precompile_headers.rst
@@ -25,7 +25,7 @@ The named ``<target>`` must have been created by a command such as
:ref:`ALIAS target <Alias Targets>`.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the :ref:`scope <Target Usage Requirements>` of the following arguments.
+specify the :ref:`scope <Target Command Scope>` of the following arguments.
``PRIVATE`` and ``PUBLIC`` items will populate the :prop_tgt:`PRECOMPILE_HEADERS`
property of ``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
:prop_tgt:`INTERFACE_PRECOMPILE_HEADERS` property of ``<target>``
diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst
index 40755c5..0d31f8c 100644
--- a/Help/command/target_sources.rst
+++ b/Help/command/target_sources.rst
@@ -22,7 +22,7 @@ The named ``<target>`` must have been created by a command such as
``<target>`` can be a custom target.
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
-specify the :ref:`scope <Target Usage Requirements>` of the source file paths
+specify the :ref:`scope <Target Command Scope>` of the source file paths
(``<items>``) that follow them. ``PRIVATE`` and ``PUBLIC`` items will
populate the :prop_tgt:`SOURCES` property of ``<target>``, which are used when
building the target itself. ``PUBLIC`` and ``INTERFACE`` items will populate the
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index 0255b4d9..5021851 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -77,6 +77,7 @@ Try Compiling Source Files
[COMPILE_DEFINITIONS <defs>...]
[LINK_OPTIONS <options>...]
[LINK_LIBRARIES <libs>...]
+ [LINKER_LANGUAGE <lang>]
[OUTPUT_VARIABLE <var>]
[COPY_FILE <fileName> [COPY_FILE_ERROR <var>]]
[<LANG>_STANDARD <std>]
@@ -177,6 +178,9 @@ The options for the above signatures are:
If this option is specified, any ``-DLINK_LIBRARIES=...`` value
given to the ``CMAKE_FLAGS`` option will be ignored.
+ .. versionadded:: 3.29
+ Alias targets to imported libraries are also supported.
+
``LINK_OPTIONS <options>...``
.. versionadded:: 3.14
@@ -184,6 +188,14 @@ The options for the above signatures are:
set the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property in the generated
project, depending on the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable.
+``LINKER_LANGUAGE <lang>``
+ .. versionadded:: 3.29
+
+ Specify the :prop_tgt:`LINKER_LANGUAGE` target property of the generated
+ project. When using multiple source files with different languages, set
+ this to the language of the source file containing the program entry point,
+ e.g., ``main``.
+
``LOG_DESCRIPTION <text>``
.. versionadded:: 3.26
diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst
index 1b5087d..c466a81 100644
--- a/Help/command/try_run.rst
+++ b/Help/command/try_run.rst
@@ -67,6 +67,7 @@ The signature above is recommended for clarity.
[COMPILE_DEFINITIONS <defs>...]
[LINK_OPTIONS <options>...]
[LINK_LIBRARIES <libs>...]
+ [LINKER_LANGUAGE <lang>]
[COMPILE_OUTPUT_VARIABLE <var>]
[COPY_FILE <fileName> [COPY_FILE_ERROR <var>]]
[<LANG>_STANDARD <std>]
diff --git a/Help/cpack_gen/deb.rst b/Help/cpack_gen/deb.rst
index 705ec9c..23436de 100644
--- a/Help/cpack_gen/deb.rst
+++ b/Help/cpack_gen/deb.rst
@@ -69,28 +69,32 @@ List of CPack DEB generator specific variables:
:Mandatory: Yes
:Default: ``<CPACK_PACKAGE_FILE_NAME>[-<component>].deb``
- This may be set to ``DEB-DEFAULT`` to allow the CPack DEB generator to generate
- package file name by itself in deb format::
+ This may be set to:
- <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
+ ``DEB-DEFAULT``
+ Tell CPack to automatically generate the package file name in deb format::
- Alternatively provided package file name must end
- with either ``.deb`` or ``.ipk`` suffix.
+ <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
- .. versionadded:: 3.10
- ``.ipk`` suffix used by OPKG packaging system.
+ This setting recommended as the preferred behavior, but for backward
+ compatibility with the CPack DEB generator in CMake prior to version 3.6,
+ this is not the default. Without this, duplicate names may occur.
+ Duplicate files get overwritten and it is up to the packager to set
+ the variables in a manner that will prevent such errors.
- .. note::
+ ``<file-name>[.deb]``
+ Use the given file name.
- Preferred setting of this variable is ``DEB-DEFAULT`` but for backward
- compatibility with the CPack DEB generator in CMake prior to version 3.6 this
- feature is disabled by default.
+ .. versionchanged:: 3.29
- .. note::
+ The ``.deb`` suffix will be automatically added if the file name does
+ not end in ``.deb`` or ``.ipk``. Previously the suffix was required.
+
+ ``<file-name>.ipk``
+ .. versionadded:: 3.10
- By using non default filenames duplicate names may occur. Duplicate files
- get overwritten and it is up to the packager to set the variables in a
- manner that will prevent such errors.
+ Use the given file name.
+ The ``.ipk`` suffix is used by the OPKG packaging system.
.. variable:: CPACK_DEBIAN_PACKAGE_EPOCH
diff --git a/Help/cpack_gen/innosetup.rst b/Help/cpack_gen/innosetup.rst
index f48e7f5..ffdf508 100644
--- a/Help/cpack_gen/innosetup.rst
+++ b/Help/cpack_gen/innosetup.rst
@@ -12,7 +12,11 @@ The generator provides a lot of options like components. Unfortunately, not
all features (e.g. component dependencies) are currently supported by
Inno Setup and they're ignored by the generator for now.
-CPack requires Inno Setup 6 or greater and only works on Windows.
+CPack requires Inno Setup 6 or greater.
+
+.. versionadded:: 3.30
+ The generator is now available on non-Windows hosts,
+ but requires Wine to run the Inno Setup tools.
Variables specific to CPack Inno Setup generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/cpack_gen/productbuild.rst b/Help/cpack_gen/productbuild.rst
index 48a9b44..ee8a03f 100644
--- a/Help/cpack_gen/productbuild.rst
+++ b/Help/cpack_gen/productbuild.rst
@@ -91,8 +91,9 @@ macOS using ProductBuild:
.. versionadded:: 3.23
This option enables more granular control over where the product may be
- installed. When it is set to true, a ``domains`` element of the following
- form will be added to the productbuild Distribution XML:
+ installed. When it is set to true (see policy :policy:`CMP0161`), a
+ ``domains`` element of the following form will be added to the
+ productbuild Distribution XML:
.. code-block:: xml
diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst
index 7b91261..4a2ce5f 100644
--- a/Help/cpack_gen/rpm.rst
+++ b/Help/cpack_gen/rpm.rst
@@ -84,9 +84,18 @@ List of CPack RPM generator specific variables:
:Default: ``<CPACK_PACKAGE_FILE_NAME>[-<component>].rpm`` with spaces
replaced by '-'
- This may be set to ``RPM-DEFAULT`` to allow ``rpmbuild`` tool to generate package
- file name by itself.
- Alternatively provided package file name must end with ``.rpm`` suffix.
+ This may be set to:
+
+ ``RPM-DEFAULT``
+ Tell ``rpmbuild`` to automatically generate the package file name.
+
+ ``<file-name>[.rpm]``
+ Use the given file name.
+
+ .. versionchanged:: 3.29
+
+ The ``.rpm`` suffix will be automatically added if missing.
+ Previously the suffix was required.
.. note::
diff --git a/Help/cpack_gen/wix.rst b/Help/cpack_gen/wix.rst
index af01252..dfa3434 100644
--- a/Help/cpack_gen/wix.rst
+++ b/Help/cpack_gen/wix.rst
@@ -1,10 +1,103 @@
CPack WIX Generator
-------------------
-CPack WIX generator specific options
+Use the `WiX Toolset`_ to produce a Windows Installer ``.msi`` database.
+
+.. _`WiX Toolset`: https://wixtoolset.org/
.. versionadded:: 3.7
- Support :variable:`CPACK_COMPONENT_<compName>_DISABLED` variable.
+ The :variable:`CPACK_COMPONENT_<compName>_DISABLED` variable is now
+ supported.
+
+WiX Toolsets
+^^^^^^^^^^^^
+
+CPack selects one of the following variants of the WiX Toolset
+based on the :variable:`CPACK_WIX_VERSION` variable:
+
+* `WiX .NET Tools`_
+* `WiX Toolset v3`_
+
+WiX .NET Tools
+""""""""""""""
+
+Packaging is performed using the following tools:
+
+``wix build``
+ Build WiX source files directly into a Windows Installer ``.msi`` database.
+
+ Invocations may be customized using tool-specific variables:
+
+ * :variable:`CPACK_WIX_BUILD_EXTENSIONS <CPACK_WIX_<TOOL>_EXTENSIONS>`
+ * :variable:`CPACK_WIX_BUILD_EXTRA_FLAGS <CPACK_WIX_<TOOL>_EXTRA_FLAGS>`
+
+WiX extensions must be named with the form ``WixToolset.<Name>.wixext``.
+
+CPack expects the ``wix`` .NET tool to be available for command-line use
+with any required WiX extensions already installed. Be sure the ``wix``
+version is compatible with :variable:`CPACK_WIX_VERSION`, and that WiX
+extension versions match the ``wix`` tool version. For example:
+
+1. Install the ``wix`` command-line tool using ``dotnet``.
+
+ To install ``wix`` globally for the current user:
+
+ .. code-block:: bat
+
+ dotnet tool install --global wix --version 4.0.4
+
+ This places ``wix.exe`` in ``%USERPROFILE%\.dotnet\tools`` and adds
+ the directory to the current user's ``PATH`` environment variable.
+
+ Or, to install ``wix`` in a specific path, e.g., in ``c:\WiX``:
+
+ .. code-block:: bat
+
+ dotnet tool install --tool-path c:\WiX wix --version 4.0.4
+
+ This places ``wix.exe`` in ``c:\WiX``, but does *not* add it to the
+ current user's ``PATH`` environment variable. The ``WIX`` environment
+ variable may be set to tell CPack where to find the tool,
+ e.g., ``set WIX=c:\WiX``.
+
+2. Add the WiX ``UI`` extension, needed by CPack's default WiX template:
+
+ .. code-block:: bat
+
+ wix extension add --global WixToolset.UI.wixext/4.0.4
+
+ Extensions added globally are stored in ``%USERPROFILE%\.wix``, or if the
+ ``WIX_EXTENSIONS`` environment variable is set, in ``%WIX_EXTENSIONS%\.wix``.
+
+WiX Toolset v3
+""""""""""""""
+
+Packaging is performed using the following tools:
+
+``candle``
+ Compiles WiX source files into ``.wixobj`` files.
+
+ Invocations may be customized using tool-specific variables:
+
+ * :variable:`CPACK_WIX_CANDLE_EXTENSIONS <CPACK_WIX_<TOOL>_EXTENSIONS>`
+ * :variable:`CPACK_WIX_CANDLE_EXTRA_FLAGS <CPACK_WIX_<TOOL>_EXTRA_FLAGS>`
+
+``light``
+ Links ``.wixobj`` files into a Windows Installer ``.msi`` database.
+
+ Invocations may be customized using tool-specific variables:
+
+ * :variable:`CPACK_WIX_LIGHT_EXTENSIONS <CPACK_WIX_<TOOL>_EXTENSIONS>`
+ * :variable:`CPACK_WIX_LIGHT_EXTRA_FLAGS <CPACK_WIX_<TOOL>_EXTRA_FLAGS>`
+
+CPack invokes both tools as needed. Intermediate ``.wixobj`` files
+are considered implementation details.
+
+WiX extensions must be named with the form ``Wix<Name>Extension``.
+
+CPack expects the above tools to be available for command-line
+use via the ``PATH``. Or, if the ``WIX`` environment variable is set,
+CPack looks for the tools in ``%WIX%`` and ``%WIX%\bin``.
Variables specific to CPack WIX generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -12,6 +105,19 @@ Variables specific to CPack WIX generator
The following variables are specific to the installers built on
Windows using WiX.
+.. variable:: CPACK_WIX_VERSION
+
+ .. versionadded:: 3.30
+
+ Specify the version of WiX Toolset for which the configuration
+ is written. The value must be one of
+
+ ``4``
+ Package using `WiX .NET Tools`_.
+
+ ``3``
+ Package using `WiX Toolset v3`_. This is the default.
+
.. variable:: CPACK_WIX_UPGRADE_GUID
Upgrade GUID (``Product/@UpgradeCode``)
@@ -68,8 +174,13 @@ Windows using WiX.
.. variable:: CPACK_WIX_UI_REF
- This variable allows you to override the Id of the ``<UIRef>`` element
- in the WiX template.
+ Specify the WiX ``UI`` extension's dialog set:
+
+ * With `WiX .NET Tools`_, this is the Id of the
+ ``<ui:WixUI>`` element in the default WiX template.
+
+ * With `WiX Toolset v3`_, this is the Id of the
+ ``<UIRef>`` element in the default WiX template.
The default is ``WixUI_InstallDir`` in case no CPack components have
been defined and ``WixUI_FeatureTree`` otherwise.
@@ -107,7 +218,7 @@ Windows using WiX.
Language(s) of the installer
- Languages are compiled into the WixUI extension library. To use them,
+ Languages are compiled into the Wix ``UI`` extension library. To use them,
simply provide the name of the culture. If you specify more than one
culture identifier in a comma or semicolon delimited list, the first one
that is found will be used. You can find a list of supported languages at:
@@ -119,7 +230,8 @@ Windows using WiX.
If this variable is set, the specified template will be used to generate
the WiX wxs file. This should be used if further customization of the
- output is required.
+ output is required. The template contents will override the effect of most
+ ``CPACK_WIX_`` variables.
If this variable is not set, the default MSI template included with CMake
will be used.
@@ -195,39 +307,35 @@ Windows using WiX.
Extra WiX source files
- This variable provides an optional list of extra WiX source files (.wxs)
- that should be compiled and linked. The full path to source files is
- required.
+ This variable provides an optional list of extra WiX source files (``.wxs``)
+ that should be compiled and linked. The paths must be absolute.
.. variable:: CPACK_WIX_EXTRA_OBJECTS
- Extra WiX object files or libraries
+ Extra WiX object files or libraries to use with `WiX Toolset v3`_.
- This variable provides an optional list of extra WiX object (.wixobj)
- and/or WiX library (.wixlib) files. The full path to objects and libraries
- is required.
+ This variable provides an optional list of extra WiX object (``.wixobj``)
+ and/or WiX library (``.wixlib``) files. The paths must be absolute.
.. variable:: CPACK_WIX_EXTENSIONS
- This variable provides a list of additional extensions for the WiX
- tools light and candle.
+ Specify a list of additional extensions for WiX tools.
+ See `WiX Toolsets`_ for extension naming patterns.
.. variable:: CPACK_WIX_<TOOL>_EXTENSIONS
- This is the tool specific version of CPACK_WIX_EXTENSIONS.
- ``<TOOL>`` can be either LIGHT or CANDLE.
+ Specify a list of additional extensions for a specific WiX tool.
+ See `WiX Toolsets`_ for possible ``<TOOL>`` names.
.. variable:: CPACK_WIX_<TOOL>_EXTRA_FLAGS
- This list variable allows you to pass additional
- flags to the WiX tool ``<TOOL>``.
+ Specify a list of additional command-line flags for a specific WiX tool.
+ See `WiX Toolsets`_ for possible ``<TOOL>`` names.
Use it at your own risk.
Future versions of CPack may generate flags which may be in conflict
with your own flags.
- ``<TOOL>`` can be either LIGHT or CANDLE.
-
.. variable:: CPACK_WIX_CMAKE_PACKAGE_REGISTRY
If this variable is set the generated installer will create
@@ -325,9 +433,9 @@ Windows using WiX.
.. versionadded:: 3.23
- If this variable is set then the inclusion of WixUIExtensions is skipped,
- i.e. the ``-ext "WixUIExtension"`` command line is not included during
- the execution of the WiX light tool.
+ If this variable is set to true, the default inclusion of the WiX ``UI``
+ extension is skipped, i.e., the ``-ext WixUIExtension`` or
+ ``-ext WixToolset.UI.wixext`` flag is not passed to WiX tools.
.. variable:: CPACK_WIX_ARCHITECTURE
@@ -337,3 +445,34 @@ Windows using WiX.
of the installer. May for example be set to ``x64`` or ``arm64``.
When unspecified, CPack will default to ``x64`` or ``x86``.
+
+.. variable:: CPACK_WIX_INSTALL_SCOPE
+
+ .. versionadded:: 3.29
+
+ This variable can be optionally set to specify the ``InstallScope``
+ of the installer:
+
+ ``perMachine`` (default)
+ Create an installer that installs for all users and requires
+ administrative privileges. Start menu entries created by the
+ installer are visible to all users.
+
+ ``perUser``
+ Not yet supported. This is reserved for future use.
+
+ ``NONE``
+ Create an installer without any ``InstallScope`` attribute.
+
+ This is not supported if :variable:`CPACK_WIX_VERSION` is set
+ to any value other than ``3``.
+
+ .. deprecated:: 3.29
+
+ This value is only for compatibility with the inconsistent behavior used
+ by CPack 3.28 and older. The resulting installer requires administrative
+ privileges and installs into the system-wide ``ProgramFiles`` directory,
+ but the start menu entry and uninstaller registration are created only
+ for the current user.
+
+ See https://wixtoolset.org/docs/v3/xsd/wix/package/
diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst
index 65c0ccf..00413e1 100644
--- a/Help/dev/documentation.rst
+++ b/Help/dev/documentation.rst
@@ -13,8 +13,8 @@ The ``Help`` directory contains CMake help manual source files.
They are written using the `reStructuredText`_ markup syntax and
processed by `Sphinx`_ to generate the CMake help manuals.
-.. _`reStructuredText`: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
-.. _`Sphinx`: http://sphinx-doc.org
+.. _`reStructuredText`: https://docutils.sourceforge.net/docs/ref/rst/introduction.html
+.. _`Sphinx`: https://sphinx-doc.org
Markup Constructs
-----------------
@@ -338,7 +338,7 @@ Document a "variable" object:
The directive requires a single argument, the variable name.
-.. _`Sphinx Domain`: http://sphinx-doc.org/domains.html
+.. _`Sphinx Domain`: https://sphinx-doc.org/domains.html
.. _`cmake(1)`: https://cmake.org/cmake/help/latest/manual/cmake.1.html
.. _`cmake-env-variables(7)`: https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html
.. _`cmake-generator-expressions(7)`: https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html
@@ -520,7 +520,7 @@ Style: Cross-References
Mark up linkable references as links, including repeats.
An alternative, which is used by wikipedia
-(`<http://en.wikipedia.org/wiki/WP:REPEATLINK>`_),
+(`<https://en.wikipedia.org/wiki/WP:REPEATLINK>`_),
is to link to a reference only once per article. That style is not used
in CMake documentation.
diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst
index 87ac031..93298c5 100644
--- a/Help/dev/experimental.rst
+++ b/Help/dev/experimental.rst
@@ -13,3 +13,49 @@ specific values will change over time to reinforce their experimental nature.
When used, a warning will be generated to indicate that an experimental
feature is in use and that the affected behavior in the project is not part of
CMake's stability guarantees.
+
+Export Package Dependencies
+===========================
+
+In order to activate support for this experimental feature, set
+
+* variable ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES`` to
+* value ``1942b4fa-b2c5-4546-9385-83f254070067``.
+
+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
+experimenting.
+
+When activated, this experimental feature provides the following:
+
+* The ``install(EXPORT)`` and ``export(EXPORT)`` commands have experimental
+ ``EXPORT_PACKAGE_DEPENDENCIES`` arguments to generate ``find_dependency``
+ calls automatically.
+
+* Details of the calls may be configured using the ``export(SETUP)``
+ command's ``PACKAGE_DEPENDENCY`` argument.
+
+* The package name associated with specific targets may be specified
+ using the ``CMAKE_EXPORT_FIND_PACKAGE_NAME`` variable and/or
+``EXPORT_FIND_PACKAGE_NAME`` target property.
+
+C++ ``import std`` support
+==========================
+
+In order to activate support for ``import std`` in C++23 and newer targets,
+set
+
+* variable ``CMAKE_EXPERIMENTAL_CXX_IMPORT_STD`` to
+* value ``0e5b6991-d74f-4b3d-a41c-cf096e0b2508``.
+
+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
+experimenting.
+
+When activated, this experimental feature provides the following:
+
+* The :prop_tgt:`CXX_MODULE_STD` target property and its initializing variable
+ :variable:`CMAKE_CXX_MODULE_STD`.
+
+* Targets with the property set to a true value and at least ``cxx_std_23``
+ may use ``import std;`` in any scanned C++ source file.
diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst
index 81e0e6f..c904673 100644
--- a/Help/dev/maint.rst
+++ b/Help/dev/maint.rst
@@ -8,6 +8,13 @@ See documentation on `CMake Development`_ for more information.
.. contents:: Maintainer Processes:
+Governance
+==========
+
+CMake has no formal governance body. Maintainers expect one another to
+cooperate constructively and make decisions in good faith. In cases of
+disagreement, the chief maintainer retains final authority.
+
Review a Merge Request
======================
@@ -332,15 +339,16 @@ Commit with a message such as::
away from setting policies to OLD.
Update the ``cmake_policy`` version range generated by ``install(EXPORT)``
-in ``cmExportFileGenerator::GeneratePolicyHeaderCode`` to end at the
+in ``cmExportFileGenerator::GeneratePolicyHeaderCode`` and
+``install_jar_exports`` in ``javaTargets.cmake.in`` to end at the
previous release. We use one release back since we now know all the
policies added for that version. Commit with a message such as::
export: Increase maximum policy version in exported files to $prev
- The files generated by `install(EXPORT)` and `export()` commands
- are known to work with policies as of CMake $prev, so enable them
- in sufficiently new CMake versions.
+ The files generated by `install(EXPORT)`, `export()`, and
+ `install_jar_exports()` commands are known to work with policies
+ as of CMake $prev, so enable them in sufficiently new CMake versions.
Update the ``cmake_minimum_required`` version range in CMake itself:
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 68ca743..fa7d620 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -16,7 +16,7 @@ format source code. It automatically runs ``clang-format`` on the set of
source files for which we enforce style. The script also has options to
format only a subset of files, such as those that are locally modified.
-.. _`clang-format`: http://clang.llvm.org/docs/ClangFormat.html
+.. _`clang-format`: https://clang.llvm.org/docs/ClangFormat.html
.. _`.clang-format`: ../../.clang-format
.. _`Utilities/Scripts/clang-format.bash`: ../../Utilities/Scripts/clang-format.bash
diff --git a/Help/dev/try_compile-linker-language.rst b/Help/dev/try_compile-linker-language.rst
new file mode 100644
index 0000000..8482dee
--- /dev/null
+++ b/Help/dev/try_compile-linker-language.rst
@@ -0,0 +1,6 @@
+try_compile-linker-language
+---------------------------
+
+* The :command:`try_compile` and :command:`try_run` commands gained a
+ ``LINKER_LANGUAGE`` option to specify the :prop_tgt:`LINKER_LANGUAGE`
+ target property in the generated test project.
diff --git a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
index dbc589a..a50797c 100644
--- a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
@@ -8,6 +8,10 @@ CMAKE_BUILD_PARALLEL_LEVEL
Specifies the maximum number of concurrent processes to use when building
using the ``cmake --build`` command line
:ref:`Build Tool Mode <Build Tool Mode>`.
+For example, if ``CMAKE_BUILD_PARALLEL_LEVEL`` is set to 8, the
+underlying build tool will execute up to 8 jobs concurrently as if
+``cmake --build`` were invoked with the
+:option:`--parallel 8 <cmake--build --parallel>` option.
If this variable is defined empty the native build tool's default number is
used.
diff --git a/Help/envvar/CMAKE_INSTALL_PREFIX.rst b/Help/envvar/CMAKE_INSTALL_PREFIX.rst
new file mode 100644
index 0000000..5c3e055
--- /dev/null
+++ b/Help/envvar/CMAKE_INSTALL_PREFIX.rst
@@ -0,0 +1,11 @@
+CMAKE_INSTALL_PREFIX
+--------------------
+
+.. versionadded:: 3.29
+
+.. include:: ENV_VAR.txt
+
+The ``CMAKE_INSTALL_PREFIX`` environment variable specifies a custom default
+value for the :variable:`CMAKE_INSTALL_PREFIX` variable in place of the
+default values specified by CMake itself. The value specified must be an
+absolute path to a directory.
diff --git a/Help/envvar/CMAKE_TEST_LAUNCHER.rst b/Help/envvar/CMAKE_TEST_LAUNCHER.rst
new file mode 100644
index 0000000..d620ce5
--- /dev/null
+++ b/Help/envvar/CMAKE_TEST_LAUNCHER.rst
@@ -0,0 +1,11 @@
+CMAKE_TEST_LAUNCHER
+-------------------
+
+.. versionadded:: 3.29
+
+.. include:: ENV_VAR.txt
+
+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
+build tree. On later runs in an existing build tree the value persists in
+the cache as :variable:`CMAKE_TEST_LAUNCHER`.
diff --git a/Help/envvar/CMAKE_TLS_VERIFY.rst b/Help/envvar/CMAKE_TLS_VERIFY.rst
new file mode 100644
index 0000000..9571cb8
--- /dev/null
+++ b/Help/envvar/CMAKE_TLS_VERIFY.rst
@@ -0,0 +1,15 @@
+CMAKE_TLS_VERIFY
+----------------
+
+.. versionadded:: 3.30
+
+.. include:: ENV_VAR.txt
+
+Specify the default value for the :command:`file(DOWNLOAD)` and
+:command:`file(UPLOAD)` commands' ``TLS_VERIFY`` option.
+This environment variable is used if the option is not given
+and the :variable:`CMAKE_TLS_VERIFY` cmake variable is not set.
+
+This variable is also used by the :module:`ExternalProject` and
+:module:`FetchContent` modules for internal calls to
+:command:`file(DOWNLOAD)` and ``git clone``.
diff --git a/Help/envvar/CMAKE_TLS_VERSION.rst b/Help/envvar/CMAKE_TLS_VERSION.rst
new file mode 100644
index 0000000..c411861
--- /dev/null
+++ b/Help/envvar/CMAKE_TLS_VERSION.rst
@@ -0,0 +1,16 @@
+CMAKE_TLS_VERSION
+-----------------
+
+.. versionadded:: 3.30
+
+.. include:: ENV_VAR.txt
+
+Specify the default value for the :command:`file(DOWNLOAD)` and
+:command:`file(UPLOAD)` commands' ``TLS_VERSION`` option.
+This environment variable is used if the option is not given
+and the :variable:`CMAKE_TLS_VERSION` cmake variable is not set.
+See that variable for allowed values.
+
+This variable is also used by the :module:`ExternalProject` and
+:module:`FetchContent` modules for internal calls to
+:command:`file(DOWNLOAD)` and ``git clone``.
diff --git a/Help/envvar/CTEST_PARALLEL_LEVEL.rst b/Help/envvar/CTEST_PARALLEL_LEVEL.rst
index fd4936e..0ef01d5 100644
--- a/Help/envvar/CTEST_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CTEST_PARALLEL_LEVEL.rst
@@ -3,5 +3,20 @@ CTEST_PARALLEL_LEVEL
.. include:: ENV_VAR.txt
-Specify the number of tests for CTest to run in parallel. See :manual:`ctest(1)`
-for more information on parallel test execution.
+Specify the number of tests for CTest to run in parallel.
+For example, if ``CTEST_PARALLEL_LEVEL`` is set to 8, CTest will run
+up to 8 tests concurrently as if ``ctest`` were invoked with the
+:option:`--parallel 8 <ctest --parallel>` option.
+
+.. versionchanged:: 3.29
+
+ The value may be empty, or ``0``, to let ctest use a default level of
+ parallelism, or unbounded parallelism, respectively, as documented by
+ the :option:`ctest --parallel` option.
+
+ On Windows, environment variables cannot be set to an empty string.
+ CTest will interpret a whitespace-only string as empty.
+
+ In CMake 3.28 and earlier, an empty or ``0`` value was equivalent to ``1``.
+
+See :manual:`ctest(1)` for more information on parallel test execution.
diff --git a/Help/envvar/OBJCFLAGS.rst b/Help/envvar/OBJCFLAGS.rst
new file mode 100644
index 0000000..2f30807
--- /dev/null
+++ b/Help/envvar/OBJCFLAGS.rst
@@ -0,0 +1,14 @@
+OBJCFLAGS
+---------
+
+.. versionadded:: 3.16
+
+.. include:: ENV_VAR.txt
+
+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
+
+See also :variable:`CMAKE_OBJC_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/OBJCXXFLAGS.rst b/Help/envvar/OBJCXXFLAGS.rst
new file mode 100644
index 0000000..089222a
--- /dev/null
+++ b/Help/envvar/OBJCXXFLAGS.rst
@@ -0,0 +1,14 @@
+OBJCXXFLAGS
+-----------
+
+.. versionadded:: 3.16
+
+.. include:: ENV_VAR.txt
+
+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
+
+See also :variable:`CMAKE_OBJCXX_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/guide/tutorial/Adding Generator Expressions.rst b/Help/guide/tutorial/Adding Generator Expressions.rst
index 910eacb..d2dddf7 100644
--- a/Help/guide/tutorial/Adding Generator Expressions.rst
+++ b/Help/guide/tutorial/Adding Generator Expressions.rst
@@ -24,7 +24,7 @@ Logical, Informational, and Output expressions.
Logical expressions are used to create conditional output. The basic
expressions are the ``0`` and ``1`` expressions. A ``$<0:...>`` results in the
-empty string, and ``<1:...>`` results in the content of ``...``. They can also
+empty string, and ``$<1:...>`` results in the content of ``...``. They can also
be nested.
Exercise 1 - Adding Compiler Warning Flags with Generator Expressions
diff --git a/Help/guide/tutorial/Adding a Library.rst b/Help/guide/tutorial/Adding a Library.rst
index 18ced97..cfcfc67 100644
--- a/Help/guide/tutorial/Adding a Library.rst
+++ b/Help/guide/tutorial/Adding a Library.rst
@@ -145,10 +145,10 @@ Next, the new library target is linked to the executable target using
</details>
-Finally we need to specify the library's header file location. Modify
-:command:`target_include_directories` to add the ``MathFunctions`` subdirectory
-as an include directory so that the ``MathFunctions.h`` header file can be
-found.
+Finally we need to specify the library's header file location.
+Modify the existing :command:`target_include_directories` call
+to add the ``MathFunctions`` subdirectory as an include directory
+so that the ``MathFunctions.h`` header file can be found.
.. raw:: html
diff --git a/Help/guide/tutorial/Step12/CMakeLists.txt b/Help/guide/tutorial/Step12/CMakeLists.txt
index 1d8b5a6..1ba4e31 100644
--- a/Help/guide/tutorial/Step12/CMakeLists.txt
+++ b/Help/guide/tutorial/Step12/CMakeLists.txt
@@ -97,7 +97,7 @@ include(CMakePackageConfigHelpers)
# generate the config file that includes the exports
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
- INSTALL_DESTINATION "lib/cmake/example"
+ INSTALL_DESTINATION "lib/cmake/MathFunctions"
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
diff --git a/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
index ffb2f35..74c553f 100644
--- a/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt
@@ -14,9 +14,9 @@ if (USE_MYMATH)
mysqrt.cxx
)
- # TODO 7: Link SqrtLibrary to tutorial_compiler_flags
+ # TODO 6: Link SqrtLibrary to tutorial_compiler_flags
target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
endif()
-# TODO 6: Link MathFunctions to tutorial_compiler_flags
+# TODO 7: Link MathFunctions to tutorial_compiler_flags
diff --git a/Help/manual/CTEST_EXAMPLE_MAKEFILE_JOB_SERVER.make b/Help/manual/CTEST_EXAMPLE_MAKEFILE_JOB_SERVER.make
new file mode 100644
index 0000000..a17673a
--- /dev/null
+++ b/Help/manual/CTEST_EXAMPLE_MAKEFILE_JOB_SERVER.make
@@ -0,0 +1,2 @@
+test:
+ +ctest -j 8
diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt
index fb1e7d4..b8ea1ce 100644
--- a/Help/manual/OPTIONS_BUILD.txt
+++ b/Help/manual/OPTIONS_BUILD.txt
@@ -108,7 +108,9 @@
.. versionadded:: 3.21
Specify the cross compiling toolchain file, equivalent to setting
- :variable:`CMAKE_TOOLCHAIN_FILE` variable.
+ :variable:`CMAKE_TOOLCHAIN_FILE` variable. Relative paths are interpreted as
+ relative to the build directory, and if not found, relative to the source
+ directory.
.. option:: --install-prefix <directory>
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index b88b864..9eca05d 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -162,102 +162,278 @@ or :command:`file(GENERATE)` by using ``$<TARGET_OBJECTS:objlib>``.
Build Specification and Usage Requirements
==========================================
-The :command:`target_include_directories`, :command:`target_compile_definitions`
-and :command:`target_compile_options` commands specify the build specifications
-and the usage requirements of binary targets. The commands populate the
-:prop_tgt:`INCLUDE_DIRECTORIES`, :prop_tgt:`COMPILE_DEFINITIONS` and
-:prop_tgt:`COMPILE_OPTIONS` target properties respectively, and/or the
-:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`, :prop_tgt:`INTERFACE_COMPILE_DEFINITIONS`
-and :prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties.
-
-Each of the commands has a ``PRIVATE``, ``PUBLIC`` and ``INTERFACE`` mode. The
-``PRIVATE`` mode populates only the non-``INTERFACE_`` variant of the target
-property and the ``INTERFACE`` mode populates only the ``INTERFACE_`` variants.
-The ``PUBLIC`` mode populates both variants of the respective target property.
-Each command may be invoked with multiple uses of each keyword:
+Targets build according to their own
+`build specification <Target Build Specification_>`_ in combination with
+`usage requirements <Target Usage Requirements_>`_ propagated from their
+link dependencies. Both may be specified using target-specific
+`commands <Target Commands_>`_.
-.. code-block:: cmake
-
- target_compile_definitions(archive
- PRIVATE BUILDING_WITH_LZMA
- INTERFACE USING_ARCHIVE_LIB
- )
-
-Note that usage requirements are not designed as a way to make downstreams
-use particular :prop_tgt:`COMPILE_OPTIONS` or
-:prop_tgt:`COMPILE_DEFINITIONS` etc for convenience only. The contents of
-the properties must be **requirements**, not merely recommendations or
-convenience.
-
-See the :ref:`Creating Relocatable Packages` section of the
-:manual:`cmake-packages(7)` manual for discussion of additional care
-that must be taken when specifying usage requirements while creating
-packages for redistribution.
-
-Target Properties
------------------
-
-The contents of the :prop_tgt:`INCLUDE_DIRECTORIES`,
-:prop_tgt:`COMPILE_DEFINITIONS` and :prop_tgt:`COMPILE_OPTIONS` target
-properties are used appropriately when compiling the source files of a
-binary target.
-
-Entries in the :prop_tgt:`INCLUDE_DIRECTORIES` are added to the compile line
-with ``-I`` or ``-isystem`` prefixes and in the order of appearance in the
-property value.
-
-Entries in the :prop_tgt:`COMPILE_DEFINITIONS` are prefixed with ``-D`` or
-``/D`` and added to the compile line in an unspecified order. The
-:prop_tgt:`DEFINE_SYMBOL` target property is also added as a compile
-definition as a special convenience case for ``SHARED`` and ``MODULE``
-library targets.
-
-Entries in the :prop_tgt:`COMPILE_OPTIONS` are escaped for the shell and added
-in the order of appearance in the property value. Several compile options have
-special separate handling, such as :prop_tgt:`POSITION_INDEPENDENT_CODE`.
-
-The contents of the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`,
-:prop_tgt:`INTERFACE_COMPILE_DEFINITIONS` and
-:prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties are
-*Usage Requirements* -- they specify content which consumers
-must use to correctly compile and link with the target they appear on.
-For any binary target, the contents of each ``INTERFACE_`` property on
-each target specified in a :command:`target_link_libraries` command is
-consumed:
+For example:
.. code-block:: cmake
- set(srcs archive.cpp zip.cpp)
- if (LZMA_FOUND)
- list(APPEND srcs lzma.cpp)
- endif()
- add_library(archive SHARED ${srcs})
+ add_library(archive SHARED archive.cpp zip.cpp)
+
if (LZMA_FOUND)
- # The archive library sources are compiled with -DBUILDING_WITH_LZMA
+ # Add a source implementing support for lzma.
+ target_sources(archive PRIVATE lzma.cpp)
+
+ # Compile the 'archive' library sources with '-DBUILDING_WITH_LZMA'.
target_compile_definitions(archive PRIVATE BUILDING_WITH_LZMA)
endif()
+
target_compile_definitions(archive INTERFACE USING_ARCHIVE_LIB)
- add_executable(consumer)
- # Link consumer to archive and consume its usage requirements. The consumer
- # executable sources are compiled with -DUSING_ARCHIVE_LIB.
+ add_executable(consumer consumer.cpp)
+
+ # Link 'consumer' to 'archive'. This also consumes its usage requirements,
+ # so 'consumer.cpp' is compiled with '-DUSING_ARCHIVE_LIB'.
target_link_libraries(consumer archive)
-Because it is common to require that the source directory and corresponding
-build directory are added to the :prop_tgt:`INCLUDE_DIRECTORIES`, the
-:variable:`CMAKE_INCLUDE_CURRENT_DIR` variable can be enabled to conveniently
-add the corresponding directories to the :prop_tgt:`INCLUDE_DIRECTORIES` of
-all targets. The variable :variable:`CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE`
-can be enabled to add the corresponding directories to the
-:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` of all targets. This makes use of
-targets in multiple different directories convenient through use of the
-:command:`target_link_libraries` command.
+Target Commands
+---------------
+
+Target-specific commands populate the
+`build specification <Target Build Specification_>`_ of `Binary Targets`_ and
+`usage requirements <Target Usage Requirements_>`_ of `Binary Targets`_,
+`Interface Libraries`_, and `Imported Targets`_.
+
+.. _`Target Command Scope`:
+
+Invocations must specify scope keywords, each affecting the visibility
+of arguments following it. The scopes are:
+
+``PUBLIC``
+ Populates both properties for `building <Target Build Specification_>`_
+ and properties for `using <Target Usage Requirements_>`_ a target.
+
+``PRIVATE``
+ Populates only properties for `building <Target Build Specification_>`_
+ a target.
+
+``INTERFACE``
+ Populates only properties for `using <Target Usage Requirements_>`_
+ a target.
+
+The commands are:
+
+:command:`target_compile_definitions`
+ Populates the :prop_tgt:`COMPILE_DEFINITIONS` build specification and
+ :prop_tgt:`INTERFACE_COMPILE_DEFINITIONS` usage requirement properties.
+
+ For example, the call
+
+ .. code-block:: cmake
+
+ target_compile_definitions(archive
+ PRIVATE BUILDING_WITH_LZMA
+ INTERFACE USING_ARCHIVE_LIB
+ )
+
+ appends ``BUILDING_WITH_LZMA`` to the target's ``COMPILE_DEFINITIONS``
+ property and appends ``USING_ARCHIVE_LIB`` to the target's
+ ``INTERFACE_COMPILE_DEFINITIONS`` property.
+
+:command:`target_compile_options`
+ Populates the :prop_tgt:`COMPILE_OPTIONS` build specification and
+ :prop_tgt:`INTERFACE_COMPILE_OPTIONS` usage requirement properties.
+
+:command:`target_compile_features`
+ .. versionadded:: 3.1
+
+ Populates the :prop_tgt:`COMPILE_FEATURES` build specification and
+ :prop_tgt:`INTERFACE_COMPILE_FEATURES` usage requirement properties.
+
+:command:`target_include_directories`
+ Populates the :prop_tgt:`INCLUDE_DIRECTORIES` build specification
+ and :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` usage requirement
+ properties. With the ``SYSTEM`` option, it also populates the
+ :prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` usage requirement.
+
+ For convenience, the :variable:`CMAKE_INCLUDE_CURRENT_DIR` variable
+ may be enabled to add the source directory and corresponding build
+ directory as ``INCLUDE_DIRECTORIES`` on all targets. Similarly,
+ the :variable:`CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE` variable may
+ be enabled to add them as ``INTERFACE_INCLUDE_DIRECTORIES`` on all
+ targets.
+
+:command:`target_sources`
+ .. versionadded:: 3.1
+
+ Populates the :prop_tgt:`SOURCES` build specification and
+ :prop_tgt:`INTERFACE_SOURCES` usage requirement properties.
+
+ It also supports specifying :ref:`File Sets`, which can add C++ module
+ sources and headers not listed in the ``SOURCES`` and ``INTERFACE_SOURCES``
+ properties. File sets may also populate the :prop_tgt:`INCLUDE_DIRECTORIES`
+ build specification and :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` usage
+ requirement properties with the include directories containing the headers.
+
+:command:`target_precompile_headers`
+ .. versionadded:: 3.16
+
+ Populates the :prop_tgt:`PRECOMPILE_HEADERS` build specification and
+ :prop_tgt:`INTERFACE_PRECOMPILE_HEADERS` usage requirement properties.
+
+:command:`target_link_libraries`
+ Populates the :prop_tgt:`LINK_LIBRARIES` build specification
+ and :prop_tgt:`INTERFACE_LINK_LIBRARIES` usage requirement properties.
+
+ This is the primary mechanism by which link dependencies and their
+ `usage requirements <Target Usage Requirements_>`_ are transitively
+ propagated to affect compilation and linking of a target.
+
+:command:`target_link_directories`
+ .. versionadded:: 3.13
+
+ Populates the :prop_tgt:`LINK_DIRECTORIES` build specification and
+ :prop_tgt:`INTERFACE_LINK_DIRECTORIES` usage requirement properties.
+
+:command:`target_link_options`
+ .. versionadded:: 3.13
+
+ Populates the :prop_tgt:`LINK_OPTIONS` build specification and
+ :prop_tgt:`INTERFACE_LINK_OPTIONS` usage requirement properties.
+
+.. _`Target Build Specification`:
+
+Target Build Specification
+--------------------------
+
+The build specification of `Binary Targets`_ is represented by target
+properties. For each of the following `build <Target Build Properties_>`_
+and `link <Target Link Properties_>`_ properties, compilation and linking
+of the target is affected both by its own value and by the corresponding
+`usage requirement <Target Usage Requirements_>`_ property, named with
+an ``INTERFACE_`` prefix, collected from the transitive closure of link
+dependencies.
+
+.. _`Target Build Properties`:
+
+Target Build Properties
+^^^^^^^^^^^^^^^^^^^^^^^
+
+:prop_tgt:`COMPILE_DEFINITIONS`
+ List of compile definitions for compiling sources in the target.
+ These are passed to the compiler with ``-D`` flags, or equivalent,
+ in an unspecified order.
+
+ The :prop_tgt:`DEFINE_SYMBOL` target property is also used
+ as a compile definition as a special convenience case for
+ ``SHARED`` and ``MODULE`` library targets.
+
+:prop_tgt:`COMPILE_OPTIONS`
+ List of compile options for compiling sources in the target.
+ These are passed to the compiler as flags, in the order of appearance.
+
+ Compile options are automatically escaped for the shell.
+
+ Some compile options are best specified via dedicated settings,
+ such as the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property.
+
+:prop_tgt:`COMPILE_FEATURES`
+ .. versionadded:: 3.1
+
+ List of :manual:`compile features <cmake-compile-features(7)>` needed
+ for compiling sources in the target. Typically these ensure the
+ target's sources are compiled using a sufficient language standard level.
+
+:prop_tgt:`INCLUDE_DIRECTORIES`
+ List of include directories for compiling sources in the target.
+ These are passed to the compiler with ``-I`` or ``-isystem`` flags,
+ or equivalent, in the order of appearance.
+
+ For convenience, the :variable:`CMAKE_INCLUDE_CURRENT_DIR` variable
+ may be enabled to add the source directory and corresponding build
+ directory as ``INCLUDE_DIRECTORIES`` on all targets.
+
+:prop_tgt:`SOURCES`
+ List of source files associated with the target. This includes sources
+ specified when the target was created by the :command:`add_executable`,
+ :command:`add_library`, or :command:`add_custom_target` command.
+ It also includes sources added by the :command:`target_sources` command,
+ but does not include :ref:`File Sets`.
+
+:prop_tgt:`PRECOMPILE_HEADERS`
+ .. versionadded:: 3.16
+
+ List of header files to precompile and include when compiling
+ sources in the target.
+
+:prop_tgt:`AUTOMOC_MACRO_NAMES`
+ .. versionadded:: 3.10
+
+ List of macro names used by :prop_tgt:`AUTOMOC` to determine if a
+ C++ source in the target needs to be processed by ``moc``.
+
+:prop_tgt:`AUTOUIC_OPTIONS`
+ .. versionadded:: 3.0
+
+ List of options used by :prop_tgt:`AUTOUIC` when invoking ``uic``
+ for the target.
+
+.. _`Target Link Properties`:
+
+Target Link Properties
+^^^^^^^^^^^^^^^^^^^^^^
+
+:prop_tgt:`LINK_LIBRARIES`
+ List of link libraries for linking the target, if it is an executable,
+ shared library, or module library. Entries for `Normal Libraries`_ are
+ passed to the linker either via paths to their link artifacts, or
+ with ``-l`` flags or equivalent. Entries for `Object Libraries`_ are
+ passed to the linker via paths to their object files.
+
+ Additionally, for compiling and linking the target itself,
+ `usage requirements <Target Usage Requirements_>`_ are propagated from
+ ``LINK_LIBRARIES`` entries naming `Normal Libraries`_,
+ `Interface Libraries`_, `Object Libraries`_, and `Imported Targets`_,
+ collected over the transitive closure of their
+ :prop_tgt:`INTERFACE_LINK_LIBRARIES` properties.
+
+:prop_tgt:`LINK_DIRECTORIES`
+ .. versionadded:: 3.13
+
+ List of link directories for linking the target, if it is an executable,
+ shared library, or module library. The directories are passed to the
+ linker with ``-L`` flags, or equivalent.
+
+:prop_tgt:`LINK_OPTIONS`
+ .. versionadded:: 3.13
+
+ List of link options for linking the target, if it is an executable,
+ shared library, or module library. The options are passed to the
+ linker as flags, in the order of appearance.
+
+ Link options are automatically escaped for the shell.
+
+:prop_tgt:`LINK_DEPENDS`
+ List of files on which linking the target depends, if it is an executable,
+ shared library, or module library. For example, linker scripts specified
+ via :prop_tgt:`LINK_OPTIONS` may be listed here such that changing them
+ causes binaries to be linked again.
.. _`Target Usage Requirements`:
-Transitive Usage Requirements
------------------------------
+Target Usage Requirements
+-------------------------
+
+The *usage requirements* of a target are settings that propagate to consumers,
+which link to the target via :command:`target_link_libraries`, in order to
+correctly compile and link with it. They are represented by transitive
+`build <Transitive Build Properties_>`_ and
+`link <Transitive Link Properties_>`_ properties.
+
+Note that usage requirements are not designed as a way to make downstreams
+use particular :prop_tgt:`COMPILE_OPTIONS`, :prop_tgt:`COMPILE_DEFINITIONS`,
+etc. for convenience only. The contents of the properties must be
+**requirements**, not merely recommendations.
+
+See the :ref:`Creating Relocatable Packages` section of the
+:manual:`cmake-packages(7)` manual for discussion of additional care
+that must be taken when specifying usage requirements while creating
+packages for redistribution.
The usage requirements of a target can transitively propagate to the dependents.
The :command:`target_link_libraries` command has ``PRIVATE``,
@@ -329,6 +505,91 @@ Note that care must be taken when specifying usage requirements for targets
which will be exported for installation using the :command:`install(EXPORT)`
command. See :ref:`Creating Packages` for more.
+.. _`Transitive Build Properties`:
+
+Transitive Build Properties
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+:prop_tgt:`INTERFACE_COMPILE_DEFINITIONS`
+ List of compile definitions for compiling sources in the target's consumers.
+ Typically these are used by the target's header files.
+
+:prop_tgt:`INTERFACE_COMPILE_OPTIONS`
+ List of compile options for compiling sources in the target's consumers.
+
+:prop_tgt:`INTERFACE_COMPILE_FEATURES`
+ .. versionadded:: 3.1
+
+ List of :manual:`compile features <cmake-compile-features(7)>` needed
+ for compiling sources in the target's consumers. Typically these
+ ensure the target's header files are processed when compiling consumers
+ using a sufficient language standard level.
+
+:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
+ List of include directories for compiling sources in the target's consumers.
+ Typically these are the locations of the target's header files.
+
+:prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`
+ List of directories that, when specified as include directories, e.g., by
+ :prop_tgt:`INCLUDE_DIRECTORIES` or :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`,
+ should be treated as "system" include directories when compiling sources
+ in the target's consumers.
+
+:prop_tgt:`INTERFACE_SOURCES`
+ List of source files to associate with the target's consumers.
+
+:prop_tgt:`INTERFACE_PRECOMPILE_HEADERS`
+ .. versionadded:: 3.16
+
+ List of header files to precompile and include when compiling
+ sources in the target's consumers.
+
+:prop_tgt:`INTERFACE_AUTOMOC_MACRO_NAMES`
+ .. versionadded:: 3.27
+
+ List of macro names used by :prop_tgt:`AUTOMOC` to determine if a
+ C++ source in the target's consumers needs to be processed by ``moc``.
+
+:prop_tgt:`INTERFACE_AUTOUIC_OPTIONS`
+ .. versionadded:: 3.0
+
+ List of options used by :prop_tgt:`AUTOUIC` when invoking ``uic``
+ for the target's consumers.
+
+.. _`Transitive Link Properties`:
+
+Transitive Link Properties
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+:prop_tgt:`INTERFACE_LINK_LIBRARIES`
+ List of link libraries for linking the target's consumers, for
+ those that are executables, shared libraries, or module libraries.
+ These are the transitive dependencies of the target.
+
+ Additionally, for compiling and linking the target's consumers,
+ `usage requirements <Target Usage Requirements_>`_ are collected from
+ the transitive closure of ``INTERFACE_LINK_LIBRARIES`` entries naming
+ `Normal Libraries`_, `Interface Libraries`_, `Object Libraries`_,
+ and `Imported Targets`_,
+
+:prop_tgt:`INTERFACE_LINK_DIRECTORIES`
+ .. versionadded:: 3.13
+
+ List of link directories for linking the target's consumers, for
+ those that are executables, shared libraries, or module libraries.
+
+:prop_tgt:`INTERFACE_LINK_OPTIONS`
+ .. versionadded:: 3.13
+
+ List of link options for linking the target's consumers, for
+ those that are executables, shared libraries, or module libraries.
+
+:prop_tgt:`INTERFACE_LINK_DEPENDS`
+ .. versionadded:: 3.13
+
+ List of files on which linking the target's consumers depends, for
+ those that are executables, shared libraries, or module libraries.
+
.. _`Compatible Interface Properties`:
Compatible Interface Properties
diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst
index 1e87ec6..fb93222 100644
--- a/Help/manual/cmake-compile-features.7.rst
+++ b/Help/manual/cmake-compile-features.7.rst
@@ -266,6 +266,7 @@ versions specified for each:
* ``PGI``: PGI version 12.10+.
* ``NVHPC``: NVIDIA HPC compilers version 11.0+.
* ``TI``: Texas Instruments compiler.
+* ``TIClang``: Texas Instruments Clang-based compilers.
* ``XL``: IBM XL version 10.1+.
CMake is currently aware of the :prop_tgt:`C standards <C_STANDARD>` and
diff --git a/Help/manual/cmake-configure-log.7.rst b/Help/manual/cmake-configure-log.7.rst
index 4d64506..cb6cb90 100644
--- a/Help/manual/cmake-configure-log.7.rst
+++ b/Help/manual/cmake-configure-log.7.rst
@@ -56,7 +56,7 @@ step finished normally, ends with a ``...`` document marker line:
A new document is appended to the log every time CMake configures
the build tree and logs new events.
-The keys of the each document root mapping are:
+The keys of each document root mapping are:
``events``
A YAML block sequence of nodes corresponding to events logged during
diff --git a/Help/manual/cmake-cxxmodules.7.rst b/Help/manual/cmake-cxxmodules.7.rst
index 3ee6645..840d65f 100644
--- a/Help/manual/cmake-cxxmodules.7.rst
+++ b/Help/manual/cmake-cxxmodules.7.rst
@@ -12,6 +12,49 @@ to scan source files for module dependencies during the build, collates
scanning results to infer ordering constraints, and tells the build tool
how to dynamically update the build graph.
+Compilation Strategy
+====================
+
+With C++ modules, compiling a set of C++ sources is no longer embarrassingly
+parallel. That is, any given source may first require the compilation of
+another source file first in order to provide a "CMI" (compiled module
+interface) or "BMI" (binary module interface) that C++ compilers use to
+satisfy ``import`` statements in other sources. With headers, sources could
+share their declarations so that any consumers could compile independently.
+With modules, declarations are now generated into these BMI files by the
+compiler during compilation based on the contents of the source file and its
+``export`` statements.
+
+The order necessary for compilation requires build-time resolution of the
+ordering because the order is controlled by the contents of the sources. This
+means that the ordering needs extracted from the source during the build to
+avoid regenerating the build graph via a configure and generate phase for
+every source change to get a correct build.
+
+The general strategy is to use a "scanner" to extract the ordering dependency
+information and update the build graph with new edges between existing edges
+by taking the per-source scan results (represented by `P1689R5`_ files) and
+"collating" the dependencies within a target and to modules produced by
+targets visible to the target. The primary task is to generate "module map"
+files to pass to each compile rule with the paths to the BMIs needed to
+satisfy ``import`` statements. The collator also has tasks to use the
+build-time information to fill out information including ``install`` rules for
+the module interface units, their BMIs, and properties for any exported
+targets with C++ modules.
+
+.. _`P1689R5`: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html
+
+.. note:
+
+ CMake is focusing on correct builds before looking at performance
+ improvements. There are known tactics within the chosen strategy which may
+ offer build performance improvements. However, they are being deferred
+ until we have a working model against which to compare them. It is also
+ important to note that a tactic useful in one situation (e.g., clean
+ builds) may not be performant in a different situation (e.g., incremental
+ builds). Finding a balance and offering controls to select the tactics is
+ future work.
+
Scanning Control
================
@@ -43,6 +86,25 @@ Compilers which CMake natively supports module dependency scanning include:
* LLVM/Clang 16.0 and newer
* GCC 14 (for the in-development branch, after 2023-09-20) and newer
+``import std`` Support
+======================
+
+Support for ``import std`` is limited to the following toolchain and standard
+library combinations:
+
+* Clang 18.1.2 and newer with ``-stdlib=libc++``
+* MSVC toolset 14.36 and newer (provided with Visual Studio 17.6 Preview 2 and
+ newer)
+
+The :variable:`CMAKE_CXX_COMPILER_IMPORT_STD` variable may be used to detect
+support for a standard level with the active C++ toolchain.
+
+.. note ::
+
+ This support is provided only when experimental support for
+ ``import std;`` has been enabled by the
+ ``CMAKE_EXPERIMENTAL_CXX_IMPORT_STD`` gate.
+
Generator Support
=================
@@ -73,6 +135,7 @@ For the :ref:`Visual Studio Generators`:
- Only Visual Studio 2022 and MSVC toolsets 14.34 (Visual Studio
17.4) and newer.
- No support for exporting or installing BMI or module information.
-- No support for compiling BMIs from ``IMPORTED`` targets with C++ modules.
+- No support for compiling BMIs from ``IMPORTED`` targets with C++ modules
+ (including ``import std``).
- No diagnosis of using modules provided by ``PRIVATE`` sources from
``PUBLIC`` module sources.
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index a09bd14..cebe8f9 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -119,7 +119,8 @@ do.
The more modern approach is to behave as much like
:ref:`config file packages <Config File Packages>` files as possible, by
providing :ref:`imported target <Imported targets>`. This has the advantage
-of propagating :ref:`Target Usage Requirements` to consumers.
+of propagating :ref:`usage requirements <Target Usage Requirements>`
+to consumers.
In either case (or even when providing both variables and imported
targets), find modules should provide backwards compatibility with old
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index 55f07b7..a69ace6 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -27,6 +27,8 @@ Environment Variables that Change Behavior
/envvar/CMAKE_MAXIMUM_RECURSION_DEPTH
/envvar/CMAKE_PREFIX_PATH
/envvar/CMAKE_PROGRAM_PATH
+ /envvar/CMAKE_TLS_VERIFY
+ /envvar/CMAKE_TLS_VERSION
/envvar/SSL_CERT_DIR
/envvar/SSL_CERT_FILE
@@ -50,12 +52,14 @@ Environment Variables that Control the Build
/envvar/CMAKE_GENERATOR_PLATFORM
/envvar/CMAKE_GENERATOR_TOOLSET
/envvar/CMAKE_INSTALL_MODE
+ /envvar/CMAKE_INSTALL_PREFIX
/envvar/CMAKE_LANG_COMPILER_LAUNCHER
/envvar/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES_EXCLUDE
/envvar/CMAKE_LANG_LINKER_LAUNCHER
/envvar/CMAKE_MSVCIDE_RUN_PATH
/envvar/CMAKE_NO_VERBOSE
/envvar/CMAKE_OSX_ARCHITECTURES
+ /envvar/CMAKE_TEST_LAUNCHER
/envvar/CMAKE_TOOLCHAIN_FILE
/envvar/DESTDIR
/envvar/LDFLAGS
@@ -88,7 +92,9 @@ Environment Variables for Languages
/envvar/ISPC
/envvar/ISPCFLAGS
/envvar/OBJC
+ /envvar/OBJCFLAGS
/envvar/OBJCXX
+ /envvar/OBJCXXFLAGS
/envvar/RC
/envvar/RCFLAGS
/envvar/SWIFTC
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst
index 88a7bab..260030e 100644
--- a/Help/manual/cmake-file-api.7.rst
+++ b/Help/manual/cmake-file-api.7.rst
@@ -431,7 +431,7 @@ Version 1 does not exist to avoid confusion with that from
{
"kind": "codemodel",
- "version": { "major": 2, "minor": 6 },
+ "version": { "major": 2, "minor": 7 },
"paths": {
"source": "/path/to/top-level-source-dir",
"build": "/path/to/top-level-build-dir"
@@ -998,6 +998,36 @@ with members:
destination is available. The value is an unsigned integer 0-based
index into the ``backtraceGraph`` member's ``nodes`` array.
+``launchers``
+ Optional member that is present on executable targets that have
+ at least one launcher specified by the project. The value is a
+ JSON array of entries corresponding to the specified launchers.
+ Each entry is a JSON object with members:
+
+ ``command``
+ A string specifying the path to the launcher on disk, represented
+ with forward slashes. If the file is inside the top-level source
+ directory then the path is specified relative to that directory.
+
+ ``arguments``
+ Optional member that is present when the launcher command has
+ arguments preceding the executable to be launched. The value
+ is a JSON array of strings representing the arguments.
+
+ ``type``
+ A string specifying the type of launcher. The value is one of
+ the following:
+
+ ``emulator``
+ An emulator for the target platform when cross-compiling.
+ See the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property.
+
+ ``test``
+ A start program for the execution of tests.
+ See the :prop_tgt:`TEST_LAUNCHER` target property.
+
+ This field was added in codemodel version 2.7.
+
``link``
Optional member that is present for executables and shared library
targets that link into a runtime binary. The value is a JSON object
@@ -1459,7 +1489,7 @@ There is only one ``cmakeFiles`` object major version, version 1.
{
"kind": "cmakeFiles",
- "version": { "major": 1, "minor": 0 },
+ "version": { "major": 1, "minor": 1 },
"paths": {
"build": "/path/to/top-level-build-dir",
"source": "/path/to/top-level-source-dir"
@@ -1481,6 +1511,16 @@ There is only one ``cmakeFiles`` object major version, version 1.
"isExternal": true,
"path": "/path/to/cmake/Modules/CMakeGenericSystem.cmake"
}
+ ],
+ "globsDependent": [
+ {
+ "expression": "src/*.cxx",
+ "recurse": true,
+ "files": [
+ "src/foo.cxx",
+ "src/bar.cxx"
+ ]
+ }
]
}
@@ -1523,6 +1563,44 @@ The members specific to ``cmakeFiles`` objects are:
Optional member that is present with boolean value ``true``
if the path specifies a file in the CMake installation.
+``globsDependent``
+ Optional member that is present when the project calls :command:`file(GLOB)`
+ or :command:`file(GLOB_RECURSE)` with the ``CONFIGURE_DEPENDS`` option.
+ The value is a JSON array of JSON objects, each specifying a globbing
+ expression and the list of paths it matched. If the globbing expression
+ no longer matches the same list of paths, CMake considers the build system
+ to be out of date.
+
+ This field was added in ``cmakeFiles`` version 1.1.
+
+ The members of each entry are:
+
+ ``expression``
+ A string specifying the globbing expression.
+
+ ``recurse``
+ Optional member that is present with boolean value ``true``
+ if the entry corresponds to a :command:`file(GLOB_RECURSE)` call.
+ Otherwise the entry corresponds to a :command:`file(GLOB)` call.
+
+ ``listDirectories``
+ Optional member that is present with boolean value ``true`` if
+ :command:`file(GLOB)` was called without ``LIST_DIRECTORIES false`` or
+ :command:`file(GLOB_RECURSE)` was called with ``LIST_DIRECTORIES true``.
+
+ ``followSymlinks``
+ Optional member that is present with boolean value ``true`` if
+ :command:`file(GLOB)` was called with the ``FOLLOW_SYMLINKS`` option.
+
+ ``relative``
+ Optional member that is present if :command:`file(GLOB)` was called
+ with the ``RELATIVE <path>`` option. The value is a string containing
+ the ``<path>`` given.
+
+ ``paths``
+ A JSON array of strings specifying the paths matched by the call
+ to :command:`file(GLOB)` or :command:`file(GLOB_RECURSE)`.
+
Object Kind "toolchains"
------------------------
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index d4a43de..31f0573 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -1053,6 +1053,10 @@ related to most of the expressions in this sub-section.
``1`` if CMake's compiler id of the C compiler matches any one
of the entries in ``compiler_ids``, otherwise ``0``.
+ .. versionchanged:: 3.15
+ Multiple ``compiler_ids`` can be specified.
+ CMake 3.14 and earlier only accepted a single compiler ID.
+
.. genex:: $<CXX_COMPILER_ID>
CMake's compiler id of the CXX compiler used.
@@ -1063,6 +1067,10 @@ related to most of the expressions in this sub-section.
``1`` if CMake's compiler id of the CXX compiler matches any one
of the entries in ``compiler_ids``, otherwise ``0``.
+ .. versionchanged:: 3.15
+ Multiple ``compiler_ids`` can be specified.
+ CMake 3.14 and earlier only accepted a single compiler ID.
+
.. genex:: $<CUDA_COMPILER_ID>
.. versionadded:: 3.15
@@ -1115,6 +1123,10 @@ related to most of the expressions in this sub-section.
``1`` if CMake's compiler id of the Fortran compiler matches any one
of the entries in ``compiler_ids``, otherwise ``0``.
+ .. versionchanged:: 3.15
+ Multiple ``compiler_ids`` can be specified.
+ CMake 3.14 and earlier only accepted a single compiler ID.
+
.. genex:: $<HIP_COMPILER_ID>
.. versionadded:: 3.21
@@ -1269,7 +1281,8 @@ Compile Context
.. versionadded:: 3.27
- Content of ``...``, when collecting :ref:`Target Usage Requirements`,
+ Content of ``...``, when collecting
+ :ref:`transitive build properties <Transitive Build Properties>`,
otherwise it is the empty string. This is intended for use in an
:prop_tgt:`INTERFACE_LINK_LIBRARIES` and :prop_tgt:`LINK_LIBRARIES` target
properties, typically populated via the :command:`target_link_libraries` command.
@@ -1657,7 +1670,8 @@ Link Context
.. versionadded:: 3.1
- Content of ``...``, except while collecting :ref:`Target Usage Requirements`,
+ Content of ``...``, except while collecting usage requirements from
+ :ref:`transitive build properties <Transitive Build Properties>`,
in which case it is the empty string. This is intended for use in an
:prop_tgt:`INTERFACE_LINK_LIBRARIES` target property, typically populated
via the :command:`target_link_libraries` command, to specify private link
@@ -1688,22 +1702,15 @@ Link Context
only be used to specify link options.
-.. _`Target-Dependent Queries`:
+.. _`Target-Dependent Expressions`:
Target-Dependent Expressions
----------------------------
-These queries refer to a target ``tgt``. Unless otherwise stated, this can
-be any runtime artifact, namely:
-
-* An executable target created by :command:`add_executable`.
-* A shared library target (``.so``, ``.dll`` but not their ``.lib`` import
- library) created by :command:`add_library`.
-* A static library target created by :command:`add_library`.
+Target Meta-Data
+^^^^^^^^^^^^^^^^
-In the following, the phrase "the ``tgt`` filename" means the name of the
-``tgt`` binary file. This has to be distinguished from the phrase
-"the target name", which is just the string ``tgt``.
+These expressions look up information about a target.
.. genex:: $<TARGET_EXISTS:tgt>
@@ -1720,11 +1727,27 @@ In the following, the phrase "the ``tgt`` filename" means the name of the
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
-.. genex:: $<TARGET_NAME:...>
+.. genex:: $<TARGET_NAME:tgt>
+
+ The target name ``tgt`` as written. This marks ``tgt`` as being the name
+ of a target inside a larger expression, which is required if exporting
+ targets to multiple dependent export sets. The ``tgt`` text must be a
+ literal name of a target; it may not contain generator expressions.
+ The target does not have to exist.
- Marks ``...`` as being the name of a target. This is required if exporting
- targets to multiple dependent export sets. The ``...`` must be a literal
- name of a target, it may not contain generator expressions.
+.. genex:: $<TARGET_POLICY:policy>
+
+ ``1`` if the ``policy`` was ``NEW`` when the 'head' target was created,
+ else ``0``. If the ``policy`` was not set, the warning message for the policy
+ will be emitted. This generator expression only works for a subset of
+ policies.
+
+
+Target Properties
+^^^^^^^^^^^^^^^^^
+
+These expressions look up the values of
+:ref:`target properties <Target Properties>`.
.. genex:: $<TARGET_PROPERTY:tgt,prop>
@@ -1744,23 +1767,64 @@ In the following, the phrase "the ``tgt`` filename" means the name of the
:target: TARGET_PROPERTY:prop
Value of the property ``prop`` on the target for which the expression
- is being evaluated. Note that for generator expressions in
+ is being evaluated. Note that for generator expressions in
:ref:`Target Usage Requirements` this is the consuming target rather
than the target specifying the requirement.
-.. genex:: $<TARGET_OBJECTS:tgt>
+The expressions have special evaluation rules for some properties:
- .. versionadded:: 3.1
+* :ref:`Target Build Specification` properties evaluate as a
+ :ref:`semicolon-separated list <CMake Language Lists>` representing the union
+ of the value on the target itself with the values of the corresponding
+ :ref:`Target Usage Requirements` on targets named by the target's
+ :prop_tgt:`LINK_LIBRARIES`. Evaluation of the usage requirements is
+ transitive over the closure of the linked targets'
+ :prop_tgt:`INTERFACE_LINK_LIBRARIES`.
- List of objects resulting from building ``tgt``. This would typically be
- used on :ref:`object library <Object Libraries>` targets.
+ Evaluation of :prop_tgt:`LINK_LIBRARIES` itself is not transitive.
-.. genex:: $<TARGET_POLICY:policy>
+* :ref:`Target Usage Requirements` evaluate as a
+ :ref:`semicolon-separated list <CMake Language Lists>` representing the union
+ of the value on the target itself with the values of the same properties on
+ targets named by the target's :prop_tgt:`INTERFACE_LINK_LIBRARIES`.
+ Evaluation is transitive over the closure of the target's
+ :prop_tgt:`INTERFACE_LINK_LIBRARIES`:
- ``1`` if the ``policy`` was ``NEW`` when the 'head' target was created,
- else ``0``. If the ``policy`` was not set, the warning message for the policy
- will be emitted. This generator expression only works for a subset of
- policies.
+ * For :ref:`Transitive Build Properties`, the transitive closure
+ *excludes* entries of :prop_tgt:`INTERFACE_LINK_LIBRARIES` guarded
+ by the :genex:`LINK_ONLY` generator expression.
+
+ * For :ref:`Transitive Link Properties`, the transitive closure is
+ *includes* entries of :prop_tgt:`INTERFACE_LINK_LIBRARIES` guarded
+ by the :genex:`LINK_ONLY` generator expression.
+ See policy :policy:`CMP0166`.
+
+ Evaluation of :prop_tgt:`INTERFACE_LINK_LIBRARIES` itself is not transitive.
+
+* :ref:`Compatible Interface Properties` evaluate as a single value
+ combined from the target itself, from targets named by the target's
+ :prop_tgt:`LINK_LIBRARIES`, and from the transitive closure of the
+ linked targets' :prop_tgt:`INTERFACE_LINK_LIBRARIES`. Values of a
+ compatible interface property from multiple targets combine based on
+ the type of compatibility required by the ``COMPATIBLE_INTERFACE_*``
+ property defining it.
+
+
+Target Artifacts
+^^^^^^^^^^^^^^^^
+
+These expressions look up information about artifacts associated with
+a given target ``tgt``. Unless otherwise stated, this can be any
+runtime artifact, namely:
+
+* An executable target created by :command:`add_executable`.
+* A shared library target (``.so``, ``.dll`` but not their ``.lib`` import
+ library) created by :command:`add_library`.
+* A static library target created by :command:`add_library`.
+
+In the following, the phrase "the ``tgt`` filename" means the name of the
+``tgt`` binary file. This has to be distinguished from the phrase
+"the target name", which is just the string ``tgt``.
.. genex:: $<TARGET_FILE:tgt>
@@ -2242,6 +2306,13 @@ In the following, the phrase "the ``tgt`` filename" means the name of the
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on (see policy :policy:`CMP0112`).
+.. genex:: $<TARGET_OBJECTS:tgt>
+
+ .. versionadded:: 3.1
+
+ List of objects resulting from building ``tgt``. This would typically be
+ used on :ref:`object library <Object Libraries>` targets.
+
.. genex:: $<TARGET_RUNTIME_DLLS:tgt>
.. versionadded:: 3.21
@@ -2321,10 +2392,13 @@ Export And Install Expressions
Content of the install prefix when the target is exported via
:command:`install(EXPORT)`, or when evaluated in the
- :prop_tgt:`INSTALL_NAME_DIR` property, the ``INSTALL_NAME_DIR`` argument of
- :command:`install(RUNTIME_DEPENDENCY_SET)`, the code argument of
- :command:`install(CODE)`, or the file argument of :command:`install(SCRIPT)`,
- and empty otherwise.
+ :prop_tgt:`INSTALL_NAME_DIR` property or the ``INSTALL_NAME_DIR`` argument of
+ :command:`install(RUNTIME_DEPENDENCY_SET)`, and empty otherwise.
+
+ .. versionchanged:: 3.27
+ Evaluates to the content of the install prefix
+ in the code argument of :command:`install(CODE)` or
+ the file argument of :command:`install(SCRIPT)`.
Multi-level Expression Evaluation
---------------------------------
@@ -2395,6 +2469,13 @@ special meaning.
A literal ``;``. Used to prevent list expansion on an argument with ``;``.
+.. genex:: $<QUOTE>
+
+ .. versionadded:: 3.30
+
+ A literal ``"``. Used to allow string literal quotes inside a generator expression.
+
+
Deprecated Expressions
----------------------
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 46707ff..826790d 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -51,6 +51,31 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used
to determine whether to report an error on use of deprecated macros or
functions.
+Policies Introduced by CMake 3.30
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0166: TARGET_PROPERTY evaluates link properties transitively over private dependencies of static libraries. </policy/CMP0166>
+ CMP0165: enable_language() must not be called before project(). </policy/CMP0165>
+ CMP0164: add_library() rejects SHARED libraries when not supported by the platform. </policy/CMP0164>
+ CMP0163: The GENERATED source file property is now visible in all directories. </policy/CMP0163>
+ CMP0162: Visual Studio generators add UseDebugLibraries indicators by default. </policy/CMP0162>
+
+Policies Introduced by CMake 3.29
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0161: CPACK_PRODUCTBUILD_DOMAINS defaults to true. </policy/CMP0161>
+ CMP0160: More read-only target properties now error when trying to set them. </policy/CMP0160>
+ CMP0159: file(STRINGS) with REGEX updates CMAKE_MATCH_<n>. </policy/CMP0159>
+ CMP0158: add_test() honors CMAKE_CROSSCOMPILING_EMULATOR only when cross-compiling. </policy/CMP0158>
+ CMP0157: Swift compilation mode is selected by an abstraction. </policy/CMP0157>
+ CMP0156: De-duplicate libraries on link lines based on linker capabilities. </policy/CMP0156>
+
Policies Introduced by CMake 3.28
=================================
@@ -105,7 +130,7 @@ Policies Introduced by CMake 3.24
CMP0138: CheckIPOSupported uses flags from calling project. </policy/CMP0138>
CMP0137: try_compile() passes platform variables in project mode. </policy/CMP0137>
CMP0136: Watcom runtime library flags are selected by an abstraction. </policy/CMP0136>
- CMP0135: ExternalProject ignores timestamps in archives by default for the URL download method. </policy/CMP0135>
+ CMP0135: ExternalProject and FetchContent ignore timestamps in archives by default for the URL download method. </policy/CMP0135>
CMP0134: Fallback to "HOST" Windows registry view when "TARGET" view is not usable. </policy/CMP0134>
CMP0133: The CPack module disables SLA by default in the CPack DragNDrop Generator. </policy/CMP0133>
CMP0132: Do not set compiler environment variables on first run. </policy/CMP0132>
@@ -150,7 +175,7 @@ Policies Introduced by CMake 3.20
CMP0120: The WriteCompilerDetectionHeader module is removed. </policy/CMP0120>
CMP0119: LANGUAGE source file property explicitly compiles as language. </policy/CMP0119>
- CMP0118: The GENERATED source file property is now visible in all directories. </policy/CMP0118>
+ CMP0118: GENERATED sources may be used across directories without manual marking. </policy/CMP0118>
CMP0117: MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default. </policy/CMP0117>
CMP0116: Ninja generators transform DEPFILEs from add_custom_command(). </policy/CMP0116>
CMP0115: Source file extensions must be explicit. </policy/CMP0115>
@@ -190,7 +215,7 @@ Policies Introduced by CMake 3.17
CMP0102: mark_as_advanced() does nothing if a cache entry does not exist. </policy/CMP0102>
CMP0101: target_compile_options honors BEFORE keyword in all scopes. </policy/CMP0101>
CMP0100: Let AUTOMOC and AUTOUIC process .hh header files. </policy/CMP0100>
- CMP0099: Link properties are transitive over private dependency on static libraries. </policy/CMP0099>
+ CMP0099: Link properties are transitive over private dependencies of static libraries. </policy/CMP0099>
CMP0098: FindFLEX runs flex in CMAKE_CURRENT_BINARY_DIR when executing. </policy/CMP0098>
Policies Introduced by CMake 3.16
diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst
index fc0e1f9..5e91ae5 100644
--- a/Help/manual/cmake-presets.7.rst
+++ b/Help/manual/cmake-presets.7.rst
@@ -78,6 +78,9 @@ The root object recognizes the following fields:
``8``
.. versionadded:: 3.28
+ ``9``
+ .. versionadded:: 3.30
+
``cmakeMinimumRequired``
An optional object representing the minimum version of CMake needed to
build this project. This object consists of the following fields:
@@ -146,7 +149,9 @@ guaranteed to be provided by the project. ``CMakeUserPresets.json`` may
include files from anywhere.
Starting from version ``7``, the ``include`` field supports
-`macro expansion`_, but only ``$penv{}`` macro expansion.
+`macro expansion`_, but only ``$penv{}`` macro expansion. Starting from version
+``9``, other macro expansions are also available, except for preset specific
+ones (e.g. ``presetName``), and ``$env{}``.
Configure Preset
^^^^^^^^^^^^^^^^
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 0ff2f2a..7e640df 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -129,7 +129,9 @@ Properties on Targets
/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY_CONFIG
/prop_tgt/ARCHIVE_OUTPUT_NAME
/prop_tgt/ARCHIVE_OUTPUT_NAME_CONFIG
+ /prop_tgt/AUTOGEN_BETTER_GRAPH_MULTI_CONFIG
/prop_tgt/AUTOGEN_BUILD_DIR
+ /prop_tgt/AUTOGEN_COMMAND_LINE_LENGTH_MAX
/prop_tgt/AUTOGEN_ORIGIN_DEPENDS
/prop_tgt/AUTOGEN_PARALLEL
/prop_tgt/AUTOGEN_TARGET_DEPENDS
@@ -192,6 +194,7 @@ Properties on Targets
/prop_tgt/CXX_MODULE_SET
/prop_tgt/CXX_MODULE_SET_NAME
/prop_tgt/CXX_MODULE_SETS
+ /prop_tgt/CXX_MODULE_STD
/prop_tgt/CXX_SCAN_FOR_MODULES
/prop_tgt/CXX_STANDARD
/prop_tgt/CXX_STANDARD_REQUIRED
@@ -211,6 +214,7 @@ Properties on Targets
/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD
/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD_CONFIG
/prop_tgt/EXPORT_COMPILE_COMMANDS
+ /prop_tgt/EXPORT_FIND_PACKAGE_NAME
/prop_tgt/EXPORT_NAME
/prop_tgt/EXPORT_NO_SYSTEM
/prop_tgt/EXPORT_PROPERTIES
@@ -334,6 +338,7 @@ Properties on Targets
/prop_tgt/LINK_SEARCH_START_STATIC
/prop_tgt/LINK_WHAT_YOU_USE
/prop_tgt/LINKER_LANGUAGE
+ /prop_tgt/LINKER_TYPE
/prop_tgt/LOCATION
/prop_tgt/LOCATION_CONFIG
/prop_tgt/MACHO_COMPATIBILITY_VERSION
@@ -389,11 +394,13 @@ Properties on Targets
/prop_tgt/STATIC_LIBRARY_FLAGS_CONFIG
/prop_tgt/STATIC_LIBRARY_OPTIONS
/prop_tgt/SUFFIX
+ /prop_tgt/Swift_COMPILATION_MODE
/prop_tgt/Swift_DEPENDENCIES_FILE
/prop_tgt/Swift_LANGUAGE_VERSION
/prop_tgt/Swift_MODULE_DIRECTORY
/prop_tgt/Swift_MODULE_NAME
/prop_tgt/SYSTEM
+ /prop_tgt/TEST_LAUNCHER
/prop_tgt/TYPE
/prop_tgt/UNITY_BUILD
/prop_tgt/UNITY_BUILD_BATCH_SIZE
@@ -439,7 +446,9 @@ Properties on Targets
/prop_tgt/VS_SDK_REFERENCES
/prop_tgt/VS_SOLUTION_DEPLOY
/prop_tgt/VS_SOURCE_SETTINGS_tool
+ /prop_tgt/VS_USE_DEBUG_LIBRARIES
/prop_tgt/VS_USER_PROPS
+ /prop_tgt/VS_FILTER_PROPS
/prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
/prop_tgt/VS_WINRT_COMPONENT
/prop_tgt/VS_WINRT_REFERENCES
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index e5a39f5..27230c8 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -10,34 +10,39 @@ cmake-qt(7)
Introduction
============
-CMake can find and use Qt 4 and Qt 5 libraries. The Qt 4 libraries are found
-by the :module:`FindQt4` find-module shipped with CMake, whereas the
-Qt 5 libraries are found using "Config-file Packages" shipped with Qt 5. See
-:manual:`cmake-packages(7)` for more information about CMake packages, and
-see `the Qt cmake manual <https://doc.qt.io/qt-5/cmake-manual.html>`_
-for your Qt version.
-
-Qt 4 and Qt 5 may be used together in the same
+CMake can find and use Qt 4, Qt 5 and Qt 6 libraries. The Qt 4 libraries are
+found by the :module:`FindQt4` find-module shipped with CMake, whereas the
+Qt 5 and Qt 6 libraries are found using "Config-file Packages" shipped with
+Qt 5 and Qt 6. See :manual:`cmake-packages(7)` for more information about CMake
+packages, and see `the Qt cmake manual`_ for your Qt version.
+
+.. _`the Qt cmake manual`: https://doc.qt.io/qt-6/cmake-manual.html
+
+Qt 4, Qt 5 and Qt 6 may be used together in the same
:manual:`CMake buildsystem <cmake-buildsystem(7)>`:
.. code-block:: cmake
- cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
- project(Qt4And5)
+ project(Qt4_5_6)
set(CMAKE_AUTOMOC ON)
- find_package(Qt5 COMPONENTS Widgets DBus REQUIRED)
+ find_package(Qt6 COMPONENTS Widgets DBus REQUIRED)
add_executable(publisher publisher.cpp)
- target_link_libraries(publisher Qt5::Widgets Qt5::DBus)
+ target_link_libraries(publisher Qt6::Widgets Qt6::DBus)
+
+ find_package(Qt5 COMPONENTS Gui DBus REQUIRED)
+ add_executable(subscriber1 subscriber1.cpp)
+ target_link_libraries(subscriber1 Qt5::Gui Qt5::DBus)
find_package(Qt4 REQUIRED)
- add_executable(subscriber subscriber.cpp)
- target_link_libraries(subscriber Qt4::QtGui Qt4::QtDBus)
+ add_executable(subscriber2 subscriber2.cpp)
+ target_link_libraries(subscriber2 Qt4::QtGui Qt4::QtDBus)
-A CMake target may not link to both Qt 4 and Qt 5. A diagnostic is issued if
-this is attempted or results from transitive target dependency evaluation.
+A CMake target may not link to more than one Qt version. A diagnostic is issued
+if this is attempted or results from transitive target dependency evaluation.
Qt Build Tools
==============
@@ -46,7 +51,7 @@ Qt relies on some bundled tools for code generation, such as ``moc`` for
meta-object code generation, ``uic`` for widget layout and population,
and ``rcc`` for virtual file system content generation. These tools may be
automatically invoked by :manual:`cmake(1)` if the appropriate conditions
-are met. The automatic tool invocation may be used with both Qt 4 and Qt 5.
+are met. The automatic tool invocation may be used with Qt version 4 to 6.
.. _`Qt AUTOMOC`:
@@ -158,7 +163,7 @@ should be used when running ``uic``:
.. code-block:: cmake
add_library(KI18n klocalizedstring.cpp)
- target_link_libraries(KI18n Qt5::Core)
+ target_link_libraries(KI18n Qt6::Core)
# KI18n uses the tr2i18n() function instead of tr(). That function is
# declared in the klocalizedstring.h header.
@@ -213,25 +218,44 @@ overrides options from the :prop_tgt:`AUTORCC_OPTIONS` target property.
Source files can be excluded from :prop_tgt:`AUTORCC` processing by
enabling :prop_sf:`SKIP_AUTORCC` or the broader :prop_sf:`SKIP_AUTOGEN`.
+.. _`<ORIGIN>_autogen`:
+
The ``<ORIGIN>_autogen`` target
===============================
The ``moc`` and ``uic`` tools are executed as part of a synthesized
-``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>` generated by
-CMake. By default that ``<ORIGIN>_autogen`` target inherits the dependencies
+:ref:`<ORIGIN>_autogen` :command:`custom target <add_custom_target>` generated by
+CMake. By default that :ref:`<ORIGIN>_autogen` target inherits the dependencies
of the ``<ORIGIN>`` target (see :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`).
-Target dependencies may be added to the ``<ORIGIN>_autogen`` target by adding
+Target dependencies may be added to the :ref:`<ORIGIN>_autogen` target by adding
them to the :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property.
+.. note::
+ If Qt 5.15 or later is used and the generator is either :generator:`Ninja` or
+ :ref:`Makefile Generators`, see :ref:`<ORIGIN>_autogen_timestamp_deps`.
+
+.. _`<ORIGIN>_autogen_timestamp_deps`:
+
+The ``<ORIGIN>_autogen_timestamp_deps`` target
+==============================================
+
+If Qt 5.15 or later is used and the generator is either :generator:`Ninja` or
+:ref:`Makefile Generators`, the ``<ORIGIN>_autogen_timestamp_deps`` target is
+also created in addition to the :ref:`<ORIGIN>_autogen` target. This target
+does not have any sources or commands to execute, but it has dependencies that
+were previously inherited by the pre-Qt 5.15 :ref:`<ORIGIN>_autogen` target.
+These dependencies will serve as a list of order-only dependencies for the
+custom command, without forcing the custom command to re-execute.
+
Visual Studio Generators
========================
When using the :manual:`Visual Studio generators <cmake-generators(7)>`, CMake
generates a ``PRE_BUILD`` :command:`custom command <add_custom_command>`
-instead of the ``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>`
-(for :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`).
-This isn't always possible though and
-an ``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>` is used,
+instead of the :ref:`<ORIGIN>_autogen`
+:command:`custom target <add_custom_target>` (for :prop_tgt:`AUTOMOC` and
+:prop_tgt:`AUTOUIC`). This isn't always possible though and an
+:ref:`<ORIGIN>_autogen` :command:`custom target <add_custom_target>` is used,
when either
- the ``<ORIGIN>`` target depends on :prop_sf:`GENERATED` files which aren't
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index d9df773..8f98f8b 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -55,7 +55,6 @@ Variables that Provide Information
/variable/CMAKE_EDIT_COMMAND
/variable/CMAKE_EXECUTABLE_SUFFIX
/variable/CMAKE_EXECUTABLE_SUFFIX_LANG
- /variable/CMAKE_EXTRA_GENERATOR
/variable/CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
/variable/CMAKE_FIND_DEBUG_MODE
/variable/CMAKE_FIND_PACKAGE_NAME
@@ -74,6 +73,10 @@ Variables that Provide Information
/variable/CMAKE_JOB_POOLS
/variable/CMAKE_LANG_COMPILER_AR
/variable/CMAKE_LANG_COMPILER_FRONTEND_VARIANT
+ /variable/CMAKE_LANG_COMPILER_LINKER
+ /variable/CMAKE_LANG_COMPILER_LINKER_FRONTEND_VARIANT
+ /variable/CMAKE_LANG_COMPILER_LINKER_ID
+ /variable/CMAKE_LANG_COMPILER_LINKER_VERSION
/variable/CMAKE_LANG_COMPILER_RANLIB
/variable/CMAKE_LANG_LINK_LIBRARY_SUFFIX
/variable/CMAKE_LINK_LIBRARY_SUFFIX
@@ -111,8 +114,10 @@ Variables that Provide Information
/variable/CMAKE_SOURCE_DIR
/variable/CMAKE_STATIC_LIBRARY_PREFIX
/variable/CMAKE_STATIC_LIBRARY_SUFFIX
+ /variable/CMAKE_Swift_COMPILATION_MODE
/variable/CMAKE_Swift_MODULE_DIRECTORY
/variable/CMAKE_Swift_NUM_THREADS
+ /variable/CMAKE_TEST_LAUNCHER
/variable/CMAKE_TOOLCHAIN_FILE
/variable/CMAKE_TWEAK_VERSION
/variable/CMAKE_VERBOSE_MAKEFILE
@@ -126,11 +131,13 @@ Variables that Provide Information
/variable/CMAKE_VS_PLATFORM_TOOLSET
/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA
/variable/CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR
+ /variable/CMAKE_VS_PLATFORM_TOOLSET_FORTRAN
/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
/variable/CMAKE_VS_PLATFORM_TOOLSET_VERSION
/variable/CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER
/variable/CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION
/variable/CMAKE_VS_TARGET_FRAMEWORK_VERSION
+ /variable/CMAKE_VS_USE_DEBUG_LIBRARIES
/variable/CMAKE_VS_VERSION_BUILD_NUMBER
/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
@@ -169,8 +176,6 @@ Variables that Change Behavior
/variable/CMAKE_ABSOLUTE_DESTINATION_FILES
/variable/CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY
/variable/CMAKE_APPBUNDLE_PATH
- /variable/CMAKE_AUTOMOC_RELAXED_MODE
- /variable/CMAKE_BACKWARDS_COMPATIBILITY
/variable/CMAKE_BUILD_TYPE
/variable/CMAKE_CLANG_VFS_OVERLAY
/variable/CMAKE_CODEBLOCKS_COMPILER_ID
@@ -198,8 +203,6 @@ Variables that Change Behavior
/variable/CMAKE_FIND_LIBRARY_PREFIXES
/variable/CMAKE_FIND_LIBRARY_SUFFIXES
/variable/CMAKE_FIND_NO_INSTALL_PREFIX
- /variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
- /variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
/variable/CMAKE_FIND_PACKAGE_PREFER_CONFIG
/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
/variable/CMAKE_FIND_PACKAGE_TARGETS_GLOBAL
@@ -251,6 +254,7 @@ Variables that Change Behavior
/variable/CMAKE_PROJECT_TOP_LEVEL_INCLUDES
/variable/CMAKE_REQUIRE_FIND_PACKAGE_PackageName
/variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
+ /variable/CMAKE_SKIP_TEST_ALL_DEPENDENCY
/variable/CMAKE_STAGING_PREFIX
/variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS
/variable/CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE
@@ -268,6 +272,7 @@ Variables that Change Behavior
/variable/CMAKE_SYSTEM_PROGRAM_PATH
/variable/CMAKE_TLS_CAINFO
/variable/CMAKE_TLS_VERIFY
+ /variable/CMAKE_TLS_VERSION
/variable/CMAKE_USER_MAKE_RULES_OVERRIDE
/variable/CMAKE_WARN_DEPRECATED
/variable/CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
@@ -336,15 +341,6 @@ Variables that Describe the System
/variable/LINUX
/variable/MINGW
/variable/MSVC
- /variable/MSVC10
- /variable/MSVC11
- /variable/MSVC12
- /variable/MSVC14
- /variable/MSVC60
- /variable/MSVC70
- /variable/MSVC71
- /variable/MSVC80
- /variable/MSVC90
/variable/MSVC_IDE
/variable/MSVC_TOOLSET_VERSION
/variable/MSVC_VERSION
@@ -395,6 +391,8 @@ Variables that Control the Build
/variable/CMAKE_APPLE_SILICON_PROCESSOR
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG
+ /variable/CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG
+ /variable/CMAKE_AUTOGEN_COMMAND_LINE_LENGTH_MAX
/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS
/variable/CMAKE_AUTOGEN_PARALLEL
/variable/CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE
@@ -426,6 +424,7 @@ Variables that Control the Build
/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
/variable/CMAKE_CUDA_RUNTIME_LIBRARY
/variable/CMAKE_CUDA_SEPARABLE_COMPILATION
+ /variable/CMAKE_CXX_MODULE_STD
/variable/CMAKE_CXX_SCAN_FOR_MODULES
/variable/CMAKE_DEBUG_POSTFIX
/variable/CMAKE_DEFAULT_BUILD_TYPE
@@ -439,6 +438,7 @@ Variables that Control the Build
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG_INIT
/variable/CMAKE_EXE_LINKER_FLAGS_INIT
+ /variable/CMAKE_EXPORT_FIND_PACKAGE_NAME
/variable/CMAKE_FOLDER
/variable/CMAKE_Fortran_FORMAT
/variable/CMAKE_Fortran_MODULE_DIRECTORY
@@ -459,7 +459,6 @@ Variables that Control the Build
/variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH
/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION
/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG
- /variable/CMAKE_IOS_INSTALL_COMBINED
/variable/CMAKE_LANG_CLANG_TIDY
/variable/CMAKE_LANG_CLANG_TIDY_EXPORT_FIXES_DIR
/variable/CMAKE_LANG_COMPILER_LAUNCHER
@@ -474,6 +473,8 @@ Variables that Control the Build
/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE_SUPPORTED
/variable/CMAKE_LANG_LINK_WHAT_YOU_USE_FLAG
/variable/CMAKE_LANG_LINKER_LAUNCHER
+ /variable/CMAKE_LANG_USING_LINKER_MODE
+ /variable/CMAKE_LANG_USING_LINKER_TYPE
/variable/CMAKE_LANG_VISIBILITY_PRESET
/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY
/variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY_CONFIG
@@ -490,6 +491,7 @@ Variables that Control the Build
/variable/CMAKE_LINK_LIBRARY_USING_FEATURE_SUPPORTED
/variable/CMAKE_LINK_WHAT_YOU_USE
/variable/CMAKE_LINK_WHAT_YOU_USE_CHECK
+ /variable/CMAKE_LINKER_TYPE
/variable/CMAKE_MACOSX_BUNDLE
/variable/CMAKE_MACOSX_RPATH
/variable/CMAKE_MAP_IMPORTED_CONFIG_CONFIG
@@ -534,7 +536,6 @@ Variables that Control the Build
/variable/CMAKE_UNITY_BUILD
/variable/CMAKE_UNITY_BUILD_BATCH_SIZE
/variable/CMAKE_UNITY_BUILD_UNIQUE_ID
- /variable/CMAKE_USE_RELATIVE_PATHS
/variable/CMAKE_VERIFY_INTERFACE_HEADER_SETS
/variable/CMAKE_VISIBILITY_INLINES_HIDDEN
/variable/CMAKE_VS_DEBUGGER_COMMAND
@@ -571,9 +572,6 @@ Variables for Languages
/variable/CMAKE_C_EXTENSIONS
/variable/CMAKE_C_STANDARD
/variable/CMAKE_C_STANDARD_REQUIRED
- /variable/CMAKE_COMPILER_IS_GNUCC
- /variable/CMAKE_COMPILER_IS_GNUCXX
- /variable/CMAKE_COMPILER_IS_GNUG77
/variable/CMAKE_CUDA_ARCHITECTURES
/variable/CMAKE_CUDA_COMPILE_FEATURES
/variable/CMAKE_CUDA_EXTENSIONS
@@ -582,6 +580,7 @@ Variables for Languages
/variable/CMAKE_CUDA_STANDARD_REQUIRED
/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
/variable/CMAKE_CXX_COMPILE_FEATURES
+ /variable/CMAKE_CXX_COMPILER_IMPORT_STD
/variable/CMAKE_CXX_EXTENSIONS
/variable/CMAKE_CXX_STANDARD
/variable/CMAKE_CXX_STANDARD_REQUIRED
@@ -646,6 +645,7 @@ Variables for Languages
/variable/CMAKE_LANG_STANDARD
/variable/CMAKE_LANG_STANDARD_DEFAULT
/variable/CMAKE_LANG_STANDARD_INCLUDE_DIRECTORIES
+ /variable/CMAKE_LANG_STANDARD_LATEST
/variable/CMAKE_LANG_STANDARD_LIBRARIES
/variable/CMAKE_LANG_STANDARD_REQUIRED
/variable/CMAKE_OBJC_EXTENSIONS
@@ -693,7 +693,6 @@ Variables for CTest
/variable/CTEST_CUSTOM_TESTS_IGNORE
/variable/CTEST_CUSTOM_WARNING_EXCEPTION
/variable/CTEST_CUSTOM_WARNING_MATCH
- /variable/CTEST_CVS_CHECKOUT
/variable/CTEST_CVS_COMMAND
/variable/CTEST_CVS_UPDATE_OPTIONS
/variable/CTEST_DROP_LOCATION
@@ -722,7 +721,6 @@ Variables for CTest
/variable/CTEST_P4_UPDATE_OPTIONS
/variable/CTEST_RESOURCE_SPEC_FILE
/variable/CTEST_RUN_CURRENT_SCRIPT
- /variable/CTEST_SCP_COMMAND
/variable/CTEST_SCRIPT_DIRECTORY
/variable/CTEST_SITE
/variable/CTEST_SOURCE_DIRECTORY
@@ -733,7 +731,8 @@ Variables for CTest
/variable/CTEST_SVN_UPDATE_OPTIONS
/variable/CTEST_TEST_LOAD
/variable/CTEST_TEST_TIMEOUT
- /variable/CTEST_TRIGGER_SITE
+ /variable/CTEST_TLS_VERIFY
+ /variable/CTEST_TLS_VERSION
/variable/CTEST_UPDATE_COMMAND
/variable/CTEST_UPDATE_OPTIONS
/variable/CTEST_UPDATE_VERSION_ONLY
@@ -786,3 +785,67 @@ are subject to change, and not recommended for use in project code.
/variable/CMAKE_LANG_PLATFORM_ID
/variable/CMAKE_NOT_USING_CONFIG_FLAGS
/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
+
+Deprecated Variables that Provide Information
+=============================================
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CMAKE_EXTRA_GENERATOR
+
+Deprecated Variables that Change Behavior
+=========================================
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CMAKE_AUTOMOC_RELAXED_MODE
+ /variable/CMAKE_BACKWARDS_COMPATIBILITY
+ /variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
+ /variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
+
+Deprecated Variables that Describe the System
+=============================================
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/MSVC10
+ /variable/MSVC11
+ /variable/MSVC12
+ /variable/MSVC14
+ /variable/MSVC60
+ /variable/MSVC70
+ /variable/MSVC71
+ /variable/MSVC80
+ /variable/MSVC90
+
+Deprecated Variables that Control the Build
+===========================================
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CMAKE_IOS_INSTALL_COMBINED
+ /variable/CMAKE_USE_RELATIVE_PATHS
+
+Deprecated Variables for Languages
+==================================
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CMAKE_COMPILER_IS_GNUCC
+ /variable/CMAKE_COMPILER_IS_GNUCXX
+ /variable/CMAKE_COMPILER_IS_GNUG77
+
+Deprecated Variables for CTest
+==============================
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CTEST_CVS_CHECKOUT
+ /variable/CTEST_SCP_COMMAND
+ /variable/CTEST_TRIGGER_SITE
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 5223acb..621c005 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -891,6 +891,10 @@ Available commands are:
``-`` will result in an error. Use ``--`` to indicate the end of options, in
case a file starts with ``-``.
+ .. versionadded:: 3.29
+
+ ``cat`` can now print the standard input by passing the ``-`` argument.
+
.. program:: cmake-E
.. option:: chdir <dir> <cmd> [<arg>...]
@@ -1311,6 +1315,7 @@ The following ``cmake -E`` commands are available only on Windows:
Write Windows registry value.
+.. _`Find-Package Tool Mode`:
Run the Find-Package Tool
=========================
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 5512c61..c9ab31e 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -118,17 +118,27 @@ Run Tests
previously interrupted. If no interruption occurred, the ``-F`` option
will have no effect.
-.. option:: -j <jobs>, --parallel <jobs>
+.. option:: -j [<level>], --parallel [<level>]
- Run the tests in parallel using the given number of jobs.
+ Run tests in parallel, optionally limited to a given level of parallelism.
- This option tells CTest to run the tests in parallel using given
- number of jobs. This option can also be set by setting the
- :envvar:`CTEST_PARALLEL_LEVEL` environment variable.
+ .. versionadded:: 3.29
- This option can be used with the :prop_test:`PROCESSORS` test property.
+ The ``<level>`` may be omitted, or ``0``, in which case:
- See `Label and Subproject Summary`_.
+ * Under `Job Server Integration`_, parallelism is limited by
+ available job tokens.
+
+ * Otherwise, if the value is omitted, parallelism is limited
+ by the number of processors, or 2, whichever is larger.
+
+ * Otherwise, if the value is ``0``, parallelism is unbounded.
+
+ This option may instead be specified by the :envvar:`CTEST_PARALLEL_LEVEL`
+ environment variable.
+
+ This option can be used with the :prop_test:`PROCESSORS` test property.
+ See the `Label and Subproject Summary`_.
.. option:: --resource-spec-file <file>
@@ -234,6 +244,30 @@ Run Tests
of the test's labels (i.e. the multiple ``-LE`` labels form an ``AND``
relationship). See `Label Matching`_.
+.. option:: --tests-from-file <filename>
+
+ .. versionadded:: 3.29
+
+ Run tests listed in the given file.
+
+ This option tells CTest to run tests that are listed in the given file.
+ The file must contain one exact test name per line.
+ Lines that do not exactly match any test names are ignored.
+ This option can be combined with the other options like
+ ``-R``, ``-E``, ``-L`` or ``-LE``.
+
+.. option:: --exclude-from-file <filename>
+
+ .. versionadded:: 3.29
+
+ Exclude tests listed in the given file.
+
+ This option tells CTest to NOT run tests that are listed in the given file.
+ The file must contain one exact test name per line.
+ Lines that do not exactly match any test names are ignored.
+ This option can be combined with the other options like
+ ``-R``, ``-E``, ``-L`` or ``-LE``.
+
.. option:: -FA <regex>, --fixture-exclude-any <regex>
Exclude fixtures matching ``<regex>`` from automatically adding any tests to
@@ -354,6 +388,8 @@ Run Tests
.. option:: --test-dir <dir>
+ .. versionadded:: 3.20
+
Specify the directory in which to look for tests, typically a CMake project
build directory. If not specified, the current directory is used.
@@ -752,6 +788,16 @@ The available ``<dashboard-options>`` are the following:
This option will submit extra files to the dashboard.
+.. option:: --http-header <header>
+
+ .. versionadded:: 3.29
+
+ Append HTTP header when submitting to the dashboard.
+
+ This option will cause CTest to append the specified header
+ when submitting to the dashboard.
+ This option may be specified more than once.
+
.. option:: --http1.0
Submit using `HTTP 1.0`.
@@ -1406,14 +1452,25 @@ Configuration settings include:
* :module:`CTest` module variable: ``CTEST_SUBMIT_RETRY_DELAY``
``CurlOptions``
+ .. deprecated:: 3.30
+
+ Use ``TLSVerify`` instead.
+
Specify a semicolon-separated list of options to control the
Curl library that CTest uses internally to connect to the
- server. Possible options are ``CURLOPT_SSL_VERIFYPEER_OFF``
- and ``CURLOPT_SSL_VERIFYHOST_OFF``.
+ server.
* `CTest Script`_ variable: :variable:`CTEST_CURL_OPTIONS`
* :module:`CTest` module variable: ``CTEST_CURL_OPTIONS``
+ Possible options are:
+
+ ``CURLOPT_SSL_VERIFYPEER_OFF``
+ Disable the ``CURLOPT_SSL_VERIFYPEER`` curl option.
+
+ ``CURLOPT_SSL_VERIFYHOST_OFF``
+ Disable the ``CURLOPT_SSL_VERIFYHOST`` curl option.
+
``DropLocation``
Legacy option. When ``SubmitURL`` is not set, it is constructed from
``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
@@ -1494,6 +1551,24 @@ Configuration settings include:
* `CTest Script`_ variable: :variable:`CTEST_SUBMIT_INACTIVITY_TIMEOUT`
* :module:`CTest` module variable: ``CTEST_SUBMIT_INACTIVITY_TIMEOUT``
+``TLSVersion``
+ .. versionadded:: 3.30
+
+ Specify a minimum TLS version allowed when submitting to a dashboard
+ via ``https://`` URLs.
+
+ * `CTest Script`_ variable: :variable:`CTEST_TLS_VERSION`
+ * :module:`CTest` module variable: ``CTEST_TLS_VERSION``
+
+``TLSVerify``
+ .. versionadded:: 3.30
+
+ Specify a boolean value indicating whether to verify the server
+ certificate when submitting to a dashboard via ``https://`` URLs.
+
+ * `CTest Script`_ variable: :variable:`CTEST_TLS_VERIFY`
+ * :module:`CTest` module variable: ``CTEST_TLS_VERIFY``
+
``TriggerSite``
Legacy option. Not used.
@@ -1847,6 +1922,31 @@ fixture in their :prop_test:`FIXTURES_REQUIRED`, and a resource spec file may
not be specified with the ``--resource-spec-file`` argument or the
:variable:`CTEST_RESOURCE_SPEC_FILE` variable.
+.. _`ctest-job-server-integration`:
+
+Job Server Integration
+======================
+
+.. versionadded:: 3.29
+
+On POSIX systems, when running under the context of a `Job Server`_,
+CTest shares its job slots. This is independent of the :prop_test:`PROCESSORS`
+test property, which still counts against CTest's :option:`-j <ctest -j>`
+parallel level. CTest acquires exactly one token from the job server before
+running each test, and returns it when the test finishes.
+
+For example, consider the ``Makefile``:
+
+.. literalinclude:: CTEST_EXAMPLE_MAKEFILE_JOB_SERVER.make
+ :language: make
+
+When invoked via ``make -j 2 test``, ``ctest`` connects to the job server,
+acquires a token for each test, and runs at most 2 tests concurrently.
+
+On Windows systems, job server integration is not yet implemented.
+
+.. _`Job Server`: https://www.gnu.org/software/make/manual/html_node/Job-Slots.html
+
See Also
========
diff --git a/Help/manual/presets/schema.json b/Help/manual/presets/schema.json
index d27faa1..f80685c 100644
--- a/Help/manual/presets/schema.json
+++ b/Help/manual/presets/schema.json
@@ -124,6 +124,24 @@
"include": { "$ref": "#/definitions/include" }
},
"additionalProperties": false
+ },
+ {
+ "properties": {
+ "$schema": { "$ref": "#/definitions/$schema" },
+ "version": {
+ "const": 9,
+ "description": "A required integer representing the version of the JSON schema."
+ },
+ "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired" },
+ "vendor": { "$ref": "#/definitions/vendor" },
+ "configurePresets": { "$ref": "#/definitions/configurePresetsV7" },
+ "buildPresets": { "$ref": "#/definitions/buildPresetsV4" },
+ "testPresets": { "$ref": "#/definitions/testPresetsV6" },
+ "packagePresets": { "$ref": "#/definitions/packagePresetsV6" },
+ "workflowPresets": { "$ref": "#/definitions/workflowPresetsV6" },
+ "include": { "$ref": "#/definitions/include" }
+ },
+ "additionalProperties": false
}
],
"required": [
diff --git a/Help/policy/CMP0001.rst b/Help/policy/CMP0001.rst
index 6fa64d9..e06f2a1 100644
--- a/Help/policy/CMP0001.rst
+++ b/Help/policy/CMP0001.rst
@@ -14,8 +14,8 @@ and the :command:`cmake_policy` command. However, CMake must still check
``CMAKE_BACKWARDS_COMPATIBILITY`` for projects written for CMake 2.4 and
below.
-This policy was introduced in CMake version 2.6.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0002.rst b/Help/policy/CMP0002.rst
index dc68d51..f50ddd5 100644
--- a/Help/policy/CMP0002.rst
+++ b/Help/policy/CMP0002.rst
@@ -21,8 +21,8 @@ physical name while keeping logical names distinct. Custom targets
must simply have globally unique names (unless one uses the global
property :prop_gbl:`ALLOW_DUPLICATE_CUSTOM_TARGETS` with a Makefiles generator).
-This policy was introduced in CMake version 2.6.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0003.rst b/Help/policy/CMP0003.rst
index dd90883..0a6b778 100644
--- a/Help/policy/CMP0003.rst
+++ b/Help/policy/CMP0003.rst
@@ -97,8 +97,8 @@ Note that the warning for this policy will be issued for at most one
target. This avoids flooding users with messages for every target
when setting the policy once will probably fix all targets.
-This policy was introduced in CMake version 2.6.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0004.rst b/Help/policy/CMP0004.rst
index be6d307..74e3e66 100644
--- a/Help/policy/CMP0004.rst
+++ b/Help/policy/CMP0004.rst
@@ -19,8 +19,8 @@ policy used when checking the library names is that in effect when the
target is created by an :command:`add_executable` or :command:`add_library`
command.
-This policy was introduced in CMake version 2.6.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0005.rst b/Help/policy/CMP0005.rst
index 59567d5..3037a12 100644
--- a/Help/policy/CMP0005.rst
+++ b/Help/policy/CMP0005.rst
@@ -19,8 +19,8 @@ generate correct escapes for all native build tools automatically.
See documentation of the ``COMPILE_DEFINITIONS`` target property for
limitations of the escaping implementation.
-This policy was introduced in CMake version 2.6.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0006.rst b/Help/policy/CMP0006.rst
index 181958b..31efebd 100644
--- a/Help/policy/CMP0006.rst
+++ b/Help/policy/CMP0006.rst
@@ -17,8 +17,8 @@ The ``OLD`` behavior for this policy is to fall back to the
behavior for this policy is to produce an error if a bundle target is installed
without a ``BUNDLE DESTINATION``.
-This policy was introduced in CMake version 2.6.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0007.rst b/Help/policy/CMP0007.rst
index 1006ed3..b95f36c 100644
--- a/Help/policy/CMP0007.rst
+++ b/Help/policy/CMP0007.rst
@@ -10,8 +10,8 @@ and not 4. The ``OLD`` behavior for this policy is to ignore empty list
elements. The ``NEW`` behavior for this policy is to correctly count
empty elements in a list.
-This policy was introduced in CMake version 2.6.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0008.rst b/Help/policy/CMP0008.rst
index 18ede82..bcb10d5 100644
--- a/Help/policy/CMP0008.rst
+++ b/Help/policy/CMP0008.rst
@@ -28,8 +28,8 @@ split the library name from the path and ask the linker to search for
it. The ``NEW`` behavior for this policy is to trust the given path and
pass it directly to the native build tool unchanged.
-This policy was introduced in CMake version 2.6.1. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0009.rst b/Help/policy/CMP0009.rst
index 27cfde0..c554522 100644
--- a/Help/policy/CMP0009.rst
+++ b/Help/policy/CMP0009.rst
@@ -14,8 +14,8 @@ policy is to follow the symlinks. The ``NEW`` behavior for this policy is not
to follow the symlinks by default, but only if ``FOLLOW_SYMLINKS`` is given
as an additional argument to the ``FILE`` command.
-This policy was introduced in CMake version 2.6.2. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.2
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0010.rst b/Help/policy/CMP0010.rst
index cfae498..442553d 100644
--- a/Help/policy/CMP0010.rst
+++ b/Help/policy/CMP0010.rst
@@ -13,8 +13,8 @@ The ``NEW`` behavior for this policy is to report an error.
If :policy:`CMP0053` is set to ``NEW``, this policy has no effect
and is treated as always being ``NEW``.
-This policy was introduced in CMake version 2.6.3. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.3
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0011.rst b/Help/policy/CMP0011.rst
index 257415c..976b3c3 100644
--- a/Help/policy/CMP0011.rst
+++ b/Help/policy/CMP0011.rst
@@ -18,8 +18,8 @@ compatibility. The ``OLD`` behavior for this policy is to imply
The ``NEW`` behavior for this policy is to allow the commands to do
their default cmake_policy ``PUSH`` and ``POP``.
-This policy was introduced in CMake version 2.6.3. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.3
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0012.rst b/Help/policy/CMP0012.rst
index 17ec8d3..dd889d2 100644
--- a/Help/policy/CMP0012.rst
+++ b/Help/policy/CMP0012.rst
@@ -21,8 +21,8 @@ variables named like numbers and boolean constants. The ``NEW`` behavior
for this policy is to recognize numbers and boolean constants without
dereferencing variables with such names.
-This policy was introduced in CMake version 2.8.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0013.rst b/Help/policy/CMP0013.rst
index dbd67a1..4ee19cc 100644
--- a/Help/policy/CMP0013.rst
+++ b/Help/policy/CMP0013.rst
@@ -14,8 +14,8 @@ this policy is to allow duplicate binary directories. The NEW
behavior for this policy is to disallow duplicate binary directories
with an error.
-This policy was introduced in CMake version 2.8.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0014.rst b/Help/policy/CMP0014.rst
index 331dde5..1487bc4 100644
--- a/Help/policy/CMP0014.rst
+++ b/Help/policy/CMP0014.rst
@@ -10,8 +10,8 @@ treating them as if present but empty. In CMake 2.8.0 and above this
The ``OLD`` behavior for this policy is to silently ignore the problem.
The ``NEW`` behavior for this policy is to report an error.
-This policy was introduced in CMake version 2.8.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0015.rst b/Help/policy/CMP0015.rst
index 90d5203..cd65c3f 100644
--- a/Help/policy/CMP0015.rst
+++ b/Help/policy/CMP0015.rst
@@ -12,8 +12,8 @@ this policy is to use relative paths verbatim in the linker command. The
``NEW`` behavior for this policy is to convert relative paths to absolute
paths by appending the relative path to ``CMAKE_CURRENT_SOURCE_DIR``.
-This policy was introduced in CMake version 2.8.1. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0016.rst b/Help/policy/CMP0016.rst
index 026d02a..960361d 100644
--- a/Help/policy/CMP0016.rst
+++ b/Help/policy/CMP0016.rst
@@ -9,8 +9,8 @@ ignored if it was called with only one argument, and this argument
wasn't a valid target. In CMake 2.8.3 and above it reports an error
in this case.
-This policy was introduced in CMake version 2.8.3. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.3
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0017.rst b/Help/policy/CMP0017.rst
index ca4664e..d06ad13 100644
--- a/Help/policy/CMP0017.rst
+++ b/Help/policy/CMP0017.rst
@@ -14,8 +14,8 @@ precedence over the ones in the CMake module directory. The ``OLD``
behavior is to always prefer files from CMAKE_MODULE_PATH over files
from the CMake modules directory.
-This policy was introduced in CMake version 2.8.4. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.4
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0018.rst b/Help/policy/CMP0018.rst
index 6248406..e4cd184 100644
--- a/Help/policy/CMP0018.rst
+++ b/Help/policy/CMP0018.rst
@@ -27,9 +27,8 @@ The ``NEW`` behavior for this policy is to ignore
``CMAKE_SHARED_LIBRARY_<Lang>_FLAGS`` whether it is modified or not and
honor the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property.
-This policy was introduced in CMake version 2.8.9. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.9
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0019.rst b/Help/policy/CMP0019.rst
index 682dcdf..f3fa46a 100644
--- a/Help/policy/CMP0019.rst
+++ b/Help/policy/CMP0019.rst
@@ -15,8 +15,8 @@ The ``OLD`` behavior for this policy is to re-evaluate the values for
strict compatibility. The ``NEW`` behavior for this policy is to leave
the values untouched.
-This policy was introduced in CMake version 2.8.11. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.11
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0020.rst b/Help/policy/CMP0020.rst
index 6d27684..0a4de5c 100644
--- a/Help/policy/CMP0020.rst
+++ b/Help/policy/CMP0020.rst
@@ -20,8 +20,8 @@ The ``OLD`` behavior for this policy is not to link executables to
The ``NEW`` behavior for this policy is to link executables to ``qtmain.lib``
automatically when they link to QtCore ``IMPORTED`` target.
-This policy was introduced in CMake version 2.8.11. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.11
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0021.rst b/Help/policy/CMP0021.rst
index 937b106..2c49c33 100644
--- a/Help/policy/CMP0021.rst
+++ b/Help/policy/CMP0021.rst
@@ -14,8 +14,8 @@ in the ``INCLUDE_DIRECTORIES`` target property. The ``NEW`` behavior for this
policy is to issue a ``FATAL_ERROR`` if ``INCLUDE_DIRECTORIES`` contains a
relative path.
-This policy was introduced in CMake version 2.8.12. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.12
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0022.rst b/Help/policy/CMP0022.rst
index be60e37..c82a768 100644
--- a/Help/policy/CMP0022.rst
+++ b/Help/policy/CMP0022.rst
@@ -32,8 +32,8 @@ The ``NEW`` behavior for this policy is to use the ``INTERFACE_LINK_LIBRARIES``
property for in-build targets, and ignore the old properties matching
``(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?``.
-This policy was introduced in CMake version 2.8.12. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.12
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0023.rst b/Help/policy/CMP0023.rst
index 3c72c81..c863a91 100644
--- a/Help/policy/CMP0023.rst
+++ b/Help/policy/CMP0023.rst
@@ -28,8 +28,8 @@ The ``OLD`` behavior for this policy is to allow keyword and plain
this policy is to not to allow mixing of the keyword and plain
signatures.
-This policy was introduced in CMake version 2.8.12. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.12
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0024.rst b/Help/policy/CMP0024.rst
index 6e24b04..c9fd472 100644
--- a/Help/policy/CMP0024.rst
+++ b/Help/policy/CMP0024.rst
@@ -17,9 +17,8 @@ The ``OLD`` behavior for this policy is to allow including the result of
an :command:`export` command. The ``NEW`` behavior for this policy is not to
allow including the result of an :command:`export` command.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0025.rst b/Help/policy/CMP0025.rst
index ba5e1e9..cfbed2a 100644
--- a/Help/policy/CMP0025.rst
+++ b/Help/policy/CMP0025.rst
@@ -18,10 +18,10 @@ to the invocation of either command.
The ``OLD`` behavior for this policy is to use compiler id ``Clang``. The
``NEW`` behavior for this policy is to use compiler id ``AppleClang``.
-This policy was introduced in CMake version 3.0. Use the
-:command:`cmake_policy` command to set this policy to ``OLD`` or ``NEW``
-explicitly. Unlike most policies, CMake version |release| does *not* warn
-by default when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0025 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0026.rst b/Help/policy/CMP0026.rst
index e08fd54..b2a5f25 100644
--- a/Help/policy/CMP0026.rst
+++ b/Help/policy/CMP0026.rst
@@ -22,8 +22,8 @@ The ``OLD`` behavior for this policy is to allow reading the :prop_tgt:`LOCATION
properties from build-targets. The ``NEW`` behavior for this policy is to
not to allow reading the :prop_tgt:`LOCATION` properties from build-targets.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0027.rst b/Help/policy/CMP0027.rst
index bf7b6a9..78c01f7 100644
--- a/Help/policy/CMP0027.rst
+++ b/Help/policy/CMP0027.rst
@@ -20,8 +20,8 @@ The ``NEW`` behavior of this policy is to report an error if an entry in
the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` of a generator-expression
conditionally linked ``IMPORTED`` target does not exist.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0028.rst b/Help/policy/CMP0028.rst
index dcd39d8..18b17ee 100644
--- a/Help/policy/CMP0028.rst
+++ b/Help/policy/CMP0028.rst
@@ -20,8 +20,8 @@ disk, even if the search term contains double-colons. The ``NEW`` behavior
for this policy is to issue a ``FATAL_ERROR`` if a link dependency contains
double-colons but is not an ``IMPORTED`` target or an ``ALIAS`` target.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0037.rst b/Help/policy/CMP0037.rst
index 9895fb0..f912a22 100644
--- a/Help/policy/CMP0037.rst
+++ b/Help/policy/CMP0037.rst
@@ -27,8 +27,8 @@ reserved names or which do not match the validity pattern.
The ``NEW`` behavior for this policy is to report an error
if an add_* command is used with an invalid target name.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0038.rst b/Help/policy/CMP0038.rst
index 7fb2209..b0de8ca 100644
--- a/Help/policy/CMP0038.rst
+++ b/Help/policy/CMP0038.rst
@@ -11,8 +11,8 @@ The ``OLD`` behavior for this policy is to ignore targets which list themselves
in their own link implementation. The ``NEW`` behavior for this policy is to
report an error if a target attempts to link to itself.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0039.rst b/Help/policy/CMP0039.rst
index 4b14e21..558c5c5 100644
--- a/Help/policy/CMP0039.rst
+++ b/Help/policy/CMP0039.rst
@@ -12,8 +12,8 @@ libraries of utility targets. The ``NEW`` behavior for this policy is to
report an error if an attempt is made to set the link libraries of a
utility target.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0040.rst b/Help/policy/CMP0040.rst
index 0afe589..b6777ef 100644
--- a/Help/policy/CMP0040.rst
+++ b/Help/policy/CMP0040.rst
@@ -13,9 +13,8 @@ for unknown targets. The ``NEW`` behavior for this policy is to report
an error if the target referenced in :command:`add_custom_command` is
unknown or was defined outside the current directory.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or
-``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0041.rst b/Help/policy/CMP0041.rst
index 3b4df36..bf9e8a5 100644
--- a/Help/policy/CMP0041.rst
+++ b/Help/policy/CMP0041.rst
@@ -20,8 +20,8 @@ contain a generator expression. The ``NEW`` behavior for this policy is to repor
an error if a generator expression appears in another location and the path is
relative.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0042.rst b/Help/policy/CMP0042.rst
index 0877564..8fb8cb2 100644
--- a/Help/policy/CMP0042.rst
+++ b/Help/policy/CMP0042.rst
@@ -14,8 +14,8 @@ wanting ``@rpath`` in a target's install name may remove any setting of
the :prop_tgt:`INSTALL_NAME_DIR` and :variable:`CMAKE_INSTALL_NAME_DIR`
variables.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0043.rst b/Help/policy/CMP0043.rst
index 05210ac..decd228 100644
--- a/Help/policy/CMP0043.rst
+++ b/Help/policy/CMP0043.rst
@@ -40,8 +40,8 @@ The ``OLD`` behavior for this policy is to consume the content of the suffixed
compilation command. The ``NEW`` behavior for this policy is to ignore the content
of the :prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` target property .
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0044.rst b/Help/policy/CMP0044.rst
index 6a4d040..36c2839 100644
--- a/Help/policy/CMP0044.rst
+++ b/Help/policy/CMP0044.rst
@@ -14,8 +14,8 @@ with the value in the ``<LANG>_COMPILER_ID`` expression. The ``NEW`` behavior
for this policy is to perform a case-sensitive comparison with the value in
the ``<LANG>_COMPILER_ID`` expression.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0045.rst b/Help/policy/CMP0045.rst
index 80e217b..257abfa 100644
--- a/Help/policy/CMP0045.rst
+++ b/Help/policy/CMP0045.rst
@@ -12,8 +12,8 @@ variable to a ``-NOTFOUND`` value. The ``NEW`` behavior
for this policy is to issue a ``FATAL_ERROR`` if the command is called with a
non-existent target.
-This policy was introduced in CMake version 3.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0046.rst b/Help/policy/CMP0046.rst
index bf78584..6e9bc72 100644
--- a/Help/policy/CMP0046.rst
+++ b/Help/policy/CMP0046.rst
@@ -11,9 +11,8 @@ dependencies. The ``NEW`` behavior for this policy is to report an error
if non-existent dependencies are listed in the :command:`add_dependencies`
command.
-This policy was introduced in CMake version 3.0.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set it
-to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0047.rst b/Help/policy/CMP0047.rst
index 9588edd..e82d72c 100644
--- a/Help/policy/CMP0047.rst
+++ b/Help/policy/CMP0047.rst
@@ -19,10 +19,10 @@ The ``OLD`` behavior for this policy is to use the ``GNU`` compiler id
for the qcc and QCC compiler drivers. The ``NEW`` behavior for this policy
is to use the ``QCC`` compiler id for those drivers.
-This policy was introduced in CMake version 3.0. Use the
-:command:`cmake_policy` command to set this policy to ``OLD`` or ``NEW``
-explicitly. Unlike most policies, CMake version |release| does *not* warn
-by default when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0047 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0048.rst b/Help/policy/CMP0048.rst
index e63ec01..6192136 100644
--- a/Help/policy/CMP0048.rst
+++ b/Help/policy/CMP0048.rst
@@ -16,9 +16,8 @@ The ``OLD`` behavior for this policy is to leave ``VERSION`` variables untouched
The ``NEW`` behavior for this policy is to set ``VERSION`` as documented by the
:command:`project` command.
-This policy was introduced in CMake version 3.0.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set
-it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0049.rst b/Help/policy/CMP0049.rst
index 49b20be..d12ef88 100644
--- a/Help/policy/CMP0049.rst
+++ b/Help/policy/CMP0049.rst
@@ -17,9 +17,8 @@ The ``OLD`` behavior for this policy is to expand such variables when processing
the target sources. The ``NEW`` behavior for this policy is to issue an error
if such variables need to be expanded.
-This policy was introduced in CMake version 3.0.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set
-it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0050.rst b/Help/policy/CMP0050.rst
index 27e7b1d..1b93773 100644
--- a/Help/policy/CMP0050.rst
+++ b/Help/policy/CMP0050.rst
@@ -12,9 +12,8 @@ The ``OLD`` behavior for this policy is to allow the use of
:command:`add_custom_command` SOURCE signatures. The ``NEW`` behavior for this
policy is to issue an error if such a signature is used.
-This policy was introduced in CMake version 3.0.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set it to ``OLD`` or
-``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0051.rst b/Help/policy/CMP0051.rst
index 3558909..e049bba 100644
--- a/Help/policy/CMP0051.rst
+++ b/Help/policy/CMP0051.rst
@@ -20,9 +20,8 @@ expressions from the :prop_tgt:`SOURCES` target property. The ``NEW``
behavior for this policy is to include ``TARGET_OBJECTS`` expressions
in the output.
-This policy was introduced in CMake version 3.1.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set it
-to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0052.rst b/Help/policy/CMP0052.rst
index c75f9ab..c710262 100644
--- a/Help/policy/CMP0052.rst
+++ b/Help/policy/CMP0052.rst
@@ -21,9 +21,8 @@ The ``OLD`` behavior for this policy is to export the content of the
directory. The ``NEW`` behavior for this
policy is to issue an error if such a directory is used.
-This policy was introduced in CMake version 3.1.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set it
-to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0053.rst b/Help/policy/CMP0053.rst
index 58500d6..5a6f5cf 100644
--- a/Help/policy/CMP0053.rst
+++ b/Help/policy/CMP0053.rst
@@ -44,9 +44,8 @@ The ``OLD`` behavior for this policy is to honor the legacy behavior for
variable references and escape sequences. The ``NEW`` behavior is to
use the simpler variable expansion and escape sequence evaluation rules.
-This policy was introduced in CMake version 3.1.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set
-it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0054.rst b/Help/policy/CMP0054.rst
index c7ae019..d22e8d9 100644
--- a/Help/policy/CMP0054.rst
+++ b/Help/policy/CMP0054.rst
@@ -46,9 +46,8 @@ further dereferenced:
if("E" STREQUAL "")
-This policy was introduced in CMake version 3.1.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set
-it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0055.rst b/Help/policy/CMP0055.rst
index 47cac8e..dc83863 100644
--- a/Help/policy/CMP0055.rst
+++ b/Help/policy/CMP0055.rst
@@ -13,9 +13,8 @@ The ``OLD`` behavior for this policy is to allow :command:`break` to be placed
outside of loop contexts and ignores any arguments. The ``NEW`` behavior for this
policy is to issue an error if a misplaced break or any arguments are found.
-This policy was introduced in CMake version 3.2.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set it to ``OLD`` or
-``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.2
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0056.rst b/Help/policy/CMP0056.rst
index 628a6a1..ca238e2 100644
--- a/Help/policy/CMP0056.rst
+++ b/Help/policy/CMP0056.rst
@@ -27,9 +27,11 @@ set it on the command line by defining the
:variable:`CMAKE_POLICY_DEFAULT_CMP0056 <CMAKE_POLICY_DEFAULT_CMP<NNNN>>`
variable in the cache.
-This policy was introduced in CMake version 3.2. Unlike most policies,
-CMake version |release| does *not* warn by default when this policy
-is not set and simply uses ``OLD`` behavior. See documentation of the
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.2
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
+See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0056 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0057.rst b/Help/policy/CMP0057.rst
index 76aebfb..07bc969 100644
--- a/Help/policy/CMP0057.rst
+++ b/Help/policy/CMP0057.rst
@@ -10,9 +10,8 @@ CMake 3.3 adds support for the new IN_LIST operator.
The ``OLD`` behavior for this policy is to ignore the IN_LIST operator.
The ``NEW`` behavior is to interpret the IN_LIST operator.
-This policy was introduced in CMake version 3.3.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set
-it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0058.rst b/Help/policy/CMP0058.rst
index faab1cb..2b729e0 100644
--- a/Help/policy/CMP0058.rst
+++ b/Help/policy/CMP0058.rst
@@ -104,12 +104,12 @@ rules for unknown dependencies in the build tree. The ``NEW``
behavior for this policy is to not generate these and instead
require projects to specify custom command ``BYPRODUCTS`` explicitly.
-This policy was introduced in CMake version 3.3.
-CMake version |release| warns when it sees unknown dependencies in
-out-of-source build trees if the policy is not set and then uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set
-the policy to ``OLD`` or ``NEW`` explicitly. The policy setting
-must be in scope at the end of the top-level ``CMakeLists.txt``
-file of the project and has global effect.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
+.. |WARNS_OR_DOES_NOT_WARN| replace::
+ warns when it sees unknown dependencies in out-of-source build trees
+.. include:: STANDARD_ADVICE.txt
+
+The policy setting must be in scope at the end of the top-level
+``CMakeLists.txt`` file of the project and has global effect.
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst
index 6317d05..4ac286d 100644
--- a/Help/policy/CMP0059.rst
+++ b/Help/policy/CMP0059.rst
@@ -13,9 +13,8 @@ The ``OLD`` behavior for this policy is to provide the list of flags given
so far to the :command:`add_definitions` command. The ``NEW`` behavior is
to behave as a normal user-defined directory property.
-This policy was introduced in CMake version 3.3.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set
-it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0060.rst b/Help/policy/CMP0060.rst
index 09257d1..8fff803 100644
--- a/Help/policy/CMP0060.rst
+++ b/Help/policy/CMP0060.rst
@@ -58,9 +58,11 @@ libraries whose full paths are known to be in implicit link directories.
The ``NEW`` behavior for this policy is to link libraries by full path even
if they are in implicit link directories.
-This policy was introduced in CMake version 3.3. Unlike most policies,
-CMake version |release| does *not* warn by default when this policy
-is not set and simply uses ``OLD`` behavior. See documentation of the
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
+See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0060 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0061.rst b/Help/policy/CMP0061.rst
index aca551d..22ec0d0 100644
--- a/Help/policy/CMP0061.rst
+++ b/Help/policy/CMP0061.rst
@@ -21,8 +21,8 @@ The ``OLD`` behavior for this policy is to add ``-i`` to ``make``
calls in CTest. The ``NEW`` behavior for this policy is to not
add ``-i``.
-This policy was introduced in CMake version 3.3. Unlike most policies,
-CMake version |release| does *not* warn when this policy is not set and
-simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0062.rst b/Help/policy/CMP0062.rst
index 01e93f0..e0cf71b 100644
--- a/Help/policy/CMP0062.rst
+++ b/Help/policy/CMP0062.rst
@@ -23,9 +23,8 @@ The ``OLD`` behavior for this policy is to allow installing the result of
an :command:`export()` command. The ``NEW`` behavior for this policy is
not to allow installing the result of an :command:`export()` command.
-This policy was introduced in CMake version 3.3. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy()` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0063.rst b/Help/policy/CMP0063.rst
index fec3ad8..1e1cbfa 100644
--- a/Help/policy/CMP0063.rst
+++ b/Help/policy/CMP0063.rst
@@ -22,9 +22,8 @@ for static libraries, object libraries, and executables without exports.
The ``NEW`` behavior for this policy is to honor the visibility properties
for all target types.
-This policy was introduced in CMake version 3.3. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy()` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0064.rst b/Help/policy/CMP0064.rst
index 0c20c13..4fd873f 100644
--- a/Help/policy/CMP0064.rst
+++ b/Help/policy/CMP0064.rst
@@ -11,9 +11,8 @@ given test name was created by the :command:`add_test` command.
The ``OLD`` behavior for this policy is to ignore the ``TEST`` operator.
The ``NEW`` behavior is to interpret the ``TEST`` operator.
-This policy was introduced in CMake version 3.4. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy()` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.4
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0065.rst b/Help/policy/CMP0065.rst
index 8968b91..54034b1 100644
--- a/Help/policy/CMP0065.rst
+++ b/Help/policy/CMP0065.rst
@@ -20,9 +20,11 @@ The ``NEW`` behavior of this policy is to only use the additional link
flags when linking executables if the :prop_tgt:`ENABLE_EXPORTS` target
property is set to ``True``.
-This policy was introduced in CMake version 3.4. Unlike most policies,
-CMake version |release| does *not* warn by default when this policy
-is not set and simply uses ``OLD`` behavior. See documentation of the
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.4
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
+See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0065 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0066.rst b/Help/policy/CMP0066.rst
index b08430f..947a186 100644
--- a/Help/policy/CMP0066.rst
+++ b/Help/policy/CMP0066.rst
@@ -18,11 +18,13 @@ variables like :variable:`CMAKE_<LANG>_FLAGS_DEBUG` and only use CMake's
built-in defaults for the current compiler and platform.
The ``NEW`` behavior of this policy is to honor config-specific flag
-variabldes like :variable:`CMAKE_<LANG>_FLAGS_DEBUG`.
+variables like :variable:`CMAKE_<LANG>_FLAGS_DEBUG`.
-This policy was introduced in CMake version 3.7. Unlike most policies,
-CMake version |release| does *not* warn by default when this policy
-is not set and simply uses ``OLD`` behavior. See documentation of the
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.7
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
+See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0066 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0067.rst b/Help/policy/CMP0067.rst
index 8358bb2..0696131 100644
--- a/Help/policy/CMP0067.rst
+++ b/Help/policy/CMP0067.rst
@@ -30,9 +30,11 @@ setting variables when generating the ``try_compile`` test project.
The ``NEW`` behavior of this policy is to honor language standard
setting variables.
-This policy was introduced in CMake version 3.8. Unlike most policies,
-CMake version |release| does *not* warn by default when this policy
-is not set and simply uses ``OLD`` behavior. See documentation of the
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.8
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
+See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0067 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0068.rst b/Help/policy/CMP0068.rst
index 5d2a4b1..aad8c3a 100644
--- a/Help/policy/CMP0068.rst
+++ b/Help/policy/CMP0068.rst
@@ -29,9 +29,8 @@ The ``OLD`` behavior of this policy is to use the ``RPATH`` settings for
``install_name`` on macOS. The ``NEW`` behavior of this policy is to ignore
the ``RPATH`` settings for ``install_name`` on macOS.
-This policy was introduced in CMake version 3.9. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.9
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0069.rst b/Help/policy/CMP0069.rst
index eafac45..97665e6 100644
--- a/Help/policy/CMP0069.rst
+++ b/Help/policy/CMP0069.rst
@@ -26,10 +26,9 @@ behavior for this policy is to add IPO flags only for Intel compiler on Linux.
The ``NEW`` behavior for this policy is to add IPO flags for the current
compiler or produce an error if CMake does not know the flags.
-This policy was introduced in CMake version 3.9. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.9
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0070.rst b/Help/policy/CMP0070.rst
index c880d1f..33b5a97 100644
--- a/Help/policy/CMP0070.rst
+++ b/Help/policy/CMP0070.rst
@@ -19,9 +19,8 @@ working directory of CMake. The ``NEW`` behavior for this policy is to
interpret relative paths with respect to the current source or binary
directory of the caller.
-This policy was introduced in CMake version 3.10. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.10
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0071.rst b/Help/policy/CMP0071.rst
index 700d3b0..7e118ee 100644
--- a/Help/policy/CMP0071.rst
+++ b/Help/policy/CMP0071.rst
@@ -36,9 +36,8 @@ Source skip example::
set_property(SOURCE /path/to/file3.h PROPERTY SKIP_AUTOGEN ON)
# ...
-This policy was introduced in CMake version 3.10. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.10
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0072.rst b/Help/policy/CMP0072.rst
index 1dcdfef..430cb5a 100644
--- a/Help/policy/CMP0072.rst
+++ b/Help/policy/CMP0072.rst
@@ -20,9 +20,8 @@ The ``OLD`` behavior for this policy is to set ``OpenGL_GL_PREFERENCE`` to
``LEGACY``. The ``NEW`` behavior for this policy is to set
``OpenGL_GL_PREFERENCE`` to ``GLVND``.
-This policy was introduced in CMake version 3.11. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.11
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0073.rst b/Help/policy/CMP0073.rst
index 8f0345c..897092e 100644
--- a/Help/policy/CMP0073.rst
+++ b/Help/policy/CMP0073.rst
@@ -19,9 +19,8 @@ not been updated to avoid using them.
The ``OLD`` behavior for this policy is to set ``<tgt>_LIB_DEPENDS`` cache
entries. The ``NEW`` behavior for this policy is to not set them.
-This policy was introduced in CMake version 3.12. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike most policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.12
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0074.rst b/Help/policy/CMP0074.rst
index 863bbb2..fff843f 100644
--- a/Help/policy/CMP0074.rst
+++ b/Help/policy/CMP0074.rst
@@ -17,9 +17,8 @@ The ``OLD`` behavior for this policy is to ignore ``<PackageName>_ROOT``
variables. The ``NEW`` behavior for this policy is to use
``<PackageName>_ROOT`` variables.
-This policy was introduced in CMake version 3.12. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.12
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0075.rst b/Help/policy/CMP0075.rst
index 4213782..479c629 100644
--- a/Help/policy/CMP0075.rst
+++ b/Help/policy/CMP0075.rst
@@ -20,9 +20,8 @@ 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.
-This policy was introduced in CMake version 3.12. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.12
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0076.rst b/Help/policy/CMP0076.rst
index edca742..a30b4c9 100644
--- a/Help/policy/CMP0076.rst
+++ b/Help/policy/CMP0076.rst
@@ -20,9 +20,8 @@ to expect this behavior. The ``OLD`` behavior for this policy is to leave
all relative source file paths unmodified. The ``NEW`` behavior of this
policy is to convert relative paths to absolute according to above rules.
-This policy was introduced in CMake version 3.13. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0077.rst b/Help/policy/CMP0077.rst
index 482125a..f64f92f 100644
--- a/Help/policy/CMP0077.rst
+++ b/Help/policy/CMP0077.rst
@@ -50,10 +50,11 @@ See :policy:`CMP0126` for a similar policy for the :command:`set(CACHE)`
command, but note that there are some differences in ``NEW`` behavior
between the two policies.
-This policy was introduced in CMake version 3.13. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly within a project. Use the :variable:`CMAKE_POLICY_DEFAULT_CMP0077
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
+
+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.
diff --git a/Help/policy/CMP0078.rst b/Help/policy/CMP0078.rst
index 89fdb0b..c4b8a64 100644
--- a/Help/policy/CMP0078.rst
+++ b/Help/policy/CMP0078.rst
@@ -18,9 +18,8 @@ explicit preference. The value may be one of:
This is the default if not specified.
* ``STANDARD``: target name matches specified name.
-This policy was introduced in CMake version 3.13. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0079.rst b/Help/policy/CMP0079.rst
index 01aa08d..039ac7b 100644
--- a/Help/policy/CMP0079.rst
+++ b/Help/policy/CMP0079.rst
@@ -34,9 +34,8 @@ except in the previously accidentally allowed case of using the ``INTERFACE``
keyword only. The ``NEW`` behavior of this policy is to allow all such
calls but use the new scoping rules.
-This policy was introduced in CMake version 3.13. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0080.rst b/Help/policy/CMP0080.rst
index 789efea..cface96 100644
--- a/Help/policy/CMP0080.rst
+++ b/Help/policy/CMP0080.rst
@@ -19,9 +19,8 @@ The ``OLD`` behavior of this policy is to allow :module:`BundleUtilities` to
be included at configure time. The ``NEW`` behavior of this policy is to
disallow such inclusion.
-This policy was introduced in CMake version 3.13. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0081.rst b/Help/policy/CMP0081.rst
index d1573dd..b89a353 100644
--- a/Help/policy/CMP0081.rst
+++ b/Help/policy/CMP0081.rst
@@ -17,8 +17,8 @@ in the :prop_tgt:`LINK_DIRECTORIES` target property. The ``NEW`` behavior for
this policy is to issue a ``FATAL_ERROR`` if :prop_tgt:`LINK_DIRECTORIES`
contains a relative path.
-This policy was introduced in CMake version 3.13. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior. Use
-the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0082.rst b/Help/policy/CMP0082.rst
index 25c9580..2de0cd9 100644
--- a/Help/policy/CMP0082.rst
+++ b/Help/policy/CMP0082.rst
@@ -19,9 +19,11 @@ The ``OLD`` behavior for this policy is to run the install rules from
behavior for this policy is to run all install rules in the order they are
declared.
-This policy was introduced in CMake version 3.14. Unlike most policies,
-CMake version |release| does *not* warn by default when this policy
-is not set and simply uses ``OLD`` behavior. See documentation of the
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
+See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0082 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst
index 7518ee3..2ba9e14 100644
--- a/Help/policy/CMP0083.rst
+++ b/Help/policy/CMP0083.rst
@@ -25,10 +25,9 @@ which it is used, it is the project's responsibility to use the
:prop_tgt:`POSITION_INDEPENDENT_CODE` target property for executables will be
honored at link time.
-This policy was introduced in CMake version 3.14. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike most policies, CMake version |release| does not warn when this policy is
-not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. Note::
diff --git a/Help/policy/CMP0084.rst b/Help/policy/CMP0084.rst
index 9547701..3b86a73 100644
--- a/Help/policy/CMP0084.rst
+++ b/Help/policy/CMP0084.rst
@@ -20,9 +20,8 @@ The ``OLD`` behavior of this policy is for :module:`FindQt` to exist for
:command:`find_package`. The ``NEW`` behavior is to pretend that it doesn't
exist for :command:`find_package`.
-This policy was introduced in CMake version 3.14. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0085.rst b/Help/policy/CMP0085.rst
index d90c72f..783c644 100644
--- a/Help/policy/CMP0085.rst
+++ b/Help/policy/CMP0085.rst
@@ -15,9 +15,8 @@ The ``OLD`` behavior of this policy is for ``$<IN_LIST:...>`` to always return
``0`` if the first argument is empty. The ``NEW`` behavior is to return ``1``
if the first argument is empty and the list contains an empty item.
-This policy was introduced in CMake version 3.14. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0086.rst b/Help/policy/CMP0086.rst
index 725b502..c1abffe 100644
--- a/Help/policy/CMP0086.rst
+++ b/Help/policy/CMP0086.rst
@@ -14,9 +14,8 @@ The ``OLD`` behavior for this policy is to never pass ``-module`` option.
The ``NEW`` behavior is to pass ``-module`` option to ``SWIG`` compiler if
``SWIG_MODULE_NAME`` is specified.
-This policy was introduced in CMake version 3.14. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0087.rst b/Help/policy/CMP0087.rst
index 4a65506..3ef2c60 100644
--- a/Help/policy/CMP0087.rst
+++ b/Help/policy/CMP0087.rst
@@ -23,9 +23,8 @@ for calling these commands from places that have their own policy scope but not
their own directory scope (e.g. from files brought in via :command:`include()`
rather than :command:`add_subdirectory()`).
-This policy was introduced in CMake version 3.14. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0088.rst b/Help/policy/CMP0088.rst
index 1840a58..e53078c 100644
--- a/Help/policy/CMP0088.rst
+++ b/Help/policy/CMP0088.rst
@@ -23,9 +23,8 @@ to generate implicit files. The ``NEW`` behavior of this policy is to
use the current binary directory for the ``WORKING_DIRECTORY`` and where
to generate implicit files.
-This policy was introduced in CMake version 3.14. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike most policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0089.rst b/Help/policy/CMP0089.rst
index e3fc77a..5f548c0 100644
--- a/Help/policy/CMP0089.rst
+++ b/Help/policy/CMP0089.rst
@@ -21,10 +21,10 @@ to the invocation of either command.
The ``OLD`` behavior for this policy is to use compiler id ``XL``. The
``NEW`` behavior for this policy is to use compiler id ``XLClang``.
-This policy was introduced in CMake version 3.15. Use the
-:command:`cmake_policy` command to set this policy to ``OLD`` or ``NEW`` explicitly.
-Unlike most policies, CMake version |release| does *not* warn
-by default when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0089 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0090.rst b/Help/policy/CMP0090.rst
index 58dd999..df7726c 100644
--- a/Help/policy/CMP0090.rst
+++ b/Help/policy/CMP0090.rst
@@ -21,9 +21,8 @@ to populate the user package registry unless
The ``NEW`` behavior is for :command:`export(PACKAGE)` command to do nothing
unless the :variable:`CMAKE_EXPORT_PACKAGE_REGISTRY` is enabled.
-This policy was introduced in CMake version 3.15. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike most policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0091.rst b/Help/policy/CMP0091.rst
index ffc0ade..110e655 100644
--- a/Help/policy/CMP0091.rst
+++ b/Help/policy/CMP0091.rst
@@ -43,9 +43,8 @@ entries and ignore the :variable:`CMAKE_MSVC_RUNTIME_LIBRARY` abstraction.
The ``NEW`` behavior for this policy is to *not* place MSVC runtime
library flags in the default cache entries and use the abstraction instead.
-This policy was introduced in CMake version 3.15. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0092.rst b/Help/policy/CMP0092.rst
index 2f39830..03a9975 100644
--- a/Help/policy/CMP0092.rst
+++ b/Help/policy/CMP0092.rst
@@ -32,9 +32,8 @@ default :variable:`CMAKE_<LANG>_FLAGS` cache entries. The ``NEW`` behavior
for this policy is to *not* place MSVC warning flags in the default cache
entries.
-This policy was introduced in CMake version 3.15. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0093.rst b/Help/policy/CMP0093.rst
index 4a9955f..5f7ae7d 100644
--- a/Help/policy/CMP0093.rst
+++ b/Help/policy/CMP0093.rst
@@ -18,9 +18,8 @@ The ``OLD`` behavior for this policy is for :module:`FindBoost` to report
policy is for :module:`FindBoost` to report ``Boost_VERSION`` in
``x.y.z`` format.
-This policy was introduced in CMake version 3.15. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses the ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0094.rst b/Help/policy/CMP0094.rst
index 1b57658..1b88a22 100644
--- a/Help/policy/CMP0094.rst
+++ b/Help/policy/CMP0094.rst
@@ -16,9 +16,8 @@ The ``OLD`` behavior for this policy set value ``VERSION`` for variables
``Python3_FIND_STRATEGY``, ``Python2_FIND_STRATEGY`` and
``Python_FIND_STRATEGY``.
-This policy was introduced in CMake version 3.15. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses the ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0095.rst b/Help/policy/CMP0095.rst
index ebdbab6..cbeffc7 100644
--- a/Help/policy/CMP0095.rst
+++ b/Help/policy/CMP0095.rst
@@ -24,9 +24,9 @@ intermediary ``cmake_install.cmake`` script. The ``NEW`` behavior is to properly
escape coincidental CMake syntax in ``RPATH`` entries when generating the
intermediary ``cmake_install.cmake`` script.
-This policy was introduced in CMake version 3.16. CMake version |release| warns
-when the policy is not set and detected usage of CMake-like syntax and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set it to ``OLD``
-or ``NEW`` explicitly.
+.. |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:: DEPRECATED.txt
diff --git a/Help/policy/CMP0096.rst b/Help/policy/CMP0096.rst
index 8fd6f72..8ea3784 100644
--- a/Help/policy/CMP0096.rst
+++ b/Help/policy/CMP0096.rst
@@ -19,9 +19,8 @@ e.g. such that version ``1.07.06`` becomes ``1.7.6``. The ``NEW`` behavior
of this policy preserves the leading zeros in all components, such that
version ``1.07.06`` remains unchanged.
-This policy was introduced in CMake version 3.16. Unlike many policies, CMake
-version |release| does *not* warn when this policy is not set and simply uses
-the ``OLD`` behavior. Use the :command:`cmake_policy` command to set it to
-``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.16
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0097.rst b/Help/policy/CMP0097.rst
index 24957d0..66a7b96 100644
--- a/Help/policy/CMP0097.rst
+++ b/Help/policy/CMP0097.rst
@@ -21,7 +21,8 @@ an empty string to initialize and update all git submodules.
The ``NEW`` behavior for this policy is for ``GIT_SUBMODULES`` when set to
an empty string to initialize and update no git submodules.
-This policy was introduced in CMake version 3.16. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike most policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.16
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0098.rst b/Help/policy/CMP0098.rst
index e793380..42c900b 100644
--- a/Help/policy/CMP0098.rst
+++ b/Help/policy/CMP0098.rst
@@ -24,9 +24,8 @@ to generate implicit files. The ``NEW`` behavior of this policy is to
use the current binary directory for the ``WORKING_DIRECTORY`` relative to
which implicit files are generated unless provided as absolute path.
-This policy was introduced in CMake version 3.17. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0099.rst b/Help/policy/CMP0099.rst
index 0c64949..0a2b786 100644
--- a/Help/policy/CMP0099.rst
+++ b/Help/policy/CMP0099.rst
@@ -3,13 +3,16 @@ CMP0099
.. versionadded:: 3.17
-Target link properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
-:prop_tgt:`INTERFACE_LINK_DIRECTORIES` and :prop_tgt:`INTERFACE_LINK_DEPENDS`
-are now transitive over private dependencies of static libraries.
+Link properties are transitive over private dependencies of static libraries.
-In CMake 3.16 and below the interface link properties attached to libraries
-are not propagated for private dependencies of static libraries.
+In CMake 3.16 and below, evaluation of target properties
+:prop_tgt:`INTERFACE_LINK_OPTIONS`, :prop_tgt:`INTERFACE_LINK_DIRECTORIES`,
+and :prop_tgt:`INTERFACE_LINK_DEPENDS` during buildsystem generation does not
+follow private dependencies of static libraries, which appear in their
+:prop_tgt:`INTERFACE_LINK_LIBRARIES` guarded by :genex:`LINK_ONLY` generator
+expressions.
Only the libraries themselves are propagated to link the dependent binary.
+
CMake 3.17 and later prefer to propagate all interface link properties.
This policy provides compatibility for projects that have not been updated
to expect the new behavior.
@@ -18,9 +21,14 @@ The ``OLD`` behavior for this policy is to not propagate interface link
properties. The ``NEW`` behavior of this policy is to propagate interface link
properties.
-This policy was introduced in CMake version 3.17. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. versionadded:: 3.30
+
+ Policy :policy:`CMP0166` makes :genex:`TARGET_PROPERTY` evaluation of
+ these three transitive link properties follow private dependencies of
+ static libraries too.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0100.rst b/Help/policy/CMP0100.rst
index 730fa82..c3b782b 100644
--- a/Help/policy/CMP0100.rst
+++ b/Help/policy/CMP0100.rst
@@ -34,9 +34,8 @@ in :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` just like other header files.
set_property(SOURCE /path/to/file2.hh PROPERTY SKIP_AUTOUIC ON)
set_property(SOURCE /path/to/file3.hh PROPERTY SKIP_AUTOGEN ON)
-This policy was introduced in CMake version 3.17.0. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17.0
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0101.rst b/Help/policy/CMP0101.rst
index 6781079..ceefcda 100644
--- a/Help/policy/CMP0101.rst
+++ b/Help/policy/CMP0101.rst
@@ -22,9 +22,8 @@ when inserting into the :prop_tgt:`COMPILE_OPTIONS` property.
The ``NEW`` behavior for this policy is to honor the ``BEFORE`` keyword in
all cases.
-This policy was introduced in CMake version 3.17. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0102.rst b/Help/policy/CMP0102.rst
index 08024bf..8590979 100644
--- a/Help/policy/CMP0102.rst
+++ b/Help/policy/CMP0102.rst
@@ -19,11 +19,11 @@ The ``OLD`` behavior for this policy is to create the empty cache definition.
The ``NEW`` behavior of this policy is to ignore variables which do not
already exist in the cache.
-This policy was introduced in CMake version 3.17. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior. See
-documentation of the :variable:`CMAKE_POLICY_WARNING_CMP0102
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
+See documentation of the :variable:`CMAKE_POLICY_WARNING_CMP0102
<CMAKE_POLICY_WARNING_CMP<NNNN>>` variable to control the warning.
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0103.rst b/Help/policy/CMP0103.rst
index b5f44d1..50bceba 100644
--- a/Help/policy/CMP0103.rst
+++ b/Help/policy/CMP0103.rst
@@ -16,9 +16,8 @@ The ``OLD`` behavior for this policy is to ignore the multiple occurrences of
The ``NEW`` behavior of this policy is to raise an error on second call to
:command:`export` command with same ``FILE`` without ``APPEND``.
-This policy was introduced in CMake version 3.18. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.18
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0104.rst b/Help/policy/CMP0104.rst
index b125729..9e8d222 100644
--- a/Help/policy/CMP0104.rst
+++ b/Help/policy/CMP0104.rst
@@ -29,10 +29,9 @@ If :prop_tgt:`CUDA_ARCHITECTURES` is set to a false value no architectures
flags are passed to the compiler. This is intended to support packagers and
the rare cases where full control over the passed flags is required.
-This policy was introduced in CMake version 3.18. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.18
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0105.rst b/Help/policy/CMP0105.rst
index aadc8d6..8726997 100644
--- a/Help/policy/CMP0105.rst
+++ b/Help/policy/CMP0105.rst
@@ -14,9 +14,8 @@ device link step.
The ``NEW`` behavior of this policy is to use the link options during the
device link step.
-This policy was introduced in CMake version 3.18. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.18
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0106.rst b/Help/policy/CMP0106.rst
index 18a6635..5f7e078 100644
--- a/Help/policy/CMP0106.rst
+++ b/Help/policy/CMP0106.rst
@@ -14,8 +14,8 @@ The ``OLD`` behavior of this policy is for :module:`Documentation` to add
cache variables and find VTK documentation dependent packages. The ``NEW``
behavior is to act as an empty module.
-This policy was introduced in CMake version 3.18. CMake version |release|
-warns when the policy is not set and uses ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.18
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0107.rst b/Help/policy/CMP0107.rst
index da5ae06..ece0b23 100644
--- a/Help/policy/CMP0107.rst
+++ b/Help/policy/CMP0107.rst
@@ -13,9 +13,8 @@ The ``OLD`` behavior for this policy is to allow target overwrite.
The ``NEW`` behavior of this policy is to prevent target overwriting.
-This policy was introduced in CMake version 3.17. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0108.rst b/Help/policy/CMP0108.rst
index 4d1091d..fbb72b3 100644
--- a/Help/policy/CMP0108.rst
+++ b/Help/policy/CMP0108.rst
@@ -13,9 +13,8 @@ aliased to itself.
The ``NEW`` behavior of this policy is to prevent a target to link to itself
through an ``ALIAS`` target.
-This policy was introduced in CMake version 3.17. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0109.rst b/Help/policy/CMP0109.rst
index f86287f..2073d72 100644
--- a/Help/policy/CMP0109.rst
+++ b/Help/policy/CMP0109.rst
@@ -17,8 +17,8 @@ read permission but not execute permission.
The ``NEW`` behavior for this policy is for ``find_program`` to require
execute permission but not read permission.
-This policy was introduced in CMake version 3.19. CMake version |release|
-warns when the policy is not set and uses ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0110.rst b/Help/policy/CMP0110.rst
index 6977d41..ad9e096 100644
--- a/Help/policy/CMP0110.rst
+++ b/Help/policy/CMP0110.rst
@@ -21,6 +21,8 @@ handling whitespace and special characters properly (if not using the
mentioned workaround). The ``NEW`` behavior on the other hand allows names
with whitespace and special characters for tests created by ``add_test``.
-This policy was introduced in CMake version 3.19. CMake version |release|
-warns when the policy is not set and uses ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0111.rst b/Help/policy/CMP0111.rst
index e327583..33a925b 100644
--- a/Help/policy/CMP0111.rst
+++ b/Help/policy/CMP0111.rst
@@ -20,8 +20,8 @@ unknown, static or shared library target as ``<TARGET_NAME>-NOTFOUND`` if not
set.
The ``NEW`` behavior is to raise an error.
-This policy was introduced in CMake version 3.19. CMake version |release|
-warns when the policy is not set and uses ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0112.rst b/Help/policy/CMP0112.rst
index 25c3896..2d21d96 100644
--- a/Help/policy/CMP0112.rst
+++ b/Help/policy/CMP0112.rst
@@ -34,9 +34,11 @@ target for the above generator expressions. The ``NEW`` behavior of
this policy is to not add a dependency on the evaluated target for the
above generator expressions.
-This policy was introduced in CMake version 3.19. Unlike many policies,
-CMake version |release| does *not* warn by default when this policy
-is not set and simply uses ``OLD`` behavior. See documentation of the
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
+See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0112 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0113.rst b/Help/policy/CMP0113.rst
index 6f56902..1908727 100644
--- a/Help/policy/CMP0113.rst
+++ b/Help/policy/CMP0113.rst
@@ -36,8 +36,8 @@ The ``OLD`` behavior for this policy is to duplicate custom commands in
dependent targets. The ``NEW`` behavior of this policy is to not duplicate
custom commands in dependent targets.
-This policy was introduced in CMake version 3.19. Unlike many policies,
-CMake version |release| does *not* warn when this policy is not set and
-simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0114.rst b/Help/policy/CMP0114.rst
index ae48478..f4ca7ef 100644
--- a/Help/policy/CMP0114.rst
+++ b/Help/policy/CMP0114.rst
@@ -79,7 +79,8 @@ is to use the above-documented behavior from 3.18 and below. The ``NEW``
behavior for this policy is to use the above-documented behavior preferred
by 3.19 and above.
-This policy was introduced in CMake version 3.19. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0115.rst b/Help/policy/CMP0115.rst
index 7f82c43..b11f97d 100644
--- a/Help/policy/CMP0115.rst
+++ b/Help/policy/CMP0115.rst
@@ -27,8 +27,8 @@ The ``OLD`` behavior for this policy is to implicitly append known extensions
to source files if they can't be found. The ``NEW`` behavior of this policy is
to not append known extensions and require them to be explicit.
-This policy was introduced in CMake version 3.20. CMake version |release|
-warns when the policy is not set and uses ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0116.rst b/Help/policy/CMP0116.rst
index 18e5a96..b0fc896 100644
--- a/Help/policy/CMP0116.rst
+++ b/Help/policy/CMP0116.rst
@@ -33,9 +33,13 @@ time of the custom command's creation, and you can have custom commands in the
same directory with different values for ``CMP0116`` by setting the policy
before each custom command.
-This policy was introduced in CMake version 3.20. Unlike most policies,
-CMake version |release| does *not* warn by default when this policy is not set
-(unless ``DEPFILE`` is used in a subdirectory) and simply uses ``OLD``
-behavior. See documentation of the
+.. |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
+
+See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0116 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0117.rst b/Help/policy/CMP0117.rst
index 0c4dd30..e1a0ee9 100644
--- a/Help/policy/CMP0117.rst
+++ b/Help/policy/CMP0117.rst
@@ -35,9 +35,8 @@ default :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` cache entry. The
``NEW`` behavior for this policy is to *not* place the MSVC ``/GR`` flag in
the default cache entry.
-This policy was introduced in CMake version 3.20. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0118.rst b/Help/policy/CMP0118.rst
index aa7e0f7..5c04927 100644
--- a/Help/policy/CMP0118.rst
+++ b/Help/policy/CMP0118.rst
@@ -3,23 +3,36 @@ CMP0118
.. versionadded:: 3.20
-The :prop_sf:`GENERATED` source file property is now visible in all directories.
+:prop_sf:`GENERATED` sources may be used across directories without manual marking.
-Whether or not a source file is generated is an all-or-nothing global
-property of the source. Consequently, the associated ``GENERATED``
-property is now visible from any directory scope, not only from the scope
-for which it was set.
+In CMake 3.19 and below, the :prop_sf:`GENERATED` source file property,
+like other source file properties, was scoped in every directory separately.
+If a source file was generated in one directory, projects had to manually
+set the ``GENERATED`` property in another directory in order to use the file.
+Whether or not a source file is generated is an all-or-nothing global
+property of the source: a source is either generated or it is not.
+CMake 3.20 and above prefer to allow source files generated in one directory
+to be used in other directories without manually marking them as ``GENERATED``.
Additionally, the ``GENERATED`` property may now be set only to boolean
-values, and may not be turned off once turned on.
-
-The ``OLD`` behavior of this policy is to only allow ``GENERATED`` to be
-visible from the directory scope for which it was set. The ``NEW``
-behavior on the other hand allows it to be visible from any scope.
-
-This policy was introduced in CMake version 3.20. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior with regard
-to visibility of the ``GENERATED`` property. However, CMake does warn
-about setting the ``GENERATED`` property to a non-boolean value.
+values, and may not be turned off once turned on. This policy provides
+compatibility for projects that have not been updated for this behavior.
+
+The ``OLD`` behavior of this policy is to allow generated files to be used
+only in directories in which their ``GENERATED`` property has been turned on.
+The ``NEW`` behavior of this policy is to allow generated files to be used
+in other directories without explicitly turning on the ``GENERATED`` property
+for those directories.
+
+.. versionadded:: 3.30
+
+ Policy :policy:`CMP0163` additionally makes the :prop_sf:`GENERATED` source
+ file property visible to :command:`get_property` and
+ :command:`get_source_file_property` calls in other directories.
+
+.. |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:: DEPRECATED.txt
diff --git a/Help/policy/CMP0119.rst b/Help/policy/CMP0119.rst
index 61c8bdc..78e9894 100644
--- a/Help/policy/CMP0119.rst
+++ b/Help/policy/CMP0119.rst
@@ -28,9 +28,8 @@ property using its undocumented meaning to "use the ``<LANG>`` compiler".
The ``NEW`` behavior for this policy is to interpret the ``LANGUAGE <LANG>``
property using its documented meaning to "compile as a ``<LANG>`` source".
-This policy was introduced in CMake version 3.20. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0120.rst b/Help/policy/CMP0120.rst
index 9d2f6c9..0ffeb0e 100644
--- a/Help/policy/CMP0120.rst
+++ b/Help/policy/CMP0120.rst
@@ -38,9 +38,9 @@ The ``OLD`` behavior of this policy is for inclusion of the deprecated
:module:`WriteCompilerDetectionHeader` module to work. The ``NEW``
behavior is for inclusion of the module to fail as if it does not exist.
-This policy was introduced in CMake version 3.20. CMake version |release|
-warns when the policy is not set and uses ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0121.rst b/Help/policy/CMP0121.rst
index 326e7d5..6e08cb5 100644
--- a/Help/policy/CMP0121.rst
+++ b/Help/policy/CMP0121.rst
@@ -14,8 +14,8 @@ their integer value (if any) at the start of the string. For example,
``2good4you`` is a ``2`` and ``not_an_integer`` is a ``0``. The ``NEW``
behavior is for invalid indices to trigger an error.
-This policy was introduced in CMake version 3.21. CMake version |release|
-warns when the policy is not set and uses ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0122.rst b/Help/policy/CMP0122.rst
index 1ff8c48..0b2da6c 100644
--- a/Help/policy/CMP0122.rst
+++ b/Help/policy/CMP0122.rst
@@ -9,9 +9,8 @@ Starting with CMake 3.21, :module:`UseSWIG` generates now a library using
default naming conventions. This policy provides compatibility with projects
that expect the legacy behavior.
-This policy was introduced in CMake version 3.21. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0123.rst b/Help/policy/CMP0123.rst
index e09b5ec..85f23a4 100644
--- a/Help/policy/CMP0123.rst
+++ b/Help/policy/CMP0123.rst
@@ -25,8 +25,8 @@ a link option ``--cpu=`` based on those variables. The ``NEW`` behavior
does not add compile or link options, and projects are responsible for
setting correct options.
-This policy was introduced in CMake version 3.21. CMake version |release|
-warns when the policy is not set and uses ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0124.rst b/Help/policy/CMP0124.rst
index d5cde64..2c19cac 100644
--- a/Help/policy/CMP0124.rst
+++ b/Help/policy/CMP0124.rst
@@ -42,9 +42,8 @@ For example:
Under the ``OLD`` behavior, this code prints ``var1: value`` and ``var2:``.
Under the ``NEW`` behavior, this code prints only ``var1: value``.
-This policy was introduced in CMake version 3.21. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn when the policy
-is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0125.rst b/Help/policy/CMP0125.rst
index 0b1704e..8c5e23a 100644
--- a/Help/policy/CMP0125.rst
+++ b/Help/policy/CMP0125.rst
@@ -34,9 +34,8 @@ described above. When it is set to ``NEW``, the behavior is as follows:
the result variable, except where a relative path provided by a cache or
non-cache variable cannot be resolved to an existing path.
-This policy was introduced in CMake version 3.21. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn when the policy
-is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0126.rst b/Help/policy/CMP0126.rst
index a389512..ca40709 100644
--- a/Help/policy/CMP0126.rst
+++ b/Help/policy/CMP0126.rst
@@ -24,14 +24,16 @@ regardless of the ``CMP0126`` policy setting. The :command:`option` command
will *not* set the cache variable if a non-cache variable of the same name
already exists and :policy:`CMP0077` is set to ``NEW``.
-Policy ``CMP0126`` was introduced in CMake version 3.21. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly
-within a project. Use the :variable:`CMAKE_POLICY_DEFAULT_CMP0126
-<CMAKE_POLICY_DEFAULT_CMP\<NNNN\>>` variable to set the policy for
-a third-party project in a subdirectory without modifying it.
-Unlike many policies, CMake version |release| does *not* warn when the policy
-is not set and simply uses ``OLD`` behavior. See documentation of the
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
+See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0126 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
+The :variable:`CMAKE_POLICY_DEFAULT_CMP0126 <CMAKE_POLICY_DEFAULT_CMP\<NNNN\>>`
+variable may be used to set the policy for a third-party project in a
+subdirectory without modifying it.
+
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0127.rst b/Help/policy/CMP0127.rst
index 2106110..3de4f5e 100644
--- a/Help/policy/CMP0127.rst
+++ b/Help/policy/CMP0127.rst
@@ -26,9 +26,8 @@ to be re-written as::
Policy ``CMP0127`` provides compatibility for projects that have not
been updated to expect the new behavior.
-This policy was introduced in CMake version 3.22. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.22
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0128.rst b/Help/policy/CMP0128.rst
index 604a146..7d2c537 100644
--- a/Help/policy/CMP0128.rst
+++ b/Help/policy/CMP0128.rst
@@ -61,9 +61,10 @@ using :variable:`CMAKE_<LANG>_FLAGS_INIT`) then they will affect the detected
default :variable:`standard <CMAKE_<LANG>_STANDARD_DEFAULT>` and
:variable:`extensions <CMAKE_<LANG>_EXTENSIONS_DEFAULT>`.
-Unlike many policies, CMake version |release| does *not* warn when the policy
-is not set and simply uses the ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.22
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0128 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0129.rst b/Help/policy/CMP0129.rst
index 31a26e5..08ef8d1 100644
--- a/Help/policy/CMP0129.rst
+++ b/Help/policy/CMP0129.rst
@@ -23,10 +23,10 @@ The ``OLD`` behavior for this policy is to use compiler id ``GNU`` (and set
:variable:`CMAKE_<LANG>_SIMULATE_ID` to ``GNU``, and
:variable:`CMAKE_<LANG>_SIMULATE_VERSION` to the supported GNU compiler version.
-This policy was introduced in CMake version 3.23. Use the
-:command:`cmake_policy` command to set this policy to ``OLD`` or ``NEW`` explicitly.
-Unlike most policies, CMake version |release| does *not* warn
-by default when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.23
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0129 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0130.rst b/Help/policy/CMP0130.rst
index 0dd5623..79f1ebb 100644
--- a/Help/policy/CMP0130.rst
+++ b/Help/policy/CMP0130.rst
@@ -25,8 +25,8 @@ The ``OLD`` behavior for this policy is to ignore errors in
:command:`while` conditions. The ``NEW`` behavior for this
policy is to diagnose errors in :command:`while` conditions.
-This policy was introduced in CMake version 3.24. CMake version |release|
-warns when the policy is not set and uses ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0131.rst b/Help/policy/CMP0131.rst
index d5430e4..8899943 100644
--- a/Help/policy/CMP0131.rst
+++ b/Help/policy/CMP0131.rst
@@ -23,9 +23,8 @@ content guarded by :genex:`$<LINK_ONLY:...>` even for non-linking
usage requirements. The ``NEW`` behavior for this policy is to use
the guarded content only for link dependencies.
-This policy was introduced in CMake version 3.24. Use the
-:command:`cmake_policy` command to set this policy to ``OLD`` or ``NEW``
-explicitly. Unlike many policies, CMake version |release| does *not*
-warn when this policy is not set, and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0132.rst b/Help/policy/CMP0132.rst
index fadbbdc..c2a90c2 100644
--- a/Help/policy/CMP0132.rst
+++ b/Help/policy/CMP0132.rst
@@ -18,9 +18,8 @@ The ``OLD`` behavior for this policy sets the relevant environment variable
on the first run when a language is enabled. The ``NEW`` behavior for this
policy does not set any such environment variables.
-This policy was introduced in CMake version 3.24. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0133.rst b/Help/policy/CMP0133.rst
index c19bcf9..3bccd15 100644
--- a/Help/policy/CMP0133.rst
+++ b/Help/policy/CMP0133.rst
@@ -21,10 +21,10 @@ The ``OLD`` behavior for this policy is to enable
:variable:`CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE` by default.
The ``NEW`` behavior for this policy is to not enable it by default.
-This policy was introduced in CMake version 3.24. Use the
-:command:`cmake_policy` command to set this policy to ``OLD`` or ``NEW``
-explicitly. Unlike many policies, CMake version |release| does *not* warn
-by default when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
+.. include:: STANDARD_ADVICE.txt
+
See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0133 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
variable to control the warning.
diff --git a/Help/policy/CMP0134.rst b/Help/policy/CMP0134.rst
index a94012c..986d58e 100644
--- a/Help/policy/CMP0134.rst
+++ b/Help/policy/CMP0134.rst
@@ -28,9 +28,8 @@ The ``OLD`` behavior for this policy is to use registry views ``64`` and
The ``NEW`` behavior for this policy is to use registry views ``TARGET`` and
``BOTH`` as default.
-This policy was introduced in CMake version 3.24. Use the
-:command:`cmake_policy` command to set this policy to ``OLD`` or ``NEW``
-explicitly. Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0135.rst b/Help/policy/CMP0135.rst
index 1c0c134..09c688d 100644
--- a/Help/policy/CMP0135.rst
+++ b/Help/policy/CMP0135.rst
@@ -4,26 +4,26 @@ CMP0135
.. versionadded:: 3.24
When using the ``URL`` download method with the :command:`ExternalProject_Add`
-command, CMake 3.23 and below sets the timestamps of the extracted contents
-to the same as the timestamps in the archive. When the ``URL`` changes, the
-new archive is downloaded and extracted, but the timestamps of the extracted
-contents might not be newer than the previous contents. Anything that depends
-on the extracted contents might not be rebuilt, even though the contents may
-change.
+or :command:`FetchContent_Declare` commands, CMake 3.23 and below sets the
+timestamps of the extracted contents to the same as the timestamps in the
+archive. When the ``URL`` changes, the new archive is downloaded and extracted,
+but the timestamps of the extracted contents might not be newer than the
+previous contents. Anything that depends on the extracted contents might not
+be rebuilt, even though the contents may change.
CMake 3.24 and above prefers to set the timestamps of all extracted contents
to the time of the extraction. This ensures that anything that depends on the
extracted contents will be rebuilt whenever the ``URL`` changes.
-The ``DOWNLOAD_EXTRACT_TIMESTAMP`` option to the
-:command:`ExternalProject_Add` command can be used to explicitly specify how
-timestamps should be handled. When ``DOWNLOAD_EXTRACT_TIMESTAMP`` is not
+The ``DOWNLOAD_EXTRACT_TIMESTAMP`` option to the :command:`ExternalProject_Add`
+and :command:`FetchContent_Declare` commands can be used to explicitly specify
+how timestamps should be handled. When ``DOWNLOAD_EXTRACT_TIMESTAMP`` is not
given, this policy controls the default behavior. The ``OLD`` behavior for
this policy is to restore the timestamps from the archive. The ``NEW``
behavior sets the timestamps of extracted contents to the time of extraction.
-This policy was introduced in CMake version 3.24. CMake version |release|
-warns when the policy is not set and uses ``OLD`` behavior. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0136.rst b/Help/policy/CMP0136.rst
index 5414278..0980c87 100644
--- a/Help/policy/CMP0136.rst
+++ b/Help/policy/CMP0136.rst
@@ -42,9 +42,8 @@ entries and ignore the :variable:`CMAKE_WATCOM_RUNTIME_LIBRARY` abstraction.
The ``NEW`` behavior for this policy is to *not* place Watcom runtime
library flags in the default cache entries and use the abstraction instead.
-This policy was introduced in CMake version 3.24. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0137.rst b/Help/policy/CMP0137.rst
index ba3cb9c..3d879d1 100644
--- a/Help/policy/CMP0137.rst
+++ b/Help/policy/CMP0137.rst
@@ -25,9 +25,8 @@ Regardless of the policy setting, the
:variable:`CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable may be set
to suppress passing the platform variables through either signature.
-This policy was introduced in CMake version 3.24. Use the
-:command:`cmake_policy` command to set this policy to ``OLD`` or ``NEW``
-explicitly. Unlike many policies, CMake version |release| does *not* warn
-by default when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0138.rst b/Help/policy/CMP0138.rst
index a86849d..f933b90 100644
--- a/Help/policy/CMP0138.rst
+++ b/Help/policy/CMP0138.rst
@@ -23,9 +23,8 @@ project's values of :variable:`CMAKE_<LANG>_FLAGS` and
for this policy is to use the values of those variables as
compiler flags in the test project.
-This policy was introduced in CMake version 3.24. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0139.rst b/Help/policy/CMP0139.rst
index 5a0f4f7..640055d 100644
--- a/Help/policy/CMP0139.rst
+++ b/Help/policy/CMP0139.rst
@@ -9,9 +9,8 @@ operator.
The ``OLD`` behavior for this policy is to ignore the ``PATH_EQUAL`` operator.
The ``NEW`` behavior is to interpret the ``PATH_EQUAL`` operator.
-This policy was introduced in CMake version 3.24.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set
-it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0140.rst b/Help/policy/CMP0140.rst
index dea8989..4236017 100644
--- a/Help/policy/CMP0140.rst
+++ b/Help/policy/CMP0140.rst
@@ -9,9 +9,8 @@ The ``OLD`` behavior for this policy is to ignore any parameters given to the
command.
The ``NEW`` behavior is to check the validity of the parameters.
-This policy was introduced in CMake version 3.25.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set
-it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.25
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0141.rst b/Help/policy/CMP0141.rst
index 970e41d..1aef848 100644
--- a/Help/policy/CMP0141.rst
+++ b/Help/policy/CMP0141.rst
@@ -47,9 +47,8 @@ abstraction. The ``NEW`` behavior for this policy is to *not* place MSVC
debug information format flags in the default cache entries and use
the abstraction instead.
-This policy was introduced in CMake version 3.25. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.25
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0142.rst b/Help/policy/CMP0142.rst
index 1f928f0..e4b1440 100644
--- a/Help/policy/CMP0142.rst
+++ b/Help/policy/CMP0142.rst
@@ -19,9 +19,8 @@ The ``OLD`` behavior for this policy is to append
``$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)`` to all library search paths.
The ``NEW`` behavior is to not modify library search paths.
-This policy was introduced in CMake version 3.25. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.25
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0143.rst b/Help/policy/CMP0143.rst
index 24fdc27..b3bbb28 100644
--- a/Help/policy/CMP0143.rst
+++ b/Help/policy/CMP0143.rst
@@ -22,9 +22,10 @@ to the whole project.
This policy provides compatibility with projects that have not been updated
to expect enabling of folders. Enabling folders causes projects to appear
-differently in IDEs. The policy was introduced in CMake version 3.26. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+differently in IDEs.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.26
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0144.rst b/Help/policy/CMP0144.rst
index 3959d96..81e622a 100644
--- a/Help/policy/CMP0144.rst
+++ b/Help/policy/CMP0144.rst
@@ -18,9 +18,8 @@ variables if the original ``<PackageName>`` has lower-case characters.
The ``NEW`` behavior for this policy is to use ``<PACKAGENAME>_ROOT``
variables.
-This policy was introduced in CMake version 3.27. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0145.rst b/Help/policy/CMP0145.rst
index bb1c02e..9b0d43f 100644
--- a/Help/policy/CMP0145.rst
+++ b/Help/policy/CMP0145.rst
@@ -22,9 +22,8 @@ The ``OLD`` behavior of this policy is for ``include(Dart)`` and
``find_package(Dart)`` to load the deprecated modules. The ``NEW``
behavior is for uses of the modules to fail as if they do not exist.
-This policy was introduced in CMake version 3.27. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0146.rst b/Help/policy/CMP0146.rst
index c7cac22..7d6ba19 100644
--- a/Help/policy/CMP0146.rst
+++ b/Help/policy/CMP0146.rst
@@ -21,9 +21,8 @@ The ``OLD`` behavior of this policy is for ``find_package(CUDA)`` to
load the deprecated module. The ``NEW`` behavior is for uses of the
module to fail as if it does not exist.
-This policy was introduced in CMake version 3.27. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0147.rst b/Help/policy/CMP0147.rst
index 0f25096..fd5dc5f 100644
--- a/Help/policy/CMP0147.rst
+++ b/Help/policy/CMP0147.rst
@@ -16,9 +16,8 @@ The ``OLD`` behavior for this policy is to not add ``BuildInParallel``.
The ``NEW`` behavior for this policy is to add ``BuildInParallel`` for
VS 15.8 and newer.
-This policy was introduced in CMake version 3.27. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0148.rst b/Help/policy/CMP0148.rst
index 2f5c43d..c522c6a 100644
--- a/Help/policy/CMP0148.rst
+++ b/Help/policy/CMP0148.rst
@@ -21,9 +21,8 @@ The ``OLD`` behavior of this policy is for ``find_package(PythonInterp)``
and ``find_package(PythonLibs)`` to load the deprecated modules. The ``NEW``
behavior is for uses of the modules to fail as if they do not exist.
-This policy was introduced in CMake version 3.27. CMake version
-|release| warns when the policy is not set and uses ``OLD`` behavior.
-Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0149.rst b/Help/policy/CMP0149.rst
index a84149f..11e935d 100644
--- a/Help/policy/CMP0149.rst
+++ b/Help/policy/CMP0149.rst
@@ -46,9 +46,8 @@ The ``OLD`` behavior for this policy is to use the exact value of
:variable:`CMAKE_SYSTEM_VERSION` if possible. The ``NEW`` behavior
for this policy is to ignore it.
-This policy was introduced in CMake version 3.27. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0150.rst b/Help/policy/CMP0150.rst
index fe646d9..e8c58ef 100644
--- a/Help/policy/CMP0150.rst
+++ b/Help/policy/CMP0150.rst
@@ -31,9 +31,9 @@ The remote is selected according to the following (the first match is used):
If an appropriate remote cannot be determined from the above, a fatal error
will be raised.
-This policy was introduced in CMake version 3.27. CMake version |release|
-warns when a relative path is encountered and the policy is not set,
-falling back to using ``OLD`` behavior. Use the :command:`cmake_policy`
-command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |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:: DEPRECATED.txt
diff --git a/Help/policy/CMP0151.rst b/Help/policy/CMP0151.rst
index c12f595..49b0811 100644
--- a/Help/policy/CMP0151.rst
+++ b/Help/policy/CMP0151.rst
@@ -20,9 +20,8 @@ the target's include directories.
The ``NEW`` behavior for this policy is to add autogen include directory to
the target's system include directories.
-This policy was introduced in CMake version 3.27. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0152.rst b/Help/policy/CMP0152.rst
index d7e8692..94109e3 100644
--- a/Help/policy/CMP0152.rst
+++ b/Help/policy/CMP0152.rst
@@ -14,7 +14,8 @@ resolving symlinks.
The ``NEW`` behavior for this policy is to resolve all symlinks before
collapsing ``../`` components.
-This policy was introduced in CMake version 3.28. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.28
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0154.rst b/Help/policy/CMP0154.rst
index bf398af..89a4f67 100644
--- a/Help/policy/CMP0154.rst
+++ b/Help/policy/CMP0154.rst
@@ -51,9 +51,8 @@ to produce conservative build graphs. The ``NEW`` behavior for this
policy is to assume generated files are private in targets using file sets,
and for :ref:`Ninja Generators` to produce more efficient build graphs.
-This policy was introduced in CMake version 3.28. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.28
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0155.rst b/Help/policy/CMP0155.rst
index 8b741cb..5397c0d 100644
--- a/Help/policy/CMP0155.rst
+++ b/Help/policy/CMP0155.rst
@@ -20,9 +20,8 @@ sources do not import modules. The ``NEW`` behavior for this policy is to
assume that C++ 20 and newer files may import modules if the compiler
understands how to scan for their dependencies, and need to be scanned.
-This policy was introduced in CMake version 3.28. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
-Unlike many policies, CMake version |release| does *not* warn
-when this policy is not set and simply uses ``OLD`` behavior.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.28
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0156.rst b/Help/policy/CMP0156.rst
new file mode 100644
index 0000000..d2ce291
--- /dev/null
+++ b/Help/policy/CMP0156.rst
@@ -0,0 +1,46 @@
+CMP0156
+-------
+
+.. versionadded:: 3.29
+
+De-duplicate libraries on link lines based on linker capabilities.
+
+Traditional linkers maintain a set of undefined symbols during linking. The
+linker processes each file in the order in which it appears on the command
+line, until the set of undefined symbols becomes empty. An object file is
+linked into the output object when it is encountered, with its undefined
+symbols added to the set. Upon encountering an archive file a traditional
+linker searches the objects contained therein, and processes those that satisfy
+symbols in the unresolved set.
+
+Handling mutually dependent archives may be awkward when using a traditional
+linker. Archive files may have to be specified multiple times.
+
+Some linkers (for instance Apple or Windows linkers, as well as ``LLVM LLD``)
+record all symbols found in objects and archives as they iterate over command
+line arguments. When one of these linkers encounters an undefined symbol that
+can be resolved by an object file contained in a previously processed archive
+file, it immediately extracts and links it into the output object.
+
+CMake 3.28 and below may generate link lines that repeat static libraries as
+a traditional linker would need, even when using a linker that does not need it.
+They may also de-duplicate shared libraries by keeping their last occurrence,
+which on Windows platforms can change DLL load order.
+
+CMake 3.29 and above prefer to apply different strategies based on linker
+capabilities. So, when targeting Apple and Windows platforms, all
+libraries are de-duplicated. Moreover, on Windows platforms, libraries
+are de-duplicated by keeping their first occurrence, thus respecting the
+project-specified order. This policy provides compatibility with projects
+that have not been updated to expect the latter behavior.
+
+The ``OLD`` behavior for this policy is to always repeat static libraries
+as if using a traditional linker, and always de-duplicate shared libraries
+by keeping the last occurrence of each. The ``NEW`` behavior for this policy
+is to apply different strategies based on linker capabilities.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0157.rst b/Help/policy/CMP0157.rst
new file mode 100644
index 0000000..c607203
--- /dev/null
+++ b/Help/policy/CMP0157.rst
@@ -0,0 +1,47 @@
+CMP0157
+-------
+
+.. versionadded:: 3.29
+
+Swift compilation mode is selected by an abstraction.
+
+The Swift compiler can compile modules in different modes. The desired build
+mode depends whether the developer is iterating and wants to incrementally make
+changes, or if they are building a release for distribution and want more
+optimizations applied to the resulting binary.
+
+CMake versions 3.26 through 3.28 build Swift binaries with whole-module
+optimizations enabled when configured in a non-debug build type.
+For CMake versions earlier than 3.26, the developer needs to specify
+the necessary flag manually for the :ref:`Ninja Generators`, and cannot
+not specify whole-module optimizations to the :generator:`Xcode` generator.
+
+CMake versions 3.29 and above prefer to set the compilation mode using
+the :prop_tgt:`Swift_COMPILATION_MODE` target property, which can be
+initialized by the :variable:`CMAKE_Swift_COMPILATION_MODE` variable.
+
+This policy provides compatibility for projects that have not been updated.
+The policy setting takes effect as of the first :command:`project` or
+:command:`enable_language` command that enables the ``Swift`` language.
+
+.. note::
+
+ Once the policy has taken effect at the top of a project, that choice
+ must be used throughout the tree. In projects that have nested projects
+ in subdirectories, be sure to convert everything together.
+
+The ``OLD`` behavior for this policy builds all Swift targets in
+``wholemodule`` mode for non-debug configurations. :ref:`Ninja Generators`
+prepend the ``-wmo`` flag to the default set of Swift flags.
+The :generator:`Xcode` generator sets the ``SWIFT_COMPILATION_MODE``
+attribute to ``wholemodule`` in the generated Xcode project file.
+
+The ``NEW`` behavior for this policy is to apply the compilation mode specified
+in the :prop_tgt:`Swift_COMPILATION_MODE` target property, initialized as each
+target is created by the :variable:`CMAKE_Swift_COMPILATION_MODE` variable.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0158.rst b/Help/policy/CMP0158.rst
new file mode 100644
index 0000000..66e5a62
--- /dev/null
+++ b/Help/policy/CMP0158.rst
@@ -0,0 +1,28 @@
+CMP0158
+-------
+
+.. versionadded:: 3.29
+
+:command:`add_test` honors :variable:`CMAKE_CROSSCOMPILING_EMULATOR` only
+when :variable:`cross-compiling <CMAKE_CROSSCOMPILING>`.
+
+In CMake 3.28 and below, :command:`add_test` unconditionally used the
+:prop_tgt:`CROSSCOMPILING_EMULATOR` target property (initialized by the
+:variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable) to run test commands
+naming executable targets. CMake 3.29 and above prefer to use the emulator
+only when the :variable:`CMAKE_CROSSCOMPILING` variable is enabled. The
+:variable:`CMAKE_TEST_LAUNCHER` variable may be used instead when not
+cross-compiling. This policy provides compatibility for projects that
+have not been updated.
+
+The ``OLD`` behavior for this policy is for :command:`add_test` to use
+the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property unconditionally.
+The ``NEW`` behavior for this policy is for :command:`add_test` to use
+the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property only when
+:variable:`cross-compiling <CMAKE_CROSSCOMPILING>`.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0159.rst b/Help/policy/CMP0159.rst
new file mode 100644
index 0000000..908ef0f
--- /dev/null
+++ b/Help/policy/CMP0159.rst
@@ -0,0 +1,23 @@
+CMP0159
+-------
+
+.. versionadded:: 3.29
+
+:command:`file(STRINGS)` with ``REGEX`` updates :variable:`CMAKE_MATCH_<n>`.
+
+In CMake 3.28 and below the :command:`file(STRINGS)` command's ``REGEX``
+option does not affect :variable:`CMAKE_MATCH_<n>` variables. CMake 3.29
+and above prefer to update the :variable:`CMAKE_MATCH_<n>` variables using
+captures from the last match in the file, similar to the
+:command:`string(REGEX MATCHALL)` command. This policy provides
+compatibility for projects that have not been updated to expect the behavior.
+
+The ``OLD`` behavior for this policy is for :command:`file(STRINGS)` with
+``REGEX`` to not store capture groups in :variable:`CMAKE_MATCH_<n>`
+variables. The ``NEW`` behavior is to store the capture groups.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0160.rst b/Help/policy/CMP0160.rst
new file mode 100644
index 0000000..46318ab
--- /dev/null
+++ b/Help/policy/CMP0160.rst
@@ -0,0 +1,39 @@
+CMP0160
+-------
+
+.. versionadded:: 3.29
+
+More read-only target properties now error when trying to set them.
+
+The :command:`set_target_properties` and :command:`set_property` commands
+are intended to error out on all read-only properties. However, CMake 3.28 and
+below only did this for the following properties:
+
+* :prop_tgt:`HEADER_SETS`
+* :prop_tgt:`INTERFACE_HEADER_SETS`
+* :prop_tgt:`IMPORTED_GLOBAL`
+* :prop_tgt:`MANUALLY_ADDED_DEPENDENCIES`
+* :prop_tgt:`NAME`
+* :prop_tgt:`TYPE`
+
+This policy enforces the read-only nature of the following target properties:
+
+* :prop_tgt:`ALIAS_GLOBAL`
+* :prop_tgt:`BINARY_DIR`
+* :prop_tgt:`CXX_MODULE_SETS`
+* :prop_tgt:`IMPORTED`
+* :prop_tgt:`INTERFACE_CXX_MODULE_SETS`
+* :prop_tgt:`LOCATION`
+* :prop_tgt:`LOCATION_<CONFIG>`
+* :prop_tgt:`SOURCE_DIR`
+
+The ``OLD`` behavior for this policy is to only error out for the properties
+:prop_tgt:`MANUALLY_ADDED_DEPENDENCIES`, :prop_tgt:`NAME`, and :prop_tgt:`TYPE`.
+The ``NEW`` behavior for this policy is to error out on all target properties
+that are documented as read-only.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0161.rst b/Help/policy/CMP0161.rst
new file mode 100644
index 0000000..34bb64c
--- /dev/null
+++ b/Help/policy/CMP0161.rst
@@ -0,0 +1,36 @@
+CMP0161
+-------
+
+.. versionadded:: 3.29
+
+The :variable:`CPACK_PRODUCTBUILD_DOMAINS` variable defaults to true.
+
+Before CMake 3.29, the :variable:`CPACK_PRODUCTBUILD_DOMAINS` variable is
+unset by default. When using the :cpack_gen:`CPack productbuild Generator`,
+this disables the use of the ``domains`` attribute in the productbuild
+Distribution XML, and falls back to the ``auth`` attribute instead.
+These attributes control where a productbuild package is allowed to be
+installed. But the ``auth`` attribute has been deprecated by Apple,
+so projects should migrate to using ``domains`` instead.
+
+CMake 3.29 and above prefer to use a default value of true for
+:variable:`CPACK_PRODUCTBUILD_DOMAINS`, which means ``domains`` will be used
+by default unless the project explicitly sets
+:variable:`CPACK_PRODUCTBUILD_DOMAINS` to false.
+This policy provides compatibility with projects that enabled the
+:cpack_gen:`CPack productbuild Generator`, but did not explicitly set
+:variable:`CPACK_PRODUCTBUILD_DOMAINS`.
+
+The ``OLD`` behavior for this policy is to leave
+:variable:`CPACK_PRODUCTBUILD_DOMAINS` unset if it hasn't been set.
+The ``NEW`` behavior for this policy is to use a default value of true for
+:variable:`CPACK_PRODUCTBUILD_DOMAINS`.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
+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
diff --git a/Help/policy/CMP0162.rst b/Help/policy/CMP0162.rst
new file mode 100644
index 0000000..df46d96
--- /dev/null
+++ b/Help/policy/CMP0162.rst
@@ -0,0 +1,47 @@
+CMP0162
+-------
+
+.. versionadded:: 3.30
+
+:ref:`Visual Studio Generators` add ``UseDebugLibraries`` indicators by default.
+
+The "Use Debug Libraries" setting in Visual Studio projects indicates what
+configurations are considered debug configurations. In standalone projects,
+this may affect MSBuild's default selection of MSVC runtime library,
+optimization flags, runtime checks, and similar settings. CMake typically
+generates all those settings explicitly based on the project's specification,
+so CMake 3.29 and below do not write any ``UseDebugLibraries`` indicators to
+``.vcxproj`` files.
+
+CMake 3.30 and above prefer to write ``UseDebugLibraries`` indicators because
+they are useful for reference by both humans and tools, and may also affect
+the behavior of platform-specific SDKs. The indicator for each configuration
+of a target is determined as follows:
+
+* If the target compiles sources for a known MSVC runtime library
+ (such as that specified by :prop_tgt:`MSVC_RUNTIME_LIBRARY`),
+ then ``UseDebugLibraries`` is ``true`` for configurations that
+ compile for a "Debug" runtime library, and ``false`` for others.
+
+* Otherwise, such as in targets created by :command:`add_custom_target`,
+ ``UseDebugLibraries`` is ``true`` for the ``Debug`` configuration,
+ and ``false`` for others.
+
+This policy provides compatibility for projects that have not been updated to
+expect the indicators. The policy setting is recorded by each target as it is
+created and used to determine the default behavior for that target's
+``.vcxproj`` file.
+
+The ``OLD`` behavior for this policy is to not generate ``UseDebugLibraries``
+indicators by default. The ``NEW`` behavior for this policy is to generate
+``UseDebugLibraries`` indicators by default.
+
+If the :variable:`CMAKE_VS_USE_DEBUG_LIBRARIES` variable and/or
+:prop_tgt:`VS_USE_DEBUG_LIBRARIES` target property is set, it explicitly
+controls ``UseDebugLibraries`` generation regardless of this policy.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0163.rst b/Help/policy/CMP0163.rst
new file mode 100644
index 0000000..40b3535
--- /dev/null
+++ b/Help/policy/CMP0163.rst
@@ -0,0 +1,37 @@
+CMP0163
+-------
+
+.. versionadded:: 3.30
+
+The :prop_sf:`GENERATED` source file property is now visible in all directories.
+
+In CMake 3.29 and below, the :prop_sf:`GENERATED` source file property,
+like other source file properties, was scoped in every directory separately.
+Although policy :policy:`CMP0118` allowed sources marked ``GENERATED`` in one
+directory to be used in other directories without manually marking them as
+``GENERATED`` again, the ``GENERATED`` property was still not visible to
+:command:`get_property` and :command:`get_source_file_property` calls.
+
+Whether or not a source file is generated is an all-or-nothing global
+property of the source: a source is either generated or it is not.
+CMake 3.30 and above prefer to treat the :prop_sf:`GENERATED` source file
+property as globally scoped. Once it is set in one directory, it is
+immediately visible to :command:`get_property` and
+:command:`get_source_file_property` calls in other directories.
+This policy provides compatibility for projects that have not been
+updated for this behavior.
+
+The ``OLD`` behavior of this policy is for the ``GENERATED`` source file
+property to be visible only in the directories in which it is set. The
+``NEW`` behavior of this policy is to allow the ``GENERATED`` source file
+property to be visible in all directories once set in any directory.
+Furthermore, the ``NEW`` behavior of this policy implies the ``NEW``
+behavior of policy :policy:`CMP0118`: the ``GENERATED`` property may
+be set only to boolean values, and may not be turned off once turned on.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
+.. |WARNS_OR_DOES_NOT_WARN| replace::
+ does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0164.rst b/Help/policy/CMP0164.rst
new file mode 100644
index 0000000..5ab2ee9
--- /dev/null
+++ b/Help/policy/CMP0164.rst
@@ -0,0 +1,31 @@
+CMP0164
+-------
+
+.. versionadded:: 3.30
+
+:command:`add_library` rejects ``SHARED`` libraries when not supported by
+the platform.
+
+In CMake 3.29 and below, on platforms that do not support shared libraries
+(:prop_gbl:`TARGET_SUPPORTS_SHARED_LIBS` is ``false``), the
+:command:`add_library` command automatically converted ``SHARED`` libraries to
+``STATIC`` libraries to help users build projects on such platforms. However,
+the semantics of shared and static libraries are different enough that such
+automatic conversion cannot work in general. Projects using shared libraries
+need to be ported to such platforms on a case-by-case basis.
+
+In CMake 3.30 and above, :command:`add_library` prefers to reject creation
+of shared libraries on platforms that do not support them, and fail with a
+fatal error message. This policy provides compatibility for projects that
+happened to work with the automatic conversion to static libraries and have
+not been updated with an explicit port.
+
+The ``OLD`` behavior for this policy is to implicitly create a static
+library with a developer warning. The ``NEW`` behavior for this policy is
+to fail.
+
+.. |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:: DEPRECATED.txt
diff --git a/Help/policy/CMP0165.rst b/Help/policy/CMP0165.rst
new file mode 100644
index 0000000..7a79c44
--- /dev/null
+++ b/Help/policy/CMP0165.rst
@@ -0,0 +1,26 @@
+CMP0165
+-------
+
+.. versionadded:: 3.30
+
+:command:`enable_language` must not be called before :command:`project`.
+
+In CMake 3.29 and below, if a project called :command:`enable_language`
+before the first call to :command:`project`, the language would be enabled
+but possibly using unset details that were expected to be set.
+In CMake 3.30 and above, :command:`enable_language` prefers to reject this
+case and stop with a fatal error instead if it detects that :command:`project`
+has not yet been called. This policy provides compatibility for projects that
+happened to work when :command:`enable_language` was called before
+:command:`project` and have not been updated to call these commands in the
+required order.
+
+The ``OLD`` behavior for this policy is to allow :command:`enable_language`
+to be called before :command:`project`. The ``NEW`` behavior for this policy
+is to fail with a fatal error in such cases.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0166.rst b/Help/policy/CMP0166.rst
new file mode 100644
index 0000000..5c67880
--- /dev/null
+++ b/Help/policy/CMP0166.rst
@@ -0,0 +1,40 @@
+CMP0166
+-------
+
+.. versionadded:: 3.30
+
+:genex:`TARGET_PROPERTY` evaluates link properties transitively over private
+dependencies of static libraries.
+
+In CMake 3.29 and below, the :genex:`TARGET_PROPERTY` generator expression
+evaluates properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
+:prop_tgt:`INTERFACE_LINK_DIRECTORIES`, and :prop_tgt:`INTERFACE_LINK_DEPENDS`
+as if they were :ref:`Transitive Build Properties` rather than
+:ref:`Transitive Link Properties`, even when policy :policy:`CMP0099` is
+set to ``NEW``. Private dependencies of static libraries, which appear in
+their :prop_tgt:`INTERFACE_LINK_LIBRARIES` guarded by :genex:`LINK_ONLY`
+generator expressions, are not followed. This is inconsistent with
+evaluation of the same target properties during buildsystem generation.
+
+CMake 3.30 and above prefer that :genex:`TARGET_PROPERTY` evaluates
+properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
+:prop_tgt:`INTERFACE_LINK_DIRECTORIES`, and :prop_tgt:`INTERFACE_LINK_DEPENDS`
+as :ref:`Transitive Link Properties` such that private dependencies of static
+libraries, which appear in their :prop_tgt:`INTERFACE_LINK_LIBRARIES` guarded
+by :genex:`LINK_ONLY` generator expressions, are followed.
+This policy provides compatibility for projects that have not been updated
+to expect the new behavior.
+
+The ``OLD`` behavior for this policy is for :genex:`TARGET_PROPERTY` to
+evaluate properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
+:prop_tgt:`INTERFACE_LINK_DIRECTORIES`, and :prop_tgt:`INTERFACE_LINK_DEPENDS`
+as if they were :ref:`Transitive Build Properties` by not following private
+dependencies of static libraries. The ``NEW`` behavior for this policy is
+to evaluate them as :ref:`Transitive Link Properties` by following private
+dependencies of static libraries.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/DISALLOWED_COMMAND.txt b/Help/policy/DISALLOWED_COMMAND.txt
index 6500bb0..506f2bb 100644
--- a/Help/policy/DISALLOWED_COMMAND.txt
+++ b/Help/policy/DISALLOWED_COMMAND.txt
@@ -3,7 +3,6 @@ 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.
-This policy was introduced in CMake version |disallowed_version|.
-CMake version |release| warns when the policy is not set and uses
-``OLD`` behavior. Use the :command:`cmake_policy` command to set it to ``OLD`` or
-``NEW`` explicitly.
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: |disallowed_version|
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
diff --git a/Help/policy/STANDARD_ADVICE.txt b/Help/policy/STANDARD_ADVICE.txt
new file mode 100644
index 0000000..925c174
--- /dev/null
+++ b/Help/policy/STANDARD_ADVICE.txt
@@ -0,0 +1,3 @@
+This policy was introduced in CMake version |INTRODUCED_IN_CMAKE_VERSION|.
+It may be set by :command:`cmake_policy` or :command:`cmake_minimum_required`.
+If it is not set, CMake |WARNS_OR_DOES_NOT_WARN|, and uses ``OLD`` behavior.
diff --git a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
index a31ee3a..fd2f941 100644
--- a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
@@ -37,7 +37,7 @@ The features known to this version of CMake are:
Compiler mode is at least CUDA/C++ 23.
``cuda_std_26``
- .. versionadded:: 3.25
+ .. versionadded:: 3.30
Compiler mode is at least CUDA/C++ 26.
diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
index e54b927..177659a 100644
--- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -47,7 +47,7 @@ but it does not necessarily imply complete conformance to that standard.
Compiler mode is at least C++ 23.
``cxx_std_26``
- .. versionadded:: 3.25
+ .. versionadded:: 3.30
Compiler mode is at least C++ 26.
diff --git a/Help/prop_inst/CPACK_WIX_ACL.rst b/Help/prop_inst/CPACK_WIX_ACL.rst
index 8b4fb5c..a82191a 100644
--- a/Help/prop_inst/CPACK_WIX_ACL.rst
+++ b/Help/prop_inst/CPACK_WIX_ACL.rst
@@ -18,6 +18,6 @@ each of which has to match the following format.
``<permission>`` is any of the YesNoType attributes listed here::
- http://wixtoolset.org/documentation/manual/v3/xsd/wix/permission.html
+ https://wixtoolset.org/documentation/manual/v3/xsd/wix/permission.html
The property is currently only supported by the :cpack_gen:`CPack WIX Generator`.
diff --git a/Help/prop_sf/GENERATED.rst b/Help/prop_sf/GENERATED.rst
index 5ecc86c..566b58a 100644
--- a/Help/prop_sf/GENERATED.rst
+++ b/Help/prop_sf/GENERATED.rst
@@ -4,7 +4,16 @@ GENERATED
Is this source file generated as part of the build or CMake process.
.. versionchanged:: 3.20
- The GENERATED source file property is now visible in all directories.
+ Turning on the ``GENERATED`` source file property in one directory allows
+ the associated source file to be used across directories without the need
+ to manually setting that property for other directory scopes, too.
+ Additionally, it may now be set only to boolean values, and may not be
+ turned off once turned on. See policy :policy:`CMP0118`.
+
+.. versionchanged:: 3.30
+ Whether or not a source file is generated is an all-or-nothing global
+ property of the source. Consequently, the ``GENERATED`` source file
+ property is now visible in all directories. See policy :policy:`CMP0163`.
Tells the internal CMake engine that a source file is generated by an outside
process such as another build step, or the execution of CMake itself.
@@ -38,11 +47,3 @@ be shown. For the special case of sources generated by CMake's :prop_tgt:`AUTOMO
:prop_gbl:`AUTORCC_SOURCE_GROUP` and :prop_gbl:`AUTOUIC_SOURCE_GROUP` target
properties may influence where the generated sources are grouped in the project's
file lists.
-
-.. note::
-
- Starting with CMake 3.20 the ``GENERATED`` source file property can be set
- and retrieved from any directory scope. It is an all-or-nothing property.
- It also can no longer be removed or unset if it was set to ``TRUE``. Policy
- :policy:`CMP0118` was introduced to allow supporting the ``OLD`` behavior
- for some time.
diff --git a/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst b/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst
index 1ec4517..e94856d 100644
--- a/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst
+++ b/Help/prop_test/FAIL_REGULAR_EXPRESSION.rst
@@ -1,15 +1,22 @@
FAIL_REGULAR_EXPRESSION
-----------------------
-If the output matches this regular expression the test will fail,
-regardless of the process exit code.
+If the test output (stdout or stderr) matches this regular expression the test
+will fail, regardless of the process exit code. Tests that exceed the timeout
+specified by :prop_test:`TIMEOUT` fail regardless of
+``FAIL_REGULAR_EXPRESSION``. Any non-zero return code or system-level test
+failures including segmentation faults, signal abort, or heap errors fail the
+test even if the regular expression does not match.
-If set, if the output matches one of specified regular expressions,
-the test will fail. Example:
+If set, if the output matches one of specified regular expressions, the test
+will fail. Example:
.. code-block:: cmake
- set_tests_properties(mytest PROPERTIES
+ # test would pass, except for FAIL_REGULAR_EXPRESSION
+ add_test(NAME mytest COMMAND ${CMAKE_COMMAND} -E echo "Failed")
+
+ set_property(TEST mytest PROPERTY
FAIL_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed"
)
diff --git a/Help/prop_test/PASS_REGULAR_EXPRESSION.rst b/Help/prop_test/PASS_REGULAR_EXPRESSION.rst
index 96468c0..b19e637 100644
--- a/Help/prop_test/PASS_REGULAR_EXPRESSION.rst
+++ b/Help/prop_test/PASS_REGULAR_EXPRESSION.rst
@@ -1,20 +1,50 @@
PASS_REGULAR_EXPRESSION
-----------------------
-The output must match this regular expression for the test to pass.
-The process exit code is ignored.
+The test output (stdout or stderr) must match this regular expression
+for the test to pass. The process exit code is ignored. Tests that exceed
+the timeout specified by :prop_test:`TIMEOUT` still fail regardless of
+``PASS_REGULAR_EXPRESSION``. System-level test failures including
+segmentation faults, signal abort, or heap errors may fail the test even
+if ``PASS_REGULAR_EXPRESSION`` is matched.
-If set, the test output will be checked against the specified regular
-expressions and at least one of the regular expressions has to match,
-otherwise the test will fail. Example:
+Example:
.. code-block:: cmake
- set_tests_properties(mytest PROPERTIES
- PASS_REGULAR_EXPRESSION "TestPassed;All ok"
+ add_test(NAME mytest COMMAND ${CMAKE_COMMAND} -E echo "Passed this test")
+
+ set_property(TEST mytest PROPERTY
+ PASS_REGULAR_EXPRESSION "pass;Passed"
)
``PASS_REGULAR_EXPRESSION`` expects a list of regular expressions.
+To run a test that may have a system-level failure, but still pass if
+``PASS_REGULAR_EXPRESSION`` matches, use a CMake command to wrap the
+executable run. Note that this will prevent automatic handling of the
+:prop_tgt:`CROSSCOMPILING_EMULATOR` and :prop_tgt:`TEST_LAUNCHER`
+target property.
+
+.. code-block:: cmake
+
+ add_executable(main main.c)
+
+ add_test(NAME sigabrt COMMAND ${CMAKE_COMMAND} -E env $<TARGET_FILE:main>)
+
+ set_property(TEST sigabrt PROPERTY PROPERTY_REGULAR_EXPRESSION "pass;Passed")
+
+.. code-block:: c
+
+ #include <signal.h>
+ #include <stdio.h>
+
+ int main(void){
+ fprintf(stdout, "Passed\n");
+ fflush(stdout); /* ensure the output buffer is seen */
+ raise(SIGABRT);
+ return 0;
+ }
+
See also the :prop_test:`FAIL_REGULAR_EXPRESSION` and
:prop_test:`SKIP_REGULAR_EXPRESSION` test properties.
diff --git a/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst b/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst
index 60038e4..8717a0a 100644
--- a/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst
+++ b/Help/prop_test/SKIP_REGULAR_EXPRESSION.rst
@@ -3,19 +3,45 @@ SKIP_REGULAR_EXPRESSION
.. versionadded:: 3.16
-If the output matches this regular expression the test will be marked as skipped.
+If the test output (stderr or stdout) matches this regular expression the test
+will be marked as skipped, regardless of the process exit code. Tests that
+exceed the timeout specified by :prop_test:`TIMEOUT` still fail regardless of
+``SKIP_REGULAR_EXPRESSION``. System-level test failures including segmentation
+faults, signal abort, or heap errors may fail the test even if the regular
+expression matches.
-If set, if the output matches one of specified regular expressions,
-the test will be marked as skipped. Example:
+Example:
.. code-block:: cmake
+ add_test(NAME mytest COMMAND ${CMAKE_COMMAND} -E echo "Skipped this test")
+
set_property(TEST mytest PROPERTY
SKIP_REGULAR_EXPRESSION "[^a-z]Skip" "SKIP" "Skipped"
)
``SKIP_REGULAR_EXPRESSION`` expects a list of regular expressions.
+To run a test that may have a system-level failure, but still skip if
+``SKIP_REGULAR_EXPRESSION`` matches, use a CMake command to wrap the
+executable run. Note that this will prevent automatic handling of the
+:prop_tgt:`CROSSCOMPILING_EMULATOR` and :prop_tgt:`TEST_LAUNCHER`
+target property.
+
+.. code-block:: cmake
+
+ add_executable(main main.c)
+
+ add_test(NAME sigabrt COMMAND ${CMAKE_COMMAND} -E env $<TARGET_FILE:main>)
+
+ set_property(TEST sigabrt PROPERTY SKIP_REGULAR_EXPRESSION "SIGABRT;[aA]bort")
+
+.. code-block:: c
+
+ #include <signal.h>
+
+ int main(void){ raise(SIGABRT); return 0; }
+
See also the :prop_test:`SKIP_RETURN_CODE`,
:prop_test:`PASS_REGULAR_EXPRESSION`, and :prop_test:`FAIL_REGULAR_EXPRESSION`
test properties.
diff --git a/Help/prop_test/SKIP_RETURN_CODE.rst b/Help/prop_test/SKIP_RETURN_CODE.rst
index 23c4c62..57fc031 100644
--- a/Help/prop_test/SKIP_RETURN_CODE.rst
+++ b/Help/prop_test/SKIP_RETURN_CODE.rst
@@ -9,4 +9,40 @@ a return code of the process can be specified that will mark the test as
``Not Run`` if it is encountered. Valid values are in the range of
0 to 255, inclusive.
-See also the :prop_test:`SKIP_REGULAR_EXPRESSION` property.
+Tests that exceed the timeout specified by :prop_test:`TIMEOUT` still fail
+regardless of ``SKIP_RETURN_CODE``.
+System-level test failures including segmentation faults,
+signal abort, or heap errors may fail the test even if the return code matches.
+
+.. code-block:: cmake
+
+ # cmake (1) defines this to return code 1
+ add_test(NAME r1 COMMAND ${CMAKE_COMMAND} -E false)
+
+ set_tests_properties(r1 PROPERTIES SKIP_RETURN_CODE 1)
+
+
+To run a test that may have a system-level failure, but still skip if
+``SKIP_RETURN_CODE`` matches, use a CMake command to wrap the executable run.
+Note that this will prevent automatic handling of the
+:prop_tgt:`CROSSCOMPILING_EMULATOR` and :prop_tgt:`TEST_LAUNCHER` target
+property.
+
+.. code-block:: cmake
+
+ add_executable(main main.c)
+
+ # cmake -E env <command> returns 1 if the command fails in any way
+ add_test(NAME sigabrt COMMAND ${CMAKE_COMMAND} -E env $<TARGET_FILE:main>)
+
+ set_property(TEST sigabrt PROPERTY SKIP_RETURN_CODE 1)
+
+.. code-block:: c
+
+ #include <signal.h>
+
+ int main(void){ raise(SIGABRT); return 0; }
+
+
+To handle multiple types of cases that may need to be skipped, consider the
+:prop_test:`SKIP_REGULAR_EXPRESSION` property.
diff --git a/Help/prop_test/WILL_FAIL.rst b/Help/prop_test/WILL_FAIL.rst
index 4926f40..9d61ab7 100644
--- a/Help/prop_test/WILL_FAIL.rst
+++ b/Help/prop_test/WILL_FAIL.rst
@@ -1,8 +1,37 @@
WILL_FAIL
---------
-If set to true, this will invert the pass/fail flag of the test.
+If ``true``, inverts the pass / fail test criteria. Tests for which
+``WILL_FAIL`` is ``true`` fail with return code 0 and pass with non-zero
+return code. Tests that exceed the timeout specified by :prop_test:`TIMEOUT`
+still fail regardless of ``WILL_FAIL``.
+System-level test failures including segmentation faults,
+signal abort, or heap errors may fail the test even if ``WILL_FAIL`` is true.
-This property can be used for tests that are expected to fail and return a
-non-zero return code. Note that system-level test failures such as segmentation
-faults or heap errors will still fail the test even if ``WILL_FALL`` is true.
+Example of a test that would ordinarily pass, but fails because ``WILL_FAIL``
+is ``true``:
+
+.. code-block:: cmake
+
+ add_test(NAME failed COMMAND ${CMAKE_COMMAND} -E true)
+ set_property(TEST failed PROPERTY WILL_FAIL true)
+
+To run a test that may have a system-level failure, but still pass if
+``WILL_FAIL`` is set, use a CMake command to wrap the executable run.
+Note that this will prevent automatic handling of the
+:prop_tgt:`CROSSCOMPILING_EMULATOR` and :prop_tgt:`TEST_LAUNCHER`
+target property.
+
+.. code-block:: cmake
+
+ add_executable(main main.c)
+
+ add_test(NAME sigabrt COMMAND ${CMAKE_COMMAND} -E env $<TARGET_FILE:main>)
+
+ set_property(TEST sigabrt PROPERTY WILL_FAIL TRUE)
+
+.. code-block:: c
+
+ #include <signal.h>
+
+ int main(void){ raise(SIGABRT); return 0; }
diff --git a/Help/prop_tgt/AUTOGEN_BETTER_GRAPH_MULTI_CONFIG.rst b/Help/prop_tgt/AUTOGEN_BETTER_GRAPH_MULTI_CONFIG.rst
new file mode 100644
index 0000000..edeb15c
--- /dev/null
+++ b/Help/prop_tgt/AUTOGEN_BETTER_GRAPH_MULTI_CONFIG.rst
@@ -0,0 +1,22 @@
+AUTOGEN_BETTER_GRAPH_MULTI_CONFIG
+---------------------------------
+
+.. versionadded:: 3.29
+
+``AUTOGEN_BETTER_GRAPH_MULTI_CONFIG`` is a boolean property that can be set
+on a target to have better dependency graph for multi-configuration generators.
+When this property is enabled, ``CMake`` will generate more per-config targets.
+Thus, the dependency graph will be more accurate for multi-configuration
+generators and some recompilations will be avoided.
+
+If the Qt version is 6.8 or newer, this property is enabled by default.
+If the Qt version is older than 6.8, this property is disabled by default.
+Consult the Qt documentation to check if the property can be enabled for older
+Qt versions.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
+
+This property is initialized by the
+:variable:`CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG` variable if it is set when
+a target is created.
diff --git a/Help/prop_tgt/AUTOGEN_COMMAND_LINE_LENGTH_MAX.rst b/Help/prop_tgt/AUTOGEN_COMMAND_LINE_LENGTH_MAX.rst
new file mode 100644
index 0000000..f1e51a7
--- /dev/null
+++ b/Help/prop_tgt/AUTOGEN_COMMAND_LINE_LENGTH_MAX.rst
@@ -0,0 +1,18 @@
+AUTOGEN_COMMAND_LINE_LENGTH_MAX
+-------------------------------
+
+.. versionadded:: 3.29
+
+Command line length limit for autogen targets, i.e. ``moc`` or ``uic``,
+that triggers the use of response files on Windows instead of passing all
+arguments to the command line.
+
+- An empty (or unset) value sets the limit to 32000
+- A positive non zero integer value sets the exact command line length
+ limit.
+
+By default ``AUTOGEN_COMMAND_LINE_LENGTH_MAX`` is initialized from
+:variable:`CMAKE_AUTOGEN_COMMAND_LINE_LENGTH_MAX`.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst
index 9350a4f..33db8a7 100644
--- a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst
+++ b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst
@@ -4,20 +4,29 @@ AUTOGEN_ORIGIN_DEPENDS
.. versionadded:: 3.14
Switch for forwarding origin target dependencies to the corresponding
-``_autogen`` target.
+:ref:`<ORIGIN>_autogen` target.
+
+ .. note::
+
+ If Qt 5.15 or later is used and the generator is either :generator:`Ninja`
+ or :ref:`Makefile Generators`, origin target dependencies are forwarded to
+ the :ref:`<ORIGIN>_autogen_timestamp_deps` target instead of
+ :ref:`<ORIGIN>_autogen`
+
Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property
-``ON`` have a corresponding ``_autogen`` target which generates
-``moc`` and ``uic`` files. As this ``_autogen`` target is created at
+``ON`` have a corresponding :ref:`<ORIGIN>_autogen` target which generates
+``moc`` and ``uic`` files. As this :ref:`<ORIGIN>_autogen` target is created at
generate-time, it is not possible to define dependencies of it using
-e.g. :command:`add_dependencies`. Instead the
-``AUTOGEN_ORIGIN_DEPENDS`` target property decides whether the origin
-target dependencies should be forwarded to the ``_autogen`` target or not.
+e.g. :command:`add_dependencies`. Instead the ``AUTOGEN_ORIGIN_DEPENDS``
+target property decides whether the origin target dependencies should be
+forwarded to the :ref:`<ORIGIN>_autogen` target or not.
By default ``AUTOGEN_ORIGIN_DEPENDS`` is initialized from
:variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` which is ``ON`` by default.
-In total the dependencies of the ``_autogen`` target are composed from
+In total the dependencies of the :ref:`<ORIGIN>_autogen` target are composed
+from
- forwarded origin target dependencies
(enabled by default via ``AUTOGEN_ORIGIN_DEPENDS``)
@@ -26,15 +35,14 @@ In total the dependencies of the ``_autogen`` target are composed from
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
-Note
-^^^^
+.. note::
-Disabling ``AUTOGEN_ORIGIN_DEPENDS`` is useful to avoid building of
-origin target dependencies when building the ``_autogen`` target only.
-This is especially interesting when a
-:variable:`global autogen target <CMAKE_GLOBAL_AUTOGEN_TARGET>` is enabled.
+ Disabling ``AUTOGEN_ORIGIN_DEPENDS`` is useful to avoid building of
+ origin target dependencies when building the :ref:`<ORIGIN>_autogen` target
+ only. This is especially interesting when a
+ :variable:`global autogen target <CMAKE_GLOBAL_AUTOGEN_TARGET>` is enabled.
-When the ``_autogen`` target doesn't require all the origin target's
-dependencies, and ``AUTOGEN_ORIGIN_DEPENDS`` is disabled, it might be
-necessary to extend :prop_tgt:`AUTOGEN_TARGET_DEPENDS` to add missing
-dependencies.
+ When the :ref:`<ORIGIN>_autogen` target doesn't require all the origin target's
+ dependencies, and ``AUTOGEN_ORIGIN_DEPENDS`` is disabled, it might be
+ necessary to extend :prop_tgt:`AUTOGEN_TARGET_DEPENDS` to add missing
+ dependencies.
diff --git a/Help/prop_tgt/AUTOGEN_PARALLEL.rst b/Help/prop_tgt/AUTOGEN_PARALLEL.rst
index 663b54e..9d34355 100644
--- a/Help/prop_tgt/AUTOGEN_PARALLEL.rst
+++ b/Help/prop_tgt/AUTOGEN_PARALLEL.rst
@@ -6,9 +6,9 @@ AUTOGEN_PARALLEL
Number of parallel ``moc`` or ``uic`` processes to start when using
:prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
-The custom ``<origin>_autogen`` target starts a number of threads of which
+The custom :ref:`<ORIGIN>_autogen` target starts a number of threads of which
each one parses a source file and on demand starts a ``moc`` or ``uic``
-process. ``AUTOGEN_PARALLEL`` controls how many parallel threads
+process. ``AUTOGEN_PARALLEL`` controls how many parallel threads
(and therefore ``moc`` or ``uic`` processes) are started.
- An empty (or unset) value or the string ``AUTO`` sets the number of
diff --git a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
index 5286d2d..13e2ef7 100644
--- a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
+++ b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
@@ -1,18 +1,28 @@
AUTOGEN_TARGET_DEPENDS
----------------------
-Additional target dependencies of the corresponding ``_autogen`` target.
+Additional target dependencies of the corresponding :ref:`<ORIGIN>_autogen`
+target.
+
+ .. note::
+
+ If Qt 5.15 or later is used and the generator is either :generator:`Ninja`
+ or :ref:`Makefile Generators`, additional target dependencies are added to
+ the :ref:`<ORIGIN>_autogen_timestamp_deps` target instead of the
+ :ref:`<ORIGIN>_autogen` target.
+
Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property
-``ON`` have a corresponding ``_autogen`` target which generates
-``moc`` and ``uic`` files. As this ``_autogen`` target is created at
-generate-time, it is not possible to define dependencies of it using
-e.g. :command:`add_dependencies`. Instead the
-``AUTOGEN_TARGET_DEPENDS`` target property can be set to a
-:ref:`;-list <CMake Language Lists>` of additional dependencies for the
-``_autogen`` target. Dependencies can be target names or file names.
-
-In total the dependencies of the ``_autogen`` target are composed from
+``ON`` have a corresponding :ref:`<ORIGIN>_autogen` target which generates
+``moc`` and ``uic`` files. As this :ref:`<ORIGIN>_autogen` target is created
+at generate-time, it is not possible to define dependencies of it using e.g.
+:command:`add_dependencies`. Instead the ``AUTOGEN_TARGET_DEPENDS`` target
+property can be set to a :ref:`;-list <CMake Language Lists>` of additional
+dependencies for the :ref:`<ORIGIN>_autogen` target. Dependencies can be target
+names or file names.
+
+In total the dependencies of the :ref:`<ORIGIN>_autogen` target are composed
+from
- forwarded origin target dependencies
(enabled by default via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`)
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index 0feb2e8..d4f2b25 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -3,11 +3,13 @@ AUTOMOC
Should the target be processed with auto-moc (for Qt projects).
-``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.
+``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.
Currently, Qt versions 4 to 6 are supported.
+.. _qt5_wrap_cpp(): https://doc.qt.io/qt-5/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.
@@ -240,12 +242,16 @@ e.g. in MSVS.
:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`:
A global ``autogen`` target, that depends on all ``AUTOMOC`` or
-:prop_tgt:`AUTOUIC` generated ``<ORIGIN>_autogen`` targets in the project,
+:prop_tgt:`AUTOUIC` generated :ref:`<ORIGIN>_autogen` targets in the project,
will be generated when this variable is ``ON``.
:prop_tgt:`AUTOGEN_PARALLEL`:
This target property controls the number of ``moc`` or ``uic`` processes to
start in parallel during builds.
+:prop_tgt:`AUTOGEN_COMMAND_LINE_LENGTH_MAX`:
+This target property controls the limit when to use response files for
+``moc`` or ``uic`` processes on Windows.
+
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
diff --git a/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst b/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst
index c4277d7..d571f53 100644
--- a/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst
+++ b/Help/prop_tgt/AUTOMOC_DEPEND_FILTERS.rst
@@ -22,14 +22,14 @@ file gets rebuilt even when the source file itself doesn't change.
If any of the extracted files is :prop_sf:`GENERATED` or if it is not in the
target's sources, then it might be necessary to add it to the
-``_autogen`` target dependencies.
+:ref:`<ORIGIN>_autogen` target dependencies.
See :prop_tgt:`AUTOGEN_TARGET_DEPENDS` for reference.
By default ``AUTOMOC_DEPEND_FILTERS`` is initialized from
:variable:`CMAKE_AUTOMOC_DEPEND_FILTERS`, which is empty by default.
-From Qt 5.15.0 on this variable is ignored as moc is able to output the correct
-dependencies.
+From Qt 5.15.0 on this variable is ignored as ``moc`` is able to output the
+correct dependencies.
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst
index 33de352..fea906c 100644
--- a/Help/prop_tgt/AUTORCC.rst
+++ b/Help/prop_tgt/AUTORCC.rst
@@ -5,9 +5,11 @@ Should the target be processed with auto-rcc (for Qt projects).
``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
+
When this property is ``ON``, CMake will handle ``.qrc`` files added
as target sources at build time and invoke ``rcc`` accordingly.
This property is initialized by the value of the :variable:`CMAKE_AUTORCC`
diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst
index dc854b2..5010220 100644
--- a/Help/prop_tgt/AUTOUIC.rst
+++ b/Help/prop_tgt/AUTOUIC.rst
@@ -5,9 +5,11 @@ Should the target be processed with auto-uic (for Qt projects).
``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
+
This property is initialized by the value of the :variable:`CMAKE_AUTOUIC`
variable if it is set when a target is created.
@@ -74,12 +76,16 @@ e.g. in MSVS.
:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`:
A global ``autogen`` target, that depends on all :prop_tgt:`AUTOMOC` or
-``AUTOUIC`` generated ``<ORIGIN>_autogen`` targets in the project,
+``AUTOUIC`` generated :ref:`<ORIGIN>_autogen` targets in the project,
will be generated when this variable is ``ON``.
:prop_tgt:`AUTOGEN_PARALLEL`:
This target property controls the number of ``moc`` or ``uic`` processes to
start in parallel during builds.
+:prop_tgt:`AUTOGEN_COMMAND_LINE_LENGTH_MAX`:
+This target property controls the limit when to use response files for
+``moc`` or ``uic`` processes on Windows.
+
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
diff --git a/Help/prop_tgt/AUTOUIC_OPTIONS.rst b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
index 425ea1c..d601740 100644
--- a/Help/prop_tgt/AUTOUIC_OPTIONS.rst
+++ b/Help/prop_tgt/AUTOUIC_OPTIONS.rst
@@ -1,6 +1,8 @@
AUTOUIC_OPTIONS
---------------
+.. versionadded:: 3.0
+
Additional options for ``uic`` when using :prop_tgt:`AUTOUIC`
This property holds additional command line options which will be used when
diff --git a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst
index 8b777e4..d09ff19 100644
--- a/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst
+++ b/Help/prop_tgt/CROSSCOMPILING_EMULATOR.rst
@@ -13,6 +13,10 @@ for built target system executables.
Lists>`, then the first value is the command and remaining values are its
arguments.
+.. versionadded:: 3.29
+ Contents of ``CROSSCOMPILING_EMULATOR`` may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
This property is initialized by the value of the
:variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable if it is set when a target
is created.
diff --git a/Help/prop_tgt/CXX_MODULE_STD.rst b/Help/prop_tgt/CXX_MODULE_STD.rst
new file mode 100644
index 0000000..d42699d
--- /dev/null
+++ b/Help/prop_tgt/CXX_MODULE_STD.rst
@@ -0,0 +1,41 @@
+CXX_MODULE_STD
+--------------
+
+.. versionadded:: 3.30
+
+``CXX_MODULE_STD`` is a boolean specifying whether the target may use
+``import std;`` its C++ sources or not.
+
+.. note ::
+
+ This setting is meaningful only when experimental support for ``import
+ std;`` has been enabled by the ``CMAKE_EXPERIMENTAL_CXX_IMPORT_STD`` gate.
+
+When this property is explicitly set to ``ON``, CMake will add a dependency to
+a target which provides the C++ standard library's modules for the C++
+standard applied to the target. This target is only applicable within the
+current build and will not appear in the exported interfaces of the targets.
+When consumed, these targets will be reapplied as necessary.
+
+.. note:
+
+ Similar to the introduction of :prop:`CXX_SCAN_FOR_MODULES`, this property
+ defaults to _not_ adding ``import std`` support to targets using
+ ``cxx_std_23`` without an explicit request in order to preserve existing
+ behavior for projects using C++23 without ``import std``. A future policy
+ to change the default behavior is expected once the feature sees wider
+ usage.
+
+This property's value is not relevant for targets which disable scanning (see
+:prop_tgt:`CXX_SCAN_FOR_MODULES`). Additionally, this property only applies to
+targets utilizing C++23 (``cxx_std_23``) or newer.
+
+The property supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`, however
+expressions that depend upon the configuration, the consuming target, or the
+linker language are not allowed. Whether a target uses ``import std`` should
+not depend upon such things as it is a static property of the target's source
+code.
+
+Targets which are exported with C++ module sources will have this property's
+resolved value exported.
diff --git a/Help/prop_tgt/EXPORT_FIND_PACKAGE_NAME.rst b/Help/prop_tgt/EXPORT_FIND_PACKAGE_NAME.rst
new file mode 100644
index 0000000..b7405d6
--- /dev/null
+++ b/Help/prop_tgt/EXPORT_FIND_PACKAGE_NAME.rst
@@ -0,0 +1,14 @@
+EXPORT_FIND_PACKAGE_NAME
+------------------------
+
+.. note::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES``.
+
+Control the package name associated with a dependency target when exporting a
+:command:`find_dependency` call in :command:`install(EXPORT)` or
+:command:`export(EXPORT)`. This can be used to assign a package name to a
+package that is built by CMake and exported, or to override the package in the
+:command:`find_package` call that created the target.
+
+This property is initialized by :variable:`CMAKE_EXPORT_FIND_PACKAGE_NAME`.
diff --git a/Help/prop_tgt/IMPORTED_LOCATION.rst b/Help/prop_tgt/IMPORTED_LOCATION.rst
index 2351374..b162253 100644
--- a/Help/prop_tgt/IMPORTED_LOCATION.rst
+++ b/Help/prop_tgt/IMPORTED_LOCATION.rst
@@ -32,7 +32,7 @@ listed in the :prop_tgt:`IMPORTED_CONFIGURATIONS` target property may be
selected and its :prop_tgt:`IMPORTED_LOCATION_<CONFIG>` value used.
To get the location of an imported target read one of the :prop_tgt:`LOCATION`
-or ``LOCATION_<CONFIG>`` properties.
+or :prop_tgt:`LOCATION_<CONFIG>` properties.
For platforms with import libraries (e.g. Windows, AIX or Apple) see also
:prop_tgt:`IMPORTED_IMPLIB`.
diff --git a/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst b/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst
index e97d293..2fe011a 100644
--- a/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst
+++ b/Help/prop_tgt/INTERFACE_AUTOUIC_OPTIONS.rst
@@ -1,6 +1,8 @@
INTERFACE_AUTOUIC_OPTIONS
-------------------------
+.. versionadded:: 3.0
+
List of interface options to pass to uic.
Targets may populate this property to publish the options
diff --git a/Help/prop_tgt/LANG_STANDARD.rst b/Help/prop_tgt/LANG_STANDARD.rst
index c83da01..4b59af7 100644
--- a/Help/prop_tgt/LANG_STANDARD.rst
+++ b/Help/prop_tgt/LANG_STANDARD.rst
@@ -18,7 +18,7 @@ controlled with the :prop_tgt:`<LANG>_STANDARD_REQUIRED` target property.
Note that the actual language standard used may be higher than that specified
by ``<LANG>_STANDARD``, regardless of the value of
:prop_tgt:`<LANG>_STANDARD_REQUIRED`. In particular,
-:ref:`transitive usage requirements <Target Usage Requirements>` or the use of
+:ref:`usage requirements <Target Usage Requirements>` or the use of
:manual:`compile features <cmake-compile-features(7)>` can raise the required
language standard above what ``<LANG>_STANDARD`` specifies.
diff --git a/Help/prop_tgt/LANG_STANDARD_REQUIRED.rst b/Help/prop_tgt/LANG_STANDARD_REQUIRED.rst
index e61125b..532057b 100644
--- a/Help/prop_tgt/LANG_STANDARD_REQUIRED.rst
+++ b/Help/prop_tgt/LANG_STANDARD_REQUIRED.rst
@@ -20,7 +20,7 @@ error will be issued if that requirement cannot be met.
Note that the actual language standard used may be higher than that specified
by :prop_tgt:`<LANG>_STANDARD`, regardless of the value of
``<LANG>_STANDARD_REQUIRED``. In particular,
-:ref:`transitive usage requirements <Target Usage Requirements>` or the use of
+:ref:`usage requirements <Target Usage Requirements>` or the use of
:manual:`compile features <cmake-compile-features(7)>` can raise the required
language standard above what :prop_tgt:`<LANG>_STANDARD` specifies.
diff --git a/Help/prop_tgt/LINKER_TYPE.rst b/Help/prop_tgt/LINKER_TYPE.rst
new file mode 100644
index 0000000..0a016fe
--- /dev/null
+++ b/Help/prop_tgt/LINKER_TYPE.rst
@@ -0,0 +1,28 @@
+LINKER_TYPE
+-----------
+
+.. versionadded:: 3.29
+
+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
+
+This property is not supported on :generator:`Green Hills MULTI` and
+:generator:`Visual Studio 9 2008` generators.
+
+The implementation details for the selected linker will be provided by the
+:variable:`CMAKE_<LANG>_USING_LINKER_<TYPE>` variable. For example:
+
+.. code-block:: cmake
+
+ add_library(lib1 SHARED ...)
+ set_property(TARGET lib1 PROPERTY LINKER_TYPE LLD)
+
+This specifies that ``lib1`` should use linker type ``LLD`` for the link step.
+The command line options that will be passed to the toolchain will be provided
+by the ``CMAKE_<LANG>_USING_LINKER_LLD`` variable.
+
+Note that the linker would typically be set using :variable:`CMAKE_LINKER_TYPE`
+for the whole build rather than setting the ``LINKER_TYPE`` property on
+individual targets.
diff --git a/Help/prop_tgt/OBJC_STANDARD.rst b/Help/prop_tgt/OBJC_STANDARD.rst
index 0609239..a3c5653 100644
--- a/Help/prop_tgt/OBJC_STANDARD.rst
+++ b/Help/prop_tgt/OBJC_STANDARD.rst
@@ -20,6 +20,16 @@ Supported values are:
``11``
Objective C11
+``17``
+ .. versionadded:: 3.21
+
+ Objective C17
+
+``23``
+ .. versionadded:: 3.21
+
+ Objective C23
+
If the value requested does not result in a compile flag being added for
the compiler in use, a previous standard flag will be added instead. This
means that using:
diff --git a/Help/prop_tgt/SOURCES.rst b/Help/prop_tgt/SOURCES.rst
index 1ebfa14..1688ef7 100644
--- a/Help/prop_tgt/SOURCES.rst
+++ b/Help/prop_tgt/SOURCES.rst
@@ -18,7 +18,7 @@ evaluate to an absolute path. Not doing so is considered undefined behavior.
Paths that are for files generated by the build will be treated
as relative to the build directory of the target, if the path is not
already specified as an absolute path. Note that whether a file is seen as
-generated may be affected by policy :policy:`CMP0118`.
+generated may be affected by policies :policy:`CMP0118` and :policy:`CMP0163`.
If a path does not start with a generator expression, is not an
absolute path and is not a generated file, it will be treated as relative to
diff --git a/Help/prop_tgt/SOVERSION.rst b/Help/prop_tgt/SOVERSION.rst
index b377f22..4f8b1b5 100644
--- a/Help/prop_tgt/SOVERSION.rst
+++ b/Help/prop_tgt/SOVERSION.rst
@@ -1,15 +1,17 @@
SOVERSION
---------
-What version number is this target.
+ABI version number of a shared library target.
For shared libraries :prop_tgt:`VERSION` and ``SOVERSION`` can be used to
-specify the build version and API version respectively. When building or
+specify the build version and ABI version respectively. When building or
installing appropriate symlinks are created if the platform supports
symlinks and the linker supports so-names. If only one of both is
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
+
Windows Versions
^^^^^^^^^^^^^^^^
diff --git a/Help/prop_tgt/Swift_COMPILATION_MODE-VALUES.txt b/Help/prop_tgt/Swift_COMPILATION_MODE-VALUES.txt
new file mode 100644
index 0000000..b94380a
--- /dev/null
+++ b/Help/prop_tgt/Swift_COMPILATION_MODE-VALUES.txt
@@ -0,0 +1,19 @@
+``incremental``
+ Compiles each Swift source in the module separately, resulting in better
+ parallelism in the build. The compiler emits additional information into
+ the build directory improving rebuild performance when small changes are made
+ to the source between rebuilds. This is the best option to use while
+ iterating on changes in a project.
+
+``wholemodule``
+ Whole-module optimizations are slowest to compile, but results in the most
+ optimized library. The entire context is loaded into once instance of the
+ compiler, so there is no parallelism across source files in the module.
+
+``singlefile``
+ Compiles each source in a Swift modules separately, resulting in better
+ parallelism. Unlike the ``incremental`` build mode, no additional information
+ is emitted by the compiler during the build, so rebuilding after making small
+ changes to the source file will not run faster. This option should be used
+ sparingly, preferring ``incremental`` builds, unless working around a compiler
+ bug.
diff --git a/Help/prop_tgt/Swift_COMPILATION_MODE.rst b/Help/prop_tgt/Swift_COMPILATION_MODE.rst
new file mode 100644
index 0000000..e26474a
--- /dev/null
+++ b/Help/prop_tgt/Swift_COMPILATION_MODE.rst
@@ -0,0 +1,33 @@
+Swift_COMPILATION_MODE
+----------------------
+
+.. versionadded:: 3.29
+
+Specify how Swift compiles a target.
+
+The allowed values are:
+
+.. include:: Swift_COMPILATION_MODE-VALUES.txt
+
+Use :manual:`generator expressions <cmake-generator-expressions(7)>` to support
+per-configuration specification. For example, the code:
+
+.. code-block:: cmake
+
+ add_library(foo foo.swift)
+ set_property(TARGET foo PROPERTY
+ Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release>,wholemodule,incremental>")
+
+sets the Swift compilation mode to wholemodule mode in the release configuration
+and sets the property to incremental mode in other configurations.
+
+The property is initialized from the value of the
+:variable:`CMAKE_Swift_COMPILATION_MODE` variable, if it is set. If the property
+is not set or is empty, then CMake uses the default value ``incremental`` to
+specify the swift compilation mode.
+
+.. note::
+
+ This property only has effect when policy :policy:`CMP0157` is set to ``NEW``
+ prior to the first :command:`project` or :command:`enable_language` command
+ that enables the Swift language.
diff --git a/Help/prop_tgt/TEST_LAUNCHER.rst b/Help/prop_tgt/TEST_LAUNCHER.rst
new file mode 100644
index 0000000..7eec319
--- /dev/null
+++ b/Help/prop_tgt/TEST_LAUNCHER.rst
@@ -0,0 +1,23 @@
+TEST_LAUNCHER
+-------------
+
+.. versionadded:: 3.29
+
+Use the given launcher to run executables.
+This command will be added as a prefix to :command:`add_test` commands
+for build target system executables and is meant to be run on the host
+machine.
+
+It effectively acts as a run script for tests in a similar way
+to how :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` works for compilation.
+
+If this property contains a :ref:`semicolon-separated list <CMake Language
+Lists>`, then the first value is the command and remaining values are its
+arguments.
+
+Contents of ``TEST_LAUNCHER`` may use
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+This property is initialized by the value of the
+:variable:`CMAKE_TEST_LAUNCHER` variable if it is set when a target
+is created.
diff --git a/Help/prop_tgt/UNITY_BUILD.rst b/Help/prop_tgt/UNITY_BUILD.rst
index 9d68250..577b0c9 100644
--- a/Help/prop_tgt/UNITY_BUILD.rst
+++ b/Help/prop_tgt/UNITY_BUILD.rst
@@ -30,11 +30,23 @@ values:
If no explicit :prop_tgt:`UNITY_BUILD_MODE` has been specified, CMake will
default to ``BATCH``.
-Unity builds are not currently supported for all languages. CMake version
-|release| supports combining ``C`` and ``CXX`` source files. For targets that
-mix source files from more than one language, CMake will separate the languages
-such that each generated unity source file only contains sources for a single
-language.
+Unity builds are supported for the following languages:
+
+``C``
+ .. versionadded:: 3.16
+
+``CXX``
+ .. versionadded:: 3.16
+
+``OBJC``
+ .. versionadded:: 3.29
+
+``OBJCXX``
+ .. versionadded:: 3.29
+
+For targets that mix source files from more than one language, CMake
+separates the languages such that each generated unity source file only
+contains sources for a single language.
This property is initialized by the value of the :variable:`CMAKE_UNITY_BUILD`
variable when a target is created.
diff --git a/Help/prop_tgt/VERSION.rst b/Help/prop_tgt/VERSION.rst
index 95db483..f9cb020 100644
--- a/Help/prop_tgt/VERSION.rst
+++ b/Help/prop_tgt/VERSION.rst
@@ -1,10 +1,10 @@
VERSION
-------
-What version number is this target.
+Version number of a shared library target.
For shared libraries ``VERSION`` and :prop_tgt:`SOVERSION` can be used
-to specify the build version and API version respectively. When building or
+to specify the build version and ABI version respectively. When building or
installing appropriate symlinks are created if the platform supports
symlinks and the linker supports so-names. If only one of both is
specified the missing is assumed to have the same version number. For
@@ -12,6 +12,8 @@ executables ``VERSION`` can be used to specify the build version. When
building or installing appropriate symlinks are created if the
platform supports symlinks.
+.. include:: VERSION_SOVERSION_EXAMPLE.txt
+
Windows Versions
^^^^^^^^^^^^^^^^
diff --git a/Help/prop_tgt/VERSION_SOVERSION_EXAMPLE.txt b/Help/prop_tgt/VERSION_SOVERSION_EXAMPLE.txt
new file mode 100644
index 0000000..ff2a958
--- /dev/null
+++ b/Help/prop_tgt/VERSION_SOVERSION_EXAMPLE.txt
@@ -0,0 +1,9 @@
+A common convention is to specify both ``VERSION`` and ``SOVERSION``
+such that ``SOVERSION`` matches the first component of ``VERSION``:
+
+.. code-block:: cmake
+
+ set_target_properties(mylib PROPERTIES VERSION 1.2.3 SOVERSION 1)
+
+The idea is that breaking changes to the ABI increment both the
+``SOVERSION`` and the major ``VERSION`` number.
diff --git a/Help/prop_tgt/VS_FILTER_PROPS.rst b/Help/prop_tgt/VS_FILTER_PROPS.rst
new file mode 100644
index 0000000..3de0a16
--- /dev/null
+++ b/Help/prop_tgt/VS_FILTER_PROPS.rst
@@ -0,0 +1,10 @@
+VS_FILTER_PROPS
+---------------
+
+.. versionadded:: 3.30
+
+Sets the filter props file to be included in the visual studio
+C++ project filter file.
+
+The ``*.filter.props`` files can be used for Visual Studio wide
+configuration which is independent from cmake.
diff --git a/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES-PURPOSE.txt b/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES-PURPOSE.txt
new file mode 100644
index 0000000..8d3714e
--- /dev/null
+++ b/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES-PURPOSE.txt
@@ -0,0 +1,18 @@
+Indicate to :ref:`Visual Studio Generators` what configurations are considered
+debug configurations. This controls the ``UseDebugLibraries`` setting in
+each configuration of a ``.vcxproj`` file.
+
+The "Use Debug Libraries" setting in Visual Studio projects, despite its
+specific-sounding name, is a general-purpose indicator of what configurations
+are considered debug configurations. In standalone projects, this may affect
+MSBuild's default selection of MSVC runtime library, optimization flags,
+runtime checks, and similar settings. In CMake projects those settings are
+typically generated explicitly based on the project's specification, e.g.,
+the MSVC runtime library is controlled by |MSVC_RUNTIME_LIBRARY|. However,
+the ``UseDebugLibraries`` indicator is useful for reference by both humans
+and tools, and may also affect the behavior of platform-specific SDKs.
+
+Set |VS_USE_DEBUG_LIBRARIES| to a true or false value to indicate whether
+each configuration is considered a debug configuration. The value may also
+be the empty string (``""``) in which case no ``UseDebugLibraries`` will be
+added explicitly by CMake, and MSBuild will use its default value, ``false``.
diff --git a/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES.rst b/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES.rst
new file mode 100644
index 0000000..3d5ada4
--- /dev/null
+++ b/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES.rst
@@ -0,0 +1,28 @@
+VS_USE_DEBUG_LIBRARIES
+----------------------
+
+.. versionadded:: 3.30
+
+.. |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
+
+Use :manual:`generator expressions <cmake-generator-expressions(7)>`
+for per-configuration specification. For example, the code:
+
+.. code-block:: cmake
+
+ add_executable(foo foo.c)
+ set_property(TARGET foo PROPERTY
+ VS_USE_DEBUG_LIBRARIES "$<CONFIG:Debug,Custom>")
+
+indicates that target ``foo`` considers its "Debug" and "Custom"
+configurations to be debug configurations, and its other configurations
+to be non-debug configurations.
+
+The property is initialized from the value of the
+:variable:`CMAKE_VS_USE_DEBUG_LIBRARIES` variable, if it is set.
+If the property is not set then CMake generates ``UseDebugLibraries`` using
+heuristics to determine which configurations are debug configurations.
+See policy :policy:`CMP0162`.
diff --git a/Help/prop_tgt/XCODE_EMBED_type.rst b/Help/prop_tgt/XCODE_EMBED_type.rst
index e27d905..0354f97 100644
--- a/Help/prop_tgt/XCODE_EMBED_type.rst
+++ b/Help/prop_tgt/XCODE_EMBED_type.rst
@@ -43,6 +43,28 @@ The supported values for ``<type>`` are:
The specified items will be added to the ``Embed Resources`` build phase.
They must be CMake target names or folder paths.
+``XPC_SERVICES``
+ .. versionadded:: 3.29
+
+ The specified items will be added to the ``Embed XPC Services`` build phase.
+ They must be CMake target names.
+
+When listing a target as any of the things to embed, Xcode must see that target
+as part of the same Xcode project, or a sub-project of the one defining the
+bundle. In order to satisfy this constraint, the CMake project must ensure
+at least one of the following:
+
+* The :variable:`CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY` variable is set
+ to true in the top level ``CMakeLists.txt`` file. This is the simplest and
+ most robust approach.
+* Define the target-to-embed in a subdirectory of the one that defines the
+ target being embedded into.
+* If the target-to-embed and the target being embedded into are in separate,
+ unrelated directories (i.e. they are siblings, not one a parent of the
+ other), ensure they have a common :command:`project` call in a parent
+ directory and no other :command:`project` calls between themselves and that
+ common :command:`project` call.
+
See also :prop_tgt:`XCODE_EMBED_<type>_PATH`,
:prop_tgt:`XCODE_EMBED_<type>_REMOVE_HEADERS_ON_COPY` and
:prop_tgt:`XCODE_EMBED_<type>_CODE_SIGN_ON_COPY`.
diff --git a/Help/prop_tgt/XCODE_EMBED_type_PATH.rst b/Help/prop_tgt/XCODE_EMBED_type_PATH.rst
index ef04d14..255aa68 100644
--- a/Help/prop_tgt/XCODE_EMBED_type_PATH.rst
+++ b/Help/prop_tgt/XCODE_EMBED_type_PATH.rst
@@ -25,3 +25,6 @@ The supported values for ``<type>`` are:
``RESOURCES``
.. versionadded:: 3.28
+
+``XPC_SERVICES``
+ .. versionadded:: 3.29
diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst
index 5fedf7d..ab59ee2 100644
--- a/Help/release/3.14.rst
+++ b/Help/release/3.14.rst
@@ -302,7 +302,7 @@ Autogen
* A new :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` variable and
:prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` target property may be set to enable or
disable forwarding of the origin target dependencies to the corresponding
- ``_autogen`` target.
+ :ref:`<ORIGIN>_autogen` target.
CTest
-----
diff --git a/Help/release/3.20.rst b/Help/release/3.20.rst
index ebd0f91..51e4594 100644
--- a/Help/release/3.20.rst
+++ b/Help/release/3.20.rst
@@ -147,8 +147,9 @@ Properties
for the associated :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` variable
to allow for configuration of exporting compile commands per target.
-* The :prop_sf:`GENERATED` source-file property is now visible
- from any directory scope, regardless of the scope in which it is set.
+* Generated sources may be used across directories without manual marking.
+ Additionally, the :prop_sf:`GENERATED` source file property can no longer be
+ turned off once turned on, nor can it be set to other than boolean values.
See policy :policy:`CMP0118`.
* The :prop_tgt:`UNITY_BUILD_UNIQUE_ID` target property
diff --git a/Help/release/3.22.rst b/Help/release/3.22.rst
index eba5d66..2d060ac 100644
--- a/Help/release/3.22.rst
+++ b/Help/release/3.22.rst
@@ -19,7 +19,7 @@ Commands
* The :command:`string(TIMESTAMP)` command now supports the ``%V``
specifier for ISO 8601 week numbers.
-.. _`OS identification variables`: https://www.freedesktop.org/software/systemd/man/os-release.html
+.. _`OS identification variables`: https://www.freedesktop.org/software/systemd/man/latest/os-release.html
Variables
---------
diff --git a/Help/release/3.25.rst b/Help/release/3.25.rst
index cb6984c..646c5ba 100644
--- a/Help/release/3.25.rst
+++ b/Help/release/3.25.rst
@@ -27,9 +27,7 @@ Presets
Languages
---------
-* The :manual:`Compile Features <cmake-compile-features(7)>` functionality
- is now aware of C++26, and defines a ``cxx_std_26`` meta-feature.
- C++26 compiler modes may also be specified via the :prop_tgt:`CXX_STANDARD`,
+* C++26 compiler modes may now be specified via the :prop_tgt:`CXX_STANDARD`,
:prop_tgt:`CUDA_STANDARD`, :prop_tgt:`HIP_STANDARD`,
or :prop_tgt:`OBJCXX_STANDARD` target properties.
diff --git a/Help/release/3.29.rst b/Help/release/3.29.rst
new file mode 100644
index 0000000..302bdf4
--- /dev/null
+++ b/Help/release/3.29.rst
@@ -0,0 +1,220 @@
+CMake 3.29 Release Notes
+************************
+
+.. only:: html
+
+ .. contents::
+
+Changes made since CMake 3.28 include the following.
+
+New Features
+============
+
+Command-Line
+------------
+
+* :manual:`cmake(1)` :option:`-E cat <cmake-E cat>` can now print the standard
+ input by passing the ``-`` argument.
+
+Generators
+----------
+
+* :ref:`Visual Studio Generators` now support selecting between the
+ Intel oneAPI Fortran compiler (``ifx``) and the Intel classic Fortran
+ compiler (``ifort``) using a ``fortran=`` field in
+ :variable:`CMAKE_GENERATOR_TOOLSET`.
+
+File-Based API
+--------------
+
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
+ been updated to 2.7.
+
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained
+ a new "launchers" field.
+
+Compilers
+---------
+
+* The LLVM/Clang GNU-like frontend on Windows (``clang++``) may now be used
+ to compile ``CUDA`` language sources.
+
+* Compilers targeting the GNU ABI on Windows (MinGW) may now be used to
+ compile Objective C (``OBJC``) and Objective C++ (``OBJCXX``). These
+ include GNU compilers (``gcc`` and ``g++``) and the LLVM/Clang GNU-like
+ frontends (``clang`` and ``clang++``).
+
+* TI Clang-based compilers are now supported with
+ :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` ``TIClang``.
+
+Commands
+--------
+
+* The :ref:`add_custom_command(TARGET) <add_custom_command(TARGET)>`
+ signature now supports adding build events through :ref:`Alias Targets`.
+
+* The :command:`cmake_language(EXIT)` sub-command was added to terminate
+ :option:`cmake -P` scripts with a specified exit code.
+
+* The :command:`export(SETUP)` sub-command was added to configure export sets.
+ Its ``TARGET`` option's ``XCFRAMEWORK_LOCATION`` setting specifies the
+ location of a ``.xcframework`` that can be substituted for an installed
+ target.
+
+* The :command:`if` command gained new tests ``IS_READABLE``, ``IS_WRITABLE``
+ and ``IS_EXECUTABLE`` to check file or directory permissions.
+
+Variables
+---------
+
+* The :envvar:`CMAKE_INSTALL_PREFIX` environment variable was added to
+ provide a default value for the :variable:`CMAKE_INSTALL_PREFIX` variable.
+
+* The :variable:`CMAKE_LINKER_TYPE` variable and corresponding
+ :prop_tgt:`LINKER_TYPE` target property were added to specify
+ what linker to use with some toolchains.
+
+* The :variable:`CMAKE_<LANG>_COMPILER_LINKER`,
+ :variable:`CMAKE_<LANG>_COMPILER_LINKER_ID`,
+ :variable:`CMAKE_<LANG>_COMPILER_LINKER_VERSION` and
+ :variable:`CMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANT` variables
+ were added to describe the linker used by the language's link step.
+
+* The :variable:`CMAKE_PROJECT_INCLUDE`,
+ :variable:`CMAKE_PROJECT_INCLUDE_BEFORE`,
+ :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`, and
+ :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE` variables learned
+ to support a :ref:`semicolon-separated list <CMake Language Lists>` of
+ CMake language files to be included sequentially. These variables can also
+ reference module names to be found in :variable:`CMAKE_MODULE_PATH` or
+ builtin to CMake.
+
+* The :variable:`CMAKE_SKIP_TEST_ALL_DEPENDENCY` variable was added
+ to control whether the ``test`` (or ``RUN_TESTS``) buildsystem
+ target depends on the ``all`` (or ``ALL_BUILD``) target.
+
+* A :variable:`CMAKE_TEST_LAUNCHER` variable and corresponding
+ :prop_tgt:`TEST_LAUNCHER` target property were added to specify
+ a launcher to be used by executable targets when invoked by
+ tests added by the :command:`add_test` command.
+
+Properties
+----------
+
+* The :prop_tgt:`CROSSCOMPILING_EMULATOR` target property now
+ supports :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+* The :prop_tgt:`UNITY_BUILD` target property now supports the
+ Objective C (``OBJC``) and Objective C++ (``OBJCXX``) languages.
+
+* The :prop_tgt:`XCODE_EMBED_XPC_SERVICES <XCODE_EMBED_<type>>` target property
+ was added to tell the :generator:`Xcode` generator what targets to put in
+ the ``Embed XPC Resources`` build phase.
+
+Modules
+-------
+
+* The :module:`CMakePackageConfigHelpers` module gained new
+ :command:`generate_apple_platform_selection_file` and
+ :command:`generate_apple_architecture_selection_file` functions, which can
+ be used to generate a file that includes another Apple-platform-specific
+ file or the includes an architecture-specific implementation of a package
+ for an Apple platform, respectively.
+
+* The :module:`FindOpenGL` module learned to find a GLU include
+ directory different than the GL include directory. A new
+ ``OPENGL_INCLUDE_DIRS`` result variable provides all include
+ directories.
+
+CTest
+-----
+
+* :manual:`ctest(1)` gained a :option:`--http-header <ctest --http-header>`
+ option to add custom headers on submission to CDash.
+
+* :manual:`ctest(1)` gained the :option:`--tests-from-file <ctest
+ --tests-from-file>` and :option:`--exclude-from-file <ctest
+ --exclude-from-file>` options to run or exclude tests named in a file.
+
+* :manual:`ctest(1)` now supports :ref:`job server integration
+ <ctest-job-server-integration>` on POSIX systems.
+
+* The :option:`ctest -j` option may now be given without a value to let
+ ctest choose a default level of parallelism, or with ``0`` to let ctest
+ use unbounded parallelism. The corresponding :envvar:`CTEST_PARALLEL_LEVEL`
+ environment variable, if set to the empty string, is now equivalent to
+ passing ``-j`` with no value.
+
+* The :command:`ctest_test` command gained options
+ ``INCLUDE_FROM_FILE`` and ``EXCLUDE_FROM_FILE`` to run or exclude
+ tests named in a file.
+
+CPack
+-----
+
+* The :cpack_gen:`CPack DEB Generator` :variable:`CPACK_DEBIAN_FILE_NAME`
+ variable may now be set without any suffix, and the ``.deb`` suffix
+ will be added automatically.
+
+* The :cpack_gen:`CPack RPM Generator` :variable:`CPACK_RPM_FILE_NAME`
+ variable may now be set without any suffix, and the ``.rpm`` suffix
+ will be added automatically.
+
+* The :cpack_gen:`CPack WIX Generator` gained a new variable,
+ :variable:`CPACK_WIX_INSTALL_SCOPE`, to control the
+ ``InstallScope`` property of WiX MSI installers.
+
+Other Changes
+=============
+
+* CMake learned to de-duplicate libraries on link lines based on linker
+ capabilities. See policy :policy:`CMP0156`.
+
+* The :command:`add_test` command now honors
+ :variable:`CMAKE_CROSSCOMPILING_EMULATOR` only when cross-compiling.
+ See policy :policy:`CMP0158`.
+
+* On Windows, when targeting the MSVC ABI, the :command:`find_library` command
+ now accepts ``.a`` file names after first considering ``.lib``. This is
+ symmetric with existing behavior when targeting the GNU ABI, in which the
+ command accepts ``.lib`` file names after first considering ``.a``.
+
+* On Windows, when targeting the MSVC ABI, the :command:`find_library` command
+ now considers ``.dll.lib`` file names before ``.lib``. This is the default
+ suffix for DLL import libraries created by Rust toolchains for the MSVC ABI.
+
+* The :generator:`Ninja` and :generator:`NMake Makefiles` generators now use
+ the ``-external:I`` flag for system includes when using IntelLLVM as of
+ version 2021.4. The ``-external:W0`` flag is also used as of version 2022.2.
+
+* The :command:`create_test_sourcelist` command now provides a full path to
+ the generated driver source file.
+
+* The :variable:`CPACK_PRODUCTBUILD_DOMAINS` variable now defaults to true.
+ See policy :policy:`CMP0161`.
+
+* The :cpack_gen:`CPack WIX Generator` now produces WiX MSI installers
+ that create start menu and uninstall entries for all users by default,
+ as documented by the :variable:`CPACK_WIX_INSTALL_SCOPE` variable
+ ``perMachine`` value. Previously, without a custom WiX template,
+ it produced installers that would only create start menu and uninstall
+ entries for the current user, even though they install for all users.
+
+Updates
+=======
+
+Changes made since CMake 3.29.0 include the following.
+
+3.29.1
+------
+
+* The :variable:`CMAKE_LINKER_TYPE` variable and corresponding
+ :prop_tgt:`LINKER_TYPE` target property now work with compilers
+ for the ``Swift`` language.
+
+3.29.2
+------
+
+* 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/3.6.rst b/Help/release/3.6.rst
index cc0d5da..63e3134 100644
--- a/Help/release/3.6.rst
+++ b/Help/release/3.6.rst
@@ -122,7 +122,7 @@ Modules
from git repositories.
* The :module:`FindBLAS` and :module:`FindLAPACK` modules learned to
- support `OpenBLAS <http://www.openblas.net>`__.
+ support `OpenBLAS <https://www.openblas.net>`__.
* The :module:`FindCUDA` module learned to find the ``cublas_device`` library.
diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst
new file mode 100644
index 0000000..e4cc01e
--- /dev/null
+++ b/Help/release/dev/0-sample-topic.rst
@@ -0,0 +1,7 @@
+0-sample-topic
+--------------
+
+* This is a sample release note for the change in a topic.
+ Developers should add similar notes for each topic branch
+ making a noteworthy change. Each document should be named
+ and titled to match the topic name to avoid merge conflicts.
diff --git a/Help/release/dev/CXX_MODULE_STD-property.rst b/Help/release/dev/CXX_MODULE_STD-property.rst
new file mode 100644
index 0000000..50febf4
--- /dev/null
+++ b/Help/release/dev/CXX_MODULE_STD-property.rst
@@ -0,0 +1,5 @@
+CXX_MODULE_STD-property
+-----------------------
+
+* The :prop_tgt:`CXX_MODULE_STD` property may be used to control
+ ``import std;`` support for targets.
diff --git a/Help/release/dev/FindBacktrace-imported-library.rst b/Help/release/dev/FindBacktrace-imported-library.rst
new file mode 100644
index 0000000..ffb8d66
--- /dev/null
+++ b/Help/release/dev/FindBacktrace-imported-library.rst
@@ -0,0 +1,4 @@
+FindBacktrace-imported-library
+------------------------------
+
+* The :module:`FindBacktrace` module now provides an imported target.
diff --git a/Help/release/dev/FindCUDAToolkit-nvfatbin.rst b/Help/release/dev/FindCUDAToolkit-nvfatbin.rst
new file mode 100644
index 0000000..f8bb624
--- /dev/null
+++ b/Help/release/dev/FindCUDAToolkit-nvfatbin.rst
@@ -0,0 +1,5 @@
+FindCUDAToolkit-nvfatbin
+------------------------
+
+* The :module:`FindCUDAToolkit` module now provides a target for
+ ``libnvfatbin`` and ``libnvfatbin_static``, if found.
diff --git a/Help/release/dev/FindOpenMP-runtime-msvc.rst b/Help/release/dev/FindOpenMP-runtime-msvc.rst
new file mode 100644
index 0000000..76df237
--- /dev/null
+++ b/Help/release/dev/FindOpenMP-runtime-msvc.rst
@@ -0,0 +1,5 @@
+FindOpenMP-runtime-msvc
+-----------------------
+
+* The :module:`FindOpenMP` module gained a ``OpenMP_RUNTIME_MSVC``
+ option to control the OpenMP runtime used with MSVC.
diff --git a/Help/release/dev/add_library-no-static-fallback.rst b/Help/release/dev/add_library-no-static-fallback.rst
new file mode 100644
index 0000000..72de12b
--- /dev/null
+++ b/Help/release/dev/add_library-no-static-fallback.rst
@@ -0,0 +1,6 @@
+add_library-no-static-fallback
+------------------------------
+
+* On platforms that do not support shared libraries, the :command:`add_library`
+ command now rejects creation of shared libraries instead of automatically
+ converting them to static libraries. See policy :policy:`CMP0164`.
diff --git a/Help/release/dev/cpack-innosetup-linux.rst b/Help/release/dev/cpack-innosetup-linux.rst
new file mode 100644
index 0000000..8909ca9
--- /dev/null
+++ b/Help/release/dev/cpack-innosetup-linux.rst
@@ -0,0 +1,5 @@
+cpack-innosetup-linux
+---------------------
+
+* The :cpack_gen:`CPack Inno Setup Generator` is now available
+ on non-Windows hosts.
diff --git a/Help/release/dev/cpack-wix.rst b/Help/release/dev/cpack-wix.rst
new file mode 100644
index 0000000..020dfeb
--- /dev/null
+++ b/Help/release/dev/cpack-wix.rst
@@ -0,0 +1,5 @@
+cpack-wix
+---------
+
+* The :cpack_gen:`CPack WIX Generator` gained support for WiX Toolset v4.
+ See the :variable:`CPACK_WIX_VERSION` variable.
diff --git a/Help/release/dev/curl-tls-version.rst b/Help/release/dev/curl-tls-version.rst
new file mode 100644
index 0000000..26d03ad
--- /dev/null
+++ b/Help/release/dev/curl-tls-version.rst
@@ -0,0 +1,26 @@
+curl-tls-version
+----------------
+
+* The :command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands
+ gained a ``TLS_VERSION <min>`` option to specify the minimum TLS
+ version for connections to ``https://`` URLs.
+
+* The :variable:`CMAKE_TLS_VERSION` variable and :envvar:`CMAKE_TLS_VERSION`
+ environment variable were added to specify a default minimum TLS version
+ for connections to ``https://`` URLs by the :command:`file(DOWNLOAD)`
+ and :command:`file(UPLOAD)` commands.
+
+* The :envvar:`CMAKE_TLS_VERIFY` environment variable was added as a fallback
+ to the existing :variable:`CMAKE_TLS_VERIFY` variable. It specifies
+ whether to verify the server certificate for ``https://`` URLs by default.
+
+* The :module:`ExternalProject` module's :command:`ExternalProject_Add`
+ command gained a ``TLS_VERSION <min>`` option, and support for the
+ :variable:`CMAKE_TLS_VERSION` variable and :envvar:`CMAKE_TLS_VERSION`
+ environment variable, to specify the minimum TLS version for connections
+ to ``https://`` URLs.
+
+* The :command:`ctest_submit` command and :option:`ctest -T Submit <ctest -T>`
+ step gained ``TLSVersion`` and ``TLSVerify`` options to control negotiation
+ with ``https://`` URLs. See the :variable:`CTEST_TLS_VERSION` and
+ :variable:`CTEST_TLS_VERIFY` variables.
diff --git a/Help/release/dev/cxx-26.rst b/Help/release/dev/cxx-26.rst
new file mode 100644
index 0000000..08e3fdd
--- /dev/null
+++ b/Help/release/dev/cxx-26.rst
@@ -0,0 +1,8 @@
+cxx-26
+------
+
+* The :manual:`Compile Features <cmake-compile-features(7)>` functionality
+ now implements support for the ``cxx_std_26`` and ``cuda_std_26``
+ meta-features to indicate that the compiler mode must be at least C++26.
+ These meta-features were first documented by CMake 3.25, but were not fully
+ implemented.
diff --git a/Help/release/dev/enable_language-before-project.rst b/Help/release/dev/enable_language-before-project.rst
new file mode 100644
index 0000000..2b1fd1d
--- /dev/null
+++ b/Help/release/dev/enable_language-before-project.rst
@@ -0,0 +1,6 @@
+enable_language-before-project
+------------------------------
+
+* The :command:`enable_language` command now fails with an error
+ if it is called before the first :command:`project` call.
+ See policy :policy:`CMP0165`.
diff --git a/Help/release/dev/fileapi-provide-glob-dependent.rst b/Help/release/dev/fileapi-provide-glob-dependent.rst
new file mode 100644
index 0000000..fa02272
--- /dev/null
+++ b/Help/release/dev/fileapi-provide-glob-dependent.rst
@@ -0,0 +1,9 @@
+fileapi-provide-glob-dependent
+------------------------------
+
+* The :manual:`cmake-file-api(7)` "cmakeFiles" version 1 object's ``version``
+ field has been updated to 1.1.
+
+* The :manual:`cmake-file-api(7)` "cmakeFiles" version 1 object gained a
+ ``globsDependent`` field to report :command:`file(GLOB)` calls using
+ ``CONFIGURE_DEPENDS``.
diff --git a/Help/release/dev/genex-link-properties.rst b/Help/release/dev/genex-link-properties.rst
new file mode 100644
index 0000000..e1e84e0
--- /dev/null
+++ b/Help/release/dev/genex-link-properties.rst
@@ -0,0 +1,8 @@
+genex-link-properties
+---------------------
+
+* The :genex:`TARGET_PROPERTY` generator expression now evaluates target
+ properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
+ :prop_tgt:`INTERFACE_LINK_DIRECTORIES`, and
+ :prop_tgt:`INTERFACE_LINK_DEPENDS` correctly by following private
+ dependencies of static libraries. See policy :policy:`CMP0166`.
diff --git a/Help/release/dev/genex-quote.rst b/Help/release/dev/genex-quote.rst
new file mode 100644
index 0000000..61bcfc0
--- /dev/null
+++ b/Help/release/dev/genex-quote.rst
@@ -0,0 +1,4 @@
+genex-quote
+-----------
+
+* The :genex:`$<QUOTE>` generator expression was added to evaluate to ``"``.
diff --git a/Help/release/dev/lang-standard-latest.rst b/Help/release/dev/lang-standard-latest.rst
new file mode 100644
index 0000000..b4713b6
--- /dev/null
+++ b/Help/release/dev/lang-standard-latest.rst
@@ -0,0 +1,5 @@
+lang-standard-latest
+--------------------
+
+* The :variable:`CMAKE_<LANG>_STANDARD_LATEST` variable was added to
+ describe the latest supported standard of language ``<LANG>``.
diff --git a/Help/release/dev/preset-includes-macro-expansion.rst b/Help/release/dev/preset-includes-macro-expansion.rst
new file mode 100644
index 0000000..83aace4
--- /dev/null
+++ b/Help/release/dev/preset-includes-macro-expansion.rst
@@ -0,0 +1,7 @@
+preset-includes-macro-expansion
+-------------------------------
+
+* :manual:`cmake-presets(7)` files now support schema version ``9``:
+
+ * ``include`` fields now expand all macros except ``$env{}`` and
+ preset-specific macros.
diff --git a/Help/release/dev/prop-GENERATED-visibility.rst b/Help/release/dev/prop-GENERATED-visibility.rst
new file mode 100644
index 0000000..33f28d9
--- /dev/null
+++ b/Help/release/dev/prop-GENERATED-visibility.rst
@@ -0,0 +1,6 @@
+prop-GENERATED-visibility
+-------------------------
+
+* The :prop_sf:`GENERATED` source file property is now visible in all
+ directories. See policy :policy:`CMP0163`. Policy :policy:`CMP0118`'s
+ documentation has been revised to describe its actual effects.
diff --git a/Help/release/dev/rel-win-PATH.rst b/Help/release/dev/rel-win-PATH.rst
new file mode 100644
index 0000000..f4a7360
--- /dev/null
+++ b/Help/release/dev/rel-win-PATH.rst
@@ -0,0 +1,8 @@
+rel-win-PATH
+------------
+
+* The precompiled Windows ``.msi`` installers provided on
+ `cmake.org <https://cmake.org/download/>`_, when performing a fresh
+ installation, now modify the system-wide ``PATH`` by default.
+ When replacing an existing installation, the ``PATH`` modification
+ preference is preserved by default.
diff --git a/Help/release/dev/rel-zip-newlines.rst b/Help/release/dev/rel-zip-newlines.rst
new file mode 100644
index 0000000..43de464
--- /dev/null
+++ b/Help/release/dev/rel-zip-newlines.rst
@@ -0,0 +1,6 @@
+rel-zip-newlines
+----------------
+
+* The official ``.zip`` source archive provided on
+ `cmake.org <https://cmake.org/download/>`_ now uses LF newlines,
+ instead of CRLF newlines, for consistency with modern conventions.
diff --git a/Help/release/dev/vs-UseDebugLibraries.rst b/Help/release/dev/vs-UseDebugLibraries.rst
new file mode 100644
index 0000000..b3774a9
--- /dev/null
+++ b/Help/release/dev/vs-UseDebugLibraries.rst
@@ -0,0 +1,10 @@
+vs-UseDebugLibraries
+--------------------
+
+* :ref:`Visual Studio Generators` now add ``UseDebugLibraries`` indicators to
+ ``.vcxproj`` files to denote which configurations are debug configurations.
+ See policy :policy:`CMP0162`.
+
+* The :variable:`CMAKE_VS_USE_DEBUG_LIBRARIES` variable and corresponding
+ :prop_tgt:`VS_USE_DEBUG_LIBRARIES` target property were added to explicitly
+ control ``UseDebugLibraries`` indicators in ``.vcxproj`` files.
diff --git a/Help/release/dev/vs-filter-props.rst b/Help/release/dev/vs-filter-props.rst
new file mode 100644
index 0000000..5a09511
--- /dev/null
+++ b/Help/release/dev/vs-filter-props.rst
@@ -0,0 +1,6 @@
+vs-filter-props
+---------------
+
+* A :prop_tgt:`VS_FILTER_PROPS` target property was added to tell
+ :ref:`Visual Studio Generators` for VS 2010 and above to use a
+ custom MSBuild filter ``.props`` file.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index b84bdb4..a809467 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -7,12 +7,15 @@ CMake Release Notes
This file should include the adjacent "dev.txt" file
in development versions but not in release versions.
+.. include:: dev.txt
+
Releases
========
.. toctree::
:maxdepth: 1
+ 3.29 <3.29>
3.28 <3.28>
3.27 <3.27>
3.26 <3.26>
diff --git a/Help/variable/BUILD_SHARED_LIBS.rst b/Help/variable/BUILD_SHARED_LIBS.rst
index 53087b2..0e80f42 100644
--- a/Help/variable/BUILD_SHARED_LIBS.rst
+++ b/Help/variable/BUILD_SHARED_LIBS.rst
@@ -1,10 +1,43 @@
BUILD_SHARED_LIBS
-----------------
-Global flag to cause :command:`add_library` to create shared libraries if on.
+Tell :command:`add_library` to default to ``SHARED`` libraries,
+instead of ``STATIC`` libraries, when called with no explicit library type.
-If present and true, this will cause all libraries to be built shared
-unless the library was explicitly added as a static library. This
-variable is often added to projects as an :command:`option` so that each user
-of a project can decide if they want to build the project using shared or
-static libraries.
+Calls to :command:`add_library` without any explicit library type check
+the current ``BUILD_SHARED_LIBS`` variable value. If it is true, then the
+default library type is ``SHARED``. Otherwise, the default is ``STATIC``.
+
+For example, the code:
+
+.. code-block:: cmake
+
+ add_library(example ${sources})
+
+behaves as if written
+
+.. code-block:: cmake
+
+ if(BUILD_SHARED_LIBS)
+ add_library(example SHARED ${sources})
+ else()
+ add_library(example STATIC ${sources})
+ endif()
+
+CMake does not define ``BUILD_SHARED_LIBS`` by default, but projects
+often create a cache entry for it using the :command:`option` command:
+
+.. code-block:: cmake
+
+ option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+This provides a switch that users can control, e.g., with :option:`cmake -D`.
+If adding such an option to the project, do so in the top level
+``CMakeLists.txt`` file, before any :command:`add_library` calls.
+Note that if bringing external dependencies directly into the build, such as
+with :module:`FetchContent` or a direct call to :command:`add_subdirectory`,
+and one of those dependencies has such a call to
+:command:`option(BUILD_SHARED_LIBS ...) <option>`, the top level project must
+also call :command:`option(BUILD_SHARED_LIBS ...) <option>` before bringing in
+its dependencies. Failure to do so can lead to different behavior between the
+first and subsequent CMake runs.
diff --git a/Help/variable/CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG.rst b/Help/variable/CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG.rst
new file mode 100644
index 0000000..223cfcc
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG.rst
@@ -0,0 +1,10 @@
+CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG
+---------------------------------------
+
+.. versionadded:: 3.29
+
+This variable is used to initialize the
+:prop_tgt:`AUTOGEN_BETTER_GRAPH_MULTI_CONFIG` property on all targets as they
+are created. See that target property for additional information.
+
+By default ``CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG`` is unset.
diff --git a/Help/variable/CMAKE_AUTOGEN_COMMAND_LINE_LENGTH_MAX.rst b/Help/variable/CMAKE_AUTOGEN_COMMAND_LINE_LENGTH_MAX.rst
new file mode 100644
index 0000000..eabda43
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOGEN_COMMAND_LINE_LENGTH_MAX.rst
@@ -0,0 +1,10 @@
+CMAKE_AUTOGEN_COMMAND_LINE_LENGTH_MAX
+-------------------------------------
+
+.. versionadded:: 3.29
+
+Command line length limit for autogen targets, i.e. ``moc`` or ``uic``,
+that triggers the use of response files on Windows instead of passing all
+arguments to the command line.
+
+By default ``CMAKE_AUTOGEN_COMMAND_LINE_LENGTH_MAX`` is unset.
diff --git a/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst
index f490974..52aa891 100644
--- a/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst
+++ b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst
@@ -4,7 +4,14 @@ CMAKE_AUTOGEN_ORIGIN_DEPENDS
.. versionadded:: 3.14
Switch for forwarding origin target dependencies to the corresponding
-``_autogen`` targets.
+:ref:`<ORIGIN>_autogen` targets.
+
+ .. note::
+
+ If Qt 5.15 or later is used and the generator is either :generator:`Ninja`
+ or :ref:`Makefile Generators`, additional target dependencies are added to
+ the :ref:`<ORIGIN>_autogen_timestamp_deps` target instead of the
+ :ref:`<ORIGIN>_autogen` target.
This variable is used to initialize the :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`
property on all the targets. See that target property for additional
diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst
index 1c3a26c..2640389 100644
--- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst
+++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst
@@ -19,5 +19,8 @@ for the target system.
The command will be used to run :command:`try_run` generated executables,
which avoids manual population of the ``TryRunResults.cmake`` file.
-It is also used as the default value for the
-:prop_tgt:`CROSSCOMPILING_EMULATOR` target property of executables.
+This variable is also used as the default value for the
+:prop_tgt:`CROSSCOMPILING_EMULATOR` target property of executables. However,
+while :manual:`generator expressions <cmake-generator-expressions(7)>` are
+supported by the target property (since CMake 3.29), they are *not* supported
+by this variable's :command:`try_run` functionality.
diff --git a/Help/variable/CMAKE_CXX_COMPILER_IMPORT_STD.rst b/Help/variable/CMAKE_CXX_COMPILER_IMPORT_STD.rst
new file mode 100644
index 0000000..384b5eb
--- /dev/null
+++ b/Help/variable/CMAKE_CXX_COMPILER_IMPORT_STD.rst
@@ -0,0 +1,14 @@
+CMAKE_CXX_COMPILER_IMPORT_STD
+-----------------------------
+
+.. versionadded:: 3.30
+
+A list of C++ standard levels for which ``import std`` support exists for the
+current C++ toolchain. Support for C++\<NN\> may be detected using a
+``<NN> IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD`` predicate with the
+:command:`if` command.
+
+.. note ::
+
+ This variable is meaningful only when experimental support for ``import
+ std;`` has been enabled by the ``CMAKE_EXPERIMENTAL_CXX_IMPORT_STD`` gate.
diff --git a/Help/variable/CMAKE_CXX_MODULE_STD.rst b/Help/variable/CMAKE_CXX_MODULE_STD.rst
new file mode 100644
index 0000000..e2b27a0
--- /dev/null
+++ b/Help/variable/CMAKE_CXX_MODULE_STD.rst
@@ -0,0 +1,15 @@
+CMAKE_CXX_MODULE_STD
+--------------------
+
+.. versionadded:: 3.30
+
+Whether to add utility targets as dependencies to targets with at least
+``cxx_std_23`` or not.
+
+.. note ::
+
+ This setting is meaningful only when experimental support for ``import
+ std;`` has been enabled by the ``CMAKE_EXPERIMENTAL_CXX_IMPORT_STD`` gate.
+
+This variable is used to initialize the :prop_tgt:`CXX_MODULE_STD` property on
+all targets. See that target property for additional information.
diff --git a/Help/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst b/Help/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst
index 58818f4..b375b77 100644
--- a/Help/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst
+++ b/Help/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.rst
@@ -15,4 +15,14 @@ variables which have been stored in the cache will still be there. In
that case it is recommended to remove the cache variables for this
package from the cache using the cache editor or :option:`cmake -U`.
+Note that this variable can lead to inconsistent results within the project.
+Consider the case where a dependency is requested via :command:`find_package`
+from two different places within the project. If the first call does not
+have the ``REQUIRED`` keyword, it will not find the dependency when
+``CMAKE_DISABLE_FIND_PACKAGE_<PackageName>`` is set to true for that
+dependency. The project will proceed under the assumption that the dependency
+isn't available. If the second call elsewhere in the project *does* have the
+``REQUIRED`` keyword, it can succeed. Two different parts of the same project
+have then seen opposite results for the same dependency.
+
See also the :variable:`CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable.
diff --git a/Help/variable/CMAKE_EXPORT_FIND_PACKAGE_NAME.rst b/Help/variable/CMAKE_EXPORT_FIND_PACKAGE_NAME.rst
new file mode 100644
index 0000000..dbab579
--- /dev/null
+++ b/Help/variable/CMAKE_EXPORT_FIND_PACKAGE_NAME.rst
@@ -0,0 +1,8 @@
+CMAKE_EXPORT_FIND_PACKAGE_NAME
+------------------------------
+
+.. note::
+
+ Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES``.
+
+Initializes the value of :prop_tgt:`EXPORT_FIND_PACKAGE_NAME`.
diff --git a/Help/variable/CMAKE_FIND_LIBRARY_SUFFIXES.rst b/Help/variable/CMAKE_FIND_LIBRARY_SUFFIXES.rst
index c2c2609..d78dd15 100644
--- a/Help/variable/CMAKE_FIND_LIBRARY_SUFFIXES.rst
+++ b/Help/variable/CMAKE_FIND_LIBRARY_SUFFIXES.rst
@@ -5,8 +5,8 @@ Suffixes to append when looking for libraries.
This specifies what suffixes to add to library names when the
:command:`find_library` command looks for libraries. On Windows systems this
-is typically ``.lib`` and, depending on the compiler, ``.dll.a``, ``.a``
-(e.g. GCC and Clang), so when it tries to find the ``foo`` library, it will
-look for ``[<prefix>]foo.lib`` and/or ``[<prefix>]foo[.dll].a``, depending on
-the compiler used and the ``<prefix>`` specified in the
-:variable:`CMAKE_FIND_LIBRARY_PREFIXES`.
+is typically ``.lib`` and, depending on the compiler, ``.dll.lib``, ``.dll.a``,
+``.a`` (e.g. rustc, GCC, or Clang), so when it tries to find the ``foo``
+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`.
diff --git a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
index 4855477..ae1197d 100644
--- a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
@@ -48,6 +48,20 @@ Supported pairs are:
See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_CUDA` and
:variable:`CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR` variables.
+``fortran=<compiler>``
+ .. versionadded:: 3.29
+
+ Specify the Fortran compiler to use, among those that have the required
+ Visual Studio Integration feature installed. The value may be one of:
+
+ ``ifort``
+ Intel classic Fortran compiler.
+
+ ``ifx``
+ Intel oneAPI Fortran compiler.
+
+ See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_FORTRAN` variable.
+
``host=<arch>``
Specify the host tools architecture as ``x64`` or ``x86``.
Supported by VS 2013 and above.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
index 7d3f9c3..2bf5f05 100644
--- a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
+++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
@@ -7,7 +7,7 @@ Switch to enable generation of a global ``autogen`` target.
When ``CMAKE_GLOBAL_AUTOGEN_TARGET`` is enabled, a custom target
``autogen`` is generated. This target depends on all :prop_tgt:`AUTOMOC` and
-:prop_tgt:`AUTOUIC` generated ``<ORIGIN>_autogen`` targets in the project.
+:prop_tgt:`AUTOUIC` generated :ref:`<ORIGIN>_autogen` targets in the project.
By building the global ``autogen`` target, all :prop_tgt:`AUTOMOC` and
:prop_tgt:`AUTOUIC` files in the project will be generated.
@@ -19,10 +19,9 @@ By default ``CMAKE_GLOBAL_AUTOGEN_TARGET`` is unset.
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
-Note
-^^^^
+.. note::
-``<ORIGIN>_autogen`` targets by default inherit their origin target's
-dependencies. This might result in unintended dependency target
-builds when only ``<ORIGIN>_autogen`` targets are built. A solution is to
-disable :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` on the respective origin targets.
+ :ref:`<ORIGIN>_autogen` targets by default inherit their origin target's
+ dependencies. This might result in unintended dependency target builds when
+ only :ref:`<ORIGIN>_autogen` targets are built. A solution is to disable
+ :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` on the respective origin targets.
diff --git a/Help/variable/CMAKE_HOST_SYSTEM_NAME.rst b/Help/variable/CMAKE_HOST_SYSTEM_NAME.rst
index e892677..0fe6146 100644
--- a/Help/variable/CMAKE_HOST_SYSTEM_NAME.rst
+++ b/Help/variable/CMAKE_HOST_SYSTEM_NAME.rst
@@ -6,3 +6,5 @@ Name of the OS CMake is running on.
On systems that have the uname command, this variable is set to the
output of ``uname -s``. ``Linux``, ``Windows``, and ``Darwin`` for macOS
are the values found on the big three operating systems.
+
+For a list of possible values, see :variable:`CMAKE_SYSTEM_NAME`.
diff --git a/Help/variable/CMAKE_INSTALL_PREFIX.rst b/Help/variable/CMAKE_INSTALL_PREFIX.rst
index c76727e..ce7cb8b 100644
--- a/Help/variable/CMAKE_INSTALL_PREFIX.rst
+++ b/Help/variable/CMAKE_INSTALL_PREFIX.rst
@@ -4,8 +4,19 @@ CMAKE_INSTALL_PREFIX
Install directory used by :command:`install`.
If ``make install`` is invoked or ``INSTALL`` is built, this directory is
-prepended onto all install directories. This variable defaults to
-``/usr/local`` on UNIX and ``c:/Program Files/${PROJECT_NAME}`` on Windows.
+prepended onto all install directories.
+
+This variable defaults as follows:
+
+* .. versionadded:: 3.29
+
+ If the :envvar:`CMAKE_INSTALL_PREFIX` environment variable is set,
+ its value is used as default for this variable.
+
+* ``c:/Program Files/${PROJECT_NAME}`` on Windows.
+
+* ``/usr/local`` on UNIX platforms.
+
See :variable:`CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT` for how a
project might choose its own default.
diff --git a/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst b/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst
index 93cc319..9d34170 100644
--- a/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst
+++ b/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst
@@ -5,12 +5,13 @@ CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
CMake sets this variable to a ``TRUE`` value when the
:variable:`CMAKE_INSTALL_PREFIX` has just been initialized to
-its default value, typically on the first run of CMake within
-a new build tree. This can be used by project code to change
-the default without overriding a user-provided value:
+its default value, typically on the first
+run of CMake within a new build tree and the :envvar:`CMAKE_INSTALL_PREFIX`
+environment variable is not set on the first run of CMake. This can be used
+by project code to change the default without overriding a user-provided value:
.. code-block:: cmake
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- set(CMAKE_INSTALL_PREFIX "/my/default" CACHE PATH "..." FORCE)
+ set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "/my/default")
endif()
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 6893eea..b1e2687 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -43,6 +43,7 @@ Value Name
``SunPro`` Oracle Solaris Studio
``Tasking`` `Tasking Compiler Toolsets`_
``TI`` Texas Instruments
+``TIClang`` `Texas Instruments Clang-based Compilers`_
``TinyCC`` `Tiny C Compiler`_
``XL``, ``VisualAge``, ``zOS`` IBM XL
``XLClang`` IBM Clang-based XL
@@ -68,3 +69,4 @@ languages.
.. _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
diff --git a/Help/variable/CMAKE_LANG_COMPILER_LINKER.rst b/Help/variable/CMAKE_LANG_COMPILER_LINKER.rst
new file mode 100644
index 0000000..c0ae1cd
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_COMPILER_LINKER.rst
@@ -0,0 +1,15 @@
+CMAKE_<LANG>_COMPILER_LINKER
+----------------------------
+
+.. versionadded:: 3.29
+
+The full path to the linker for ``LANG``.
+
+This is the command that will be used as the ``<LANG>`` linker.
+
+This variable is not guaranteed to be defined for all linkers or languages.
+
+.. note::
+ This variable is read-only. It must not be set by the user. To select a
+ specific linker, use the :variable:`CMAKE_LINKER_TYPE` variable or the
+ :prop_tgt:`LINKER_TYPE` target property.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_LINKER_FRONTEND_VARIANT.rst b/Help/variable/CMAKE_LANG_COMPILER_LINKER_FRONTEND_VARIANT.rst
new file mode 100644
index 0000000..735375c
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_COMPILER_LINKER_FRONTEND_VARIANT.rst
@@ -0,0 +1,18 @@
+CMAKE_<LANG>_COMPILER_LINKER_FRONTEND_VARIANT
+---------------------------------------------
+
+.. versionadded:: 3.29
+
+Identification string of the linker frontend variant.
+
+Some linkers have multiple, different frontends for accepting command
+line options. For example, ``LLVM LLD`` originally only had a frontend
+compatible with the ``GNU`` compiler, but since its port to Windows
+(``lld-link``), it now also supports a frontend compatible with ``MSVC``.
+When CMake detects such a linker, it sets this variable to what would have been
+the :variable:`CMAKE_<LANG>_COMPILER_LINKER_ID` for the linker whose frontend
+it resembles.
+
+.. note::
+ In other words, this variable describes what command line options
+ and language extensions the linker frontend expects.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_LINKER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_LINKER_ID.rst
new file mode 100644
index 0000000..a57fd33
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_COMPILER_LINKER_ID.rst
@@ -0,0 +1,33 @@
+CMAKE_<LANG>_COMPILER_LINKER_ID
+-------------------------------
+
+.. versionadded:: 3.29
+
+Linker identification string.
+
+A short string unique to the linker vendor. Possible values
+include:
+
+=============================== ===============================================
+Value Name
+=============================== ===============================================
+``AppleClang`` Apple Clang
+``LLD`` `LLVM LLD`_
+``GNU`` `GNU Binutils - ld linker`_ (also known as
+ ``bfd``)
+``GNUgold`` `GNU Binutils - gold linker`_
+``MSVC`` `Microsoft Visual Studio`_
+``MOLD`` `mold: A Modern Linker`_, or on Apple the
+ `sold`_ linker
+``AIX`` AIX system linker
+``Solaris`` SunOS system linker
+=============================== ===============================================
+
+This variable is not guaranteed to be defined for all linkers or languages.
+
+.. _LLVM LLD: https://lld.llvm.org
+.. _GNU Binutils - ld linker: https://sourceware.org/binutils
+.. _GNU Binutils - gold linker: https://sourceware.org/binutils
+.. _Microsoft Visual Studio: https://visualstudio.microsoft.com
+.. _mold\: A Modern Linker: https://github.com/rui314/mold
+.. _sold: https://github.com/bluewhalesystems/sold
diff --git a/Help/variable/CMAKE_LANG_COMPILER_LINKER_VERSION.rst b/Help/variable/CMAKE_LANG_COMPILER_LINKER_VERSION.rst
new file mode 100644
index 0000000..72b0551
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_COMPILER_LINKER_VERSION.rst
@@ -0,0 +1,10 @@
+CMAKE_<LANG>_COMPILER_LINKER_VERSION
+------------------------------------
+
+.. versionadded:: 3.29
+
+Linker version string.
+
+Linker version in major[.minor[.patch[.tweak]]] format. This
+variable is not guaranteed to be defined for all linkers or
+languages.
diff --git a/Help/variable/CMAKE_LANG_FLAGS.rst b/Help/variable/CMAKE_LANG_FLAGS.rst
index 909a001..4f8f469 100644
--- a/Help/variable/CMAKE_LANG_FLAGS.rst
+++ b/Help/variable/CMAKE_LANG_FLAGS.rst
@@ -24,6 +24,10 @@ combination with CMake's builtin defaults for the toolchain:
Initialized by the :envvar:`HIPFLAGS` environment variable.
* ``CMAKE_ISPC_FLAGS``:
Initialized by the :envvar:`ISPCFLAGS` environment variable.
+* ``CMAKE_OBJC_FLAGS``:
+ Initialized by the :envvar:`OBJCFLAGS` environment variable.
+* ``CMAKE_OBJCXX_FLAGS``:
+ Initialized by the :envvar:`OBJCXXFLAGS` environment variable.
This value is a command-line string fragment. Therefore, multiple options
should be separated by spaces, and options with spaces should be quoted.
diff --git a/Help/variable/CMAKE_LANG_STANDARD_LATEST.rst b/Help/variable/CMAKE_LANG_STANDARD_LATEST.rst
new file mode 100644
index 0000000..3a759cf
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_STANDARD_LATEST.rst
@@ -0,0 +1,64 @@
+CMAKE_<LANG>_STANDARD_LATEST
+-----------------------------
+
+.. versionadded:: 3.30
+
+This variable represents the minimum between the latest version of the
+standard for language ``<LANG>`` which is supported by the current compiler
+and the latest version which is supported by CMake. Its value will be set to
+one of the supported values of the corresponding :prop_tgt:`<LANG>_STANDARD`
+target property; see the documentation of that property for a list of
+supported languages.
+
+See the :manual:`cmake-compile-features(7)` manual for information on compile
+features and a list of supported compilers.
+
+.. note::
+
+ ``CMAKE_<LANG>_STANDARD_LATEST`` will never be set to a language standard
+ which CMake recognizes but provides no support for. Unless explicitly
+ stated otherwise, every value which is supported by the corresponding
+ :prop_tgt:`<LANG>_STANDARD` target property represents a standard of
+ language ``<LANG>`` which is both recognized and supported by CMake.
+
+Checking for Language Standard Support
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+It is possible to use the value of the ``CMAKE_<LANG>_STANDARD_LATEST``
+variable to check for language standard support. This can be used to, e.g.,
+conditionally enable optional features for a distributed library.
+
+When doing so, one should be careful to **not** rely on integer value
+comparisons between standard levels. This is because some older standards of
+a given language which are supported by CMake (e.g., C++98, represented as
+``98``) will have a higher numerical value than newer standards of that same
+language.
+
+The following code sample demonstrates how one might correctly check for
+C++17 support:
+
+.. code-block:: cmake
+
+ # Careful! We cannot do direct integer comparisons with
+ # CMAKE_CXX_STANDARD_LATEST because some earlier C++ standards (e.g.,
+ # C++98) will have a higher numerical value than our requirement (C++17).
+ #
+ # Instead, we keep a list of unsupported C++ standards and check if
+ # CMAKE_CXX_STANDARD_LATEST appears in that list.
+ set(UNSUPPORTED_CXX_STANDARDS
+ 98
+ 11
+ 14
+ )
+
+ list(FIND UNSUPPORTED_CXX_STANDARDS ${CMAKE_CXX_STANDARD_LATEST} UNSUPPORTED_CXX_STANDARDS_INDEX)
+
+ if(UNSUPPORTED_CXX_STANDARDS_INDEX EQUAL -1)
+ # We know that the current compiler supports at least C++17. Enabling
+ # some optional feature...
+ else()
+ message(STATUS
+ "Feature X is disabled because it requires C++17, but the current "
+ "compiler only supports C++${CMAKE_CXX_STANDARD_LATEST}."
+ )
+ endif()
diff --git a/Help/variable/CMAKE_LANG_USING_LINKER_MODE.rst b/Help/variable/CMAKE_LANG_USING_LINKER_MODE.rst
new file mode 100644
index 0000000..bfed407
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_USING_LINKER_MODE.rst
@@ -0,0 +1,17 @@
+CMAKE_<LANG>_USING_LINKER_MODE
+------------------------------
+
+.. versionadded:: 3.29
+
+This controls how the value of the :variable:`CMAKE_<LANG>_USING_LINKER_<TYPE>`
+variable should be interpreted. The supported linker mode values are:
+
+``FLAG``
+ :variable:`CMAKE_<LANG>_USING_LINKER_<TYPE>` holds a
+ :ref:`semicolon-separated list <CMake Language Lists>` of flags to be passed
+ to the compiler frontend. This is also the default behavior if
+ ``CMAKE_<LANG>_USING_LINKER_MODE`` is not set.
+
+``TOOL``
+ :variable:`CMAKE_<LANG>_USING_LINKER_<TYPE>` holds the path to the linker
+ tool.
diff --git a/Help/variable/CMAKE_LANG_USING_LINKER_TYPE.rst b/Help/variable/CMAKE_LANG_USING_LINKER_TYPE.rst
new file mode 100644
index 0000000..1cf7d28
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_USING_LINKER_TYPE.rst
@@ -0,0 +1,44 @@
+CMAKE_<LANG>_USING_LINKER_<TYPE>
+--------------------------------
+
+.. versionadded:: 3.29
+
+This variable defines how to specify the ``<TYPE>`` linker for the link step,
+as controlled by the :variable:`CMAKE_LINKER_TYPE` variable or the
+:prop_tgt:`LINKER_TYPE` target property. Depending on the value of the
+:variable:`CMAKE_<LANG>_USING_LINKER_MODE` variable,
+``CMAKE_<LANG>_USING_LINKER_<TYPE>`` can hold compiler flags for the link step,
+or flags to be given directly to the linker tool.
+
+.. note::
+
+ The specified linker tool is generally expected to be accessible through
+ the ``PATH`` environment variable.
+
+For example, the ``LLD`` linker for ``GNU`` compilers is defined like so:
+
+.. code-block:: cmake
+
+ set(CMAKE_C_USING_LINKER_LLD "-fuse-ld=lld")
+
+On the ``Windows`` platform with ``Clang`` compilers simulating ``MSVC``:
+
+.. code-block:: cmake
+
+ set(CMAKE_C_USING_LINKER_LLD "-fuse-ld=lld-link")
+
+And for the ``MSVC`` compiler, the linker is invoked directly, not via the
+compiler frontend:
+
+.. code-block:: cmake
+
+ set(CMAKE_C_USING_LINKER_LLD "/path/to/lld-link.exe")
+ set(CMAKE_C_USING_LINKER_MODE TOOL)
+
+A custom linker type can also be defined, usually in a toolchain file:
+
+.. code-block:: cmake
+
+ set(CMAKE_LINKER_TYPE lld_launcher)
+ set(CMAKE_C_USING_LINKER_lld_launcher "-fuse-ld=/path/to/lld-launcher.sh")
+ set(CMAKE_C_USING_LINKER_MODE FLAG)
diff --git a/Help/variable/CMAKE_LINKER_TYPE.rst b/Help/variable/CMAKE_LINKER_TYPE.rst
new file mode 100644
index 0000000..e2989ec
--- /dev/null
+++ b/Help/variable/CMAKE_LINKER_TYPE.rst
@@ -0,0 +1,14 @@
+CMAKE_LINKER_TYPE
+-----------------
+
+.. versionadded:: 3.29
+
+Specify which linker will be used for the link step.
+
+This variable is used to initialize the :prop_tgt:`LINKER_TYPE` property
+on each target created by a call to :command:`add_library` or
+:command:`add_executable`. It is meaningful only for targets having a
+link step. If set, its value is also used by the :command:`try_compile`
+command.
+
+.. include:: LINKER_PREDEFINED_TYPES.txt
diff --git a/Help/variable/CMAKE_MATCH_n.rst b/Help/variable/CMAKE_MATCH_n.rst
index a92788e..c7dd623 100644
--- a/Help/variable/CMAKE_MATCH_n.rst
+++ b/Help/variable/CMAKE_MATCH_n.rst
@@ -1,8 +1,6 @@
CMAKE_MATCH_<n>
---------------
-.. versionadded:: 3.9
-
Capture group ``<n>`` matched by the last regular expression, for groups
0 through 9. Group 0 is the entire match. Groups 1 through 9 are the
subexpressions captured by ``()`` syntax.
diff --git a/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst b/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst
index 4c5debe..f82df2f 100644
--- a/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst
+++ b/Help/variable/CMAKE_PROJECT_HOMEPAGE_URL.rst
@@ -15,22 +15,22 @@ the following top level CMakeLists.txt:
.. code-block:: cmake
cmake_minimum_required(VERSION 3.0)
- project(First HOMEPAGE_URL "http://first.example.com")
- project(Second HOMEPAGE_URL "http://second.example.com")
+ project(First HOMEPAGE_URL "https://first.example.com")
+ project(Second HOMEPAGE_URL "https://second.example.com")
add_subdirectory(sub)
- project(Third HOMEPAGE_URL "http://third.example.com")
+ project(Third HOMEPAGE_URL "https://third.example.com")
And ``sub/CMakeLists.txt`` with the following contents:
.. code-block:: cmake
- project(SubProj HOMEPAGE_URL "http://subproj.example.com")
+ project(SubProj HOMEPAGE_URL "https://subproj.example.com")
message("CMAKE_PROJECT_HOMEPAGE_URL = ${CMAKE_PROJECT_HOMEPAGE_URL}")
The most recently seen :command:`project` command from the top level
CMakeLists.txt would be ``project(Second ...)``, so this will print::
- CMAKE_PROJECT_HOMEPAGE_URL = http://second.example.com
+ CMAKE_PROJECT_HOMEPAGE_URL = https://second.example.com
To obtain the homepage URL from the most recent call to :command:`project` in
the current directory scope or above, see the :variable:`PROJECT_HOMEPAGE_URL`
diff --git a/Help/variable/CMAKE_PROJECT_INCLUDE.rst b/Help/variable/CMAKE_PROJECT_INCLUDE.rst
index 76b9d92..e3b07d0 100644
--- a/Help/variable/CMAKE_PROJECT_INCLUDE.rst
+++ b/Help/variable/CMAKE_PROJECT_INCLUDE.rst
@@ -3,12 +3,18 @@ CMAKE_PROJECT_INCLUDE
.. versionadded:: 3.15
-A CMake language file or module to be included as the last step of all
+A CMake language file to be included as the last step of all
:command:`project` command calls. This is intended for injecting custom code
into project builds without modifying their source. See :ref:`Code Injection`
for a more detailed discussion of files potentially included during a
:command:`project` call.
+.. versionadded:: 3.29
+ This variable can be a :ref:`semicolon-separated list <CMake Language Lists>`
+ of CMake language files to be included sequentially. It can also now refer to
+ module names to be found in :variable:`CMAKE_MODULE_PATH` or as a builtin
+ CMake module.
+
See also the :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`,
:variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE`,
:variable:`CMAKE_PROJECT_INCLUDE_BEFORE`, and
diff --git a/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst b/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst
index 9a8c4b5..48da906 100644
--- a/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst
+++ b/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst
@@ -3,12 +3,18 @@ CMAKE_PROJECT_INCLUDE_BEFORE
.. versionadded:: 3.15
-A CMake language file or module to be included as the first step of all
+A CMake language file to be included as the first step of all
:command:`project` command calls. This is intended for injecting custom code
into project builds without modifying their source. See :ref:`Code Injection`
for a more detailed discussion of files potentially included during a
:command:`project` call.
+.. versionadded:: 3.29
+ This variable can be a :ref:`semicolon-separated list <CMake Language Lists>`
+ of CMake language files to be included sequentially. It can also now refer to
+ module names to be found in :variable:`CMAKE_MODULE_PATH` or as a builtin
+ CMake module.
+
See also the :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`,
:variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE`,
:variable:`CMAKE_PROJECT_INCLUDE`, and
diff --git a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst
index 3bb5cd8..7e2e1bb 100644
--- a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst
+++ b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst
@@ -1,12 +1,18 @@
CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE
------------------------------------
-A CMake language file or module to be included as the last step of any
+A CMake language file to be included as the last step of any
:command:`project` command calls that specify ``<PROJECT-NAME>`` as the project
name. This is intended for injecting custom code into project builds without
modifying their source. See :ref:`Code Injection` for a more detailed
discussion of files potentially included during a :command:`project` call.
+.. versionadded:: 3.29
+ This variable can be a :ref:`semicolon-separated list <CMake Language Lists>`
+ of CMake language files to be included sequentially. It can also now refer to
+ module names to be found in :variable:`CMAKE_MODULE_PATH` or as a builtin
+ CMake module.
+
See also the :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE`,
:variable:`CMAKE_PROJECT_INCLUDE`, :variable:`CMAKE_PROJECT_INCLUDE_BEFORE`,
and :variable:`CMAKE_PROJECT_TOP_LEVEL_INCLUDES` variables.
diff --git a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst
index ca584c1..59ac1b0 100644
--- a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst
+++ b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst
@@ -3,12 +3,18 @@ CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE
.. versionadded:: 3.17
-A CMake language file or module to be included as the first step of any
+A CMake language file to be included as the first step of any
:command:`project` command calls that specify ``<PROJECT-NAME>`` as the project
name. This is intended for injecting custom code into project builds without
modifying their source. See :ref:`Code Injection` for a more detailed
discussion of files potentially included during a :command:`project` call.
+.. versionadded:: 3.29
+ This variable can be a :ref:`semicolon-separated list <CMake Language Lists>`
+ of CMake language files to be included sequentially. It can also now refer to
+ module names to be found in :variable:`CMAKE_MODULE_PATH` or as a builtin
+ CMake module.
+
See also the :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`,
:variable:`CMAKE_PROJECT_INCLUDE`, :variable:`CMAKE_PROJECT_INCLUDE_BEFORE`,
and :variable:`CMAKE_PROJECT_TOP_LEVEL_INCLUDES` variables.
diff --git a/Help/variable/CMAKE_PROJECT_TOP_LEVEL_INCLUDES.rst b/Help/variable/CMAKE_PROJECT_TOP_LEVEL_INCLUDES.rst
index 2010b08..54f530e 100644
--- a/Help/variable/CMAKE_PROJECT_TOP_LEVEL_INCLUDES.rst
+++ b/Help/variable/CMAKE_PROJECT_TOP_LEVEL_INCLUDES.rst
@@ -12,6 +12,10 @@ including things like :variable:`CMAKE_<LANG>_COMPILER`, might not be set.
See :ref:`Code Injection` for a more detailed discussion of files potentially
included during a :command:`project` call.
+.. versionadded:: 3.29
+ This variable can also now refer to module names to be found in
+ :variable:`CMAKE_MODULE_PATH` or builtin to CMake.
+
This variable is intended for specifying files that perform one-time setup
for the build. It provides an injection point for things like configuring
package managers, adding logic the user shares between projects (e.g. defining
diff --git a/Help/variable/CMAKE_REQUIRE_FIND_PACKAGE_PackageName.rst b/Help/variable/CMAKE_REQUIRE_FIND_PACKAGE_PackageName.rst
index 893f1ae..52bf30a 100644
--- a/Help/variable/CMAKE_REQUIRE_FIND_PACKAGE_PackageName.rst
+++ b/Help/variable/CMAKE_REQUIRE_FIND_PACKAGE_PackageName.rst
@@ -11,4 +11,35 @@ turned into ``REQUIRED`` by setting the variable
This can be used to assert assumptions about build environment and to
ensure the build will fail early if they do not hold.
+Note that setting this variable to true breaks some commonly used patterns.
+Multiple calls to :command:`find_package` are sometimes used to obtain a
+different search order to the default.
+For example, projects can force checking a known path for a particular
+package first before searching any of the other default search paths:
+
+.. code:: cmake
+
+ find_package(something PATHS /some/local/path NO_DEFAULT_PATH)
+ find_package(something)
+
+In the above, the first call looks for the ``something`` package in a specific
+directory. If ``CMAKE_REQUIRE_FIND_PACKAGE_something`` is set to true, then
+this first call must succeed, otherwise a fatal error occurs. The second call
+never gets a chance to provide a fall-back to using the default search
+locations.
+
+A similar pattern is used even by some of CMake's own Find modules to search
+for a config package first:
+
+.. code:: cmake
+
+ find_package(something CONFIG QUIET)
+ if(NOT something_FOUND)
+ # Fall back to searching using typical Find module logic...
+ endif()
+
+Again, if ``CMAKE_REQUIRE_FIND_PACKAGE_something`` is true, the first call
+must succeed. It effectively means a config package must be found for the
+dependency, and the Find module logic is never used.
+
See also the :variable:`CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` variable.
diff --git a/Help/variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY.rst b/Help/variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY.rst
index e88db36..69c762b 100644
--- a/Help/variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY.rst
+++ b/Help/variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY.rst
@@ -9,3 +9,5 @@ built, first the ``all`` target is built, then the installation starts.
If ``CMAKE_SKIP_INSTALL_ALL_DEPENDENCY`` is set to ``TRUE``, this
dependency is not created, so the installation process will start immediately,
independent from whether the project has been completely built or not.
+
+See also :variable:`CMAKE_SKIP_TEST_ALL_DEPENDENCY`.
diff --git a/Help/variable/CMAKE_SKIP_TEST_ALL_DEPENDENCY.rst b/Help/variable/CMAKE_SKIP_TEST_ALL_DEPENDENCY.rst
new file mode 100644
index 0000000..bae8e99
--- /dev/null
+++ b/Help/variable/CMAKE_SKIP_TEST_ALL_DEPENDENCY.rst
@@ -0,0 +1,19 @@
+CMAKE_SKIP_TEST_ALL_DEPENDENCY
+------------------------------
+
+.. versionadded:: 3.29
+
+Control whether the ``test`` target depends on the ``all`` target.
+
+If this variable is not defined, or is set to ``TRUE``, then the
+``test`` (or ``RUN_TESTS``) target does not depend on the
+``all`` (or ``ALL_BUILD``) target. When the ``test`` target is built,
+e.g., via ``make test``, the test process will start immediately,
+regardless of whether the project has been completely built or not.
+
+If ``CMAKE_SKIP_TEST_ALL_DEPENDENCY`` is explicitly set to ``FALSE``,
+then the ``test`` target will depend on the ``all`` target. When the
+``test`` target is built, e.g., via ``make test``, the ``all`` target
+will be built first, and then the tests will run.
+
+See also :variable:`CMAKE_SKIP_INSTALL_ALL_DEPENDENCY`.
diff --git a/Help/variable/CMAKE_SYSTEM_NAME.rst b/Help/variable/CMAKE_SYSTEM_NAME.rst
index fef53ee..e9ffec4 100644
--- a/Help/variable/CMAKE_SYSTEM_NAME.rst
+++ b/Help/variable/CMAKE_SYSTEM_NAME.rst
@@ -21,3 +21,86 @@ System Name for Cross Compiling
tree in order to enable :ref:`cross compiling <Cross Compiling Toolchain>`.
In this case the :variable:`CMAKE_SYSTEM_VERSION` variable must also be
set explicitly.
+
+System Names Known to CMake
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following is a list of possible values, each associated with corresponding
+operating systems or environments.
+
+========================= ======================================================
+Value Name
+========================= ======================================================
+``ADSP`` Analog Devices Audio Digital Signal Processing
+``AIX`` IBM Unix operating system
+``Android`` Android operating system
+``ARTOS`` Operating system for microcontrollers
+``BeOS`` Operating system for personal computers (discontinued)
+``BlueGeneL`` Blue Gene/L static environment
+``BlueGeneP-dynamic`` Blue Gene/P dynamic environment
+``BlueGeneP-static`` Blue Gene/P static environment
+``BlueGeneQ-dynamic`` Blue Gene/Q dynamic environment
+``BlueGeneQ-static`` Blue Gene/Q static environment
+``BSDOS`` BSD operating system (discontinued)
+``Catamount`` Operating system for Cray XT series
+``CrayLinuxEnvironment`` Cray Linux Environment
+``CYGWIN`` Cygwin environment for Windows
+``Darwin`` Apple stationary operating systems (macOS, OS X, etc.)
+``DOS`` MS-DOS or compatible
+``DragonFly`` BSD-derived operating system
+``eCos`` Real-time embedded operating system
+``Emscripten`` Compiler toolchain to WebAssembly
+``Euros`` Real-time operating system for embedded devices
+``FreeBSD`` FreeBSD operating system
+``Fuchsia`` Operating system by Google based on the Zircon kernel
+``Generic-ADSP`` Generic ADSP (Audio DSP) environment
+``Generic-ELF`` Generic ELF (Executable and Linkable Format) environment
+``Generic`` Some platforms, e.g. bare metal embedded devices
+``GHS-MULTI`` Green Hills Software MULTI environment
+``GNU`` GNU/Hurd-based operating system
+``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
+``MP-RAS`` MP-RAS UNIX operating system
+``MSYS`` MSYS environment (MSYSTEM=MSYS)
+``NetBSD`` NetBSD operating systems
+``OpenBSD`` OpenBSD operating systems
+``OpenVMS`` OpenVMS operating system by HP
+``OS2`` OS/2 operating system
+``OSF1`` Compaq Tru64 UNIX (formerly DEC OSF/1, Digital Unix) (discontinued)
+``QNX`` Unix-like operating system by BlackBerry
+``RISCos`` RISC OS operating system
+``SCO_SV`` SCO OpenServer 5
+``SerenityOS`` Unix-like operating system
+``SINIX`` SINIX operating system
+``SunOS`` Oracle Solaris and all illumos operating systems
+``syllable`` Syllable operating system
+``Tru64`` Compaq Tru64 UNIX (formerly DEC OSF/1) operating system
+``tvOS`` Apple TV operating system
+``ULTRIX`` Unix operating system (discontinued)
+``UNIX_SV`` SCO UnixWare (pre release 7)
+``UnixWare`` SCO UnixWare 7
+``visionOS`` Apple mixed reality operating system
+``watchOS`` Apple watch operating system
+``Windows`` Windows stationary operating systems
+``WindowsCE`` Windows Embedded Compact
+``WindowsPhone`` Windows mobile phone operating system
+``WindowsStore`` Universal Windows Platform applications
+``Xenix`` SCO Xenix Unix operating system (discontinued)
+========================= ======================================================
+
+Platform-specific notes:
+
+* MSYS2's ``msys/cmake`` package (``/usr/bin/cmake``) works only under
+ ``MSYSTEM=MSYS`` environments, with system name ``MSYS``. Under other
+ environments like ``MSYSTEM=MINGW64``, use another package such
+ as ``mingw64/mingw-w64-x86_64-cmake`` (``/mingw64/bin/cmake``),
+ which targets ``MSYSTEM=MINGW64`` with system name ``Windows``.
+
+* Cygwin's ``cmake`` package (``/usr/bin/cmake``) uses system name ``CYGWIN``.
+ A non-cygwin CMake on Windows (e.g. ``$PROGRAMFILES/CMake/bin/cmake``)
+ uses system name ``Windows`` even when it runs under a Cygwin environment.
diff --git a/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst b/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst
new file mode 100644
index 0000000..5e55d8c
--- /dev/null
+++ b/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst
@@ -0,0 +1,32 @@
+CMAKE_Swift_COMPILATION_MODE
+----------------------------
+
+.. versionadded:: 3.29
+
+Specify how Swift compiles a target. This variable is used to initialize the
+:prop_tgt:`Swift_COMPILATION_MODE` property on targets as they are created.
+
+The allowed values are:
+
+.. include:: ../prop_tgt/Swift_COMPILATION_MODE-VALUES.txt
+
+Use :manual:`generator expressions <cmake-generator-expressions(7)>` to support
+per-configuration specification. For example, the code:
+
+.. code-block:: cmake
+
+ set(CMAKE_Swift_COMPILATION_MODE
+ "$<IF:$<CONFIG:Release>,wholemodule,incremental>")
+
+sets the default Swift compilation mode to wholemodule mode when building a
+release configuration and to incremental mode in other configurations.
+
+If this variable is not set then the :prop_tgt:`Swift_COMPILATION_MODE` target
+property will not be set automatically. If that property is unset then CMake
+uses the default value ``incremental`` to build the Swift source files.
+
+.. note::
+
+ This property only has effect when policy :policy:`CMP0157` is set to ``NEW``
+ prior to the first :command:`project` or :command:`enable_language` command
+ that enables the Swift language.
diff --git a/Help/variable/CMAKE_TEST_LAUNCHER.rst b/Help/variable/CMAKE_TEST_LAUNCHER.rst
new file mode 100644
index 0000000..2a5fe4c
--- /dev/null
+++ b/Help/variable/CMAKE_TEST_LAUNCHER.rst
@@ -0,0 +1,16 @@
+CMAKE_TEST_LAUNCHER
+-------------------
+
+.. versionadded:: 3.29
+
+This variable is used to initialize the :prop_tgt:`TEST_LAUNCHER` target
+property of executable targets as they are created. It is used to specify
+a launcher for running tests, added by the :command:`add_test` command,
+that run an executable target.
+
+If this variable contains a :ref:`semicolon-separated list <CMake Language
+Lists>`, then the first value is the command and remaining values are its
+arguments.
+
+This variable can be initialized via an
+:envvar:`CMAKE_TEST_LAUNCHER` environment variable.
diff --git a/Help/variable/CMAKE_TLS_VERIFY.rst b/Help/variable/CMAKE_TLS_VERIFY.rst
index b22f1ce..5871ac7 100644
--- a/Help/variable/CMAKE_TLS_VERIFY.rst
+++ b/Help/variable/CMAKE_TLS_VERIFY.rst
@@ -3,7 +3,9 @@ CMAKE_TLS_VERIFY
Specify the default value for the :command:`file(DOWNLOAD)` and
:command:`file(UPLOAD)` commands' ``TLS_VERIFY`` options.
-If not set, the default is *off*.
+If this variable is not set, the commands check the
+:envvar:`CMAKE_TLS_VERIFY` environment variable.
+If neither is set, the default is *off*.
This variable is also used by the :module:`ExternalProject` and
:module:`FetchContent` modules for internal calls to :command:`file(DOWNLOAD)`.
diff --git a/Help/variable/CMAKE_TLS_VERSION-VALUES.txt b/Help/variable/CMAKE_TLS_VERSION-VALUES.txt
new file mode 100644
index 0000000..47fd2bc
--- /dev/null
+++ b/Help/variable/CMAKE_TLS_VERSION-VALUES.txt
@@ -0,0 +1,7 @@
+* ``1.0``
+
+* ``1.1``
+
+* ``1.2``
+
+* ``1.3``
diff --git a/Help/variable/CMAKE_TLS_VERSION.rst b/Help/variable/CMAKE_TLS_VERSION.rst
new file mode 100644
index 0000000..3e7f2ce
--- /dev/null
+++ b/Help/variable/CMAKE_TLS_VERSION.rst
@@ -0,0 +1,17 @@
+CMAKE_TLS_VERSION
+-----------------
+
+.. versionadded:: 3.30
+
+Specify the default value for the :command:`file(DOWNLOAD)` and
+:command:`file(UPLOAD)` commands' ``TLS_VERSION`` option.
+If this variable is not set, the commands check the
+:envvar:`CMAKE_TLS_VERSION` environment variable.
+
+The value may be one of:
+
+.. include:: CMAKE_TLS_VERSION-VALUES.txt
+
+This variable is also used by the :module:`ExternalProject` and
+:module:`FetchContent` modules for internal calls to
+:command:`file(DOWNLOAD)` and ``git clone``.
diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_FORTRAN.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_FORTRAN.rst
new file mode 100644
index 0000000..c7e4148
--- /dev/null
+++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_FORTRAN.rst
@@ -0,0 +1,12 @@
+CMAKE_VS_PLATFORM_TOOLSET_FORTRAN
+---------------------------------
+
+.. versionadded:: 3.29
+
+Fortran compiler to be used by Visual Studio projects.
+
+:ref:`Visual Studio Generators` support selecting among Fortran compilers
+that have the required Visual Studio Integration feature installed. The
+compiler may be specified by a field in :variable:`CMAKE_GENERATOR_TOOLSET` of
+the form ``fortran=...``. CMake provides the selected Fortran compiler in this
+variable. The value may be empty if the field was not specified.
diff --git a/Help/variable/CMAKE_VS_USE_DEBUG_LIBRARIES.rst b/Help/variable/CMAKE_VS_USE_DEBUG_LIBRARIES.rst
new file mode 100644
index 0000000..35d94bc
--- /dev/null
+++ b/Help/variable/CMAKE_VS_USE_DEBUG_LIBRARIES.rst
@@ -0,0 +1,29 @@
+CMAKE_VS_USE_DEBUG_LIBRARIES
+----------------------------
+
+.. versionadded:: 3.30
+
+.. |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
+
+Use :manual:`generator expressions <cmake-generator-expressions(7)>`
+for per-configuration specification. For example, the code:
+
+.. code-block:: cmake
+
+ set(CMAKE_VS_USE_DEBUG_LIBRARIES "$<CONFIG:Debug,Custom>")
+
+indicates that all following targets consider their "Debug" and "Custom"
+configurations to be debug configurations, and their other configurations
+to be non-debug configurations.
+
+This variable is used to initialize the :prop_tgt:`VS_USE_DEBUG_LIBRARIES`
+property on all targets as they are created. It is also propagated by
+calls to the :command:`try_compile` command into its test project.
+
+If this variable is not set then the :prop_tgt:`VS_USE_DEBUG_LIBRARIES`
+property will not be set automatically. If that property is not set then
+CMake generates ``UseDebugLibraries`` using heuristics to determine which
+configurations are debug configurations. See policy :policy:`CMP0162`.
diff --git a/Help/variable/CTEST_COVERAGE_COMMAND.rst b/Help/variable/CTEST_COVERAGE_COMMAND.rst
index f5425cb..3df2262 100644
--- a/Help/variable/CTEST_COVERAGE_COMMAND.rst
+++ b/Help/variable/CTEST_COVERAGE_COMMAND.rst
@@ -59,4 +59,4 @@ The rest of the supplied arguments consist of the full paths to the
``/src/main/java`` directories of each module within the source tree. These
directories are needed and should not be forgotten.
-.. _`Cobertura`: http://cobertura.github.io/cobertura/
+.. _`Cobertura`: https://cobertura.github.io/cobertura/
diff --git a/Help/variable/CTEST_CURL_OPTIONS.rst b/Help/variable/CTEST_CURL_OPTIONS.rst
index 14af4e4..45e84ed 100644
--- a/Help/variable/CTEST_CURL_OPTIONS.rst
+++ b/Help/variable/CTEST_CURL_OPTIONS.rst
@@ -1,6 +1,10 @@
CTEST_CURL_OPTIONS
------------------
+.. deprecated:: 3.30
+
+ Use the :variable:`CTEST_TLS_VERIFY` variable instead.
+
.. versionadded:: 3.1
Specify the CTest ``CurlOptions`` setting
diff --git a/Help/variable/CTEST_TLS_VERIFY.rst b/Help/variable/CTEST_TLS_VERIFY.rst
new file mode 100644
index 0000000..9b3d96c
--- /dev/null
+++ b/Help/variable/CTEST_TLS_VERIFY.rst
@@ -0,0 +1,13 @@
+CTEST_TLS_VERIFY
+----------------
+
+.. versionadded:: 3.30
+
+Specify the CTest ``TLSVerify`` setting in a :manual:`ctest(1)`
+:ref:`Dashboard Client` script or in project ``CMakeLists.txt`` code
+before including the :module:`CTest` module. The value is a boolean
+indicating whether to verify the server certificate when submitting
+to a dashboard via ``https://`` URLs.
+
+If ``CTEST_TLS_VERIFY`` is not set, the :variable:`CMAKE_TLS_VERIFY` variable
+or :envvar:`CMAKE_TLS_VERIFY` environment variable is used instead.
diff --git a/Help/variable/CTEST_TLS_VERSION.rst b/Help/variable/CTEST_TLS_VERSION.rst
new file mode 100644
index 0000000..f8123df
--- /dev/null
+++ b/Help/variable/CTEST_TLS_VERSION.rst
@@ -0,0 +1,16 @@
+CTEST_TLS_VERSION
+-----------------
+
+.. versionadded:: 3.30
+
+Specify the CTest ``TLSVersion`` setting in a :manual:`ctest(1)`
+:ref:`Dashboard Client` script or in project ``CMakeLists.txt`` code
+before including the :module:`CTest` module. The value is a minimum
+TLS version allowed when submitting to a dashboard via ``https://`` URLs.
+
+The value may be one of:
+
+.. include:: CMAKE_TLS_VERSION-VALUES.txt
+
+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_PREDEFINED_TYPES.txt b/Help/variable/LINKER_PREDEFINED_TYPES.txt
new file mode 100644
index 0000000..3c1b7b8
--- /dev/null
+++ b/Help/variable/LINKER_PREDEFINED_TYPES.txt
@@ -0,0 +1,69 @@
+.. note::
+ It is assumed that the linker specified is fully compatible with the default
+ one the compiler would normally invoke. CMake will not do any option
+ translation.
+
+Linker types are case-sensitive and may only contain letters, numbers and
+underscores. Linker types defined in all uppercase are reserved for CMake's own
+built-in types. The pre-defined linker types are:
+
+``DEFAULT``
+ This type corresponds to standard linking, essentially equivalent to the
+ :prop_tgt:`LINKER_TYPE` target property not being set at all.
+
+``SYSTEM``
+ Use the standard linker provided by the platform or toolchain. For example,
+ this implies the Microsoft linker for all MSVC-compatible compilers.
+ This type is supported for the following platform-compiler combinations:
+
+ * Linux: ``GNU``, ``Clang``, ``LLVMFlang``, ``NVIDIA``, and ``Swift``
+ compilers.
+ * Apple platforms: ``AppleClang``, ``Clang``, ``GNU``, and ``Swift``
+ compilers.
+ * Windows: ``MSVC``, ``GNU``, ``Clang``, ``NVIDIA``, and ``Swift`` compilers.
+
+``LLD``
+ Use the ``LLVM`` linker. This type is supported for the following
+ platform-compiler combinations:
+
+ * Linux: ``GNU``, ``Clang``, ``LLVMFlang``, ``NVIDIA``, and ``Swift``
+ compilers.
+ * Apple platforms: ``Clang``, ``AppleClang``, and ``Swift`` compilers.
+ * Windows: ``GNU``, ``Clang`` with MSVC-like front-end, ``Clang`` with
+ GNU-like front-end, ``MSVC``, ``NVIDIA`` with MSVC-like front-end,
+ and ``Swift``.
+
+``BFD``
+ Use the ``GNU`` linker. This type is supported for the following
+ platform-compiler combinations:
+
+ * Linux: ``GNU``, ``Clang``, ``LLVMFlang``, and ``NVIDIA`` compilers.
+ * Windows: ``GNU``, ``Clang`` with GNU-like front-end.
+
+``GOLD``
+ Supported on Linux platform with ``GNU``, ``Clang``, ``LLVMFlang``,
+ ``NVIDIA``, and ``Swift`` compilers.
+
+``MOLD``
+ Use the `mold linker <https://github.com/rui314/mold>`_. This type is
+ supported on the following platform-compiler combinations:
+
+ * Linux: ``GNU``, ``Clang``, ``LLVMFlang``, and ``NVIDIA`` compilers.
+ * Apple platforms: ``Clang`` and ``AppleClang`` compilers (acts as an
+ alias to the `sold linker`_).
+
+``SOLD``
+ Use the `sold linker`_. This type is only supported on Apple platforms
+ with ``Clang`` and ``AppleClang`` compilers.
+
+``APPLE_CLASSIC``
+ Use the Apple linker in the classic behavior (i.e. before ``Xcode 15.0``).
+ This type is only supported on Apple platforms with ``GNU``, ``Clang``,
+ ``AppleClang``, and ``Swift`` compilers.
+
+``MSVC``
+ Use the Microsoft linker. This type is only supported on the Windows
+ platform with ``MSVC``, ``Clang`` with MSVC-like front-end, and ``Swift``
+ compilers.
+
+.. _sold linker: https://github.com/bluewhalesystems/sold
diff --git a/Modules/CMakeASMCompiler.cmake.in b/Modules/CMakeASMCompiler.cmake.in
index 1efd9f5..c7dbfae 100644
--- a/Modules/CMakeASMCompiler.cmake.in
+++ b/Modules/CMakeASMCompiler.cmake.in
@@ -5,6 +5,12 @@ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_AR "@_CMAKE_ASM_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_RANLIB "@_CMAKE_ASM_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
+set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LINKER "@CMAKE_ASM_COMPILER_LINKER@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LINKER_ID "@CMAKE_ASM_COMPILER_LINKER_ID@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LINKER_VERSION @CMAKE_ASM_COMPILER_LINKER_VERSION@)
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_ASM_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_TAPI "@CMAKE_TAPI@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
diff --git a/Modules/CMakeASM_MARMASMInformation.cmake b/Modules/CMakeASM_MARMASMInformation.cmake
index 2026c17..a47f7c2 100644
--- a/Modules/CMakeASM_MARMASMInformation.cmake
+++ b/Modules/CMakeASM_MARMASMInformation.cmake
@@ -8,7 +8,7 @@ set(ASM_DIALECT "_MARMASM")
set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
-set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
# The ASM_MARMASM compiler id for this compiler is "MSVC", so fill out the runtime library table.
set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
diff --git a/Modules/CMakeASM_NASMInformation.cmake b/Modules/CMakeASM_NASMInformation.cmake
index a72575b..898b823 100644
--- a/Modules/CMakeASM_NASMInformation.cmake
+++ b/Modules/CMakeASM_NASMInformation.cmake
@@ -12,6 +12,8 @@ if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
elseif(DEFINED CMAKE_CXX_SIZEOF_DATA_PTR AND CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
else()
set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
endif()
@@ -20,6 +22,8 @@ if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
elseif(DEFINED CMAKE_CXX_SIZEOF_DATA_PTR AND CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
else()
set(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
endif()
@@ -28,6 +32,8 @@ if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
elseif(DEFINED CMAKE_CXX_SIZEOF_DATA_PTR AND CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
else()
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
endif()
@@ -38,6 +44,11 @@ if(NOT CMAKE_ASM_NASM_COMPILE_OBJECT)
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
endif()
+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>")
+endif()
+
if(CMAKE_ASM_NASM_COMPILER_ID STREQUAL "NASM")
set(CMAKE_DEPFILE_FLAGS_ASM_NASM "-MD <DEP_FILE> -MT <DEP_TARGET>")
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 2f0b774..1726fe9 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -6,6 +6,7 @@ set(CMAKE_C_COMPILER_VERSION_INTERNAL "@CMAKE_C_COMPILER_VERSION_INTERNAL@")
set(CMAKE_C_COMPILER_WRAPPER "@CMAKE_C_COMPILER_WRAPPER@")
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "@CMAKE_C_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT@")
+set(CMAKE_C_STANDARD_LATEST "@CMAKE_C_STANDARD_LATEST@")
set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@")
set(CMAKE_C90_COMPILE_FEATURES "@CMAKE_C90_COMPILE_FEATURES@")
set(CMAKE_C99_COMPILE_FEATURES "@CMAKE_C99_COMPILE_FEATURES@")
@@ -26,6 +27,12 @@ set(CMAKE_C_COMPILER_AR "@CMAKE_C_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_C_COMPILER_RANLIB "@CMAKE_C_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
+set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
+set(CMAKE_C_COMPILER_LINKER "@CMAKE_C_COMPILER_LINKER@")
+set(CMAKE_C_COMPILER_LINKER_ID "@CMAKE_C_COMPILER_LINKER_ID@")
+set(CMAKE_C_COMPILER_LINKER_VERSION @CMAKE_C_COMPILER_LINKER_VERSION@)
+set(CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_TAPI "@CMAKE_TAPI@")
set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 82d56cf..759cdf4 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -39,19 +39,28 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
+#define C_STD_99 199901L
+#define C_STD_11 201112L
+#define C_STD_17 201710L
+#define C_STD_23 202311L
+
+#ifdef __STDC_VERSION__
+# define C_STD __STDC_VERSION__
+#endif
+
#if !defined(__STDC__) && !defined(__clang__)
# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
# define C_VERSION "90"
# else
# define C_VERSION
# endif
-#elif __STDC_VERSION__ > 201710L
+#elif C_STD > C_STD_17
# define C_VERSION "23"
-#elif __STDC_VERSION__ >= 201710L
+#elif C_STD > C_STD_11
# define C_VERSION "17"
-#elif __STDC_VERSION__ >= 201000L
+#elif C_STD > C_STD_99
# define C_VERSION "11"
-#elif __STDC_VERSION__ >= 199901L
+#elif C_STD >= C_STD_99
# define C_VERSION "99"
#else
# define C_VERSION "90"
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index 665f309..998e476 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -67,7 +67,7 @@ if (NOT _INCLUDED_FILE)
endif ()
if(CMAKE_C_SIZEOF_DATA_PTR)
- foreach(f ${CMAKE_C_ABI_FILES})
+ foreach(f IN LISTS CMAKE_C_ABI_FILES)
include(${f})
endforeach()
unset(CMAKE_C_ABI_FILES)
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in
index 3c28c28..c054e5c 100644
--- a/Modules/CMakeCUDACompiler.cmake.in
+++ b/Modules/CMakeCUDACompiler.cmake.in
@@ -7,6 +7,7 @@ set(CMAKE_CUDA_DEVICE_LINKER "@CMAKE_CUDA_DEVICE_LINKER@")
set(CMAKE_CUDA_FATBINARY "@CMAKE_CUDA_FATBINARY@")
set(CMAKE_CUDA_STANDARD_COMPUTED_DEFAULT "@CMAKE_CUDA_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_CUDA_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_CUDA_EXTENSIONS_COMPUTED_DEFAULT@")
+set(CMAKE_CUDA_STANDARD_LATEST "@CMAKE_CUDA_STANDARD_LATEST@")
set(CMAKE_CUDA_COMPILE_FEATURES "@CMAKE_CUDA_COMPILE_FEATURES@")
set(CMAKE_CUDA03_COMPILE_FEATURES "@CMAKE_CUDA03_COMPILE_FEATURES@")
set(CMAKE_CUDA11_COMPILE_FEATURES "@CMAKE_CUDA11_COMPILE_FEATURES@")
@@ -14,6 +15,7 @@ set(CMAKE_CUDA14_COMPILE_FEATURES "@CMAKE_CUDA14_COMPILE_FEATURES@")
set(CMAKE_CUDA17_COMPILE_FEATURES "@CMAKE_CUDA17_COMPILE_FEATURES@")
set(CMAKE_CUDA20_COMPILE_FEATURES "@CMAKE_CUDA20_COMPILE_FEATURES@")
set(CMAKE_CUDA23_COMPILE_FEATURES "@CMAKE_CUDA23_COMPILE_FEATURES@")
+set(CMAKE_CUDA26_COMPILE_FEATURES "@CMAKE_CUDA26_COMPILE_FEATURES@")
set(CMAKE_CUDA_PLATFORM_ID "@CMAKE_CUDA_PLATFORM_ID@")
set(CMAKE_CUDA_SIMULATE_ID "@CMAKE_CUDA_SIMULATE_ID@")
@@ -72,5 +74,12 @@ set(CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_FR
@_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT@
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
+set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
+set(CMAKE_CUDA_COMPILER_LINKER "@CMAKE_CUDA_COMPILER_LINKER@")
+set(CMAKE_CUDA_COMPILER_LINKER_ID "@CMAKE_CUDA_COMPILER_LINKER_ID@")
+set(CMAKE_CUDA_COMPILER_LINKER_VERSION @CMAKE_CUDA_COMPILER_LINKER_VERSION@)
+set(CMAKE_CUDA_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_CUDA_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_AR "@CMAKE_AR@")
+set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_MT "@CMAKE_MT@")
diff --git a/Modules/CMakeCUDACompilerId.cu.in b/Modules/CMakeCUDACompilerId.cu.in
index d5a3b03..cecb948 100644
--- a/Modules/CMakeCUDACompilerId.cu.in
+++ b/Modules/CMakeCUDACompilerId.cu.in
@@ -16,16 +16,34 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
@CMAKE_CUDA_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_CUDA_COMPILER_ID_ERROR_FOR_TEST@
+#define CXX_STD_11 201103L
+#define CXX_STD_14 201402L
+#define CXX_STD_17 201703L
+#define CXX_STD_20 202002L
+#define CXX_STD_23 202302L
+
+#if defined(_MSC_VER) && defined(_MSVC_LANG)
+# if _MSVC_LANG > __cplusplus
+# define CXX_STD _MSVC_LANG
+# else
+# define CXX_STD __cplusplus
+# endif
+#else
+# define CXX_STD __cplusplus
+#endif
+
const char* info_language_standard_default = "INFO" ":" "standard_default["
-#if __cplusplus > 202002L
+#if CXX_STD > CXX_STD_23
+ "26"
+#elif CXX_STD > CXX_STD_20
"23"
-#elif __cplusplus > 201703L
+#elif CXX_STD > CXX_STD_17
"20"
-#elif __cplusplus >= 201703L
+#elif CXX_STD > CXX_STD_14
"17"
-#elif __cplusplus >= 201402L
+#elif CXX_STD > CXX_STD_11
"14"
-#elif __cplusplus >= 201103L
+#elif CXX_STD >= CXX_STD_11
"11"
#else
"03"
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 073a8af..2f7c3e4 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -6,6 +6,7 @@ set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "@CMAKE_CXX_COMPILER_VERSION_INTERNAL@")
set(CMAKE_CXX_COMPILER_WRAPPER "@CMAKE_CXX_COMPILER_WRAPPER@")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_CXX_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT@")
+set(CMAKE_CXX_STANDARD_LATEST "@CMAKE_CXX_STANDARD_LATEST@")
set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@")
set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@")
set(CMAKE_CXX11_COMPILE_FEATURES "@CMAKE_CXX11_COMPILE_FEATURES@")
@@ -13,6 +14,7 @@ set(CMAKE_CXX14_COMPILE_FEATURES "@CMAKE_CXX14_COMPILE_FEATURES@")
set(CMAKE_CXX17_COMPILE_FEATURES "@CMAKE_CXX17_COMPILE_FEATURES@")
set(CMAKE_CXX20_COMPILE_FEATURES "@CMAKE_CXX20_COMPILE_FEATURES@")
set(CMAKE_CXX23_COMPILE_FEATURES "@CMAKE_CXX23_COMPILE_FEATURES@")
+set(CMAKE_CXX26_COMPILE_FEATURES "@CMAKE_CXX26_COMPILE_FEATURES@")
set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
set(CMAKE_CXX_SIMULATE_ID "@CMAKE_CXX_SIMULATE_ID@")
@@ -27,6 +29,12 @@ set(CMAKE_CXX_COMPILER_AR "@CMAKE_CXX_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_CXX_COMPILER_RANLIB "@CMAKE_CXX_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
+set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
+set(CMAKE_CXX_COMPILER_LINKER "@CMAKE_CXX_COMPILER_LINKER@")
+set(CMAKE_CXX_COMPILER_LINKER_ID "@CMAKE_CXX_COMPILER_LINKER_ID@")
+set(CMAKE_CXX_COMPILER_LINKER_VERSION @CMAKE_CXX_COMPILER_LINKER_VERSION@)
+set(CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_TAPI "@CMAKE_TAPI@")
set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
@@ -40,7 +48,7 @@ set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
-foreach (lang C OBJC OBJCXX)
+foreach (lang IN ITEMS C OBJC OBJCXX)
if (CMAKE_${lang}_COMPILER_ID_RUN)
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
@@ -84,3 +92,6 @@ set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
set(CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR "@CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR@")
+
+set(CMAKE_CXX_COMPILER_IMPORT_STD "")
+@CMAKE_CXX_IMPORT_STD@
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 2643326..1cd8006 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -33,32 +33,73 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
-#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
-# if defined(__INTEL_CXX11_MODE__)
-# if defined(__cpp_aggregate_nsdmi)
-# define CXX_STD 201402L
-# else
-# define CXX_STD 201103L
-# endif
+#define CXX_STD_98 199711L
+#define CXX_STD_11 201103L
+#define CXX_STD_14 201402L
+#define CXX_STD_17 201703L
+#define CXX_STD_20 202002L
+#define CXX_STD_23 202302L
+
+#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG)
+# if _MSVC_LANG > CXX_STD_17
+# define CXX_STD _MSVC_LANG
+# elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
+# define CXX_STD CXX_STD_20
+# elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17
+# define CXX_STD CXX_STD_20
+# elif _MSVC_LANG > CXX_STD_14
+# define CXX_STD CXX_STD_17
+# elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)
+# define CXX_STD CXX_STD_14
+# elif defined(__INTEL_CXX11_MODE__)
+# define CXX_STD CXX_STD_11
# else
-# define CXX_STD 199711L
+# define CXX_STD CXX_STD_98
# endif
#elif defined(_MSC_VER) && defined(_MSVC_LANG)
-# define CXX_STD _MSVC_LANG
+# if _MSVC_LANG > __cplusplus
+# define CXX_STD _MSVC_LANG
+# else
+# define CXX_STD __cplusplus
+# endif
+#elif defined(__NVCOMPILER)
+# if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
+# define CXX_STD CXX_STD_20
+# else
+# define CXX_STD __cplusplus
+# endif
+#elif defined(__INTEL_COMPILER) || defined(__PGI)
+# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes)
+# define CXX_STD CXX_STD_17
+# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
+# define CXX_STD CXX_STD_14
+# else
+# define CXX_STD __cplusplus
+# endif
+#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__)
+# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
+# define CXX_STD CXX_STD_14
+# else
+# define CXX_STD __cplusplus
+# endif
+#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define CXX_STD CXX_STD_11
#else
# define CXX_STD __cplusplus
#endif
const char* info_language_standard_default = "INFO" ":" "standard_default["
-#if CXX_STD > 202002L
+#if CXX_STD > CXX_STD_23
+ "26"
+#elif CXX_STD > CXX_STD_20
"23"
-#elif CXX_STD > 201703L
+#elif CXX_STD > CXX_STD_17
"20"
-#elif CXX_STD >= 201703L
+#elif CXX_STD > CXX_STD_14
"17"
-#elif CXX_STD >= 201402L
+#elif CXX_STD > CXX_STD_11
"14"
-#elif CXX_STD >= 201103L
+#elif CXX_STD >= CXX_STD_11
"11"
#else
"98"
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 53abf37..3753d18 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -66,7 +66,7 @@ if (NOT _INCLUDED_FILE)
endif ()
if(CMAKE_CXX_SIZEOF_DATA_PTR)
- foreach(f ${CMAKE_CXX_ABI_FILES})
+ foreach(f IN LISTS CMAKE_CXX_ABI_FILES)
include(${f})
endforeach()
unset(CMAKE_CXX_ABI_FILES)
@@ -182,7 +182,7 @@ if(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
endif()
# Initialize CXX link type selection flags from C versions.
-foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+foreach(type IN ITEMS SHARED_LIBRARY SHARED_MODULE EXE)
if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
${CMAKE_${type}_LINK_STATIC_C_FLAGS})
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index 7eb93e2..2817d37 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -42,11 +42,6 @@ function(compiler_id_detection outvar lang)
# Order is relevant here. For example, compilers which pretend to be
# GCC must appear before the actual GCC.
- if ("x${lang}" STREQUAL "xCXX")
- list(APPEND ordered_compilers
- Comeau
- )
- endif()
list(APPEND ordered_compilers
Intel
IntelLLVM
@@ -85,6 +80,7 @@ function(compiler_id_detection outvar lang)
ARMCC
AppleClang
ARMClang
+ TIClang
)
list(APPEND ordered_compilers
Clang
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 6d7d17e..2042e64 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -102,6 +102,10 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI "-h")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI "Texas Instruments")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TIClang )
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TIClang "--version")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TIClang "(TI (.*) Clang Compiler)")
+
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS IAR)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_IAR )
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_IAR "IAR Assembler")
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 8beebc5..73b6cee 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -166,6 +166,11 @@ if (NOT _CMAKE_TOOLCHAIN_PREFIX)
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
set(_CMAKE_TOOLCHAIN_SUFFIX ${CMAKE_MATCH_4})
set(_CMAKE_COMPILER_SUFFIX ${CMAKE_MATCH_6})
+ elseif(CMAKE_C_COMPILER_ID MATCHES "TIClang")
+ if (COMPILER_BASENAME MATCHES "^(.+)?clang(\\.exe)?$")
+ set(_CMAKE_TOOLCHAIN_PREFIX "${CMAKE_MATCH_1}")
+ set(_CMAKE_TOOLCHAIN_SUFFIX "${CMAKE_MATCH_2}")
+ endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(CMAKE_C_COMPILER_TARGET)
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-)
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 6ac4dad..70528da 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -74,10 +74,6 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
set(CMAKE_CUDA_COMPILER_ID_VENDOR_REGEX_Clang "(clang version)")
CMAKE_DETERMINE_COMPILER_ID_VENDOR(CUDA "--version")
- if(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang" AND WIN32)
- message(FATAL_ERROR "Clang with CUDA is not yet supported on Windows. See CMake issue #20776.")
- endif()
-
# Find the CUDA toolkit to get:
# - CMAKE_CUDA_COMPILER_TOOLKIT_VERSION
# - CMAKE_CUDA_COMPILER_TOOLKIT_ROOT
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 40934ec..891ba6e 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -171,6 +171,11 @@ if (NOT _CMAKE_TOOLCHAIN_PREFIX)
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
set(_CMAKE_TOOLCHAIN_SUFFIX ${CMAKE_MATCH_3})
set(_CMAKE_COMPILER_SUFFIX ${CMAKE_MATCH_5})
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "TIClang")
+ if (COMPILER_BASENAME MATCHES "^(.+)?clang(\\.exe)?$")
+ set(_CMAKE_TOOLCHAIN_PREFIX "${CMAKE_MATCH_1}")
+ set(_CMAKE_TOOLCHAIN_SUFFIX "${CMAKE_MATCH_2}")
+ endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(CMAKE_CXX_COMPILER_TARGET)
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-)
diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake
deleted file mode 100644
index 09de7b1..0000000
--- a/Modules/CMakeDetermineCompileFeatures.cmake
+++ /dev/null
@@ -1,246 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-
-function(cmake_determine_compile_features lang)
-
- if("x${lang}" STREQUAL "xC" AND COMMAND cmake_record_c_compile_features)
- message(CHECK_START "Detecting ${lang} compile features")
-
- set(CMAKE_C90_COMPILE_FEATURES)
- set(CMAKE_C99_COMPILE_FEATURES)
- set(CMAKE_C11_COMPILE_FEATURES)
- set(CMAKE_C17_COMPILE_FEATURES)
- set(CMAKE_C23_COMPILE_FEATURES)
-
- include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
-
- cmake_record_c_compile_features()
-
- if(NOT _result EQUAL 0)
- message(CHECK_FAIL "failed")
- return()
- endif()
-
- if (CMAKE_C17_COMPILE_FEATURES AND CMAKE_C23_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_C23_COMPILE_FEATURES ${CMAKE_C17_COMPILE_FEATURES})
- endif()
- if (CMAKE_C11_COMPILE_FEATURES AND CMAKE_C17_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_C17_COMPILE_FEATURES ${CMAKE_C11_COMPILE_FEATURES})
- endif()
- if (CMAKE_C99_COMPILE_FEATURES AND CMAKE_C11_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_C11_COMPILE_FEATURES ${CMAKE_C99_COMPILE_FEATURES})
- endif()
- if (CMAKE_C90_COMPILE_FEATURES AND CMAKE_C99_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_C99_COMPILE_FEATURES ${CMAKE_C90_COMPILE_FEATURES})
- endif()
-
- if(NOT CMAKE_C_COMPILE_FEATURES)
- set(CMAKE_C_COMPILE_FEATURES
- ${CMAKE_C90_COMPILE_FEATURES}
- ${CMAKE_C99_COMPILE_FEATURES}
- ${CMAKE_C11_COMPILE_FEATURES}
- ${CMAKE_C17_COMPILE_FEATURES}
- ${CMAKE_C23_COMPILE_FEATURES}
- )
- endif()
-
- set(CMAKE_C_COMPILE_FEATURES ${CMAKE_C_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_C90_COMPILE_FEATURES ${CMAKE_C90_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_C99_COMPILE_FEATURES ${CMAKE_C99_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_C11_COMPILE_FEATURES ${CMAKE_C11_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_C17_COMPILE_FEATURES ${CMAKE_C17_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_C23_COMPILE_FEATURES ${CMAKE_C23_COMPILE_FEATURES} PARENT_SCOPE)
-
- message(CHECK_PASS "done")
-
- elseif("x${lang}" STREQUAL "xCXX" AND COMMAND cmake_record_cxx_compile_features)
- message(CHECK_START "Detecting ${lang} compile features")
-
- set(CMAKE_CXX98_COMPILE_FEATURES)
- set(CMAKE_CXX11_COMPILE_FEATURES)
- set(CMAKE_CXX14_COMPILE_FEATURES)
- set(CMAKE_CXX17_COMPILE_FEATURES)
- set(CMAKE_CXX20_COMPILE_FEATURES)
- set(CMAKE_CXX23_COMPILE_FEATURES)
- set(CMAKE_CXX26_COMPILE_FEATURES)
-
- include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
-
- cmake_record_cxx_compile_features()
-
- if(NOT _result EQUAL 0)
- message(CHECK_FAIL "failed")
- return()
- endif()
-
- if (CMAKE_CXX23_COMPILE_FEATURES AND CMAKE_CXX26_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CXX26_COMPILE_FEATURES ${CMAKE_CXX23_COMPILE_FEATURES})
- endif()
- if (CMAKE_CXX20_COMPILE_FEATURES AND CMAKE_CXX23_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CXX23_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES})
- endif()
- if (CMAKE_CXX17_COMPILE_FEATURES AND CMAKE_CXX20_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CXX20_COMPILE_FEATURES ${CMAKE_CXX17_COMPILE_FEATURES})
- endif()
- if (CMAKE_CXX14_COMPILE_FEATURES AND CMAKE_CXX17_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CXX17_COMPILE_FEATURES ${CMAKE_CXX14_COMPILE_FEATURES})
- endif()
- if (CMAKE_CXX11_COMPILE_FEATURES AND CMAKE_CXX14_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CXX14_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES})
- endif()
- if (CMAKE_CXX98_COMPILE_FEATURES AND CMAKE_CXX11_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES})
- endif()
-
- if(NOT CMAKE_CXX_COMPILE_FEATURES)
- set(CMAKE_CXX_COMPILE_FEATURES
- ${CMAKE_CXX98_COMPILE_FEATURES}
- ${CMAKE_CXX11_COMPILE_FEATURES}
- ${CMAKE_CXX14_COMPILE_FEATURES}
- ${CMAKE_CXX17_COMPILE_FEATURES}
- ${CMAKE_CXX20_COMPILE_FEATURES}
- ${CMAKE_CXX23_COMPILE_FEATURES}
- ${CMAKE_CXX26_COMPILE_FEATURES}
- )
- endif()
-
- set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CXX98_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CXX14_COMPILE_FEATURES ${CMAKE_CXX14_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CXX17_COMPILE_FEATURES ${CMAKE_CXX17_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CXX20_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CXX23_COMPILE_FEATURES ${CMAKE_CXX23_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CXX26_COMPILE_FEATURES ${CMAKE_CXX26_COMPILE_FEATURES} PARENT_SCOPE)
-
- message(CHECK_PASS "done")
-
- elseif("x${lang}" STREQUAL "xCUDA" AND COMMAND cmake_record_cuda_compile_features)
- message(CHECK_START "Detecting ${lang} compile features")
-
- set(CMAKE_CUDA03_COMPILE_FEATURES)
- set(CMAKE_CUDA11_COMPILE_FEATURES)
- set(CMAKE_CUDA14_COMPILE_FEATURES)
- set(CMAKE_CUDA17_COMPILE_FEATURES)
- set(CMAKE_CUDA20_COMPILE_FEATURES)
- set(CMAKE_CUDA23_COMPILE_FEATURES)
- set(CMAKE_CUDA26_COMPILE_FEATURES)
-
- include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
-
- cmake_record_cuda_compile_features()
-
- if(NOT _result EQUAL 0)
- message(CHECK_FAIL "failed")
- return()
- endif()
-
- if (CMAKE_CUDA23_COMPILE_FEATURES AND CMAKE_CUDA26_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CUDA26_COMPILE_FEATURES ${CMAKE_CUDA23_COMPILE_FEATURES})
- endif()
- if (CMAKE_CUDA20_COMPILE_FEATURES AND CMAKE_CUDA23_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CUDA23_COMPILE_FEATURES ${CMAKE_CUDA20_COMPILE_FEATURES})
- endif()
- if (CMAKE_CUDA17_COMPILE_FEATURES AND CMAKE_CUDA20_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CUDA20_COMPILE_FEATURES ${CMAKE_CUDA17_COMPILE_FEATURES})
- endif()
- if (CMAKE_CUDA14_COMPILE_FEATURES AND CMAKE_CUDA17_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CUDA17_COMPILE_FEATURES ${CMAKE_CUDA14_COMPILE_FEATURES})
- endif()
- if (CMAKE_CUDA11_COMPILE_FEATURES AND CMAKE_CUDA14_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CUDA14_COMPILE_FEATURES ${CMAKE_CUDA11_COMPILE_FEATURES})
- endif()
- if (CMAKE_CUDA03_COMPILE_FEATURES AND CMAKE_CUDA11_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_CUDA11_COMPILE_FEATURES ${CMAKE_CUDA03_COMPILE_FEATURES})
- endif()
-
- if(NOT CMAKE_CUDA_COMPILE_FEATURES)
- set(CMAKE_CUDA_COMPILE_FEATURES
- ${CMAKE_CUDA03_COMPILE_FEATURES}
- ${CMAKE_CUDA11_COMPILE_FEATURES}
- ${CMAKE_CUDA14_COMPILE_FEATURES}
- ${CMAKE_CUDA17_COMPILE_FEATURES}
- ${CMAKE_CUDA20_COMPILE_FEATURES}
- ${CMAKE_CUDA23_COMPILE_FEATURES}
- ${CMAKE_CUDA26_COMPILE_FEATURES}
- )
- endif()
-
- set(CMAKE_CUDA_COMPILE_FEATURES ${CMAKE_CUDA_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CUDA03_COMPILE_FEATURES ${CMAKE_CUDA03_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CUDA11_COMPILE_FEATURES ${CMAKE_CUDA11_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CUDA14_COMPILE_FEATURES ${CMAKE_CUDA14_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CUDA17_COMPILE_FEATURES ${CMAKE_CUDA17_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CUDA20_COMPILE_FEATURES ${CMAKE_CUDA20_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CUDA23_COMPILE_FEATURES ${CMAKE_CUDA23_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_CUDA26_COMPILE_FEATURES ${CMAKE_CUDA26_COMPILE_FEATURES} PARENT_SCOPE)
-
- message(CHECK_PASS "done")
-
- elseif(lang STREQUAL HIP AND COMMAND cmake_record_hip_compile_features)
- message(CHECK_START "Detecting ${lang} compile features")
-
- set(CMAKE_HIP98_COMPILE_FEATURES)
- set(CMAKE_HIP11_COMPILE_FEATURES)
- set(CMAKE_HIP14_COMPILE_FEATURES)
- set(CMAKE_HIP17_COMPILE_FEATURES)
- set(CMAKE_HIP20_COMPILE_FEATURES)
- set(CMAKE_HIP23_COMPILE_FEATURES)
- set(CMAKE_HIP26_COMPILE_FEATURES)
-
-
- include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
-
- cmake_record_hip_compile_features()
-
- if(NOT _result EQUAL 0)
- message(CHECK_FAIL "failed")
- return()
- endif()
-
- if (CMAKE_HIP23_COMPILE_FEATURES AND CMAKE_HIP26_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_HIP26_COMPILE_FEATURES ${CMAKE_HIP23_COMPILE_FEATURES})
- endif()
- if (CMAKE_HIP20_COMPILE_FEATURES AND CMAKE_HIP23_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_HIP23_COMPILE_FEATURES ${CMAKE_HIP20_COMPILE_FEATURES})
- endif()
- if (CMAKE_HIP17_COMPILE_FEATURES AND CMAKE_HIP20_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_HIP20_COMPILE_FEATURES ${CMAKE_HIP17_COMPILE_FEATURES})
- endif()
- if (CMAKE_HIP14_COMPILE_FEATURES AND CMAKE_HIP17_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_HIP17_COMPILE_FEATURES ${CMAKE_HIP14_COMPILE_FEATURES})
- endif()
- if (CMAKE_HIP11_COMPILE_FEATURES AND CMAKE_HIP14_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_HIP14_COMPILE_FEATURES ${CMAKE_HIP11_COMPILE_FEATURES})
- endif()
- if (CMAKE_HIP98_COMPILE_FEATURES AND CMAKE_HIP11_COMPILE_FEATURES)
- list(REMOVE_ITEM CMAKE_HIP11_COMPILE_FEATURES ${CMAKE_HIP98_COMPILE_FEATURES})
- endif()
-
- if(NOT CMAKE_HIP_COMPILE_FEATURES)
- set(CMAKE_HIP_COMPILE_FEATURES
- ${CMAKE_HIP98_COMPILE_FEATURES}
- ${CMAKE_HIP11_COMPILE_FEATURES}
- ${CMAKE_HIP14_COMPILE_FEATURES}
- ${CMAKE_HIP17_COMPILE_FEATURES}
- ${CMAKE_HIP20_COMPILE_FEATURES}
- ${CMAKE_HIP23_COMPILE_FEATURES}
- ${CMAKE_HIP26_COMPILE_FEATURES}
- )
- endif()
-
- set(CMAKE_HIP_COMPILE_FEATURES ${CMAKE_HIP_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_HIP98_COMPILE_FEATURES ${CMAKE_HIP98_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_HIP11_COMPILE_FEATURES ${CMAKE_HIP11_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_HIP14_COMPILE_FEATURES ${CMAKE_HIP14_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_HIP17_COMPILE_FEATURES ${CMAKE_HIP17_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_HIP20_COMPILE_FEATURES ${CMAKE_HIP20_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_HIP23_COMPILE_FEATURES ${CMAKE_HIP23_COMPILE_FEATURES} PARENT_SCOPE)
- set(CMAKE_HIP26_COMPILE_FEATURES ${CMAKE_HIP26_COMPILE_FEATURES} PARENT_SCOPE)
-
- message(CHECK_PASS "done")
-
- endif()
-
-endfunction()
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 3156ca9..fc0b714 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -15,7 +15,7 @@ macro(_cmake_find_compiler lang)
set(_${lang}_COMPILER_LIST "${CMAKE_${lang}_COMPILER_LIST}")
set(CMAKE_${lang}_COMPILER_LIST "")
# Prefer vendors of compilers from reference languages.
- foreach(l ${_languages})
+ foreach(l IN LISTS _languages)
list(APPEND CMAKE_${lang}_COMPILER_LIST
${_${lang}_COMPILER_NAMES_${CMAKE_${l}_COMPILER_ID}})
endforeach()
@@ -33,7 +33,7 @@ macro(_cmake_find_compiler lang)
# Look for directories containing compilers of reference languages.
set(_${lang}_COMPILER_HINTS "${CMAKE_${lang}_COMPILER_HINTS}")
- foreach(l ${_languages})
+ foreach(l IN LISTS _languages)
if(CMAKE_${l}_COMPILER AND IS_ABSOLUTE "${CMAKE_${l}_COMPILER}")
get_filename_component(_hint "${CMAKE_${l}_COMPILER}" PATH)
if(IS_DIRECTORY "${_hint}")
@@ -99,7 +99,7 @@ macro(_cmake_find_compiler lang)
if (CMAKE_${lang}_COMPILER MATCHES "^/usr/bin/(.+)$")
_query_xcrun("${CMAKE_MATCH_1}" RESULT_VAR xcrun_result)
elseif (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND")
- foreach(comp ${CMAKE_${lang}_COMPILER_LIST})
+ foreach(comp IN LISTS CMAKE_${lang}_COMPILER_LIST)
_query_xcrun("${comp}" RESULT_VAR xcrun_result)
if(xcrun_result)
break()
@@ -120,6 +120,10 @@ macro(_cmake_find_compiler_path lang)
# CMAKE_${lang}_COMPILER and the rest as CMAKE_${lang}_COMPILER_ARG1
# Otherwise, preserve any existing CMAKE_${lang}_COMPILER_ARG1 that might
# have been saved by CMakeDetermine${lang}Compiler in a previous run.
+
+ # Necessary for Windows paths to avoid improper escaping of backslashes
+ cmake_path(CONVERT "${CMAKE_${lang}_COMPILER}" TO_CMAKE_PATH_LIST CMAKE_${lang}_COMPILER NORMALIZE)
+
list(LENGTH CMAKE_${lang}_COMPILER _CMAKE_${lang}_COMPILER_LENGTH)
if(_CMAKE_${lang}_COMPILER_LENGTH GREATER 1)
set(CMAKE_${lang}_COMPILER_ARG1 "${CMAKE_${lang}_COMPILER}")
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index efc18f9..6d82304 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -6,6 +6,7 @@
# This is used internally by CMake and should not be included by user
# code.
+include(${CMAKE_ROOT}/Modules/Internal/CMakeDetermineLinkerId.cmake)
include(${CMAKE_ROOT}/Modules/CMakeParseImplicitIncludeInfo.cmake)
include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
include(${CMAKE_ROOT}/Modules/CMakeParseLibraryArchitecture.cmake)
@@ -19,15 +20,19 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerABI_${lang}.bin")
set(CMAKE_FLAGS )
set(COMPILE_DEFINITIONS )
+ set(LINK_OPTIONS )
if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
- set(CMAKE_FLAGS "-DEXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
+ set(LINK_OPTIONS "${CMAKE_${lang}_VERBOSE_FLAG}")
set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_FLAG}")
endif()
if(DEFINED CMAKE_${lang}_VERBOSE_COMPILE_FLAG)
set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_COMPILE_FLAG}")
endif()
+ if(DEFINED CMAKE_${lang}_VERBOSE_LINK_FLAG)
+ list(APPEND LINK_OPTIONS "${CMAKE_${lang}_VERBOSE_LINK_FLAG}")
+ endif()
if(lang MATCHES "^(CUDA|HIP)$")
- if(CMAKE_${lang}_ARCHITECTURES STREQUAL "native")
+ if(CMAKE_CUDA_ARCHITECTURES STREQUAL "native")
# We are about to detect the native architectures, so we do
# not yet know them. Use all architectures during detection.
set(CMAKE_${lang}_ARCHITECTURES "all")
@@ -39,10 +44,20 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
# from which we might detect implicit link libraries.
list(APPEND CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD_LIBRARIES=")
endif()
+ list(JOIN LINK_OPTIONS " " LINK_OPTIONS)
+ list(APPEND CMAKE_FLAGS "-DEXE_LINKER_FLAGS=${LINK_OPTIONS}")
+
__TestCompiler_setTryCompileTargetType()
# Avoid failing ABI detection on warnings.
- string(REGEX REPLACE "(^| )-Werror([= ][^-][^ ]*)?( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
+ if(CMAKE_TRY_COMPILE_CONFIGURATION)
+ string(TOUPPER "${CMAKE_TRY_COMPILE_CONFIGURATION}" _tc_config)
+ else()
+ set(_tc_config "DEBUG")
+ endif()
+ foreach(v CMAKE_${lang}_FLAGS CMAKE_${lang}_FLAGS_${_tc_config})
+ string(REGEX REPLACE "(^| )-Werror([= ][^-][^ ]*)?( |$)" " " ${v} "${${v}}")
+ endforeach()
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables
# and set them to "C" that way GCC's "search starts here" text is in
@@ -53,7 +68,6 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
set(ENV{LC_ALL} C)
set(ENV{LC_MESSAGES} C)
set(ENV{LANG} C)
-
try_compile(CMAKE_${lang}_ABI_COMPILED
SOURCES ${src}
CMAKE_FLAGS ${CMAKE_FLAGS}
@@ -82,7 +96,10 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
# Load the resulting information strings.
if(CMAKE_${lang}_ABI_COMPILED)
message(CHECK_PASS "done")
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 32 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]")
+ cmake_policy(POP)
set(ABI_SIZEOF_DPTR "NOTFOUND")
set(ABI_BYTE_ORDER "NOTFOUND")
set(ABI_NAME "NOTFOUND")
@@ -146,39 +163,42 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
set(implicit_libs "${CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES}")
set(implicit_fwks "${CMAKE_${lang}_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}")
else()
- # Parse implicit linker information for this language, if available.
- set(implicit_dirs "")
- set(implicit_objs "")
- set(implicit_libs "")
- set(implicit_fwks "")
- if(CMAKE_${lang}_VERBOSE_FLAG)
- CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs implicit_fwks log
- "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}"
- COMPUTE_IMPLICIT_OBJECTS implicit_objs
- LANGUAGE ${lang})
- message(CONFIGURE_LOG
- "Parsed ${lang} implicit link information:\n${log}\n\n")
- endif()
- # for VS IDE Intel Fortran we have to figure out the
- # implicit link path for the fortran run time using
- # a try-compile
- if("${lang}" MATCHES "Fortran"
- AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
- message(CHECK_START "Determine Intel Fortran Compiler Implicit Link Path")
- # Build a sample project which reports symbols.
- try_compile(IFORT_LIB_PATH_COMPILED
- PROJECT IntelFortranImplicit
- SOURCE_DIR ${CMAKE_ROOT}/Modules/IntelVSImplicitPath
- BINARY_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
- CMAKE_FLAGS
- "-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
- OUTPUT_VARIABLE _output)
- file(WRITE
- "${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt"
- "${_output}")
- include(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
- message(CHECK_PASS "done")
- endif()
+ # Parse implicit linker information for this language, if available.
+ set(implicit_dirs "")
+ set(implicit_objs "")
+ set(implicit_libs "")
+ set(implicit_fwks "")
+ set(compute_artifacts COMPUTE_LINKER linker_tool)
+ if(CMAKE_${lang}_VERBOSE_FLAG)
+ list(APPEND compute_artifacts COMPUTE_IMPLICIT_LIBS implicit_libs
+ COMPUTE_IMPLICIT_DIRS implicit_dirs
+ COMPUTE_IMPLICIT_FWKS implicit_fwks
+ COMPUTE_IMPLICIT_OBJECTS implicit_objs)
+ endif()
+ cmake_parse_implicit_link_info2("${OUTPUT}" log "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}"
+ ${compute_artifacts} LANGUAGE ${lang})
+ message(CONFIGURE_LOG
+ "Parsed ${lang} implicit link information:\n${log}\n\n")
+ # for VS IDE Intel Fortran we have to figure out the
+ # implicit link path for the fortran run time using
+ # a try-compile
+ if("${lang}" MATCHES "Fortran"
+ AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+ message(CHECK_START "Determine Intel Fortran Compiler Implicit Link Path")
+ # Build a sample project which reports symbols.
+ try_compile(IFORT_LIB_PATH_COMPILED
+ PROJECT IntelFortranImplicit
+ SOURCE_DIR ${CMAKE_ROOT}/Modules/IntelVSImplicitPath
+ BINARY_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
+ CMAKE_FLAGS
+ "-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
+ OUTPUT_VARIABLE _output)
+ file(WRITE
+ "${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt"
+ "${_output}")
+ include(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
+ message(CHECK_PASS "done")
+ endif()
endif()
# Implicit link libraries cannot be used explicitly for multiple
@@ -193,6 +213,12 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
list(REMOVE_ITEM implicit_dirs $ENV{CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES_EXCLUDE})
endif()
+ set(CMAKE_${lang}_COMPILER_LINKER "${linker_tool}" PARENT_SCOPE)
+ cmake_determine_linker_id(${lang} "${linker_tool}")
+ set(CMAKE_${lang}_COMPILER_LINKER_ID "${CMAKE_${lang}_COMPILER_LINKER_ID}" PARENT_SCOPE)
+ set(CMAKE_${lang}_COMPILER_LINKER_VERSION ${CMAKE_${lang}_COMPILER_LINKER_VERSION} PARENT_SCOPE)
+ set(CMAKE_${lang}_COMPILER_LINKER_FRONTEND_VARIANT ${CMAKE_${lang}_COMPILER_LINKER_FRONTEND_VARIANT} PARENT_SCOPE)
+
set(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
set(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE)
set(CMAKE_${lang}_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${implicit_fwks}" PARENT_SCOPE)
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 85c555a..7fcfbdc 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -174,27 +174,30 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endif()
endif()
- # FIXME(LLVMFlang): It does not provide predefines identifying the MSVC ABI or architecture.
- # It should be taught to define _MSC_VER and its _M_* architecture flags.
if("x${lang}" STREQUAL "xFortran" AND "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xLLVMFlang")
- # Parse the target triple to detect information we should later be able
- # to get during preprocessing above, once LLVMFlang provides it.
+ # Parse the target triple to detect information not always available from the preprocessor.
if(COMPILER_${lang}_PRODUCED_OUTPUT MATCHES "-triple ([0-9a-z_]*)-.*windows-msvc([0-9]+)\\.([0-9]+)")
- set(CMAKE_${lang}_SIMULATE_ID "MSVC")
+ # CMakeFortranCompilerId.F.in does not extract the _MSC_VER minor version.
+ # We can do better using the version parsed here.
set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
- set(arch ${CMAKE_MATCH_1})
- if(arch STREQUAL "x86_64")
- set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "x64")
- elseif(arch STREQUAL "aarch64")
- set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "ARM64")
- elseif(arch STREQUAL "arm64ec")
- set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "ARM64EC")
- elseif(arch MATCHES "^i[3-9]86$")
- set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "X86")
- else()
- message(FATAL_ERROR "LLVMFlang target architecture unrecognized: ${arch}")
+
+ if (CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 18.0)
+ # LLVMFlang < 18.0 does not provide predefines identifying the MSVC ABI or architecture.
+ set(CMAKE_${lang}_SIMULATE_ID "MSVC")
+ set(arch ${CMAKE_MATCH_1})
+ if(arch STREQUAL "x86_64")
+ set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "x64")
+ elseif(arch STREQUAL "aarch64")
+ set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "ARM64")
+ elseif(arch STREQUAL "arm64ec")
+ set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "ARM64EC")
+ elseif(arch MATCHES "^i[3-9]86$")
+ set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "X86")
+ else()
+ message(FATAL_ERROR "LLVMFlang target architecture unrecognized: ${arch}")
+ endif()
+ set(MSVC_${lang}_ARCHITECTURE_ID "${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID}")
endif()
- set(MSVC_${lang}_ARCHITECTURE_ID "${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID}")
elseif(COMPILER_${lang}_PRODUCED_OUTPUT MATCHES "-triple ([0-9a-z_]*)-.*windows-gnu")
set(CMAKE_${lang}_SIMULATE_ID "GNU")
endif()
@@ -277,7 +280,8 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endif()
elseif("x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xGNU"
OR "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xAppleClang"
- OR "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xFujitsuClang")
+ OR "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xFujitsuClang"
+ OR "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xTIClang")
set(CMAKE_${lang}_COMPILER_FRONTEND_VARIANT "GNU")
elseif("x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC")
set(CMAKE_${lang}_COMPILER_FRONTEND_VARIANT "MSVC")
@@ -308,6 +312,29 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endif ()
endif ()
+ set(CMAKE_${lang}_STANDARD_LIBRARY "")
+ if ("x${lang}" STREQUAL "xCXX" AND
+ EXISTS "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/${lang}-DetectStdlib.h" AND
+ "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xClang" AND
+ "x${CMAKE_${lang}_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ # See #20851 for a proper abstraction for this.
+ execute_process(
+ COMMAND "${CMAKE_${lang}_COMPILER}"
+ ${CMAKE_${lang}_COMPILER_ID_ARG1}
+ ${CMAKE_CXX_COMPILER_ID_FLAGS_LIST}
+ -E
+ -x c++-header
+ "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/${lang}-DetectStdlib.h"
+ -o - # Write to stdout.
+ OUTPUT_VARIABLE _lang_stdlib_out
+ ERROR_VARIABLE _lang_stdlib_err
+ RESULT_VARIABLE _lang_stdlib_res
+ ERROR_STRIP_TRAILING_WHITESPACE)
+ if (_lang_stdlib_res EQUAL 0)
+ string(REGEX REPLACE ".*CMAKE-STDLIB-DETECT: (.+)\n.*" "\\1" "CMAKE_${lang}_STANDARD_LIBRARY" "${_lang_stdlib_out}")
+ endif ()
+ endif ()
+
# Display the final identification result.
if(CMAKE_${lang}_COMPILER_ID)
if(CMAKE_${lang}_COMPILER_VERSION)
@@ -351,6 +378,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
set(CMAKE_${lang}_COMPILER_PRODUCED_OUTPUT "${COMPILER_${lang}_PRODUCED_OUTPUT}" PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_CLANG_RESOURCE_DIR "${CMAKE_${lang}_COMPILER_CLANG_RESOURCE_DIR}" PARENT_SCOPE)
+ set(CMAKE_${lang}_STANDARD_LIBRARY "${CMAKE_${lang}_STANDARD_LIBRARY}" PARENT_SCOPE)
endfunction()
include(CMakeCompilerIdDetection)
@@ -426,7 +454,13 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
elseif(lang STREQUAL Fortran)
set(v Intel)
set(ext vfproj)
- set(id_cl ifort.exe)
+ if(CMAKE_VS_PLATFORM_TOOLSET_FORTRAN)
+ set(id_cl "${CMAKE_VS_PLATFORM_TOOLSET_FORTRAN}.exe")
+ set(id_UseCompiler "UseCompiler=\"${CMAKE_VS_PLATFORM_TOOLSET_FORTRAN}Compiler\"")
+ else()
+ set(id_cl ifort.exe)
+ set(id_UseCompiler "")
+ endif()
elseif(lang STREQUAL CSharp)
set(v 10)
set(ext csproj)
@@ -909,9 +943,12 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set(SIMULATE_VERSION)
set(CMAKE_${lang}_COMPILER_ID_STRING_REGEX ".?I.?N.?F.?O.?:.?[A-Za-z0-9_]+\\[[^]]*\\]")
foreach(encoding "" "ENCODING;UTF-16LE" "ENCODING;UTF-16BE")
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS "${file}" CMAKE_${lang}_COMPILER_ID_STRINGS
LIMIT_COUNT 38 ${encoding}
REGEX "${CMAKE_${lang}_COMPILER_ID_STRING_REGEX}")
+ cmake_policy(POP)
if(NOT CMAKE_${lang}_COMPILER_ID_STRINGS STREQUAL "")
break()
endif()
diff --git a/Modules/CMakeDetermineCompilerSupport.cmake b/Modules/CMakeDetermineCompilerSupport.cmake
new file mode 100644
index 0000000..d561e7b
--- /dev/null
+++ b/Modules/CMakeDetermineCompilerSupport.cmake
@@ -0,0 +1,260 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+
+function(cmake_determine_compiler_support lang)
+
+ if("x${lang}" STREQUAL "xC" AND COMMAND cmake_record_c_compile_features)
+ message(CHECK_START "Detecting ${lang} compile features")
+
+ set(CMAKE_C90_COMPILE_FEATURES)
+ set(CMAKE_C99_COMPILE_FEATURES)
+ set(CMAKE_C11_COMPILE_FEATURES)
+ set(CMAKE_C17_COMPILE_FEATURES)
+ set(CMAKE_C23_COMPILE_FEATURES)
+
+ include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
+
+ cmake_record_c_compile_features()
+
+ if(NOT _result EQUAL 0)
+ message(CHECK_FAIL "failed")
+ return()
+ endif()
+
+ if (CMAKE_C17_COMPILE_FEATURES AND CMAKE_C23_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_C23_COMPILE_FEATURES ${CMAKE_C17_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_C11_COMPILE_FEATURES AND CMAKE_C17_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_C17_COMPILE_FEATURES ${CMAKE_C11_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_C99_COMPILE_FEATURES AND CMAKE_C11_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_C11_COMPILE_FEATURES ${CMAKE_C99_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_C90_COMPILE_FEATURES AND CMAKE_C99_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_C99_COMPILE_FEATURES ${CMAKE_C90_COMPILE_FEATURES})
+ endif()
+
+ if(NOT CMAKE_C_COMPILE_FEATURES)
+ set(CMAKE_C_COMPILE_FEATURES
+ ${CMAKE_C90_COMPILE_FEATURES}
+ ${CMAKE_C99_COMPILE_FEATURES}
+ ${CMAKE_C11_COMPILE_FEATURES}
+ ${CMAKE_C17_COMPILE_FEATURES}
+ ${CMAKE_C23_COMPILE_FEATURES}
+ )
+ endif()
+
+ set(CMAKE_C_COMPILE_FEATURES ${CMAKE_C_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_C90_COMPILE_FEATURES ${CMAKE_C90_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_C99_COMPILE_FEATURES ${CMAKE_C99_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_C11_COMPILE_FEATURES ${CMAKE_C11_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_C17_COMPILE_FEATURES ${CMAKE_C17_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_C23_COMPILE_FEATURES ${CMAKE_C23_COMPILE_FEATURES} PARENT_SCOPE)
+
+ message(CHECK_PASS "done")
+
+ elseif("x${lang}" STREQUAL "xCXX" AND COMMAND cmake_record_cxx_compile_features)
+ message(CHECK_START "Detecting ${lang} compile features")
+
+ set(CMAKE_CXX98_COMPILE_FEATURES)
+ set(CMAKE_CXX11_COMPILE_FEATURES)
+ set(CMAKE_CXX14_COMPILE_FEATURES)
+ set(CMAKE_CXX17_COMPILE_FEATURES)
+ set(CMAKE_CXX20_COMPILE_FEATURES)
+ set(CMAKE_CXX23_COMPILE_FEATURES)
+ set(CMAKE_CXX26_COMPILE_FEATURES)
+
+ include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
+
+ cmake_record_cxx_compile_features()
+
+ if(NOT _result EQUAL 0)
+ message(CHECK_FAIL "failed")
+ return()
+ endif()
+
+ if (CMAKE_CXX23_COMPILE_FEATURES AND CMAKE_CXX26_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CXX26_COMPILE_FEATURES ${CMAKE_CXX23_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_CXX20_COMPILE_FEATURES AND CMAKE_CXX23_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CXX23_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_CXX17_COMPILE_FEATURES AND CMAKE_CXX20_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CXX20_COMPILE_FEATURES ${CMAKE_CXX17_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_CXX14_COMPILE_FEATURES AND CMAKE_CXX17_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CXX17_COMPILE_FEATURES ${CMAKE_CXX14_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_CXX11_COMPILE_FEATURES AND CMAKE_CXX14_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CXX14_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_CXX98_COMPILE_FEATURES AND CMAKE_CXX11_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES})
+ endif()
+
+ if(NOT CMAKE_CXX_COMPILE_FEATURES)
+ set(CMAKE_CXX_COMPILE_FEATURES
+ ${CMAKE_CXX98_COMPILE_FEATURES}
+ ${CMAKE_CXX11_COMPILE_FEATURES}
+ ${CMAKE_CXX14_COMPILE_FEATURES}
+ ${CMAKE_CXX17_COMPILE_FEATURES}
+ ${CMAKE_CXX20_COMPILE_FEATURES}
+ ${CMAKE_CXX23_COMPILE_FEATURES}
+ ${CMAKE_CXX26_COMPILE_FEATURES}
+ )
+ endif()
+
+ # Create targets for use with `import std;` here.
+ set(CMAKE_CXX_IMPORT_STD "")
+ foreach (_cmake_import_std_version IN ITEMS 23 26)
+ if (CMAKE_CXX${_cmake_import_std_version}_COMPILE_FEATURES)
+ set(_cmake_cxx_import_std "")
+ cmake_create_cxx_import_std("${_cmake_import_std_version}" _cmake_cxx_import_std)
+ if (_cmake_cxx_import_std)
+ string(APPEND CMAKE_CXX_IMPORT_STD "### Imported target for C++${_cmake_import_std_version} standard library\n")
+ string(APPEND CMAKE_CXX_IMPORT_STD "${_cmake_cxx_import_std}\n\n")
+ endif ()
+ endif ()
+ endforeach ()
+
+ set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX98_COMPILE_FEATURES ${CMAKE_CXX98_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX11_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX14_COMPILE_FEATURES ${CMAKE_CXX14_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX17_COMPILE_FEATURES ${CMAKE_CXX17_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX20_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX23_COMPILE_FEATURES ${CMAKE_CXX23_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX26_COMPILE_FEATURES ${CMAKE_CXX26_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CXX_IMPORT_STD ${CMAKE_CXX_IMPORT_STD} PARENT_SCOPE)
+
+ message(CHECK_PASS "done")
+
+ elseif("x${lang}" STREQUAL "xCUDA" AND COMMAND cmake_record_cuda_compile_features)
+ message(CHECK_START "Detecting ${lang} compile features")
+
+ set(CMAKE_CUDA03_COMPILE_FEATURES)
+ set(CMAKE_CUDA11_COMPILE_FEATURES)
+ set(CMAKE_CUDA14_COMPILE_FEATURES)
+ set(CMAKE_CUDA17_COMPILE_FEATURES)
+ set(CMAKE_CUDA20_COMPILE_FEATURES)
+ set(CMAKE_CUDA23_COMPILE_FEATURES)
+ set(CMAKE_CUDA26_COMPILE_FEATURES)
+
+ include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
+
+ cmake_record_cuda_compile_features()
+
+ if(NOT _result EQUAL 0)
+ message(CHECK_FAIL "failed")
+ return()
+ endif()
+
+ if (CMAKE_CUDA23_COMPILE_FEATURES AND CMAKE_CUDA26_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CUDA26_COMPILE_FEATURES ${CMAKE_CUDA23_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_CUDA20_COMPILE_FEATURES AND CMAKE_CUDA23_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CUDA23_COMPILE_FEATURES ${CMAKE_CUDA20_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_CUDA17_COMPILE_FEATURES AND CMAKE_CUDA20_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CUDA20_COMPILE_FEATURES ${CMAKE_CUDA17_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_CUDA14_COMPILE_FEATURES AND CMAKE_CUDA17_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CUDA17_COMPILE_FEATURES ${CMAKE_CUDA14_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_CUDA11_COMPILE_FEATURES AND CMAKE_CUDA14_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CUDA14_COMPILE_FEATURES ${CMAKE_CUDA11_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_CUDA03_COMPILE_FEATURES AND CMAKE_CUDA11_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_CUDA11_COMPILE_FEATURES ${CMAKE_CUDA03_COMPILE_FEATURES})
+ endif()
+
+ if(NOT CMAKE_CUDA_COMPILE_FEATURES)
+ set(CMAKE_CUDA_COMPILE_FEATURES
+ ${CMAKE_CUDA03_COMPILE_FEATURES}
+ ${CMAKE_CUDA11_COMPILE_FEATURES}
+ ${CMAKE_CUDA14_COMPILE_FEATURES}
+ ${CMAKE_CUDA17_COMPILE_FEATURES}
+ ${CMAKE_CUDA20_COMPILE_FEATURES}
+ ${CMAKE_CUDA23_COMPILE_FEATURES}
+ ${CMAKE_CUDA26_COMPILE_FEATURES}
+ )
+ endif()
+
+ set(CMAKE_CUDA_COMPILE_FEATURES ${CMAKE_CUDA_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CUDA03_COMPILE_FEATURES ${CMAKE_CUDA03_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CUDA11_COMPILE_FEATURES ${CMAKE_CUDA11_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CUDA14_COMPILE_FEATURES ${CMAKE_CUDA14_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CUDA17_COMPILE_FEATURES ${CMAKE_CUDA17_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CUDA20_COMPILE_FEATURES ${CMAKE_CUDA20_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CUDA23_COMPILE_FEATURES ${CMAKE_CUDA23_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_CUDA26_COMPILE_FEATURES ${CMAKE_CUDA26_COMPILE_FEATURES} PARENT_SCOPE)
+
+ message(CHECK_PASS "done")
+
+ elseif(lang STREQUAL HIP AND COMMAND cmake_record_hip_compile_features)
+ message(CHECK_START "Detecting ${lang} compile features")
+
+ set(CMAKE_HIP98_COMPILE_FEATURES)
+ set(CMAKE_HIP11_COMPILE_FEATURES)
+ set(CMAKE_HIP14_COMPILE_FEATURES)
+ set(CMAKE_HIP17_COMPILE_FEATURES)
+ set(CMAKE_HIP20_COMPILE_FEATURES)
+ set(CMAKE_HIP23_COMPILE_FEATURES)
+ set(CMAKE_HIP26_COMPILE_FEATURES)
+
+
+ include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
+
+ cmake_record_hip_compile_features()
+
+ if(NOT _result EQUAL 0)
+ message(CHECK_FAIL "failed")
+ return()
+ endif()
+
+ if (CMAKE_HIP23_COMPILE_FEATURES AND CMAKE_HIP26_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP26_COMPILE_FEATURES ${CMAKE_HIP23_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_HIP20_COMPILE_FEATURES AND CMAKE_HIP23_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP23_COMPILE_FEATURES ${CMAKE_HIP20_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_HIP17_COMPILE_FEATURES AND CMAKE_HIP20_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP20_COMPILE_FEATURES ${CMAKE_HIP17_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_HIP14_COMPILE_FEATURES AND CMAKE_HIP17_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP17_COMPILE_FEATURES ${CMAKE_HIP14_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_HIP11_COMPILE_FEATURES AND CMAKE_HIP14_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP14_COMPILE_FEATURES ${CMAKE_HIP11_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_HIP98_COMPILE_FEATURES AND CMAKE_HIP11_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP11_COMPILE_FEATURES ${CMAKE_HIP98_COMPILE_FEATURES})
+ endif()
+
+ if(NOT CMAKE_HIP_COMPILE_FEATURES)
+ set(CMAKE_HIP_COMPILE_FEATURES
+ ${CMAKE_HIP98_COMPILE_FEATURES}
+ ${CMAKE_HIP11_COMPILE_FEATURES}
+ ${CMAKE_HIP14_COMPILE_FEATURES}
+ ${CMAKE_HIP17_COMPILE_FEATURES}
+ ${CMAKE_HIP20_COMPILE_FEATURES}
+ ${CMAKE_HIP23_COMPILE_FEATURES}
+ ${CMAKE_HIP26_COMPILE_FEATURES}
+ )
+ endif()
+
+ set(CMAKE_HIP_COMPILE_FEATURES ${CMAKE_HIP_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP98_COMPILE_FEATURES ${CMAKE_HIP98_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP11_COMPILE_FEATURES ${CMAKE_HIP11_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP14_COMPILE_FEATURES ${CMAKE_HIP14_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP17_COMPILE_FEATURES ${CMAKE_HIP17_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP20_COMPILE_FEATURES ${CMAKE_HIP20_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP23_COMPILE_FEATURES ${CMAKE_HIP23_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP26_COMPILE_FEATURES ${CMAKE_HIP26_COMPILE_FEATURES} PARENT_SCOPE)
+
+ message(CHECK_PASS "done")
+
+ endif()
+
+endfunction()
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 392f0f1..613b0c4 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -22,7 +22,7 @@ elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
_cmake_find_compiler_path(Fortran)
else()
if(NOT CMAKE_Fortran_COMPILER)
- # prefer the environment variable CC
+ # prefer the environment variable FC
if(NOT $ENV{FC} STREQUAL "")
get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
if(CMAKE_Fortran_FLAGS_ENV_INIT)
@@ -140,11 +140,11 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
set(CMAKE_Fortran_COMPILER_ID_TOOL_MATCH_INDEX 2)
set(_version_info "")
- foreach(m MAJOR MINOR PATCH TWEAK)
+ foreach(m IN ITEMS MAJOR MINOR PATCH TWEAK)
set(_COMP "_${m}")
string(APPEND _version_info "
#if defined(COMPILER_VERSION${_COMP})")
- foreach(d 1 2 3 4 5 6 7 8)
+ foreach(d RANGE 1 8)
string(APPEND _version_info "
# undef DEC
# undef HEX
@@ -265,8 +265,8 @@ if("${CMAKE_Fortran_COMPILER_ID};${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "LLVMFla
"${log}\n"
)
set(_CMAKE_Fortran_IMPLICIT_LINK_INFORMATION_DETERMINED_EARLY 1)
- if("x${CMAKE_Fortran_COMPILER_ARCHITECTURE_ID}" STREQUAL "xARM64")
- # FIXME(LLVMFlang): It does not add `-defaultlib:` fields to object
+ if("x${CMAKE_Fortran_COMPILER_ARCHITECTURE_ID}" STREQUAL "xARM64" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
+ # LLVMFlang < 18.0 does not add `-defaultlib:` fields to object
# files to specify link dependencies on its runtime libraries.
# For now, we add them ourselves.
list(APPEND CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "clang_rt.builtins-aarch64.lib")
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index fff4e9d..b330ed9 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -6,30 +6,6 @@
# CMAKE_SYSTEM_NAME - on unix this is uname -s, for windows it is Windows
# CMAKE_SYSTEM_VERSION - on unix this is uname -r, for windows it is empty
# CMAKE_SYSTEM - ${CMAKE_SYSTEM}-${CMAKE_SYSTEM_VERSION}, for windows: ${CMAKE_SYSTEM}
-#
-# Expected uname -s output:
-#
-# AIX AIX
-# BSD/OS BSD/OS
-# FreeBSD FreeBSD
-# HP-UX HP-UX
-# Linux Linux
-# GNU/kFreeBSD GNU/kFreeBSD
-# NetBSD NetBSD
-# OpenBSD OpenBSD
-# OFS/1 (Digital Unix) OSF1
-# SCO OpenServer 5 SCO_SV
-# SCO UnixWare 7 UnixWare
-# SCO UnixWare (pre release 7) UNIX_SV
-# SCO XENIX Xenix
-# Solaris SunOS
-# SunOS SunOS
-# Tru64 Tru64
-# Ultrix ULTRIX
-# cygwin CYGWIN_NT-5.1
-# MSYS MSYS_NT-6.1
-# MacOSX Darwin
-
# find out on which system cmake runs
if(CMAKE_HOST_UNIX)
@@ -177,22 +153,19 @@ if(CMAKE_TOOLCHAIN_FILE)
endif()
endif()
-
-# if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
-# or it was set via -DCMAKE_SYSTEM_NAME=...
-# if that's the case, assume we are crosscompiling
if(CMAKE_SYSTEM_NAME)
+ # CMAKE_SYSTEM_NAME was set by a toolchain file or on the command line.
+ # Assume it set CMAKE_SYSTEM_VERSION and CMAKE_SYSTEM_PROCESSOR too.
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING TRUE)
endif()
- set(PRESET_CMAKE_SYSTEM_NAME TRUE)
elseif(CMAKE_VS_WINCE_VERSION)
set(CMAKE_SYSTEM_NAME "WindowsCE")
set(CMAKE_SYSTEM_VERSION "${CMAKE_VS_WINCE_VERSION}")
set(CMAKE_SYSTEM_PROCESSOR "${MSVC_C_ARCHITECTURE_ID}")
set(CMAKE_CROSSCOMPILING TRUE)
- set(PRESET_CMAKE_SYSTEM_NAME TRUE)
else()
+ # Build for the host platform and architecture by default.
set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
if(NOT DEFINED CMAKE_SYSTEM_VERSION)
set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
@@ -206,7 +179,6 @@ else()
)
endif()
set(CMAKE_CROSSCOMPILING FALSE)
- set(PRESET_CMAKE_SYSTEM_NAME FALSE)
endif()
include(Platform/${CMAKE_SYSTEM_NAME}-Determine OPTIONAL)
@@ -224,7 +196,7 @@ endif()
# in this case there is no CMAKE_BINARY_DIR
if(CMAKE_BINARY_DIR)
# write entry to the log file
- if(PRESET_CMAKE_SYSTEM_NAME)
+ if(CMAKE_CROSSCOMPILING)
message(CONFIGURE_LOG
"The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n"
"The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n"
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index e12b175..5e85440 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -60,6 +60,13 @@ endfunction()
__resolve_tool_path(CMAKE_LINKER "${_CMAKE_TOOLCHAIN_LOCATION}" "Default Linker")
__resolve_tool_path(CMAKE_MT "${_CMAKE_TOOLCHAIN_LOCATION}" "Default Manifest Tool")
+macro(__resolve_linker_path __linker_type __name __search_path __doc)
+ if(NOT CMAKE_LINKER_${__linker_type})
+ set( CMAKE_LINKER_${__linker_type} "${__name}")
+ endif()
+ __resolve_tool_path(CMAKE_LINKER_${__linker_type} "${__search_path}" "${__doc}")
+endmacro()
+
set(_CMAKE_TOOL_VARS "")
# if it's the MS C/CXX compiler, search for link
@@ -93,6 +100,10 @@ if(("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC" AND
list(APPEND _CMAKE_TOOL_VARS LINKER MT AR)
+ # look-up for possible usable linker
+ __resolve_linker_path(LINK "link" "${_CMAKE_TOOLCHAIN_LOCATION}" "link Linker")
+ __resolve_linker_path(LLD "lld-link" "${_CMAKE_TOOLCHAIN_LOCATION}" "lld-link Linker")
+
elseif("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^x(Open)?Watcom$")
set(_CMAKE_LINKER_NAMES "wlink")
set(_CMAKE_AR_NAMES "wlib")
@@ -193,10 +204,10 @@ else()
endif()
list(PREPEND _CMAKE_NM_NAMES "llvm-nm")
if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}" VERSION_GREATER_EQUAL 9)
- # llvm-objdump versions prior to 9 did not support everything we need.
+ # llvm-objcopy and llvm-objdump on versions prior to 9 did not support everything we need.
+ list(PREPEND _CMAKE_OBJCOPY_NAMES "llvm-objcopy")
list(PREPEND _CMAKE_OBJDUMP_NAMES "llvm-objdump")
endif()
- list(PREPEND _CMAKE_OBJCOPY_NAMES "llvm-objcopy")
list(PREPEND _CMAKE_READELF_NAMES "llvm-readelf")
list(PREPEND _CMAKE_DLLTOOL_NAMES "llvm-dlltool")
list(PREPEND _CMAKE_ADDR2LINE_NAMES "llvm-addr2line")
diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake
index 726e2a2..a6bbcc4 100644
--- a/Modules/CMakeFindPackageMode.cmake
+++ b/Modules/CMakeFindPackageMode.cmake
@@ -5,10 +5,9 @@
CMakeFindPackageMode
--------------------
-
-
-This file is executed by cmake when invoked with --find-package. It
-expects that the following variables are set using -D:
+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``:
``NAME``
name of the package
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index 89a00ab..90c2ad0 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -15,6 +15,10 @@ set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_Fortran_COMPILER_AR "@CMAKE_Fortran_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_Fortran_COMPILER_LINKER "@CMAKE_Fortran_COMPILER_LINKER@")
+set(CMAKE_Fortran_COMPILER_LINKER_ID "@CMAKE_Fortran_COMPILER_LINKER_ID@")
+set(CMAKE_Fortran_COMPILER_LINKER_VERSION @CMAKE_Fortran_COMPILER_LINKER_VERSION@)
+set(CMAKE_Fortran_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_Fortran_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_Fortran_COMPILER_RANLIB "@CMAKE_Fortran_COMPILER_RANLIB@")
set(CMAKE_TAPI "@CMAKE_TAPI@")
set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index f5c2ab5..a040073 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -240,7 +240,7 @@
#else
PRINT *, 'INFO:platform[]'
#endif
-#if defined(_WIN32) && (defined(__INTEL_COMPILER) || defined(__ICC))
+#if defined(_MSC_VER)
# if defined(_M_IA64)
PRINT *, 'INFO:arch[IA64]'
# elif defined(_M_X64) || defined(_M_AMD64)
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 0f71c6f..e364755 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -43,7 +43,7 @@ if (NOT _INCLUDED_FILE)
endif ()
if(CMAKE_Fortran_SIZEOF_DATA_PTR)
- foreach(f ${CMAKE_Fortran_ABI_FILES})
+ foreach(f IN LISTS CMAKE_Fortran_ABI_FILES)
include(${f})
endforeach()
unset(CMAKE_Fortran_ABI_FILES)
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 77c1780..ccfde60 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -177,20 +177,27 @@ endfunction()
# was initialized by the block below. This is useful for user
# projects to change the default prefix while still allowing the
# command line to override it.
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
+if(NOT DEFINED CMAKE_INSTALL_PREFIX AND
+ NOT DEFINED ENV{CMAKE_INSTALL_PREFIX})
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
endif()
-# Choose a default install prefix for this platform.
-if(CMAKE_HOST_UNIX)
- set(CMAKE_INSTALL_PREFIX "/usr/local"
+if(DEFINED ENV{CMAKE_INSTALL_PREFIX})
+ set(CMAKE_INSTALL_PREFIX "$ENV{CMAKE_INSTALL_PREFIX}"
CACHE PATH "Install path prefix, prepended onto install directories.")
else()
- GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
- set(CMAKE_INSTALL_PREFIX
- "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
- CACHE PATH "Install path prefix, prepended onto install directories.")
- set(CMAKE_GENERIC_PROGRAM_FILES)
+ # If CMAKE_INSTALL_PREFIX env variable is not set,
+ # choose a default install prefix for this platform.
+ if(CMAKE_HOST_UNIX)
+ set(CMAKE_INSTALL_PREFIX "/usr/local"
+ CACHE PATH "Install path prefix, prepended onto install directories.")
+ else()
+ GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
+ set(CMAKE_INSTALL_PREFIX
+ "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
+ CACHE PATH "Install path prefix, prepended onto install directories.")
+ set(CMAKE_GENERIC_PROGRAM_FILES)
+ endif()
endif()
# Set a variable which will be used as component name in install() commands
diff --git a/Modules/CMakeHIPCompiler.cmake.in b/Modules/CMakeHIPCompiler.cmake.in
index 6d5e62a..601ffaf 100644
--- a/Modules/CMakeHIPCompiler.cmake.in
+++ b/Modules/CMakeHIPCompiler.cmake.in
@@ -5,6 +5,7 @@ set(CMAKE_HIP_COMPILER_ID "@CMAKE_HIP_COMPILER_ID@")
set(CMAKE_HIP_COMPILER_VERSION "@CMAKE_HIP_COMPILER_VERSION@")
set(CMAKE_HIP_STANDARD_COMPUTED_DEFAULT "@CMAKE_HIP_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_HIP_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_HIP_EXTENSIONS_COMPUTED_DEFAULT@")
+set(CMAKE_HIP_STANDARD_LATEST "@CMAKE_HIP_STANDARD_LATEST@")
set(CMAKE_HIP_COMPILE_FEATURES "@CMAKE_HIP_COMPILE_FEATURES@")
set(CMAKE_HIP98_COMPILE_FEATURES "@CMAKE_HIP03_COMPILE_FEATURES@")
set(CMAKE_HIP11_COMPILE_FEATURES "@CMAKE_HIP11_COMPILE_FEATURES@")
@@ -12,6 +13,7 @@ set(CMAKE_HIP14_COMPILE_FEATURES "@CMAKE_HIP14_COMPILE_FEATURES@")
set(CMAKE_HIP17_COMPILE_FEATURES "@CMAKE_HIP17_COMPILE_FEATURES@")
set(CMAKE_HIP20_COMPILE_FEATURES "@CMAKE_HIP20_COMPILE_FEATURES@")
set(CMAKE_HIP23_COMPILE_FEATURES "@CMAKE_HIP23_COMPILE_FEATURES@")
+set(CMAKE_HIP26_COMPILE_FEATURES "@CMAKE_HIP26_COMPILE_FEATURES@")
set(CMAKE_HIP_PLATFORM_ID "@CMAKE_HIP_PLATFORM_ID@")
set(CMAKE_HIP_SIMULATE_ID "@CMAKE_HIP_SIMULATE_ID@")
@@ -74,5 +76,11 @@ set(CMAKE_HIP_COMPILER_AR "@CMAKE_HIP_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_HIP_COMPILER_RANLIB "@CMAKE_HIP_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
+set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
+set(CMAKE_HIP_COMPILER_LINKER "@CMAKE_HIP_COMPILER_LINKER@")
+set(CMAKE_HIP_COMPILER_LINKER_ID "@CMAKE_HIP_COMPILER_LINKER_ID@")
+set(CMAKE_HIP_COMPILER_LINKER_VERSION @CMAKE_HIP_COMPILER_LINKER_VERSION@)
+set(CMAKE_HIP_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_HIP_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_TAPI "@CMAKE_TAPI@")
diff --git a/Modules/CMakeHIPCompilerId.hip.in b/Modules/CMakeHIPCompilerId.hip.in
index 4ac0f30..fa97667 100644
--- a/Modules/CMakeHIPCompilerId.hip.in
+++ b/Modules/CMakeHIPCompilerId.hip.in
@@ -16,16 +16,27 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
@CMAKE_HIP_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_HIP_COMPILER_ID_ERROR_FOR_TEST@
+#define CXX_STD_98 199711L
+#define CXX_STD_11 201103L
+#define CXX_STD_14 201402L
+#define CXX_STD_17 201703L
+#define CXX_STD_20 202002L
+#define CXX_STD_23 202302L
+
+#define CXX_STD __cplusplus
+
const char* info_language_standard_default = "INFO" ":" "standard_default["
-#if __cplusplus > 202002L
+#if CXX_STD > CXX_STD_23
+ "26"
+#elif CXX_STD > CXX_STD_20
"23"
-#elif __cplusplus > 201703L
+#elif CXX_STD > CXX_STD_17
"20"
-#elif __cplusplus >= 201703L
+#elif CXX_STD > CXX_STD_14
"17"
-#elif __cplusplus >= 201402L
+#elif CXX_STD > CXX_STD_11
"14"
-#elif __cplusplus >= 201103L
+#elif CXX_STD >= CXX_STD_11
"11"
#else
"98"
diff --git a/Modules/CMakeOBJCCompiler.cmake.in b/Modules/CMakeOBJCCompiler.cmake.in
index de73645..fb699fc 100644
--- a/Modules/CMakeOBJCCompiler.cmake.in
+++ b/Modules/CMakeOBJCCompiler.cmake.in
@@ -6,6 +6,7 @@ set(CMAKE_OBJC_COMPILER_VERSION_INTERNAL "@CMAKE_OBJC_COMPILER_VERSION_INTERNAL@
set(CMAKE_OBJC_COMPILER_WRAPPER "@CMAKE_OBJC_COMPILER_WRAPPER@")
set(CMAKE_OBJC_STANDARD_COMPUTED_DEFAULT "@CMAKE_OBJC_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_OBJC_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_OBJC_EXTENSIONS_COMPUTED_DEFAULT@")
+set(CMAKE_OBJC_STANDARD_LATEST "@CMAKE_OBJC_STANDARD_LATEST@")
set(CMAKE_OBJC_COMPILE_FEATURES "@CMAKE_OBJC_COMPILE_FEATURES@")
set(CMAKE_OBJC90_COMPILE_FEATURES "@CMAKE_OBJC90_COMPILE_FEATURES@")
set(CMAKE_OBJC99_COMPILE_FEATURES "@CMAKE_OBJC99_COMPILE_FEATURES@")
@@ -24,6 +25,12 @@ set(CMAKE_OBJC_COMPILER_AR "@CMAKE_OBJC_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_OBJC_COMPILER_RANLIB "@CMAKE_OBJC_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
+set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
+set(CMAKE_OBJC_COMPILER_LINKER "@CMAKE_OBJC_COMPILER_LINKER@")
+set(CMAKE_OBJC_COMPILER_LINKER_ID "@CMAKE_OBJC_COMPILER_LINKER_ID@")
+set(CMAKE_OBJC_COMPILER_LINKER_VERSION @CMAKE_OBJC_COMPILER_LINKER_VERSION@)
+set(CMAKE_OBJC_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_OBJC_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_TAPI "@CMAKE_TAPI@")
set(CMAKE_COMPILER_IS_GNUOBJC @CMAKE_COMPILER_IS_GNUOBJC@)
diff --git a/Modules/CMakeOBJCCompilerId.m.in b/Modules/CMakeOBJCCompilerId.m.in
index 89bfe02..e88bb6f 100644
--- a/Modules/CMakeOBJCCompilerId.m.in
+++ b/Modules/CMakeOBJCCompilerId.m.in
@@ -20,20 +20,28 @@ char const* qnxnto = "INFO" ":" "qnxnto[]";
@CMAKE_OBJC_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_OBJC_COMPILER_ID_ERROR_FOR_TEST@
+#define C_STD_99 199901L
+#define C_STD_11 201112L
+#define C_STD_17 201710L
+#define C_STD_23 202311L
+
+#ifdef __STDC_VERSION__
+# define C_STD __STDC_VERSION__
+#endif
+
#if !defined(__STDC__)
-# if (defined(_MSC_VER) && !defined(__clang__)) \
- || (defined(__ibmxl__) || defined(__IBMC__))
+# if defined(__ibmxl__) || defined(__IBMC__)
# define C_VERSION "90"
# else
# define C_VERSION
# endif
-#elif __STDC_VERSION__ > 201710L
+#elif C_STD > C_STD_17
# define C_VERSION "23"
-#elif __STDC_VERSION__ >= 201710L
+#elif C_STD > C_STD_11
# define C_VERSION "17"
-#elif __STDC_VERSION__ >= 201000L
+#elif C_STD > C_STD_99
# define C_VERSION "11"
-#elif __STDC_VERSION__ >= 199901L
+#elif C_STD >= C_STD_99
# define C_VERSION "99"
#else
# define C_VERSION "90"
diff --git a/Modules/CMakeOBJCInformation.cmake b/Modules/CMakeOBJCInformation.cmake
index 4c697da..8b8f10e 100644
--- a/Modules/CMakeOBJCInformation.cmake
+++ b/Modules/CMakeOBJCInformation.cmake
@@ -67,7 +67,7 @@ if (NOT _INCLUDED_FILE)
endif ()
if(CMAKE_OBJC_SIZEOF_DATA_PTR)
- foreach(f ${CMAKE_OBJC_ABI_FILES})
+ foreach(f IN LISTS CMAKE_OBJC_ABI_FILES)
include(${f})
endforeach()
unset(CMAKE_OBJC_ABI_FILES)
diff --git a/Modules/CMakeOBJCXXCompiler.cmake.in b/Modules/CMakeOBJCXXCompiler.cmake.in
index 94d24ff..3bf12b1 100644
--- a/Modules/CMakeOBJCXXCompiler.cmake.in
+++ b/Modules/CMakeOBJCXXCompiler.cmake.in
@@ -6,6 +6,7 @@ set(CMAKE_OBJCXX_COMPILER_VERSION_INTERNAL "@CMAKE_OBJCXX_COMPILER_VERSION_INTER
set(CMAKE_OBJCXX_COMPILER_WRAPPER "@CMAKE_OBJCXX_COMPILER_WRAPPER@")
set(CMAKE_OBJCXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_OBJCXX_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_OBJCXX_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_OBJCXX_EXTENSIONS_COMPUTED_DEFAULT@")
+set(CMAKE_OBJCXX_STANDARD_LATEST "@CMAKE_OBJCXX_STANDARD_LATEST@")
set(CMAKE_OBJCXX_COMPILE_FEATURES "@CMAKE_OBJCXX_COMPILE_FEATURES@")
set(CMAKE_OBJCXX98_COMPILE_FEATURES "@CMAKE_OBJCXX98_COMPILE_FEATURES@")
set(CMAKE_OBJCXX11_COMPILE_FEATURES "@CMAKE_OBJCXX11_COMPILE_FEATURES@")
@@ -25,6 +26,12 @@ set(CMAKE_OBJCXX_COMPILER_AR "@CMAKE_OBJCXX_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_OBJCXX_COMPILER_RANLIB "@CMAKE_OBJCXX_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
+set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
+set(CMAKE_OBJCXX_COMPILER_LINKER "@CMAKE_OBJCXX_COMPILER_LINKER@")
+set(CMAKE_OBJCXX_COMPILER_LINKER_ID "@CMAKE_OBJCXX_COMPILER_LINKER_ID@")
+set(CMAKE_OBJCXX_COMPILER_LINKER_VERSION @CMAKE_OBJCXX_COMPILER_LINKER_VERSION@)
+set(CMAKE_OBJCXX_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_OBJCXX_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_TAPI "@CMAKE_TAPI@")
set(CMAKE_COMPILER_IS_GNUOBJCXX @CMAKE_COMPILER_IS_GNUOBJCXX@)
@@ -44,7 +51,7 @@ if (CMAKE_OBJC_COMPILER_ID_RUN)
endforeach()
endif()
-foreach (lang C CXX OBJC)
+foreach (lang IN ITEMS C CXX OBJC)
foreach(extension IN LISTS CMAKE_OBJCXX_SOURCE_FILE_EXTENSIONS)
if (CMAKE_${lang}_COMPILER_ID_RUN)
list(REMOVE_ITEM CMAKE_${lang}_SOURCE_FILE_EXTENSIONS ${extension})
diff --git a/Modules/CMakeOBJCXXCompilerId.mm.in b/Modules/CMakeOBJCXXCompilerId.mm.in
index 2145b40..cadbaff 100644
--- a/Modules/CMakeOBJCXXCompilerId.mm.in
+++ b/Modules/CMakeOBJCXXCompilerId.mm.in
@@ -23,22 +23,27 @@ char const* qnxnto = "INFO" ":" "qnxnto[]";
@CMAKE_OBJCXX_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_OBJCXX_COMPILER_ID_ERROR_FOR_TEST@
-#if defined(_MSC_VER) && defined(_MSVC_LANG)
-#define CXX_STD _MSVC_LANG
-#else
+#define CXX_STD_98 199711L
+#define CXX_STD_11 201103L
+#define CXX_STD_14 201402L
+#define CXX_STD_17 201703L
+#define CXX_STD_20 202002L
+#define CXX_STD_23 202302L
+
#define CXX_STD __cplusplus
-#endif
const char* info_language_standard_default = "INFO" ":" "standard_default["
-#if CXX_STD > 202002L
+#if CXX_STD > CXX_STD_23
+ "26"
+#elif CXX_STD > CXX_STD_20
"23"
-#elfif CXX_STD > 201703L
+#elif CXX_STD > CXX_STD_17
"20"
-#elif CXX_STD >= 201703L
+#elif CXX_STD > CXX_STD_14
"17"
-#elif CXX_STD >= 201402L
+#elif CXX_STD > CXX_STD_11
"14"
-#elif CXX_STD >= 201103L
+#elif CXX_STD >= CXX_STD_11
"11"
#else
"98"
diff --git a/Modules/CMakeOBJCXXInformation.cmake b/Modules/CMakeOBJCXXInformation.cmake
index a6d824f..da1d6c6 100644
--- a/Modules/CMakeOBJCXXInformation.cmake
+++ b/Modules/CMakeOBJCXXInformation.cmake
@@ -62,7 +62,7 @@ if (NOT _INCLUDED_FILE)
endif ()
if(CMAKE_OBJCXX_SIZEOF_DATA_PTR)
- foreach(f ${CMAKE_OBJCXX_ABI_FILES})
+ foreach(f IN LISTS CMAKE_OBJCXX_ABI_FILES)
include(${f})
endforeach()
unset(CMAKE_OBJCXX_ABI_FILES)
@@ -178,7 +178,7 @@ if(NOT CMAKE_SHARED_MODULE_OBJCXX_FLAGS)
endif()
# Initialize OBJCXX link type selection flags from OBJC versions.
-foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+foreach(type IN ITEMS SHARED_LIBRARY SHARED_MODULE EXE)
if(NOT CMAKE_${type}_LINK_STATIC_OBJCXX_FLAGS)
set(CMAKE_${type}_LINK_STATIC_OBJCXX_FLAGS
${CMAKE_${type}_LINK_STATIC_OBJC_FLAGS})
diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 581e65c..7d038d4 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -5,12 +5,9 @@
CMakePackageConfigHelpers
-------------------------
-Helpers functions for creating config files that can be included by other
+Helper functions for creating config files that can be included by other
projects to find and use a package.
-Adds the :command:`configure_package_config_file()` and
-:command:`write_basic_package_version_file()` commands.
-
Generating a Package Configuration File
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -29,11 +26,11 @@ Generating a Package Configuration File
``configure_package_config_file()`` should be used instead of the plain
:command:`configure_file()` command when creating the ``<PackageName>Config.cmake``
or ``<PackageName>-config.cmake`` file for installing a project or library.
-It helps making the resulting package relocatable by avoiding hardcoded paths
-in the installed ``Config.cmake`` file.
+It helps make the resulting package relocatable by avoiding hardcoded paths
+in the installed ``<PackageName>Config.cmake`` file.
In a ``FooConfig.cmake`` file there may be code like this to make the install
-destinations know to the using project:
+destinations known to the using project:
.. code-block:: cmake
@@ -43,27 +40,25 @@ destinations know to the using project:
#...logic to determine installedPrefix from the own location...
set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
-All 4 options shown above are not sufficient, since the first 3 hardcode the
-absolute directory locations, and the 4th case works only if the logic to
+All four options shown above are not sufficient The first three hardcode the
+absolute directory locations. The fourth case works only if the logic to
determine the ``installedPrefix`` is correct, and if ``CONFIG_INSTALL_DIR``
contains a relative path, which in general cannot be guaranteed. This has the
effect that the resulting ``FooConfig.cmake`` file would work poorly under
-Windows and OSX, where users are used to choose the install location of a
+Windows and macOS, where users are used to choosing the install location of a
binary package at install time, independent from how
:variable:`CMAKE_INSTALL_PREFIX` was set at build/cmake time.
-Using ``configure_package_config_file`` helps. If used correctly, it makes
+Using ``configure_package_config_file()`` helps. If used correctly, it makes
the resulting ``FooConfig.cmake`` file relocatable. Usage:
-1. write a ``FooConfig.cmake.in`` file as you are used to
-2. insert a line containing only the string ``@PACKAGE_INIT@``
-3. instead of ``set(FOO_DIR "@SOME_INSTALL_DIR@")``, use
+1. Write a ``FooConfig.cmake.in`` file as you are used to.
+2. Insert a line at the top containing only the string ``@PACKAGE_INIT@``.
+3. Instead of ``set(FOO_DIR "@SOME_INSTALL_DIR@")``, use
``set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")`` (this must be after the
- ``@PACKAGE_INIT@`` line)
-4. instead of using the normal :command:`configure_file()`, use
- ``configure_package_config_file()``
-
-
+ ``@PACKAGE_INIT@`` line).
+4. Instead of using the normal :command:`configure_file()` command, use
+ ``configure_package_config_file()``.
The ``<input>`` and ``<output>`` arguments are the input and output file, the
same way as in :command:`configure_file()`.
@@ -73,48 +68,64 @@ the ``FooConfig.cmake`` file will be installed to. This path can either be
absolute, or relative to the ``INSTALL_PREFIX`` path.
The variables ``<var1>`` to ``<varN>`` given as ``PATH_VARS`` are the
-variables which contain install destinations. For each of them the macro will
+variables which contain install destinations. For each of them, the macro will
create a helper variable ``PACKAGE_<var...>``. These helper variables must be
used in the ``FooConfig.cmake.in`` file for setting the installed location.
-They are calculated by ``configure_package_config_file`` so that they are
+They are calculated by ``configure_package_config_file()`` so that they are
always relative to the installed location of the package. This works both for
-relative and also for absolute locations. For absolute locations it works
+relative and also for absolute locations. For absolute locations, it works
only if the absolute location is a subdirectory of ``INSTALL_PREFIX``.
+.. versionadded:: 3.30
+ The variable ``PACKAGE_PREFIX_DIR`` will always be defined after the
+ ``@PACKAGE_INIT@`` line. It will hold the value of the base install
+ location. In general, variables defined via the ``PATH_VARS`` mechanism
+ should be used instead, but ``PACKAGE_PREFIX_DIR`` can be used for those
+ cases not easily handled by ``PATH_VARS``, such as for files installed
+ directly to the base install location rather than a subdirectory of it.
+
+ .. note::
+ When consumers of the generated file use CMake 3.29 or older, the value
+ of ``PACKAGE_PREFIX_DIR`` can be changed by a call to
+ :command:`find_dependency` or :command:`find_package`.
+ If a project relies on ``PACKAGE_PREFIX_DIR``, it is the project's
+ responsibility to ensure that the value of ``PACKAGE_PREFIX_DIR`` is
+ preserved across any such calls, or any other calls which might include
+ another file generated by ``configure_package_config_file()``.
+
.. versionadded:: 3.1
- If the ``INSTALL_PREFIX`` argument is passed, this is used as base path to
+ If the ``INSTALL_PREFIX`` argument is passed, this is used as the base path to
calculate all the relative paths. The ``<path>`` argument must be an absolute
path. If this argument is not passed, the :variable:`CMAKE_INSTALL_PREFIX`
variable will be used instead. The default value is good when generating a
- FooConfig.cmake file to use your package from the install tree. When
- generating a FooConfig.cmake file to use your package from the build tree this
- option should be used.
+ ``FooConfig.cmake`` file to use your package from the install tree. When
+ generating a ``FooConfig.cmake`` file to use your package from the build tree,
+ this option should be used.
-By default ``configure_package_config_file`` also generates two helper macros,
-``set_and_check()`` and ``check_required_components()`` into the
+By default, ``configure_package_config_file()`` also generates two helper
+macros, ``set_and_check()`` and ``check_required_components()``, into the
``FooConfig.cmake`` file.
-``set_and_check()`` should be used instead of the normal ``set()`` command for
-setting directories and file locations. Additionally to setting the variable
-it also checks that the referenced file or directory actually exists and fails
-with a ``FATAL_ERROR`` otherwise. This makes sure that the created
+``set_and_check()`` should be used instead of the normal :command:`set` command
+for setting directories and file locations. In addition to setting the
+variable, it also checks that the referenced file or directory actually exists
+and fails with a fatal error if it doesn't. This ensures that the generated
``FooConfig.cmake`` file does not contain wrong references.
-When using the ``NO_SET_AND_CHECK_MACRO``, this macro is not generated
-into the ``FooConfig.cmake`` file.
+Add the ``NO_SET_AND_CHECK_MACRO`` option to prevent the generation of the
+``set_and_check()`` macro in the ``FooConfig.cmake`` file.
``check_required_components(<PackageName>)`` should be called at the end of
the ``FooConfig.cmake`` file. This macro checks whether all requested,
-non-optional components have been found, and if this is not the case, sets
-the ``Foo_FOUND`` variable to ``FALSE``, so that the package is considered to
+non-optional components have been found, and if this is not the case, it sets
+the ``Foo_FOUND`` variable to ``FALSE`` so that the package is considered to
be not found. It does that by testing the ``Foo_<Component>_FOUND``
variables for all requested required components. This macro should be
called even if the package doesn't provide any components to make sure
-users are not specifying components erroneously. When using the
-``NO_CHECK_REQUIRED_COMPONENTS_MACRO`` option, this macro is not generated
-into the ``FooConfig.cmake`` file.
+users are not specifying components erroneously. Add the
+``NO_CHECK_REQUIRED_COMPONENTS_MACRO`` option to prevent the generation of the
+``check_required_components()`` macro in the ``FooConfig.cmake`` file.
-For an example see below the documentation for
-:command:`write_basic_package_version_file()`.
+See also :ref:`CMakePackageConfigHelpers Examples`.
Generating a Package Version File
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -129,11 +140,11 @@ Generating a Package Version File
[ARCH_INDEPENDENT] )
-Writes a file for use as ``<PackageName>ConfigVersion.cmake`` file to
+Writes a file for use as a ``<PackageName>ConfigVersion.cmake`` file to
``<filename>``. See the documentation of :command:`find_package()` for
-details on this.
+details on such files.
-``<filename>`` is the output filename, it should be in the build tree.
+``<filename>`` is the output filename, which should be in the build tree.
``<major.minor.patch>`` is the version number of the project to be installed.
If no ``VERSION`` is given, the :variable:`PROJECT_VERSION` variable is used.
@@ -156,9 +167,9 @@ the requested version matches exactly its own version number (not considering
the tweak version). For example, version 1.2.3 of a package is only
considered compatible to requested version 1.2.3. This mode is for packages
without compatibility guarantees.
-If your project has more elaborated version matching rules, you will need to
-write your own custom ``ConfigVersion.cmake`` file instead of using this
-macro.
+If your project has more elaborate version matching rules, you will need to
+write your own custom ``<PackageName>ConfigVersion.cmake`` file instead of
+using this macro.
.. versionadded:: 3.11
The ``SameMinorVersion`` compatibility mode.
@@ -173,13 +184,13 @@ macro.
unless ``ARCH_INDEPENDENT`` is given, in which case the package is considered
compatible on any architecture.
-.. note:: ``ARCH_INDEPENDENT`` is intended for header-only libraries or similar
- packages with no binaries.
+ .. note:: ``ARCH_INDEPENDENT`` is intended for header-only libraries or
+ similar packages with no binaries.
.. versionadded:: 3.19
The version file generated by ``AnyNewerVersion``, ``SameMajorVersion`` and
- ``SameMinorVersion`` arguments of ``COMPATIBILITY`` handle the version range
- if any is specified (see :command:`find_package` command for the details).
+ ``SameMinorVersion`` arguments of ``COMPATIBILITY`` handle the version range,
+ if one is specified (see :command:`find_package` command for the details).
``ExactVersion`` mode is incompatible with version ranges and will display an
author warning if one is specified.
@@ -187,18 +198,164 @@ Internally, this macro executes :command:`configure_file()` to create the
resulting version file. Depending on the ``COMPATIBILITY``, the corresponding
``BasicConfigVersion-<COMPATIBILITY>.cmake.in`` file is used.
Please note that these files are internal to CMake and you should not call
-:command:`configure_file()` on them yourself, but they can be used as starting
-point to create more sophisticated custom ``ConfigVersion.cmake`` files.
+:command:`configure_file()` on them yourself, but they can be used as a starting
+point to create more sophisticated custom ``<PackageName>ConfigVersion.cmake``
+files.
+
+Generating an Apple Platform Selection File
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. command:: generate_apple_platform_selection_file
+
+ .. versionadded:: 3.29
+
+ Create an Apple platform selection file:
+
+ .. code-block:: cmake
+
+ generate_apple_platform_selection_file(<filename>
+ INSTALL_DESTINATION <path>
+ [INSTALL_PREFIX <path>]
+ [MACOS_INCLUDE_FILE <file>]
+ [IOS_INCLUDE_FILE <file>]
+ [IOS_SIMULATOR_INCLUDE_FILE <file>]
+ [TVOS_INCLUDE_FILE <file>]
+ [TVOS_SIMULATOR_INCLUDE_FILE <file>]
+ [WATCHOS_INCLUDE_FILE <file>]
+ [WATCHOS_SIMULATOR_INCLUDE_FILE <file>]
+ [VISIONOS_INCLUDE_FILE <file>]
+ [VISIONOS_SIMULATOR_INCLUDE_FILE <file>]
+ [ERROR_VARIABLE <variable>]
+ )
+
+ Write a file that includes an Apple-platform-specific ``.cmake`` file,
+ e.g., for use as ``<PackageName>Config.cmake``. This can be used in
+ conjunction with the ``XCFRAMEWORK_LOCATION`` argument of
+ :command:`export(SETUP)` to export packages in a way that a project
+ built for any Apple platform can use them.
+
+ ``INSTALL_DESTINATION <path>``
+ Path to which the generated file will be installed by the caller, e.g.,
+ via :command:`install(FILES)`. The path may be either relative to the
+ ``INSTALL_PREFIX`` or absolute.
+
+ ``INSTALL_PREFIX <path>``
+ Path prefix to which the package will be installed by the caller.
+ The ``<path>`` argument must be an absolute path. If this argument
+ is not passed, the :variable:`CMAKE_INSTALL_PREFIX` variable will be
+ used instead.
+
+ ``MACOS_INCLUDE_FILE <file>``
+ File to include if the platform is macOS.
+
+ ``IOS_INCLUDE_FILE <file>``
+ File to include if the platform is iOS.
+
+ ``IOS_SIMULATOR_INCLUDE_FILE <file>``
+ File to include if the platform is iOS Simulator.
+
+ ``TVOS_INCLUDE_FILE <file>``
+ File to include if the platform is tvOS.
+
+ ``TVOS_SIMULATOR_INCLUDE_FILE <file>``
+ File to include if the platform is tvOS Simulator.
+
+ ``WATCHOS_INCLUDE_FILE <file>``
+ File to include if the platform is watchOS.
+
+ ``WATCHOS_SIMULATOR_INCLUDE_FILE <file>``
+ File to include if the platform is watchOS Simulator.
+
+ ``VISIONOS_INCLUDE_FILE <file>``
+ File to include if the platform is visionOS.
+
+ ``VISIONOS_SIMULATOR_INCLUDE_FILE <file>``
+ File to include if the platform is visionOS Simulator.
+
+ ``ERROR_VARIABLE <variable>``
+ If the consuming project is built for an unsupported platform,
+ set ``<variable>`` to an error message. The includer may use this
+ information to pretend the package was not found. If this option
+ is not given, the default behavior is to issue a fatal error.
+
+ If any of the optional include files is not specified, and the consuming
+ project is built for its corresponding platform, the generated file will
+ consider the platform to be unsupported. The behavior is determined
+ by the ``ERROR_VARIABLE`` option.
+
+Generating an Apple Architecture Selection File
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. command:: generate_apple_architecture_selection_file
+
+ .. versionadded:: 3.29
+
+ Create an Apple architecture selection file:
+
+ .. code-block:: cmake
+
+ generate_apple_architecture_selection_file(<filename>
+ INSTALL_DESTINATION <path>
+ [INSTALL_PREFIX <path>]
+ [SINGLE_ARCHITECTURES <arch>...
+ SINGLE_ARCHITECTURE_INCLUDE_FILES <file>...]
+ [UNIVERSAL_ARCHITECTURES <arch>...
+ UNIVERSAL_INCLUDE_FILE <file>]
+ [ERROR_VARIABLE <variable>]
+ )
+
+ Write a file that includes an Apple-architecture-specific ``.cmake`` file
+ based on :variable:`CMAKE_OSX_ARCHITECTURES`, e.g., for inclusion from an
+ Apple-specific ``<PackageName>Config.cmake`` file.
+
+ ``INSTALL_DESTINATION <path>``
+ Path to which the generated file will be installed by the caller, e.g.,
+ via :command:`install(FILES)`. The path may be either relative to the
+ ``INSTALL_PREFIX`` or absolute.
+
+ ``INSTALL_PREFIX <path>``
+ Path prefix to which the package will be installed by the caller.
+ The ``<path>`` argument must be an absolute path. If this argument
+ is not passed, the :variable:`CMAKE_INSTALL_PREFIX` variable will be
+ used instead.
+
+ ``SINGLE_ARCHITECTURES <arch>...``
+ Architectures provided by entries of ``SINGLE_ARCHITECTURE_INCLUDE_FILES``.
+
+ ``SINGLE_ARCHITECTURE_INCLUDE_FILES <file>...``
+ Architecture-specific files. One of them will be loaded
+ when :variable:`CMAKE_OSX_ARCHITECTURES` contains a single
+ architecture matching the corresponding entry of
+ ``SINGLE_ARCHITECTURES``.
+
+ ``UNIVERSAL_ARCHITECTURES <arch>...``
+ Architectures provided by the ``UNIVERSAL_INCLUDE_FILE``.
+
+ The list may include ``$(ARCHS_STANDARD)`` to support consumption using
+ the :generator:`Xcode` generator, but the architectures should always
+ be listed individually too.
+
+ ``UNIVERSAL_INCLUDE_FILE <file>``
+ A file to load when :variable:`CMAKE_OSX_ARCHITECTURES` contains
+ a (non-strict) subset of the ``UNIVERSAL_ARCHITECTURES`` and
+ does not match any one of the ``SINGLE_ARCHITECTURES``.
+
+ ``ERROR_VARIABLE <variable>``
+ If the consuming project is built for an unsupported architecture,
+ set ``<variable>`` to an error message. The includer may use this
+ information to pretend the package was not found. If this option
+ is not given, the default behavior is to issue a fatal error.
+
+.. _`CMakePackageConfigHelpers Examples`:
Example Generating Package Files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-Example using both :command:`configure_package_config_file` and
-``write_basic_package_version_file()``:
-
-``CMakeLists.txt``:
+Example using both the :command:`configure_package_config_file` and
+:command:`write_basic_package_version_file()` commands:
.. code-block:: cmake
+ :caption: ``CMakeLists.txt``
include(GNUInstallDirs)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/Foo
@@ -219,9 +376,9 @@ Example using both :command:`configure_package_config_file` and
${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Foo )
-``FooConfig.cmake.in``:
-
-::
+.. code-block:: cmake
+ :caption: ``FooConfig.cmake.in``
+ :force:
set(FOO_VERSION x.y.z)
...
@@ -344,3 +501,183 @@ endmacro()
configure_file("${_inputFile}" "${_outputFile}" @ONLY)
endfunction()
+
+function(generate_apple_platform_selection_file _output_file)
+ set(_config_file_options
+ MACOS_INCLUDE_FILE
+ IOS_INCLUDE_FILE
+ IOS_SIMULATOR_INCLUDE_FILE
+ TVOS_INCLUDE_FILE
+ TVOS_SIMULATOR_INCLUDE_FILE
+ WATCHOS_INCLUDE_FILE
+ WATCHOS_SIMULATOR_INCLUDE_FILE
+ VISIONOS_INCLUDE_FILE
+ VISIONOS_SIMULATOR_INCLUDE_FILE
+ )
+
+ set(_options)
+ set(_single
+ INSTALL_DESTINATION
+ INSTALL_PREFIX
+ ${_config_file_options}
+ ERROR_VARIABLE
+ )
+ set(_multi)
+ cmake_parse_arguments(PARSE_ARGV 0 _gpsf "${_options}" "${_single}" "${_multi}")
+
+ if(NOT _gpsf_INSTALL_DESTINATION)
+ message(FATAL_ERROR "No INSTALL_DESTINATION given to generate_apple_platform_selection_file()")
+ endif()
+ if(_gpsf_INSTALL_PREFIX)
+ set(maybe_INSTALL_PREFIX INSTALL_PREFIX ${_gpsf_INSTALL_PREFIX})
+ else()
+ set(maybe_INSTALL_PREFIX "")
+ endif()
+
+ if(_gpsf_ERROR_VARIABLE)
+ set(_branch_INIT "set(\"${_gpsf_ERROR_VARIABLE}\" \"\")")
+ else()
+ set(_branch_INIT "")
+ endif()
+
+ set(_else ELSE)
+ foreach(_opt IN LISTS _config_file_options _else)
+ if(_gpsf_${_opt})
+ set(_config_file "${_gpsf_${_opt}}")
+ if(NOT IS_ABSOLUTE "${_config_file}")
+ string(PREPEND _config_file [[${PACKAGE_PREFIX_DIR}/]])
+ endif()
+ set(_branch_${_opt} "include(\"${_config_file}\")")
+ elseif(_gpsf_ERROR_VARIABLE)
+ set(_branch_${_opt} "set(\"${_gpsf_ERROR_VARIABLE}\" \"Platform not supported\")")
+ else()
+ set(_branch_${_opt} "message(FATAL_ERROR \"Platform not supported\")")
+ endif()
+ endforeach()
+
+ configure_package_config_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Internal/ApplePlatformSelection.cmake.in" "${_output_file}"
+ INSTALL_DESTINATION "${_gpsf_INSTALL_DESTINATION}"
+ ${maybe_INSTALL_PREFIX}
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+endfunction()
+
+function(generate_apple_architecture_selection_file _output_file)
+ set(_options)
+ set(_single
+ INSTALL_DESTINATION
+ INSTALL_PREFIX
+ UNIVERSAL_INCLUDE_FILE
+ ERROR_VARIABLE
+ )
+ set(_multi
+ SINGLE_ARCHITECTURES
+ SINGLE_ARCHITECTURE_INCLUDE_FILES
+ UNIVERSAL_ARCHITECTURES
+ )
+ cmake_parse_arguments(PARSE_ARGV 0 _gasf "${_options}" "${_single}" "${_multi}")
+
+ if(NOT _gasf_INSTALL_DESTINATION)
+ message(FATAL_ERROR "No INSTALL_DESTINATION given to generate_apple_platform_selection_file()")
+ endif()
+ if(_gasf_INSTALL_PREFIX)
+ set(maybe_INSTALL_PREFIX INSTALL_PREFIX ${_gasf_INSTALL_PREFIX})
+ else()
+ set(maybe_INSTALL_PREFIX "")
+ endif()
+
+ list(LENGTH _gasf_SINGLE_ARCHITECTURES _gasf_SINGLE_ARCHITECTURES_len)
+ list(LENGTH _gasf_SINGLE_ARCHITECTURE_INCLUDE_FILES _gasf_SINGLE_ARCHITECTURE_INCLUDE_FILES_len)
+ if(NOT _gasf_SINGLE_ARCHITECTURES_len EQUAL _gasf_SINGLE_ARCHITECTURE_INCLUDE_FILES_len)
+ message(FATAL_ERROR "SINGLE_ARCHITECTURES and SINGLE_ARCHITECTURE_INCLUDE_FILES do not have the same number of entries.")
+ endif()
+
+ set(_branch_code "")
+
+ if(_gasf_ERROR_VARIABLE)
+ string(APPEND _branch_code
+ "set(\"${_gasf_ERROR_VARIABLE}\" \"\")\n"
+ )
+ endif()
+
+ string(APPEND _branch_code
+ "\n"
+ "if(NOT CMAKE_OSX_ARCHITECTURES)\n"
+ )
+ if(_gasf_ERROR_VARIABLE)
+ string(APPEND _branch_code
+ " set(\"${_gasf_ERROR_VARIABLE}\" \"CMAKE_OSX_ARCHITECTURES must be explicitly set for this package\")\n"
+ " return()\n"
+ )
+ else()
+ string(APPEND _branch_code
+ " message(FATAL_ERROR \"CMAKE_OSX_ARCHITECTURES must be explicitly set for this package\")\n"
+ )
+ endif()
+ string(APPEND _branch_code
+ "endif()\n\n"
+ "set(_cmake_apple_archs \"\${CMAKE_OSX_ARCHITECTURES}\")\n"
+ )
+ if(NOT "${_gasf_UNIVERSAL_ARCHITECTURES}" STREQUAL "")
+ string(APPEND _branch_code "list(REMOVE_ITEM _cmake_apple_archs ${_gasf_UNIVERSAL_ARCHITECTURES})\n")
+ endif()
+ string(APPEND _branch_code "\n")
+
+ set(maybe_else "")
+
+ foreach(pair IN ZIP_LISTS _gasf_SINGLE_ARCHITECTURES _gasf_SINGLE_ARCHITECTURE_INCLUDE_FILES)
+ set(arch "${pair_0}")
+ set(config_file "${pair_1}")
+ if(NOT IS_ABSOLUTE "${config_file}")
+ string(PREPEND config_file [[${PACKAGE_PREFIX_DIR}/]])
+ endif()
+ string(APPEND _branch_code
+ "${maybe_else}if(CMAKE_OSX_ARCHITECTURES STREQUAL \"${arch}\")\n"
+ " include(\"${config_file}\")\n"
+ )
+ set(maybe_else else)
+ endforeach()
+
+ if(_gasf_UNIVERSAL_ARCHITECTURES AND _gasf_UNIVERSAL_INCLUDE_FILE)
+ set(config_file "${_gasf_UNIVERSAL_INCLUDE_FILE}")
+ if(NOT IS_ABSOLUTE "${config_file}")
+ string(PREPEND config_file [[${PACKAGE_PREFIX_DIR}/]])
+ endif()
+ string(APPEND _branch_code
+ "${maybe_else}if(NOT _cmake_apple_archs)\n"
+ " include(\"${config_file}\")\n"
+ )
+ set(maybe_else else)
+ elseif(_gasf_UNIVERSAL_ARCHITECTURES)
+ message(FATAL_ERROR "UNIVERSAL_INCLUDE_FILE requires UNIVERSAL_ARCHITECTURES")
+ elseif(_gasf_UNIVERSAL_INCLUDE_FILE)
+ message(FATAL_ERROR "UNIVERSAL_ARCHITECTURES requires UNIVERSAL_INCLUDE_FILE")
+ endif()
+
+ if(maybe_else)
+ string(APPEND _branch_code "else()\n")
+ set(_indent " ")
+ else()
+ set(_indent "")
+ endif()
+ if(_gasf_ERROR_VARIABLE)
+ string(APPEND _branch_code
+ "${_indent}set(\"${_gasf_ERROR_VARIABLE}\" \"Architecture not supported\")\n"
+ )
+ else()
+ string(APPEND _branch_code
+ "${_indent}message(FATAL_ERROR \"Architecture not supported\")\n"
+ )
+ endif()
+ if(maybe_else)
+ string(APPEND _branch_code "endif()\n")
+ endif()
+
+ configure_package_config_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Internal/AppleArchitectureSelection.cmake.in" "${_output_file}"
+ INSTALL_DESTINATION "${_gasf_INSTALL_DESTINATION}"
+ ${maybe_INSTALL_PREFIX}
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+endfunction()
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index cbdb915..dc09b20 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -15,6 +15,26 @@ cmake_policy(SET CMP0054 NEW)
# compatibility don't break.
#
function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj_regex)
+ set(keywordArgs)
+ set(oneValueArgs LANGUAGE COMPUTE_IMPLICIT_OBJECTS)
+ set(multiValueArgs )
+ cmake_parse_arguments(EXTRA_PARSE "${keywordArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ cmake_parse_implicit_link_info2("${text}" "${log_var}" "${obj_regex}"
+ COMPUTE_IMPLICIT_LIBS "${lib_var}" COMPUTE_IMPLICIT_DIRS "${dir_var}"
+ COMPUTE_IMPLICIT_FWKS "${fwk_var}" ${ARGN})
+
+ set(${lib_var} "${${lib_var}}" PARENT_SCOPE)
+ set(${dir_var} "${${dir_var}}" PARENT_SCOPE)
+ set(${fwk_var} "${${fwk_var}}" PARENT_SCOPE)
+ set(${log_var} "${${log_var}}" PARENT_SCOPE)
+
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_OBJECTS)
+ set(${EXTRA_PARSE_COMPUTE_IMPLICIT_OBJECTS} "${${EXTRA_PARSE_COMPUTE_IMPLICIT_OBJECTS}}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(cmake_parse_implicit_link_info2 text log_var obj_regex)
set(implicit_libs_tmp "")
set(implicit_objs_tmp "")
set(implicit_dirs_tmp)
@@ -22,25 +42,29 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
set(log "")
set(keywordArgs)
- set(oneValueArgs COMPUTE_IMPLICIT_OBJECTS LANGUAGE)
+ set(oneValueArgs LANGUAGE
+ COMPUTE_IMPLICIT_LIBS COMPUTE_IMPLICIT_DIRS COMPUTE_IMPLICIT_FWKS
+ COMPUTE_IMPLICIT_OBJECTS COMPUTE_LINKER)
set(multiValueArgs )
cmake_parse_arguments(EXTRA_PARSE "${keywordArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(is_msvc 0)
if(EXTRA_PARSE_LANGUAGE AND
- ("x${CMAKE_${EXTRA_PARSE_LANGUAGE}_ID}" STREQUAL "xMSVC" OR
+ ("x${CMAKE_${EXTRA_PARSE_LANGUAGE}_COMPILER_ID}" STREQUAL "xMSVC" OR
"x${CMAKE_${EXTRA_PARSE_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC"))
set(is_msvc 1)
endif()
-
# Parse implicit linker arguments.
- set(linker "CMAKE_LINKER-NOTFOUND")
- if(CMAKE_LINKER)
- get_filename_component(linker ${CMAKE_LINKER} NAME)
- string(REGEX REPLACE "([][+.*?()^$])" "\\\\\\1" linker "${linker}")
- endif()
+ set(linker "ld[0-9]*(\\.[a-z]+)?")
if(is_msvc)
- string(APPEND linker "|link\\.exe|lld-link")
+ string(APPEND linker "|link\\.exe|lld-link(\\.exe)?")
+ endif()
+ if(CMAKE_LINKER)
+ get_filename_component(default_linker ${CMAKE_LINKER} NAME)
+ if (NOT default_linker MATCHES "(${linker})")
+ string(REGEX REPLACE "([][+.*?()^$])" "\\\\\\1" default_linker "${default_linker}")
+ list(PREPEND linker "${default_linker}|")
+ endif()
endif()
set(startfile "CMAKE_LINK_STARTFILE-NOTFOUND")
if(CMAKE_LINK_STARTFILE)
@@ -50,9 +74,43 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
# whole line and just the command (argv[0]).
set(linker_regex "^( *|.*[/\\])(${linker}|${startfile}|([^/\\]+-)?ld|collect2)[^/\\]*( |$)")
set(linker_exclude_regex "collect2 version |^[A-Za-z0-9_]+=|/ldfe ")
+ set(linker_tool_regex "^[ \t]*(->|\")?[ \t]*(([^\"]*[/\\])?(${linker}))(\"|,| |$)")
+ set(linker_tool_exclude_regex "cuda-fake-ld|-fuse-ld=|^ExecuteExternalTool ")
+ set(linker_tool "NOTFOUND")
+ set(linker_tool_fallback "")
+ set(link_line_parsed 0)
string(APPEND log " link line regex: [${linker_regex}]\n")
+ if(EXTRA_PARSE_COMPUTE_LINKER)
+ string(APPEND log " linker tool regex: [${linker_tool_regex}]\n")
+ endif()
string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
foreach(line IN LISTS output_lines)
+ if(EXTRA_PARSE_COMPUTE_LINKER AND
+ NOT linker_tool AND NOT "${line}" MATCHES "${linker_tool_exclude_regex}")
+ if("${line}" MATCHES "exec: ([^()]*/(${linker}))") # IBM XL as nvcc host compiler
+ set(linker_tool "${CMAKE_MATCH_1}")
+ elseif("${line}" MATCHES "^export XL_LINKER=(.*/${linker})[ \t]*$") # IBM XL
+ set(linker_tool "${CMAKE_MATCH_1}")
+ elseif("${line}" MATCHES "--with-ld=") # GNU
+ # The GNU compiler reports how it was configured.
+ # This does not account for -fuse-ld= so use it only as a fallback.
+ if("${line}" MATCHES " --with-ld=([^ ]+/${linker})( |$)")
+ set(linker_tool_fallback "${CMAKE_MATCH_1}")
+ endif()
+ elseif("${line}" MATCHES "vs_link.*-- +([^\"]*[/\\](${linker})) ") # cmake -E vs_link_exe
+ set(linker_tool "${CMAKE_MATCH_1}")
+ elseif("${line}" MATCHES "${linker_tool_regex}")
+ set(linker_tool "${CMAKE_MATCH_2}")
+ endif()
+ endif()
+ if(NOT (EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS OR EXTRA_PARSE_COMPUTE_IMPLICIT_DIRS
+ OR EXTRA_PARSE_COMPUTE_IMPLICIT_FWKS OR EXTRA_PARSE_COMPUTE_IMPLICIT_OBJECTS))
+ if(linker_tool)
+ break()
+ else()
+ continue()
+ endif()
+ endif()
set(cmd)
if("${line}" MATCHES "${linker_regex}" AND
NOT "${line}" MATCHES "${linker_exclude_regex}")
@@ -86,7 +144,8 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
endif()
endif()
set(search_static 0)
- if("${cmd}" MATCHES "${linker_regex}")
+ if(NOT link_line_parsed AND "${cmd}" MATCHES "${linker_regex}")
+ set(link_line_parsed 1)
string(APPEND log " link line: [${line}]\n")
string(REGEX REPLACE ";-([LYz]);" ";-\\1" args "${args}")
set(skip_value_of "")
@@ -95,60 +154,78 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
string(APPEND log " arg [${arg}] ==> skip value of ${skip_value_of}\n")
set(skip_value_of "")
elseif("${arg}" MATCHES "^-L(.:)?[/\\]")
- # Unix search path.
- string(REGEX REPLACE "^-L" "" dir "${arg}")
- list(APPEND implicit_dirs_tmp ${dir})
- string(APPEND log " arg [${arg}] ==> dir [${dir}]\n")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_DIRS)
+ # Unix search path.
+ string(REGEX REPLACE "^-L" "" dir "${arg}")
+ list(APPEND implicit_dirs_tmp ${dir})
+ string(APPEND log " arg [${arg}] ==> dir [${dir}]\n")
+ endif()
elseif("${arg}" MATCHES "^[-/](LIBPATH|libpath):(.+)")
- # MSVC search path.
- set(dir "${CMAKE_MATCH_2}")
- list(APPEND implicit_dirs_tmp ${dir})
- string(APPEND log " arg [${arg}] ==> dir [${dir}]\n")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_DIRS)
+ # MSVC search path.
+ set(dir "${CMAKE_MATCH_2}")
+ list(APPEND implicit_dirs_tmp ${dir})
+ string(APPEND log " arg [${arg}] ==> dir [${dir}]\n")
+ endif()
elseif(is_msvc AND "${arg}" STREQUAL "-link")
string(APPEND log " arg [${arg}] ==> ignore MSVC cl option\n")
elseif(is_msvc AND "${arg}" MATCHES "^[-/][Ii][Mm][Pp][Ll][Ii][Bb]:")
string(APPEND log " arg [${arg}] ==> ignore MSVC link option\n")
+ elseif(is_msvc AND "${arg}" MATCHES "^[-/][Ww][Hh][Oo][Ll][Ee][Aa][Rr][Cc][Hh][Ii][Vv][Ee]:Fortran_main")
+ string(APPEND log " arg [${arg}] ==> ignore LLVMFlang program entry point\n")
elseif(is_msvc AND "${arg}" MATCHES "^(.*\\.[Ll][Ii][Bb])$")
- set(lib "${CMAKE_MATCH_1}")
- list(APPEND implicit_libs_tmp ${lib})
- string(APPEND log " arg [${arg}] ==> lib [${lib}]\n")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS)
+ set(lib "${CMAKE_MATCH_1}")
+ list(APPEND implicit_libs_tmp ${lib})
+ string(APPEND log " arg [${arg}] ==> lib [${lib}]\n")
+ endif()
elseif("${arg}" STREQUAL "-lto_library")
# ld argument "-lto_library <path>"
set(skip_value_of "${arg}")
string(APPEND log " arg [${arg}] ==> ignore, skip following value\n")
elseif("${arg}" MATCHES "^-l([^:].*)$")
- # Unix library.
- set(lib "${CMAKE_MATCH_1}")
- if(search_static AND lib MATCHES "^(gfortran|stdc\\+\\+)$")
- # Search for the static library later, once all link dirs are known.
- set(lib "SEARCH_STATIC:${lib}")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS)
+ # Unix library.
+ set(lib "${CMAKE_MATCH_1}")
+ if(search_static AND lib MATCHES "^(gfortran|stdc\\+\\+)$")
+ # Search for the static library later, once all link dirs are known.
+ set(lib "SEARCH_STATIC:${lib}")
+ endif()
+ list(APPEND implicit_libs_tmp ${lib})
+ string(APPEND log " arg [${arg}] ==> lib [${lib}]\n")
endif()
- list(APPEND implicit_libs_tmp ${lib})
- string(APPEND log " arg [${arg}] ==> lib [${lib}]\n")
elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.a$")
- # Unix library full path.
- list(APPEND implicit_libs_tmp ${arg})
- string(APPEND log " arg [${arg}] ==> lib [${arg}]\n")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS)
+ # Unix library full path.
+ list(APPEND implicit_libs_tmp ${arg})
+ string(APPEND log " arg [${arg}] ==> lib [${arg}]\n")
+ endif()
elseif("${arg}" MATCHES "^[-/](DEFAULTLIB|defaultlib):(.+)")
- # Windows library.
- set(lib "${CMAKE_MATCH_2}")
- list(APPEND implicit_libs_tmp ${lib})
- string(APPEND log " arg [${arg}] ==> lib [${lib}]\n")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS)
+ # Windows library.
+ set(lib "${CMAKE_MATCH_2}")
+ list(APPEND implicit_libs_tmp ${lib})
+ string(APPEND log " arg [${arg}] ==> lib [${lib}]\n")
+ endif()
elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.o$")
if(EXTRA_PARSE_COMPUTE_IMPLICIT_OBJECTS)
list(APPEND implicit_objs_tmp ${arg})
string(APPEND log " arg [${arg}] ==> obj [${arg}]\n")
endif()
- if(obj_regex AND "${arg}" MATCHES "${obj_regex}")
- # Object file full path.
- list(APPEND implicit_libs_tmp ${arg})
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS)
+ if(obj_regex AND "${arg}" MATCHES "${obj_regex}")
+ # Object file full path.
+ list(APPEND implicit_libs_tmp ${arg})
+ endif()
endif()
elseif("${arg}" MATCHES "^-Y(P,)?[^0-9]")
- # Sun search path ([^0-9] avoids conflict with Mac -Y<num>).
- string(REGEX REPLACE "^-Y(P,)?" "" dirs "${arg}")
- string(REPLACE ":" ";" dirs "${dirs}")
- list(APPEND implicit_dirs_tmp ${dirs})
- string(APPEND log " arg [${arg}] ==> dirs [${dirs}]\n")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_DIRS)
+ # Sun search path ([^0-9] avoids conflict with Mac -Y<num>).
+ string(REGEX REPLACE "^-Y(P,)?" "" dirs "${arg}")
+ string(REPLACE ":" ";" dirs "${dirs}")
+ list(APPEND implicit_dirs_tmp ${dirs})
+ string(APPEND log " arg [${arg}] ==> dirs [${dirs}]\n")
+ endif()
elseif("${arg}" STREQUAL "-Bstatic")
set(search_static 1)
string(APPEND log " arg [${arg}] ==> search static\n" )
@@ -156,13 +233,17 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
set(search_static 0)
string(APPEND log " arg [${arg}] ==> search dynamic\n" )
elseif("${arg}" MATCHES "^-l:")
- # HP named library.
- list(APPEND implicit_libs_tmp ${arg})
- string(APPEND log " arg [${arg}] ==> lib [${arg}]\n")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS)
+ # HP named library.
+ list(APPEND implicit_libs_tmp ${arg})
+ string(APPEND log " arg [${arg}] ==> lib [${arg}]\n")
+ endif()
elseif("${arg}" MATCHES "^-z(all|default|weak)extract")
- # Link editor option.
- list(APPEND implicit_libs_tmp ${arg})
- string(APPEND log " arg [${arg}] ==> opt [${arg}]\n")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS)
+ # Link editor option.
+ list(APPEND implicit_libs_tmp ${arg})
+ string(APPEND log " arg [${arg}] ==> opt [${arg}]\n")
+ endif()
elseif("${arg}" STREQUAL "cl.exe")
string(APPEND log " arg [${arg}] ==> recognize MSVC cl\n")
set(is_msvc 1)
@@ -170,25 +251,39 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
string(APPEND log " arg [${arg}] ==> ignore\n")
endif()
endforeach()
- break()
elseif("${line}" MATCHES "LPATH(=| is:? *)(.*)$")
- string(APPEND log " LPATH line: [${line}]\n")
- # HP search path.
- string(REPLACE ":" ";" paths "${CMAKE_MATCH_2}")
- list(APPEND implicit_dirs_tmp ${paths})
- string(APPEND log " dirs [${paths}]\n")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_DIRS)
+ string(APPEND log " LPATH line: [${line}]\n")
+ # HP search path.
+ string(REPLACE ":" ";" paths "${CMAKE_MATCH_2}")
+ list(APPEND implicit_dirs_tmp ${paths})
+ string(APPEND log " dirs [${paths}]\n")
+ endif()
else()
string(APPEND log " ignore line: [${line}]\n")
endif()
+ if((NOT EXTRA_PARSE_COMPUTE_LINKER OR linker_tool) AND link_line_parsed)
+ break()
+ endif()
endforeach()
+ if(NOT linker_tool AND linker_tool_fallback)
+ set(linker_tool "${linker_tool_fallback}")
+ endif()
+ if(linker_tool)
+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
+ cmake_path(NORMAL_PATH linker_tool)
+ endif()
+ string(APPEND log " linker tool for '${EXTRA_PARSE_LANGUAGE}': ${linker_tool}\n")
+ endif()
+
# Look for library search paths reported by linker.
- if("${output_lines}" MATCHES ";Library search paths:((;\t[^;]+)+)")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_DIRS AND "${output_lines}" MATCHES ";Library search paths:((;\t[^;]+)+)")
string(REPLACE ";\t" ";" implicit_dirs_match "${CMAKE_MATCH_1}")
string(APPEND log " Library search paths: [${implicit_dirs_match}]\n")
list(APPEND implicit_dirs_tmp ${implicit_dirs_match})
endif()
- if("${output_lines}" MATCHES ";Framework search paths:((;\t[^;]+)+)")
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_FWKS AND "${output_lines}" MATCHES ";Framework search paths:((;\t[^;]+)+)")
string(REPLACE ";\t" ";" implicit_fwks_match "${CMAKE_MATCH_1}")
string(APPEND log " Framework search paths: [${implicit_fwks_match}]\n")
list(APPEND implicit_fwks_tmp ${implicit_fwks_match})
@@ -273,11 +368,21 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj
string(APPEND log " implicit fwks: [${implicit_fwks}]\n")
# Return results.
- set(${lib_var} "${implicit_libs}" PARENT_SCOPE)
- set(${dir_var} "${implicit_dirs}" PARENT_SCOPE)
- set(${fwk_var} "${implicit_fwks}" PARENT_SCOPE)
+ if(EXTRA_PARSE_COMPUTE_LINKER)
+ set(${EXTRA_PARSE_COMPUTE_LINKER} "${linker_tool}" PARENT_SCOPE)
+ endif()
+
set(${log_var} "${log}" PARENT_SCOPE)
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS)
+ set(${EXTRA_PARSE_COMPUTE_IMPLICIT_LIBS} "${implicit_libs}" PARENT_SCOPE)
+ endif()
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_DIRS)
+ set(${EXTRA_PARSE_COMPUTE_IMPLICIT_DIRS} "${implicit_dirs}" PARENT_SCOPE)
+ endif()
+ if(EXTRA_PARSE_COMPUTE_IMPLICIT_FWKS)
+ set(${EXTRA_PARSE_COMPUTE_IMPLICIT_FWKS} "${implicit_fwks}" PARENT_SCOPE)
+ endif()
if(EXTRA_PARSE_COMPUTE_IMPLICIT_OBJECTS)
set(${EXTRA_PARSE_COMPUTE_IMPLICIT_OBJECTS} "${implicit_objs}" PARENT_SCOPE)
endif()
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 32b7166..fd0367e 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -219,6 +219,14 @@
# define ARCHITECTURE_ID ""
# endif
+#elif defined(__clang__) && defined(__ti__)
+# if defined(__ARM_ARCH)
+# define ARCHITECTURE_ID "Arm"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+
#elif defined(__TI_COMPILER_VERSION__)
# if defined(__TI_ARM__)
# define ARCHITECTURE_ID "ARM"
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 1c6f0df..60df6a2 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -56,6 +56,9 @@ set(CMAKE_Swift_LIBRARY_PATH_TERMINATOR "")
set(CMAKE_Swift_LINK_LIBRARY_FLAG "-l")
set(CMAKE_Swift_LINKER_WRAPPER_FLAG "-Xlinker" " ")
set(CMAKE_Swift_RESPONSE_FILE_LINK_FLAG @)
+set(CMAKE_Swift_RESPONSE_FILE_FLAG @)
+set(CMAKE_Swift_COMPILE_OPTIONS_COLOR_DIAGNOSTICS -color-diagnostics)
+set(CMAKE_Swift_COMPILE_OPTIONS_COLOR_DIAGNOSTICS_OFF -no-color-diagnostics)
set(CMAKE_Swift_LINKER_PREFERENCE 50)
set(CMAKE_Swift_LINKER_PREFERENCE_PROPAGATES 1)
@@ -68,30 +71,42 @@ set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -libc MD)
set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -libc MTd)
set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -libc MDd)
+set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g")
+set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
+set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g")
+set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
+
if(CMAKE_GENERATOR STREQUAL "Xcode")
+ string(APPEND CMAKE_Swift_FLAGS_DEBUG_INIT " ${CMAKE_Swift_FLAGS_DEBUG_LINKER_FLAGS}")
+ string(APPEND CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT " ${CMAKE_Swift_FLAGS_RELWITHDEBINFO_LINKER_FLAGS}")
+endif()
+
+# Warns if unset and uses old policy.
+# Old policy flag-smashes the wmo and incremental flags onto the compiler flags.
+# New policy respects the Swift_COMPILATION_MODE target property to add
+# incremental and wholemodule optimization flags as appropriate.
+cmake_policy(GET CMP0157 __SWIFT_COMP_MODE_CMP0157)
+if(__SWIFT_COMP_MODE_CMP0157 STREQUAL "NEW")
+ set(CMAKE_Swift_COMPILATION_MODE_DEFAULT "incremental")
+else()
# Xcode has a separate Xcode project option (SWIFT_COMPILATION_MODE) used to set
# whether compiling with whole-module optimizations or incrementally. Setting
# these options here will have no effect when compiling with the built-in driver,
# and will explode violently, leaving build products in the source directory, when
- # using the old swift driver.
- set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g ${CMAKE_Swift_FLAGS_DEBUG_LINKER_FLAGS}")
- set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
- set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g ${CMAKE_Swift_FLAGS_RELWITHDEBINFO_LINKER_FLAGS}")
- set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
-else()
- set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g -incremental")
- set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
- set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g")
- set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
-
- # Enable Whole Module Optimization by default unless the old
- # C++ driver is being used, which behaves differently under WMO.
- if(NOT CMAKE_Swift_COMPILER_USE_OLD_DRIVER)
- string(APPEND CMAKE_Swift_FLAGS_RELEASE_INIT " -wmo")
- string(APPEND CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT " -wmo")
- string(APPEND CMAKE_Swift_FLAGS_MINSIZEREL_INIT " -wmo")
+ # using the old swift driver. Don't append `-incremental` or `-wmo` to the
+ # flags in the Xcode generator.
+ if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ # Enable Whole Module Optimization by default unless the old
+ # C++ driver is being used, which behaves differently under WMO.
+ if(NOT CMAKE_Swift_COMPILER_USE_OLD_DRIVER)
+ string(APPEND CMAKE_Swift_FLAGS_RELEASE_INIT " -wmo")
+ string(APPEND CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT " -wmo")
+ string(APPEND CMAKE_Swift_FLAGS_MINSIZEREL_INIT " -wmo")
+ endif()
+ string(APPEND CMAKE_Swift_FLAGS_DEBUG_INIT " -incremental")
endif()
endif()
+unset(__SWIFT_COMP_MODE_CMP0157)
if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
if(NOT DEFINED CMAKE_Swift_LINK_WHAT_YOU_USE_FLAG)
@@ -104,36 +119,66 @@ endif()
cmake_initialize_per_config_variable(CMAKE_Swift_FLAGS "Swift Compiler Flags")
-# NOTE(compnerd) we do not have an object compile rule since we build the objects as part of the link step
-if(NOT CMAKE_Swift_COMPILE_OBJECT)
- set(CMAKE_Swift_COMPILE_OBJECT ":")
-endif()
-
if(NOT CMAKE_Swift_NUM_THREADS MATCHES "^[0-9]+$")
cmake_host_system_information(RESULT CMAKE_Swift_NUM_THREADS QUERY NUMBER_OF_LOGICAL_CORES)
endif()
-if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY)
- set(CMAKE_Swift_CREATE_SHARED_LIBRARY "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} <LINK_LIBRARIES>")
-endif()
+# Swift split-compilation requires CMP0157 NEW policy
+if(CMAKE_Swift_COMPILATION_MODE_DEFAULT)
+ set(CMAKE_Swift_PARALLEL_FLAGS "-j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS}")
+ if(NOT CMAKE_Swift_COMPILE_OBJECT)
+ # Omit the object output. The output is controlled by the output-file-map
+ # for normal builds. For wholemodule builds, CMake appends the appropriate
+ # flags.
+ set(CMAKE_Swift_COMPILE_OBJECT "<CMAKE_Swift_COMPILER> ${CMAKE_Swift_PARALLEL_FLAGS} -c <DEFINES> <FLAGS> <INCLUDES> <SOURCE>")
+ endif()
-if(NOT CMAKE_Swift_CREATE_SHARED_MODULE)
- set(CMAKE_Swift_CREATE_SHARED_MODULE ${CMAKE_Swift_CREATE_SHARED_LIBRARY})
-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_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+ endif()
-if(NOT CMAKE_Swift_LINK_EXECUTABLE)
- set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <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>")
+ endif()
-if(NOT CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS)
- set(CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS "${CMAKE_Swift_LINK_EXECUTABLE} -emit-module -emit-module-path <SWIFT_MODULE> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS}")
-endif()
+ if(NOT CMAKE_Swift_LINK_EXECUTABLE)
+ set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> ${CMAKE_Swift_PARALLEL_FLAGS} -emit-executable -o <TARGET> <FLAGS> <OBJECTS> <LINK_FLAGS> <LINK_LIBRARIES>")
+ endif()
+
+ if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY)
+ set(CMAKE_Swift_CREATE_STATIC_LIBRARY "<CMAKE_Swift_COMPILER> -emit-library -static -o <TARGET> <OBJECTS> <LINK_FLAGS>")
+ set(CMAKE_Swift_ARCHIVE_CREATE "<CMAKE_AR> crs <TARGET> <OBJECTS>")
+ set(CMAKE_Swift_ARCHIVE_FINISH "")
+ endif()
+ unset(CMAKE_Swift_PARALLEL_FLAGS)
+else()
+ # NOTE(compnerd) we do not have an object compile rule since we build the objects as part of the link step
+ if(NOT CMAKE_Swift_COMPILE_OBJECT)
+ set(CMAKE_Swift_COMPILE_OBJECT ":")
+ endif()
+
+ if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY)
+ set(CMAKE_Swift_CREATE_SHARED_LIBRARY "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} <LINK_LIBRARIES>")
+ endif()
-if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY)
- set(CMAKE_Swift_CREATE_STATIC_LIBRARY "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ if(NOT CMAKE_Swift_CREATE_SHARED_MODULE)
+ set(CMAKE_Swift_CREATE_SHARED_MODULE "${CMAKE_Swift_CREATE_SHARED_LIBRARY} <CMAKE_SHARED_MODULE_CREATE_Swift_FLAGS>")
+ endif()
+
+ if(NOT CMAKE_Swift_LINK_EXECUTABLE)
+ set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ endif()
- set(CMAKE_Swift_ARCHIVE_CREATE "<CMAKE_AR> crs <TARGET> <OBJECTS>")
- set(CMAKE_Swift_ARCHIVE_FINISH "")
+ if(NOT CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS)
+ set(CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS "${CMAKE_Swift_LINK_EXECUTABLE} -emit-module -emit-module-path <SWIFT_MODULE> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS}")
+ endif()
+
+ if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY)
+ set(CMAKE_Swift_CREATE_STATIC_LIBRARY "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+
+ set(CMAKE_Swift_ARCHIVE_CREATE "<CMAKE_AR> crs <TARGET> <OBJECTS>")
+ set(CMAKE_Swift_ARCHIVE_FINISH "")
+ endif()
endif()
set(CMAKE_Swift_INFORMATION_LOADED 1)
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 58726db..8ebe570 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -73,8 +73,8 @@ if(NOT CMAKE_C_COMPILER_WORKS)
endif()
# Try to identify the compiler features
-include(${CMAKE_ROOT}/Modules/CMakeDetermineCompileFeatures.cmake)
-CMAKE_DETERMINE_COMPILE_FEATURES(C)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerSupport.cmake)
+CMAKE_DETERMINE_COMPILER_SUPPORT(C)
# Re-configure to save learned information.
configure_file(
diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake
index 3057fe9..ef97f55 100644
--- a/Modules/CMakeTestCUDACompiler.cmake
+++ b/Modules/CMakeTestCUDACompiler.cmake
@@ -65,8 +65,8 @@ if(NOT CMAKE_CUDA_COMPILER_WORKS)
endif()
# Try to identify the compiler features
-include(${CMAKE_ROOT}/Modules/CMakeDetermineCompileFeatures.cmake)
-CMAKE_DETERMINE_COMPILE_FEATURES(CUDA)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerSupport.cmake)
+CMAKE_DETERMINE_COMPILER_SUPPORT(CUDA)
if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES "${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES}")
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index e640ff9..c82a154 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -66,8 +66,8 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
endif()
# Try to identify the compiler features
-include(${CMAKE_ROOT}/Modules/CMakeDetermineCompileFeatures.cmake)
-CMAKE_DETERMINE_COMPILE_FEATURES(CXX)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerSupport.cmake)
+CMAKE_DETERMINE_COMPILER_SUPPORT(CXX)
# Re-configure to save learned information.
configure_file(
diff --git a/Modules/CMakeTestHIPCompiler.cmake b/Modules/CMakeTestHIPCompiler.cmake
index ec54d80..5b49c0d 100644
--- a/Modules/CMakeTestHIPCompiler.cmake
+++ b/Modules/CMakeTestHIPCompiler.cmake
@@ -83,8 +83,8 @@ unset(__CMAKE_HIP_FLAGS)
# Try to identify the compiler features
-include(${CMAKE_ROOT}/Modules/CMakeDetermineCompileFeatures.cmake)
-CMAKE_DETERMINE_COMPILE_FEATURES(HIP)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerSupport.cmake)
+CMAKE_DETERMINE_COMPILER_SUPPORT(HIP)
if(CMAKE_HIP_COMPILER_ID STREQUAL "NVIDIA")
include(Internal/CMakeNVCCFilterImplicitInfo)
diff --git a/Modules/CMakeTestOBJCCompiler.cmake b/Modules/CMakeTestOBJCCompiler.cmake
index a36180b..bcb3e1e 100644
--- a/Modules/CMakeTestOBJCCompiler.cmake
+++ b/Modules/CMakeTestOBJCCompiler.cmake
@@ -70,8 +70,8 @@ if(NOT CMAKE_OBJC_COMPILER_WORKS)
endif()
# Try to identify the compiler features
-include(${CMAKE_ROOT}/Modules/CMakeDetermineCompileFeatures.cmake)
-CMAKE_DETERMINE_COMPILE_FEATURES(OBJC)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerSupport.cmake)
+CMAKE_DETERMINE_COMPILER_SUPPORT(OBJC)
# Re-configure to save learned information.
configure_file(
diff --git a/Modules/CMakeTestOBJCXXCompiler.cmake b/Modules/CMakeTestOBJCXXCompiler.cmake
index f7935c7..68b3871 100644
--- a/Modules/CMakeTestOBJCXXCompiler.cmake
+++ b/Modules/CMakeTestOBJCXXCompiler.cmake
@@ -69,8 +69,8 @@ if(NOT CMAKE_OBJCXX_COMPILER_WORKS)
endif()
# Try to identify the compiler features
-include(${CMAKE_ROOT}/Modules/CMakeDetermineCompileFeatures.cmake)
-CMAKE_DETERMINE_COMPILE_FEATURES(OBJCXX)
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerSupport.cmake)
+CMAKE_DETERMINE_COMPILER_SUPPORT(OBJCXX)
# Re-configure to save learned information.
configure_file(
diff --git a/Modules/CMakeVerifyManifest.cmake b/Modules/CMakeVerifyManifest.cmake
index 705ef8a..19827f1 100644
--- a/Modules/CMakeVerifyManifest.cmake
+++ b/Modules/CMakeVerifyManifest.cmake
@@ -31,7 +31,10 @@ found in the .manifest file.
# it will put the list of versions found into the variable
# specified by list_var
function(crt_version file list_var)
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS "${file}" strings REGEX "Microsoft.VC...CRT" NEWLINE_CONSUME)
+ cmake_policy(POP)
foreach(s ${strings})
set(has_match 1)
string(REGEX
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index ff1cb7e..813ac3c 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -866,6 +866,7 @@ if(NOT DEFINED CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE
"${_CMP0133_warning}\n"
"For compatibility, CMake will enable the SLA in the CPack DragNDrop Generator."
)
+ unset(_CMP0133_warning)
endif()
_cpack_set_default(CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE ON)
endif()
@@ -882,6 +883,24 @@ endif()
# WiX specific variables
_cpack_set_default(CPACK_WIX_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}")
+# productbuild specific variables
+cmake_policy(GET CMP0161 _CPack_CMP0161)
+if("x${_CPack_CMP0161}x" STREQUAL "xNEWx")
+ _cpack_set_default(CPACK_PRODUCTBUILD_DOMAINS ON)
+elseif(APPLE AND CPACK_BINARY_PRODUCTBUILD AND
+ NOT DEFINED CPACK_PRODUCTBUILD_DOMAINS AND
+ NOT "x${_CPack_CMP0161}x" STREQUAL "xOLDx")
+ cmake_policy(GET_WARNING CMP0161 _CMP0161_warning)
+ message(AUTHOR_WARNING
+ "${_CMP0161_warning}\n"
+ "For compatibility, CPACK_PRODUCTBUILD_DOMAINS will remain unset. "
+ "Explicitly setting CPACK_PRODUCTBUILD_DOMAINS or setting policy CMP0161 "
+ "to NEW will prevent this warning."
+ )
+ unset(_CMP0161_warning)
+endif()
+unset(_CPack_CMP0161)
+
# set sysroot so SDK tools can be used
if(CMAKE_OSX_SYSROOT)
_cpack_set_default(CPACK_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_PATH}")
diff --git a/Modules/CSharpUtilities.cmake b/Modules/CSharpUtilities.cmake
index dedb146..cd44169 100644
--- a/Modules/CSharpUtilities.cmake
+++ b/Modules/CSharpUtilities.cmake
@@ -64,7 +64,7 @@ Main functions provided by the module
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_designer_cs_properties` instead)::
+ :command:`csharp_set_windows_forms_properties` instead)::
csharp_set_designer_cs_properties([<file1> [<file2> [...]]])
@@ -133,7 +133,7 @@ Helper functions which are used by the above ones
Name of the variable in which the list of keys is stored
``<fileN>``
- filename(s) as given to to CSharp target using :command:`add_library`
+ filename(s) as given to CSharp target using :command:`add_library`
or :command:`add_executable`
In some way the function applies a canonicalization to the source names.
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index 99ef8e5..5e8a07d 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -20,15 +20,31 @@ mark_as_advanced(CMAKE_CTEST_COMMAND)
# Use CTest
# configure files
-if(CTEST_NEW_FORMAT)
- configure_file(
- ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
- ${PROJECT_BINARY_DIR}/CTestConfiguration.ini )
-else()
- configure_file(
- ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
- ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
-endif()
+block()
+ if(NOT DEFINED CTEST_TLS_VERSION)
+ if(DEFINED CMAKE_TLS_VERSION)
+ set(CTEST_TLS_VERSION "${CMAKE_TLS_VERSION}")
+ elseif(DEFINED ENV{CMAKE_TLS_VERSION})
+ set(CTEST_TLS_VERSION "$ENV{CMAKE_TLS_VERSION}")
+ endif()
+ endif()
+ if(NOT DEFINED CTEST_TLS_VERIFY)
+ if(DEFINED CMAKE_TLS_VERIFY)
+ set(CTEST_TLS_VERIFY "${CMAKE_TLS_VERIFY}")
+ elseif(DEFINED ENV{CMAKE_TLS_VERIFY})
+ set(CTEST_TLS_VERIFY "$ENV{CMAKE_TLS_VERIFY}")
+ endif()
+ endif()
+ if(CTEST_NEW_FORMAT)
+ configure_file(
+ ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
+ ${PROJECT_BINARY_DIR}/CTestConfiguration.ini )
+ else()
+ configure_file(
+ ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
+ ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
+ endif()
+endblock()
#
# Section 3:
diff --git a/Modules/CXX-DetectStdlib.h b/Modules/CXX-DetectStdlib.h
new file mode 100644
index 0000000..0214dee
--- /dev/null
+++ b/Modules/CXX-DetectStdlib.h
@@ -0,0 +1,10 @@
+#include <version>
+// clang-format off
+#if defined(_LIBCPP_VERSION)
+CMAKE-STDLIB-DETECT: libc++
+#elif defined(__GLIBCXX__)
+CMAKE-STDLIB-DETECT: libstdc++
+#else
+CMAKE-STDLIB-DETECT: UNKNOWN
+#endif
+ // clang-format on
diff --git a/Modules/CheckForPthreads.c b/Modules/CheckForPthreads.c
index e70ceb1..ea1f7ac 100644
--- a/Modules/CheckForPthreads.c
+++ b/Modules/CheckForPthreads.c
@@ -1,6 +1,6 @@
#include <pthread.h>
-void* start_routine(void* args)
+static void* start_routine(void* args)
{
return args;
}
diff --git a/Modules/CheckIPOSupported/main.c b/Modules/CheckIPOSupported/main.c
index 5be0864..8d2ab01 100644
--- a/Modules/CheckIPOSupported/main.c
+++ b/Modules/CheckIPOSupported/main.c
@@ -1,6 +1,6 @@
int foo();
-int main()
+int main(void)
{
return foo();
}
diff --git a/Modules/CheckLibraryExists.lists.in b/Modules/CheckLibraryExists.lists.in
deleted file mode 100644
index 741b87d..0000000
--- a/Modules/CheckLibraryExists.lists.in
+++ /dev/null
@@ -1,8 +0,0 @@
-PROJECT(CHECK_LIBRARY_EXISTS)
-
-
-ADD_DEFINITIONS(-DCHECK_FUNCTION_EXISTS=${CHECK_LIBRARY_EXISTS_FUNCTION})
-LINK_DIRECTORIES(${CHECK_LIBRARY_EXISTS_LOCATION})
-ADD_EXECUTABLE(CheckLibraryExists ${CHECK_LIBRARY_EXISTS_SOURCE})
-TARGET_LINK_LIBRARIES(CheckLibraryExists ${CHECK_LIBRARY_EXISTS_LIBRARY})
-
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake
index 72fd093..959f8e5 100644
--- a/Modules/CheckStructHasMember.cmake
+++ b/Modules/CheckStructHasMember.cmake
@@ -66,7 +66,7 @@ macro (CHECK_STRUCT_HAS_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
set(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
${_INCLUDE_FILES}
-int main()
+int main(void)
{
(void)sizeof(((${_STRUCT} *)0)->${_MEMBER});
return 0;
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index 931ed4a..621df75 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -75,14 +75,28 @@ macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
endmacro()
macro(__CHECK_SYMBOL_EXISTS_FILTER_FLAGS LANG)
- set(__CMAKE_${LANG}_FLAGS_SAVED "${CMAKE_${LANG}_FLAGS}")
- string(REGEX REPLACE "(^| )-Werror([= ][^ ]*)?( |$)" " " CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS}")
- string(REGEX REPLACE "(^| )-pedantic-errors( |$)" " " CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS}")
+ if(CMAKE_TRY_COMPILE_CONFIGURATION)
+ string(TOUPPER "${CMAKE_TRY_COMPILE_CONFIGURATION}" _tc_config)
+ else()
+ set(_tc_config "DEBUG")
+ endif()
+ foreach(v CMAKE_${LANG}_FLAGS CMAKE_${LANG}_FLAGS_${_tc_config})
+ set(__${v}_SAVED "${${v}}")
+ string(REGEX REPLACE "(^| )-Werror([= ][^-][^ ]*)?( |$)" " " ${v} "${${v}}")
+ string(REGEX REPLACE "(^| )-pedantic-errors( |$)" " " ${v} "${${v}}")
+ endforeach()
endmacro()
macro(__CHECK_SYMBOL_EXISTS_RESTORE_FLAGS LANG)
- set(CMAKE_${LANG}_FLAGS "${__CMAKE_${LANG}_FLAGS_SAVED}")
- unset(__CMAKE_${LANG}_FLAGS_SAVED)
+ if(CMAKE_TRY_COMPILE_CONFIGURATION)
+ string(TOUPPER "${CMAKE_TRY_COMPILE_CONFIGURATION}" _tc_config)
+ else()
+ set(_tc_config "DEBUG")
+ endif()
+ foreach(v CMAKE_${LANG}_FLAGS CMAKE_${LANG}_FLAGS_${_tc_config})
+ set(${v} "${__${v}_SAVED}")
+ unset(__${v}_SAVED)
+ endforeach()
endmacro()
macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE)
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 01ce1d2..849d691 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -92,6 +92,7 @@ include_guard(GLOBAL)
block(SCOPE_FOR POLICIES)
cmake_policy(SET CMP0054 NEW)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
#-----------------------------------------------------------------------------
# Helper function. DO NOT CALL DIRECTLY.
diff --git a/Modules/Compiler/ADSP-ASM.cmake b/Modules/Compiler/ADSP-ASM.cmake
new file mode 100644
index 0000000..9ef5142
--- /dev/null
+++ b/Modules/Compiler/ADSP-ASM.cmake
@@ -0,0 +1,6 @@
+include(Compiler/ADSP)
+__compiler_adsp(ASM)
+
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm)
+set(CMAKE_ASM_OUTPUT_EXTENSION ".o" )
+set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
diff --git a/Modules/Compiler/ADSP-C.cmake b/Modules/Compiler/ADSP-C.cmake
index cef3fb1..1898401 100644
--- a/Modules/Compiler/ADSP-C.cmake
+++ b/Modules/Compiler/ADSP-C.cmake
@@ -8,4 +8,6 @@ set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
+set(CMAKE_C_STANDARD_LATEST 99)
+
__compiler_check_default_language_standard(C 8.0.0.0 99)
diff --git a/Modules/Compiler/ADSP-CXX.cmake b/Modules/Compiler/ADSP-CXX.cmake
index b01cab1..e82d9fb 100644
--- a/Modules/Compiler/ADSP-CXX.cmake
+++ b/Modules/Compiler/ADSP-CXX.cmake
@@ -6,11 +6,13 @@ __compiler_adsp(CXX)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION -c++)
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION -g++)
set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
+set(CMAKE_CXX_STANDARD_LATEST 98)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.3.0.0)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION -c++11)
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION -c++11 -g++)
set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 11)
endif()
__compiler_check_default_language_standard(CXX 8.0.0.0 98)
diff --git a/Modules/Compiler/ADSP.cmake b/Modules/Compiler/ADSP.cmake
index 62566a0..39dcf39 100644
--- a/Modules/Compiler/ADSP.cmake
+++ b/Modules/Compiler/ADSP.cmake
@@ -10,6 +10,8 @@ macro(__compiler_adsp lang)
set(_CMAKE_${lang}_ADSP_FLAGS "-proc=${CMAKE_ADSP_PROCESSOR}")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -Mo <DEP_FILE>")
+
set(CMAKE_${lang}_COMPILE_OBJECT
"<CMAKE_${lang}_COMPILER> ${_CMAKE_${lang}_ADSP_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
diff --git a/Modules/Compiler/ARMClang-C.cmake b/Modules/Compiler/ARMClang-C.cmake
index 01c4cea..fce1a8e 100644
--- a/Modules/Compiler/ARMClang-C.cmake
+++ b/Modules/Compiler/ARMClang-C.cmake
@@ -21,3 +21,13 @@ set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+
+set(CMAKE_C_STANDARD_LATEST 11)
+
+# Including the "${CMAKE_ROOT}/Modules/Compiler/Clang-C.cmake" script above may set several other compile option
+# variables which do not necessarily apply here. So, we unset those variables accordingly.
+unset(CMAKE_C17_STANDARD_COMPILE_OPTION)
+unset(CMAKE_C17_EXTENSION_COMPILE_OPTION)
+
+unset(CMAKE_C23_STANDARD_COMPILE_OPTION)
+unset(CMAKE_C23_EXTENSION_COMPILE_OPTION)
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index d711b6e..41e7988 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -26,16 +26,20 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_C_STANDARD_LATEST 11)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0)
set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
+ set(CMAKE_C_STANDARD_LATEST 17)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0.3)
set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c2x")
set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
+ set(CMAKE_C_STANDARD_LATEST 23)
endif()
__compiler_check_default_language_standard(C 4.0 99 9.1 11 12.0.5 17)
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index 7c97969..8a6c855 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -22,25 +22,31 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
+
+ set(CMAKE_CXX_STANDARD_LATEST 11)
endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.1)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 14)
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
# AppleClang 5.0 knows this flag, but does not set a __cplusplus macro greater than 201103L
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 14)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
+ set(CMAKE_CXX_STANDARD_LATEST 17)
elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.1)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++1z")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
+ set(CMAKE_CXX_STANDARD_LATEST 17)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
@@ -50,14 +56,17 @@ endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
+ set(CMAKE_CXX_STANDARD_LATEST 20)
elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
+ set(CMAKE_CXX_STANDARD_LATEST 20)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std=c++2b")
set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std=gnu++2b")
+ set(CMAKE_CXX_STANDARD_LATEST 23)
endif()
__compiler_check_default_language_standard(CXX 4.0 98)
diff --git a/Modules/Compiler/AppleClang-OBJC.cmake b/Modules/Compiler/AppleClang-OBJC.cmake
index f40c396..aa02d4b 100644
--- a/Modules/Compiler/AppleClang-OBJC.cmake
+++ b/Modules/Compiler/AppleClang-OBJC.cmake
@@ -21,6 +21,8 @@ if(NOT CMAKE_OBJC_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_OBJC11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_OBJC11_EXTENSION_COMPILE_OPTION "-std=gnu11")
set(CMAKE_OBJC11_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_OBJC_STANDARD_LATEST 11)
endif()
# AppleClang 10.0 was the oldest compiler available to test C17 support
@@ -28,12 +30,16 @@ if(NOT CMAKE_OBJC_COMPILER_VERSION VERSION_LESS 10.0)
set(CMAKE_OBJC17_STANDARD_COMPILE_OPTION "-std=c17")
set(CMAKE_OBJC17_EXTENSION_COMPILE_OPTION "-std=gnu17")
set(CMAKE_OBJC17_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_OBJC_STANDARD_LATEST 17)
endif()
-if(NOT CMAKE_OBJC_COMPILER_VERSION VERSION_LESS 11.0)
+if(NOT CMAKE_OBJC_COMPILER_VERSION VERSION_LESS 11.0.3)
set(CMAKE_OBJC23_STANDARD_COMPILE_OPTION "-std=c2x")
set(CMAKE_OBJC23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
set(CMAKE_OBJC23_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_OBJC_STANDARD_LATEST 23)
endif()
# AppleClang 10.0 was the oldest compiler available to test default C11 support
diff --git a/Modules/Compiler/AppleClang-OBJCXX.cmake b/Modules/Compiler/AppleClang-OBJCXX.cmake
index 172a343..d2573e5 100644
--- a/Modules/Compiler/AppleClang-OBJCXX.cmake
+++ b/Modules/Compiler/AppleClang-OBJCXX.cmake
@@ -19,25 +19,31 @@ if(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_OBJCXX11_STANDARD_COMPILE_OPTION "-std=c++11")
set(CMAKE_OBJCXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
+
+ set(CMAKE_OBJCXX_STANDARD_LATEST 11)
endif()
if(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 6.1)
set(CMAKE_OBJCXX14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_OBJCXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
set(CMAKE_OBJCXX14_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_OBJCXX_STANDARD_LATEST 14)
elseif(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 5.1)
# AppleClang 5.0 knows this flag, but does not set a __cplusplus macro greater than 201103L
set(CMAKE_OBJCXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
set(CMAKE_OBJCXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
set(CMAKE_OBJCXX14_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_OBJCXX_STANDARD_LATEST 14)
endif()
if (NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 10.0)
set(CMAKE_OBJCXX17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_OBJCXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
+ set(CMAKE_OBJCXX_STANDARD_LATEST 17)
elseif (NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 6.1)
set(CMAKE_OBJCXX17_STANDARD_COMPILE_OPTION "-std=c++1z")
set(CMAKE_OBJCXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
+ set(CMAKE_OBJCXX_STANDARD_LATEST 17)
endif()
if (NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 8.0)
@@ -47,6 +53,7 @@ endif()
if (NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 10.0)
set(CMAKE_OBJCXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
set(CMAKE_OBJCXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
+ set(CMAKE_OBJCXX_STANDARD_LATEST 20)
endif()
__compiler_check_default_language_standard(OBJCXX 4.0 98)
diff --git a/Modules/Compiler/CMakeCommonCompilerMacros.cmake b/Modules/Compiler/CMakeCommonCompilerMacros.cmake
index 2f220d4..9eead20 100644
--- a/Modules/Compiler/CMakeCommonCompilerMacros.cmake
+++ b/Modules/Compiler/CMakeCommonCompilerMacros.cmake
@@ -105,6 +105,9 @@ endmacro()
# Define to allow compile features to be automatically determined
macro(cmake_record_cxx_compile_features)
set(_result 0)
+ if(_result EQUAL 0 AND DEFINED CMAKE_CXX26_STANDARD_COMPILE_OPTION)
+ _has_compiler_features_cxx(26)
+ endif()
if(_result EQUAL 0 AND DEFINED CMAKE_CXX23_STANDARD_COMPILE_OPTION)
_has_compiler_features_cxx(23)
endif()
@@ -142,6 +145,9 @@ endmacro()
macro(cmake_record_cuda_compile_features)
set(_result 0)
+ if(_result EQUAL 0 AND DEFINED CMAKE_CUDA26_STANDARD_COMPILE_OPTION)
+ _has_compiler_features_cuda(26)
+ endif()
if(_result EQUAL 0 AND DEFINED CMAKE_CUDA23_STANDARD_COMPILE_OPTION)
_has_compiler_features_cuda(23)
endif()
@@ -179,6 +185,9 @@ endmacro()
macro(cmake_record_hip_compile_features)
set(_result 0)
+ if(_result EQUAL 0 AND DEFINED CMAKE_HIP26_STANDARD_COMPILE_OPTION)
+ _has_compiler_features_hip(26)
+ endif()
if(_result EQUAL 0 AND DEFINED CMAKE_HIP23_STANDARD_COMPILE_OPTION)
_has_compiler_features_hip(23)
endif()
@@ -192,3 +201,52 @@ macro(cmake_record_hip_compile_features)
_has_compiler_features_hip(11)
_has_compiler_features_hip(98)
endmacro()
+
+function(cmake_create_cxx_import_std std variable)
+ set(_cmake_supported_import_std_features
+ # Compilers support `import std` in C++20 as an extension. Skip
+ # for now.
+ # 20
+ 23
+ 26)
+ list(FIND _cmake_supported_import_std_features "${std}" _cmake_supported_import_std_idx)
+ if (_cmake_supported_import_std_idx EQUAL "-1")
+ return ()
+ endif ()
+ # If the target exists, skip. A toolchain file may have provided it.
+ if (TARGET "__CMAKE::CXX${std}")
+ return ()
+ endif ()
+ # The generator must support imported C++ modules.
+ if (NOT CMAKE_GENERATOR MATCHES "Ninja")
+ return ()
+ endif ()
+ # Check if the compiler understands how to `import std;`.
+ include("${CMAKE_ROOT}/Modules/Compiler/${CMAKE_CXX_COMPILER_ID}-CXX-CXXImportStd.cmake" OPTIONAL RESULT_VARIABLE _cmake_import_std_res)
+ if (NOT _cmake_import_std_res)
+ return ()
+ endif ()
+ if (NOT COMMAND _cmake_cxx_import_std)
+ return ()
+ endif ()
+
+ # Check the experimental flag. Check it here to avoid triggering warnings in
+ # situations that don't support the feature anyways.
+ set(_cmake_supported_import_std_experimental "")
+ cmake_language(GET_EXPERIMENTAL_FEATURE_ENABLED
+ "CxxImportStd"
+ _cmake_supported_import_std_experimental)
+ if (NOT _cmake_supported_import_std_experimental)
+ return ()
+ endif ()
+
+ _cmake_cxx_import_std("${std}" target_definition)
+ string(CONCAT guarded_target_definition
+ "if (NOT TARGET \"__CMAKE::CXX${std}\")\n"
+ "${target_definition}"
+ "endif ()\n"
+ "if (TARGET \"__CMAKE::CXX${std}\")\n"
+ " list(APPEND CMAKE_CXX_COMPILER_IMPORT_STD \"${std}\")\n"
+ "endif ()\n")
+ set("${variable}" "${guarded_target_definition}" PARENT_SCOPE)
+endfunction()
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index 480a5de..c9b1669 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -33,27 +33,34 @@ if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
+
+ set(CMAKE_C_STANDARD_LATEST 99)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.1)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
+ set(CMAKE_C_STANDARD_LATEST 11)
elseif(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.0)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x")
+ set(CMAKE_C_STANDARD_LATEST 11)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
+ set(CMAKE_C_STANDARD_LATEST 17)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 18.0)
set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c23")
set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu23")
+ set(CMAKE_C_STANDARD_LATEST 23)
elseif(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)
set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c2x")
set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
+ set(CMAKE_C_STANDARD_LATEST 23)
endif()
else()
set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
@@ -74,6 +81,8 @@ else()
set(CMAKE_C17_STANDARD_COMPILE_OPTION "")
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "")
endif()
+
+ set(CMAKE_C_STANDARD_LATEST 17)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 2.1)
diff --git a/Modules/Compiler/Clang-CXX-CXXImportStd.cmake b/Modules/Compiler/Clang-CXX-CXXImportStd.cmake
new file mode 100644
index 0000000..3934db9
--- /dev/null
+++ b/Modules/Compiler/Clang-CXX-CXXImportStd.cmake
@@ -0,0 +1,153 @@
+function (_cmake_cxx_import_std std variable)
+ if (NOT CMAKE_CXX_STANDARD_LIBRARY STREQUAL "libc++")
+ return ()
+ endif ()
+
+ execute_process(
+ COMMAND
+ "${CMAKE_CXX_COMPILER}"
+ ${CMAKE_CXX_COMPILER_ID_ARG1}
+ -print-file-name=libc++.modules.json
+ OUTPUT_VARIABLE _clang_libcxx_modules_json_file
+ ERROR_VARIABLE _clang_libcxx_modules_json_file_err
+ RESULT_VARIABLE _clang_libcxx_modules_json_file_res
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE)
+ if (_clang_libcxx_modules_json_file_res)
+ return ()
+ endif ()
+
+ # Without this file, we do not have modules installed.
+ if (NOT EXISTS "${_clang_libcxx_modules_json_file}")
+ return ()
+ endif ()
+
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "18.1.2")
+ # The original PR had a key spelling mismatch internally. Do not support it
+ # and instead require a release known to have the fix.
+ # https://github.com/llvm/llvm-project/pull/83036
+ return ()
+ endif ()
+
+ file(READ "${_clang_libcxx_modules_json_file}" _clang_libcxx_modules_json)
+ string(JSON _clang_modules_json_version GET "${_clang_libcxx_modules_json}" "version")
+ string(JSON _clang_modules_json_revision GET "${_clang_libcxx_modules_json}" "revision")
+ # Require version 1.
+ if (NOT _clang_modules_json_version EQUAL "1")
+ return ()
+ endif ()
+
+ string(JSON _clang_modules_json_nmodules LENGTH "${_clang_libcxx_modules_json}" "modules")
+ # Don't declare the target without any modules.
+ if (NOT _clang_modules_json_nmodules)
+ return ()
+ endif ()
+
+ # Declare the target.
+ set(_clang_libcxx_target "")
+ # Clang 18 does not provide the module initializer for the `std` modules.
+ # Create a static library to hold these. Hope that Clang 19 can provide this,
+ # but never run the code.
+ string(APPEND _clang_libcxx_target
+ "add_library(__cmake_cxx${std} STATIC)\n")
+ string(APPEND _clang_libcxx_target
+ "target_sources(__cmake_cxx${std} INTERFACE \"$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>:$<TARGET_OBJECTS:__cmake_cxx${std}>>\")\n")
+ string(APPEND _clang_libcxx_target
+ "set_property(TARGET __cmake_cxx${std} PROPERTY EXCLUDE_FROM_ALL 1)\n")
+ string(APPEND _clang_libcxx_target
+ "set_property(TARGET __cmake_cxx${std} PROPERTY CXX_SCAN_FOR_MODULES 1)\n")
+ string(APPEND _clang_libcxx_target
+ "set_property(TARGET __cmake_cxx${std} PROPERTY CXX_MODULE_STD 0)\n")
+ string(APPEND _clang_libcxx_target
+ "target_compile_features(__cmake_cxx${std} PUBLIC cxx_std_${std})\n")
+
+ set(_clang_modules_is_stdlib 0)
+ set(_clang_modules_include_dirs_list "")
+ set(_clang_modules_module_paths "")
+ get_filename_component(_clang_modules_dir "${_clang_libcxx_modules_json_file}" DIRECTORY)
+
+ # Add module sources.
+ math(EXPR _clang_modules_json_nmodules_range "${_clang_modules_json_nmodules} - 1")
+ foreach (_clang_modules_json_modules_idx RANGE 0 "${_clang_modules_json_nmodules_range}")
+ string(JSON _clang_modules_json_module GET "${_clang_libcxx_modules_json}" "modules" "${_clang_modules_json_modules_idx}")
+
+ string(JSON _clang_modules_json_module_source GET "${_clang_modules_json_module}" "source-path")
+ string(JSON _clang_modules_json_module_is_stdlib GET "${_clang_modules_json_module}" "is-std-library")
+ string(JSON _clang_modules_json_module_local_arguments GET "${_clang_modules_json_module}" "local-arguments")
+ string(JSON _clang_modules_json_module_nsystem_include_directories LENGTH "${_clang_modules_json_module_local_arguments}" "system-include-directories")
+
+ if (NOT IS_ABSOLUTE "${_clang_modules_json_module_source}")
+ string(PREPEND _clang_modules_json_module_source "${_clang_modules_dir}/")
+ endif ()
+ list(APPEND _clang_modules_module_paths
+ "${_clang_modules_json_module_source}")
+
+ if (_clang_modules_json_module_is_stdlib)
+ set(_clang_modules_is_stdlib 1)
+ endif ()
+
+ math(EXPR _clang_modules_json_module_nsystem_include_directories_range "${_clang_modules_json_module_nsystem_include_directories} - 1")
+ foreach (_clang_modules_json_modules_system_include_directories_idx RANGE 0 "${_clang_modules_json_module_nsystem_include_directories_range}")
+ string(JSON _clang_modules_json_module_system_include_directory GET "${_clang_modules_json_module_local_arguments}" "system-include-directories" "${_clang_modules_json_modules_system_include_directories_idx}")
+
+ if (NOT IS_ABSOLUTE "${_clang_modules_json_module_system_include_directory}")
+ string(PREPEND _clang_modules_json_module_system_include_directory "${_clang_modules_dir}/")
+ endif ()
+ list(APPEND _clang_modules_include_dirs_list
+ "${_clang_modules_json_module_system_include_directory}")
+ endforeach ()
+ endforeach ()
+
+ # Split the paths into basedirs and module paths.
+ set(_clang_modules_base_dirs_list "")
+ set(_clang_modules_files "")
+ foreach (_clang_modules_module_path IN LISTS _clang_modules_module_paths)
+ get_filename_component(_clang_module_dir "${_clang_modules_module_path}" DIRECTORY)
+
+ list(APPEND _clang_modules_base_dirs_list
+ "${_clang_module_dir}")
+ string(APPEND _clang_modules_files
+ " \"${_clang_modules_module_path}\"")
+ endforeach ()
+ list(REMOVE_DUPLICATES _clang_modules_base_dirs_list)
+ set(_clang_modules_base_dirs "")
+ foreach (_clang_modules_base_dir IN LISTS _clang_modules_base_dirs_list)
+ string(APPEND _clang_modules_base_dirs
+ " \"${_clang_modules_base_dir}\"")
+ endforeach ()
+
+ # If we have a standard library module, suppress warnings about reserved
+ # module names.
+ if (_clang_modules_is_stdlib)
+ string(APPEND _clang_libcxx_target
+ "target_compile_options(__cmake_cxx${std} PRIVATE -Wno-reserved-module-identifier)\n")
+ endif ()
+
+ # Set up include directories.
+ list(REMOVE_DUPLICATES _clang_modules_include_dirs_list)
+ set(_clang_modules_include_dirs "")
+ foreach (_clang_modules_include_dir IN LISTS _clang_modules_include_dirs_list)
+ string(APPEND _clang_modules_include_dirs
+ " \"${_clang_modules_include_dir}\"")
+ endforeach ()
+ string(APPEND _clang_libcxx_target
+ "target_include_directories(__cmake_cxx${std} PRIVATE ${_clang_modules_include_dirs})\n")
+
+ # Create the file set for the modules.
+ string(APPEND _clang_libcxx_target
+ "target_sources(__cmake_cxx${std}
+ PUBLIC
+ FILE_SET std TYPE CXX_MODULES
+ BASE_DIRS ${_clang_modules_base_dirs}
+ FILES ${_clang_modules_files})\n")
+
+ # Wrap the `__cmake_cxx${std}` target in a check.
+ string(PREPEND _clang_libcxx_target
+ "if (NOT TARGET \"__cmake_cxx${std}\")\n")
+ string(APPEND _clang_libcxx_target
+ "endif ()\n")
+ string(APPEND _clang_libcxx_target
+ "add_library(__CMAKE::CXX${std} ALIAS __cmake_cxx${std})\n")
+
+ set("${variable}" "${_clang_libcxx_target}" PARENT_SCOPE)
+endfunction ()
diff --git a/Modules/Compiler/Clang-OBJC.cmake b/Modules/Compiler/Clang-OBJC.cmake
index 7a83b77..c374d71 100644
--- a/Modules/Compiler/Clang-OBJC.cmake
+++ b/Modules/Compiler/Clang-OBJC.cmake
@@ -22,18 +22,24 @@ if(NOT CMAKE_OBJC_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_OBJC11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_OBJC11_EXTENSION_COMPILE_OPTION "-std=gnu11")
set(CMAKE_OBJC11_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_OBJC_STANDARD_LATEST 11)
endif()
if(NOT CMAKE_OBJC_COMPILER_VERSION VERSION_LESS 6.0)
set(CMAKE_OBJC17_STANDARD_COMPILE_OPTION "-std=c17")
set(CMAKE_OBJC17_EXTENSION_COMPILE_OPTION "-std=gnu17")
set(CMAKE_OBJC17_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_OBJC_STANDARD_LATEST 17)
endif()
if(NOT CMAKE_OBJC_COMPILER_VERSION VERSION_LESS 9.0)
set(CMAKE_OBJC23_STANDARD_COMPILE_OPTION "-std=c2x")
set(CMAKE_OBJC23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
set(CMAKE_OBJC23_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_OBJC_STANDARD_LATEST 23)
endif()
__compiler_check_default_language_standard(OBJC 3.4 99 3.6 11)
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index 4c033ca..089b188 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -17,6 +17,7 @@ set(__pch_header_OBJCXX "objective-c++-header")
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
+ OR "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC")
macro(__compiler_clang lang)
endmacro()
@@ -94,11 +95,11 @@ else()
endif()
set(CMAKE_${lang}_ARCHIVE_CREATE_IPO
- "\"${__ar}\" cr <TARGET> <LINK_FLAGS> <OBJECTS>"
+ "\"${__ar}\" qc <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_APPEND_IPO
- "\"${__ar}\" r <TARGET> <LINK_FLAGS> <OBJECTS>"
+ "\"${__ar}\" q <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_FINISH_IPO
@@ -134,6 +135,7 @@ macro(__compiler_clang_cxx_standards lang)
if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 2.1)
set(CMAKE_${lang}98_STANDARD_COMPILE_OPTION "-std=c++98")
set(CMAKE_${lang}98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
+ set(CMAKE_${lang}_STANDARD_LATEST 98)
endif()
if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.1)
@@ -141,19 +143,23 @@ macro(__compiler_clang_cxx_standards lang)
set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "-std=c++11")
set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
set(CMAKE_${lang}11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_${lang}_STANDARD_LATEST 11)
elseif(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 2.1)
set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "-std=c++0x")
set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
+ set(CMAKE_${lang}_STANDARD_LATEST 11)
endif()
if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.5)
set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
set(CMAKE_${lang}14_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_${lang}_STANDARD_LATEST 14)
elseif(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "-std=c++1y")
set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
set(CMAKE_${lang}14_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_${lang}_STANDARD_LATEST 14)
endif()
set(_clang_version_std17 5.0)
@@ -164,17 +170,21 @@ macro(__compiler_clang_cxx_standards lang)
if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS "${_clang_version_std17}")
set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
+ set(CMAKE_${lang}_STANDARD_LATEST 17)
elseif (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.5)
set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std=c++1z")
set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
+ set(CMAKE_${lang}_STANDARD_LATEST 17)
endif()
if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 11.0)
set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std=c++20")
set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
+ set(CMAKE_${lang}_STANDARD_LATEST 20)
elseif(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS "${_clang_version_std17}")
set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std=c++2a")
set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
+ set(CMAKE_${lang}_STANDARD_LATEST 20)
endif()
unset(_clang_version_std17)
@@ -189,9 +199,11 @@ macro(__compiler_clang_cxx_standards lang)
set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=gnu++23")
set(CMAKE_${lang}26_STANDARD_COMPILE_OPTION "-std=c++26")
set(CMAKE_${lang}26_EXTENSION_COMPILE_OPTION "-std=gnu++26")
+ set(CMAKE_${lang}_STANDARD_LATEST 26)
elseif(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0)
set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std=c++2b")
set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=gnu++2b")
+ set(CMAKE_${lang}_STANDARD_LATEST 23)
endif()
unset(_clang_version_std23)
@@ -230,14 +242,18 @@ macro(__compiler_clang_cxx_standards lang)
set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std:c++latest")
endif()
+ set(CMAKE_${lang}_STANDARD_LATEST 17)
+
if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std:c++latest")
set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std:c++latest")
set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std:c++20")
set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std:c++20")
+ set(CMAKE_${lang}_STANDARD_LATEST 23)
elseif(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std:c++latest")
set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std:c++latest")
+ set(CMAKE_${lang}_STANDARD_LATEST 20)
endif()
__compiler_check_default_language_standard(${lang} 3.9 14)
@@ -261,6 +277,14 @@ macro(__compiler_clang_cxx_standards lang)
# There is no meaningful default for this
set(CMAKE_${lang}_STANDARD_DEFAULT "")
+ if(CMAKE_${lang}_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.0)
+ set(CMAKE_${lang}_STANDARD_LATEST 17)
+ elseif(CMAKE_${lang}_SIMULATE_VERSION VERSION_GREATER_EQUAL 18.0)
+ set(CMAKE_${lang}_STANDARD_LATEST 14)
+ elseif(CMAKE_${lang}_SIMULATE_VERSION VERSION_GREATER_EQUAL 16.0)
+ set(CMAKE_${lang}_STANDARD_LATEST 11)
+ endif()
+
# There are no compiler modes so we only need to test features once.
# Override the default macro for this special case. Pretend that
# all language standards are available so that at least compilation
diff --git a/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake b/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake
deleted file mode 100644
index 2265e5e..0000000
--- a/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-
-set(_compiler_id_pp_test "defined(__COMO__)")
-
-set(_compiler_id_version_compute "
- /* __COMO_VERSION__ = VRR */
-# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__COMO_VERSION__ / 100)
-# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__COMO_VERSION__ % 100)")
diff --git a/Modules/Compiler/Cray-C.cmake b/Modules/Compiler/Cray-C.cmake
index 9340948..51f8cc4 100644
--- a/Modules/Compiler/Cray-C.cmake
+++ b/Modules/Compiler/Cray-C.cmake
@@ -14,10 +14,12 @@ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1)
set(CMAKE_C99_STANDARD_COMPILE_OPTION -h c99,conform)
set(CMAKE_C99_EXTENSION_COMPILE_OPTION -h c99,gnu)
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_C_STANDARD_LATEST 99)
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.5)
set(CMAKE_C11_STANDARD_COMPILE_OPTION -h std=c11,conform)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION -h std=c11,gnu)
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_C_STANDARD_LATEST 11)
endif ()
endif ()
diff --git a/Modules/Compiler/Cray-CXX.cmake b/Modules/Compiler/Cray-CXX.cmake
index 38c8b1e..9a40b98 100644
--- a/Modules/Compiler/Cray-CXX.cmake
+++ b/Modules/Compiler/Cray-CXX.cmake
@@ -11,15 +11,18 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION -h conform)
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION -h gnu)
set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 98)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.4)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION -h std=c++11)
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION -h std=c++11,gnu)
set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 11)
endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.6)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION -h std=c++14)
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION -h std=c++14,gnu)
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 14)
endif ()
endif ()
diff --git a/Modules/Compiler/CrayClang-C.cmake b/Modules/Compiler/CrayClang-C.cmake
index bf878fc..96e46be 100644
--- a/Modules/Compiler/CrayClang-C.cmake
+++ b/Modules/Compiler/CrayClang-C.cmake
@@ -27,4 +27,6 @@ set(CMAKE_C17_EXTENSION_COMPILE_OPTION -std=gnu17)
set(CMAKE_C23_STANDARD_COMPILE_OPTION -std=c2x)
set(CMAKE_C23_EXTENSION_COMPILE_OPTION -std=gnu2x)
+set(CMAKE_C_STANDARD_LATEST 23)
+
__compiler_check_default_language_standard(C 15.0.0 17)
diff --git a/Modules/Compiler/CrayClang-CXX.cmake b/Modules/Compiler/CrayClang-CXX.cmake
index de6a53c..a61edfa 100644
--- a/Modules/Compiler/CrayClang-CXX.cmake
+++ b/Modules/Compiler/CrayClang-CXX.cmake
@@ -32,4 +32,6 @@ set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION -std=gnu++20)
set(CMAKE_CXX23_STANDARD_COMPILE_OPTION -std=c++2b)
set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION -std=gnu++2b)
+set(CMAKE_CXX_STANDARD_LATEST 23)
+
__compiler_check_default_language_standard(CXX 15.0.0 14)
diff --git a/Modules/Compiler/Fujitsu-C.cmake b/Modules/Compiler/Fujitsu-C.cmake
index dd31e43..0ffa82d 100644
--- a/Modules/Compiler/Fujitsu-C.cmake
+++ b/Modules/Compiler/Fujitsu-C.cmake
@@ -15,6 +15,8 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4)
set(CMAKE_C11_STANDARD_COMPILE_OPTION -std=c11)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION -std=gnu11)
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_C_STANDARD_LATEST 11)
endif()
__compiler_check_default_language_standard(C 4 11)
diff --git a/Modules/Compiler/Fujitsu-CXX.cmake b/Modules/Compiler/Fujitsu-CXX.cmake
index 0f42196..56f16c1 100644
--- a/Modules/Compiler/Fujitsu-CXX.cmake
+++ b/Modules/Compiler/Fujitsu-CXX.cmake
@@ -42,6 +42,8 @@ if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 4)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION -std=c++17)
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION -std=gnu++17)
+
+ set(CMAKE_CXX_STANDARD_LATEST 17)
endif()
__compiler_check_default_language_standard(CXX 4 14)
diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake
index 03e8d2b..0ac4d8c 100644
--- a/Modules/Compiler/GNU-C.cmake
+++ b/Modules/Compiler/GNU-C.cmake
@@ -1,5 +1,6 @@
include(Compiler/GNU)
__compiler_gnu(C)
+__compiler_gnu_c_standards(C)
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
@@ -12,38 +13,4 @@ endif()
set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
-if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
- set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
- set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
-elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
- set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
- set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89")
-endif()
-
-if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
- set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
- set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
- set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
- set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
-endif()
-
-if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
- set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
- set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
- set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
-elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
- set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x")
- set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x")
-endif()
-
-if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1)
- set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
- set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
-endif()
-
-if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.1)
- set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c2x")
- set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
-endif()
-
__compiler_check_default_language_standard(C 3.4 90 5.0 11 8.1 17)
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index 2e1b4ad..e98909b 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -1,5 +1,6 @@
include(Compiler/GNU)
__compiler_gnu(CXX)
+__compiler_gnu_cxx_standards(CXX)
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
@@ -22,55 +23,6 @@ else()
endif()
endif()
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
- set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
- set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
-endif()
-
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
- set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
-elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
- # 4.3 supports 0x variants
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
-endif()
-
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8.1)
- set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
-endif()
-
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
- set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
- set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
-elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
- set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
- set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
-endif()
-
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
- set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
-endif()
-
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
- set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
- set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
-elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
- set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++1z")
- set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
-endif()
-
-if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.1)
- set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20")
- set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
- set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std=c++23")
- set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std=gnu++23")
-elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
- set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
- set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
-endif()
-
__compiler_check_default_language_standard(CXX 3.4 98 6.0 14 11.1 17)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0)
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index 5dfb03e..452598b 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -17,10 +17,6 @@ endif()
set(CMAKE_Fortran_POSTPROCESS_FLAG "-fpreprocessed")
-# No -DNDEBUG for Fortran.
-string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
-string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
-
# No -isystem for Fortran because it will not find .mod files.
unset(CMAKE_INCLUDE_SYSTEM_FLAG_Fortran)
diff --git a/Modules/Compiler/GNU-OBJC.cmake b/Modules/Compiler/GNU-OBJC.cmake
index 7eeed83..4a2cd85 100644
--- a/Modules/Compiler/GNU-OBJC.cmake
+++ b/Modules/Compiler/GNU-OBJC.cmake
@@ -1,5 +1,6 @@
include(Compiler/GNU)
__compiler_gnu(OBJC)
+__compiler_gnu_c_standards(OBJC)
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
diff --git a/Modules/Compiler/GNU-OBJCXX.cmake b/Modules/Compiler/GNU-OBJCXX.cmake
index 1047b5d..e3006f2 100644
--- a/Modules/Compiler/GNU-OBJCXX.cmake
+++ b/Modules/Compiler/GNU-OBJCXX.cmake
@@ -1,5 +1,6 @@
include(Compiler/GNU)
__compiler_gnu(OBJCXX)
+__compiler_gnu_cxx_standards(OBJCXX)
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index d01054b..3f705a9 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -74,36 +74,49 @@ macro(__compiler_gnu lang)
if (NOT DEFINED CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED)
## check if this feature is supported by the linker
- execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" -Wl,--help
- OUTPUT_VARIABLE _linker_capabilities
- ERROR_VARIABLE _linker_capabilities)
- if(_linker_capabilities MATCHES "--dependency-file")
- set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED TRUE)
+ if (CMAKE_${lang}_COMPILER_LINKER AND CMAKE_${lang}_COMPILER_LINKER_ID MATCHES "GNU|LLD")
+ execute_process(COMMAND "${CMAKE_${lang}_COMPILER_LINKER}" --help
+ OUTPUT_VARIABLE _linker_capabilities
+ ERROR_VARIABLE _linker_capabilities)
+ if(_linker_capabilities MATCHES "--dependency-file")
+ set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED TRUE)
+ else()
+ set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE)
+ endif()
+ unset(_linker_capabilities)
else()
set(CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED FALSE)
endif()
- unset(_linker_capabilities)
endif()
endif()
if (CMAKE_${lang}_LINKER_DEPFILE_SUPPORTED)
set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER TRUE)
else()
- unset(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER)
+ set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE)
endif()
- # For now, due to GNU binutils ld bug when LTO is enabled (see GNU bug
- # `30568 <https://sourceware.org/bugzilla/show_bug.cgi?id=30568>`_),
- # deactivate this feature.
- if (NOT DEFINED CMAKE_LINK_DEPENDS_USE_LINKER)
- set(CMAKE_LINK_DEPENDS_USE_LINKER FALSE)
+ # Due to GNU binutils ld bug when LTO is enabled (see GNU bug
+ # `30568 <https://sourceware.org/bugzilla/show_bug.cgi?id=30568>`_),
+ # deactivate this feature if the version is less than 2.41.
+ # For now, all known versions of gold linker have also this bug.
+ if (CMAKE_${lang}_COMPILER_LINKER_ID
+ AND (CMAKE_${lang}_COMPILER_LINKER_ID STREQUAL "GNUgold"
+ OR (CMAKE_${lang}_COMPILER_LINKER_ID STREQUAL "GNU"
+ AND CMAKE_${lang}_COMPILER_LINKER_VERSION VERSION_LESS "2.41")))
+ set(CMAKE_${lang}_LINK_DEPENDS_USE_LINKER FALSE)
endif()
# Initial configuration flags.
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
- string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG")
- string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG")
- string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
+ if(NOT "x${lang}" STREQUAL "xFortran")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG")
+ endif()
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
if(NOT APPLE OR NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4) # work around #4462
@@ -138,7 +151,7 @@ macro(__compiler_gnu lang)
list(APPEND __lto_flags -flto)
endif()
- if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.7)
+ if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.7 AND NOT APPLE)
# '-ffat-lto-objects' introduced since GCC 4.7:
# * https://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Option-Summary.html (no)
# * https://gcc.gnu.org/onlinedocs/gcc-4.7.4/gcc/Option-Summary.html (yes)
@@ -155,11 +168,11 @@ macro(__compiler_gnu lang)
#
# [1]: https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/Optimize-Options.html
set(CMAKE_${lang}_ARCHIVE_CREATE_IPO
- "\"${CMAKE_${lang}_COMPILER_AR}\" cr <TARGET> <LINK_FLAGS> <OBJECTS>"
+ "\"${CMAKE_${lang}_COMPILER_AR}\" qc <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_APPEND_IPO
- "\"${CMAKE_${lang}_COMPILER_AR}\" r <TARGET> <LINK_FLAGS> <OBJECTS>"
+ "\"${CMAKE_${lang}_COMPILER_AR}\" q <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_FINISH_IPO
@@ -194,3 +207,112 @@ macro(__compiler_gnu lang)
set(CMAKE_${lang}_COMPILE_OPTIONS_COLOR_DIAGNOSTICS_OFF "-fno-diagnostics-color")
endif()
endmacro()
+
+macro(__compiler_gnu_c_standards lang)
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.5)
+ set(CMAKE_${lang}90_STANDARD_COMPILE_OPTION "-std=c90")
+ set(CMAKE_${lang}90_EXTENSION_COMPILE_OPTION "-std=gnu90")
+ set(CMAKE_${lang}_STANDARD_LATEST 90)
+ elseif (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4)
+ set(CMAKE_${lang}90_STANDARD_COMPILE_OPTION "-std=c89")
+ set(CMAKE_${lang}90_EXTENSION_COMPILE_OPTION "-std=gnu89")
+ set(CMAKE_${lang}_STANDARD_LATEST 90)
+ endif()
+
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4)
+ set(CMAKE_${lang}90_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_${lang}99_STANDARD_COMPILE_OPTION "-std=c99")
+ set(CMAKE_${lang}99_EXTENSION_COMPILE_OPTION "-std=gnu99")
+ set(CMAKE_${lang}99_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_${lang}_STANDARD_LATEST 99)
+ endif()
+
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.7)
+ set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "-std=c11")
+ set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "-std=gnu11")
+ set(CMAKE_${lang}11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_${lang}_STANDARD_LATEST 11)
+ elseif (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.6)
+ set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "-std=c1x")
+ set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "-std=gnu1x")
+ set(CMAKE_${lang}_STANDARD_LATEST 11)
+ endif()
+
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1)
+ set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std=c17")
+ set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std=gnu17")
+ set(CMAKE_${lang}_STANDARD_LATEST 17)
+ endif()
+
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 9.1)
+ set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std=c2x")
+ set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
+ set(CMAKE_${lang}_STANDARD_LATEST 23)
+ endif()
+endmacro()
+
+macro(__compiler_gnu_cxx_standards lang)
+ if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4)
+ set(CMAKE_${lang}98_STANDARD_COMPILE_OPTION "-std=c++98")
+ set(CMAKE_${lang}98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
+ set(CMAKE_${lang}_STANDARD_LATEST 98)
+ endif()
+
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.7)
+ set(CMAKE_${lang}98_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "-std=c++11")
+ set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
+ set(CMAKE_${lang}_STANDARD_LATEST 11)
+ elseif (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.4)
+ # 4.3 supports 0x variants
+ set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "-std=c++0x")
+ set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
+ set(CMAKE_${lang}_STANDARD_LATEST 11)
+ endif()
+
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.8.1)
+ set(CMAKE_${lang}11_STANDARD__HAS_FULL_SUPPORT ON)
+ endif()
+
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.9)
+ set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "-std=c++14")
+ set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
+ set(CMAKE_${lang}_STANDARD_LATEST 14)
+ elseif (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.8)
+ set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "-std=c++1y")
+ set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
+ set(CMAKE_${lang}_STANDARD_LATEST 14)
+ endif()
+
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 5.0)
+ set(CMAKE_${lang}14_STANDARD__HAS_FULL_SUPPORT ON)
+ endif()
+
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 8.0)
+ set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std=c++17")
+ set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
+ set(CMAKE_${lang}_STANDARD_LATEST 17)
+ elseif (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 5.1)
+ set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std=c++1z")
+ set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
+ set(CMAKE_${lang}_STANDARD_LATEST 17)
+ endif()
+
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 11.1)
+ set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std=c++20")
+ set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
+ set(CMAKE_${lang}23_STANDARD_COMPILE_OPTION "-std=c++23")
+ set(CMAKE_${lang}23_EXTENSION_COMPILE_OPTION "-std=gnu++23")
+ set(CMAKE_${lang}_STANDARD_LATEST 23)
+ elseif(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
+ set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std=c++2a")
+ set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
+ set(CMAKE_${lang}_STANDARD_LATEST 20)
+ endif()
+
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0)
+ set(CMAKE_${lang}26_STANDARD_COMPILE_OPTION "-std=c++26")
+ set(CMAKE_${lang}26_EXTENSION_COMPILE_OPTION "-std=gnu++26")
+ set(CMAKE_${lang}_STANDARD_LATEST 26)
+ endif()
+endmacro()
diff --git a/Modules/Compiler/IBMClang-C.cmake b/Modules/Compiler/IBMClang-C.cmake
index b69b1b8..fde6a3b 100644
--- a/Modules/Compiler/IBMClang-C.cmake
+++ b/Modules/Compiler/IBMClang-C.cmake
@@ -23,8 +23,11 @@ set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
+set(CMAKE_C_STANDARD_LATEST 11)
+
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 17.1.0)
set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
+ set(CMAKE_C_STANDARD_LATEST 17)
endif ()
__compiler_check_default_language_standard(C 17.1.0 17)
diff --git a/Modules/Compiler/IBMClang-CXX.cmake b/Modules/Compiler/IBMClang-CXX.cmake
index be9b525..ec97381 100644
--- a/Modules/Compiler/IBMClang-CXX.cmake
+++ b/Modules/Compiler/IBMClang-CXX.cmake
@@ -26,6 +26,8 @@ set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
+set(CMAKE_CXX_STANDARD_LATEST 14)
+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.1.0)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
@@ -33,6 +35,7 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.1.0)
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std=c++2b")
set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std=gnu++2b")
+ set(CMAKE_CXX_STANDARD_LATEST 23)
endif()
__compiler_check_default_language_standard(CXX 17.1.0 17)
diff --git a/Modules/Compiler/IBMClang.cmake b/Modules/Compiler/IBMClang.cmake
index 169a0f0..a43f788 100644
--- a/Modules/Compiler/IBMClang.cmake
+++ b/Modules/Compiler/IBMClang.cmake
@@ -58,11 +58,11 @@ macro(__compiler_ibmclang lang)
set(__ranlib "${CMAKE_${lang}_COMPILER_RANLIB}")
set(CMAKE_${lang}_ARCHIVE_CREATE_IPO
- "\"${__ar}\" cr <TARGET> <LINK_FLAGS> <OBJECTS>"
+ "\"${__ar}\" qc <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_APPEND_IPO
- "\"${__ar}\" r <TARGET> <LINK_FLAGS> <OBJECTS>"
+ "\"${__ar}\" q <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_FINISH_IPO
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index 9884b58..bfe5f07 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -19,12 +19,6 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl")
set(CMAKE_C_INCLUDE_WHAT_YOU_USE_DRIVER_MODE "cl")
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 16.0.0)
- set(CMAKE_C11_STANDARD_COMPILE_OPTION "-Qstd=c11")
- set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-Qstd=c11")
- set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
- endif()
-
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-Qstd=c89")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-Qstd=c89")
@@ -32,18 +26,20 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_C99_STANDARD_COMPILE_OPTION "-Qstd=c99")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-Qstd=c99")
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_C_STANDARD_LATEST 99)
+ endif()
+
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 16.0.0)
+ set(CMAKE_C11_STANDARD_COMPILE_OPTION "-Qstd=c11")
+ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-Qstd=c11")
+ set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_C_STANDARD_LATEST 11)
endif()
else()
set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0)
- set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
- set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
- set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
- endif()
-
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89")
@@ -51,6 +47,14 @@ else()
set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_C_STANDARD_LATEST 99)
+ endif()
+
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0)
+ set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
+ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
+ set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_C_STANDARD_LATEST 11)
endif()
endif()
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index 7c9cca9..f9e3e7a 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -18,57 +18,70 @@ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl")
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE_DRIVER_MODE "cl")
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0)
- set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-Qstd=c++20")
- set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-Qstd=c++20")
- endif()
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
- set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Qstd=c++17")
- set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-Qstd=c++17")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Qstd=c++11")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-Qstd=c++11")
+ else()
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Qstd=c++0x")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-Qstd=c++0x")
+ endif()
+
+ set(CMAKE_CXX_STANDARD_LATEST 11)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Qstd=c++14")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-Qstd=c++14")
+ set(CMAKE_CXX_STANDARD_LATEST 14)
endif()
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Qstd=c++11")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-Qstd=c++11")
- elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Qstd=c++0x")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-Qstd=c++0x")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Qstd=c++17")
+ set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-Qstd=c++17")
+ set(CMAKE_CXX_STANDARD_LATEST 17)
endif()
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
- set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
- set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
- set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0)
+ set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-Qstd=c++20")
+ set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-Qstd=c++20")
+ set(CMAKE_CXX_STANDARD_LATEST 20)
endif()
else()
set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0)
- set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20")
- set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
- endif()
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
+ set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
- set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
- set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
+ else()
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
+ endif()
+
+ set(CMAKE_CXX_STANDARD_LATEST 11)
endif()
- if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0)
- set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0)
+ set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
+ set(CMAKE_CXX_STANDARD_LATEST 14)
elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
+ set(CMAKE_CXX_STANDARD_LATEST 14)
endif()
# Intel 15.0.2 accepts c++14 instead of c++1y, but not gnu++14
@@ -79,22 +92,20 @@ else()
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
endif()
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0)
- set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0)
+ set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
endif()
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
- elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
- set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
+ set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
+ set(CMAKE_CXX_STANDARD_LATEST 17)
endif()
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
- set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
- set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
- set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0.20190206)
+ set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20")
+ set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
+ set(CMAKE_CXX_STANDARD_LATEST 20)
endif()
endif()
diff --git a/Modules/Compiler/IntelLLVM-C.cmake b/Modules/Compiler/IntelLLVM-C.cmake
index 3a81154..4da4dfb 100644
--- a/Modules/Compiler/IntelLLVM-C.cmake
+++ b/Modules/Compiler/IntelLLVM-C.cmake
@@ -42,24 +42,33 @@ if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
- set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c2x")
- set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
+ set(CMAKE_C_STANDARD_LATEST 17)
+
+ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 2022.1.0)
+ set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c2x")
+ set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
+ set(CMAKE_C_STANDARD_LATEST 23)
+ endif()
else()
- # clang-cl doesn't have any of these
- set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
- set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION "-Qstd:c90")
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-Qstd:c90")
- set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
- set(CMAKE_C99_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_C99_STANDARD_COMPILE_OPTION "-Qstd:c99")
+ set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-Qstd:c99")
- set(CMAKE_C11_STANDARD_COMPILE_OPTION "")
- set(CMAKE_C11_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_C11_STANDARD_COMPILE_OPTION "-Qstd:c11")
+ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-Qstd:c11")
- set(CMAKE_C17_STANDARD_COMPILE_OPTION "")
- set(CMAKE_C17_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_C17_STANDARD_COMPILE_OPTION "-Qstd:c17")
+ set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-Qstd:c17")
- set(CMAKE_C23_STANDARD_COMPILE_OPTION "")
- set(CMAKE_C23_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_C_STANDARD_LATEST 17)
+
+ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 2022.1.0)
+ set(CMAKE_C23_STANDARD_COMPILE_OPTION "-Qstd:c2x")
+ set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-Qstd:c2x")
+ set(CMAKE_C_STANDARD_LATEST 23)
+ endif()
endif()
__compiler_check_default_language_standard(C 2020 17)
diff --git a/Modules/Compiler/IntelLLVM-CXX.cmake b/Modules/Compiler/IntelLLVM-CXX.cmake
index 45b723f..989a1d4 100644
--- a/Modules/Compiler/IntelLLVM-CXX.cmake
+++ b/Modules/Compiler/IntelLLVM-CXX.cmake
@@ -47,8 +47,13 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
- set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std=c++2b")
- set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std=gnu++2b")
+ set(CMAKE_CXX_STANDARD_LATEST 20)
+
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2021.2.0)
+ set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std=c++2b")
+ set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std=gnu++2b")
+ set(CMAKE_CXX_STANDARD_LATEST 23)
+ endif()
else()
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
@@ -65,8 +70,13 @@ else()
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-Qstd:c++20")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-Qstd:c++20")
- set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-Qstd:c++2b")
- set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-Qstd:c++2b")
+ set(CMAKE_CXX_STANDARD_LATEST 20)
+
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2021.2.0)
+ set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-Qstd:c++2b")
+ set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-Qstd:c++2b")
+ set(CMAKE_CXX_STANDARD_LATEST 23)
+ endif()
endif()
__compiler_check_default_language_standard(CXX 2020 14)
diff --git a/Modules/Compiler/IntelLLVM.cmake b/Modules/Compiler/IntelLLVM.cmake
index f3c0bf4..079c894 100644
--- a/Modules/Compiler/IntelLLVM.cmake
+++ b/Modules/Compiler/IntelLLVM.cmake
@@ -19,8 +19,8 @@ set(__pch_header_OBJCXX "objective-c++-header")
macro(__compiler_intel_llvm_common lang)
set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
- set(CMAKE_${lang}_ARCHIVE_CREATE_IPO "\"${CMAKE_${lang}_COMPILER_AR}\" cr <TARGET> <LINK_FLAGS> <OBJECTS>")
- set(CMAKE_${lang}_ARCHIVE_APPEND_IPO "\"${CMAKE_${lang}_COMPILER_AR}\" r <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_CREATE_IPO "\"${CMAKE_${lang}_COMPILER_AR}\" qc <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_APPEND_IPO "\"${CMAKE_${lang}_COMPILER_AR}\" q <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_${lang}_ARCHIVE_FINISH_IPO "\"${CMAKE_${lang}_COMPILER_RANLIB}\" <TARGET>")
endmacro()
@@ -32,6 +32,12 @@ if(CMAKE_HOST_WIN32)
else()
set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch)
set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-WX")
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "2021.4")
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-external:I")
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "2022.2")
+ set(_CMAKE_INCLUDE_SYSTEM_FLAG_${lang}_WARNING "-external:W0 ")
+ endif()
+ endif()
endif()
__compiler_intel_llvm_common(${lang})
set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-Qipo")
diff --git a/Modules/Compiler/LCC-C.cmake b/Modules/Compiler/LCC-C.cmake
index 3dd6e68..01e99d3 100644
--- a/Modules/Compiler/LCC-C.cmake
+++ b/Modules/Compiler/LCC-C.cmake
@@ -12,18 +12,29 @@ endif()
set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
-set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
-set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
-set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
+if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 1.23)
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
+ set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
+endif()
+
set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
-set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
-set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
-set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
-set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
-set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
-set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c2x")
-set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
-
-__compiler_check_default_language_standard(C 1.23 90 1.20 11 1.26 17)
+
+set(CMAKE_C_STANDARD_LATEST 99)
+
+if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 1.20)
+ set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
+ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
+ set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_C_STANDARD_LATEST 11)
+endif()
+
+if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 1.26)
+ set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
+ set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
+ set(CMAKE_C_STANDARD_LATEST 17)
+endif()
+
+__compiler_check_default_language_standard(C 1.17 89 1.23 99 1.26 17)
diff --git a/Modules/Compiler/LCC-CXX.cmake b/Modules/Compiler/LCC-CXX.cmake
index b3bdd3c..22f2cc3 100644
--- a/Modules/Compiler/LCC-CXX.cmake
+++ b/Modules/Compiler/LCC-CXX.cmake
@@ -17,15 +17,33 @@ set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hi
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
-set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
-set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
-set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
-set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
-set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
-set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
-set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
-set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
-set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
-set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
+
+set(CMAKE_CXX_STANDARD_LATEST 98)
+
+if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 1.20)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
+ set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 11)
+endif()
+
+if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 1.21)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
+ set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 14)
+endif()
+
+if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 1.24)
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
+ set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
+ set(CMAKE_CXX_STANDARD_LATEST 17)
+endif()
+
+if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 1.26)
+ set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
+ set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
+ set(CMAKE_CXX_STANDARD_LATEST 20)
+endif()
__compiler_check_default_language_standard(CXX 1.19 98 1.20 11 1.21 14 1.24 17 1.26 20)
diff --git a/Modules/Compiler/LCC.cmake b/Modules/Compiler/LCC.cmake
index f8c2084..2892ec6 100644
--- a/Modules/Compiler/LCC.cmake
+++ b/Modules/Compiler/LCC.cmake
@@ -65,11 +65,11 @@ macro(__compiler_lcc lang)
set(CMAKE_${lang}_COMPILE_OPTIONS_IPO ${__lto_flags})
set(CMAKE_${lang}_ARCHIVE_CREATE_IPO
- "\"${CMAKE_${lang}_COMPILER_AR}\" cr <TARGET> <LINK_FLAGS> <OBJECTS>"
+ "\"${CMAKE_${lang}_COMPILER_AR}\" qc <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_APPEND_IPO
- "\"${CMAKE_${lang}_COMPILER_AR}\" r <TARGET> <LINK_FLAGS> <OBJECTS>"
+ "\"${CMAKE_${lang}_COMPILER_AR}\" q <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_FINISH_IPO
diff --git a/Modules/Compiler/LLVMFlang-Fortran.cmake b/Modules/Compiler/LLVMFlang-Fortran.cmake
index d27f094..0a432a9 100644
--- a/Modules/Compiler/LLVMFlang-Fortran.cmake
+++ b/Modules/Compiler/LLVMFlang-Fortran.cmake
@@ -15,6 +15,9 @@ set(CMAKE_Fortran_POSTPROCESS_FLAG "-ffixed-line-length-72")
set(CMAKE_Fortran_COMPILE_OPTIONS_TARGET "--target=")
+set(CMAKE_Fortran_LINKER_WRAPPER_FLAG "-Wl,")
+set(CMAKE_Fortran_LINKER_WRAPPER_FLAG_SEP ",")
+
if(NOT "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_Fortran_VERBOSE_FLAG "-v")
diff --git a/Modules/Compiler/MSVC-C.cmake b/Modules/Compiler/MSVC-C.cmake
index 6bf6b4e..d7fbf9f 100644
--- a/Modules/Compiler/MSVC-C.cmake
+++ b/Modules/Compiler/MSVC-C.cmake
@@ -14,12 +14,15 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std:c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std:c11")
+ set(CMAKE_C_STANDARD_LATEST 11)
+
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std:c17")
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std:c17")
+ set(CMAKE_C_STANDARD_LATEST 17)
else()
# Special case for 19.27 (VS 16.7): C11 has partial support.
macro(cmake_record_c_compile_features)
@@ -41,6 +44,7 @@ else()
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "")
set(CMAKE_C11_STANDARD_COMPILE_OPTION "")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_C_STANDARD_LATEST 11)
# There is no meaningful default for this
set(CMAKE_C_STANDARD_DEFAULT "")
diff --git a/Modules/Compiler/MSVC-CXX-CXXImportStd.cmake b/Modules/Compiler/MSVC-CXX-CXXImportStd.cmake
new file mode 100644
index 0000000..f253f9e
--- /dev/null
+++ b/Modules/Compiler/MSVC-CXX-CXXImportStd.cmake
@@ -0,0 +1,103 @@
+function (_cmake_cxx_import_std std variable)
+ find_file(_msvc_modules_json_file
+ NAME modules.json
+ HINTS
+ "$ENV{VCToolsInstallDir}/modules"
+ PATHS
+ "$ENV{INCLUDE}"
+ "${CMAKE_CXX_COMPILER}/../../.."
+ "${CMAKE_CXX_COMPILER}/../.." # msvc-wine layout
+ PATH_SUFFIXES
+ ../modules
+ NO_CACHE)
+ # Without this file, we do not have modules installed.
+ if (NOT EXISTS "${_msvc_modules_json_file}")
+ return ()
+ endif ()
+
+ file(READ "${_msvc_modules_json_file}" _msvc_modules_json)
+ string(JSON _msvc_json_version GET "${_msvc_modules_json}" "version")
+ string(JSON _msvc_json_revision GET "${_msvc_modules_json}" "revision")
+ # Require version 1.
+ if (NOT _msvc_json_version EQUAL "1")
+ return ()
+ endif ()
+
+ string(JSON _msvc_json_library GET "${_msvc_modules_json}" "library")
+ # Bail if we don't understand the library.
+ if (NOT _msvc_json_library STREQUAL "microsoft/STL")
+ return ()
+ endif ()
+
+ string(JSON _msvc_json_nmodules LENGTH "${_msvc_modules_json}" "module-sources")
+ # Don't declare the target without any modules.
+ if (NOT _msvc_json_nmodules)
+ return ()
+ endif ()
+
+ # Declare the target.
+ set(_msvc_std_target "")
+ string(APPEND _msvc_std_target
+ "add_library(__cmake_cxx${std} STATIC)\n")
+ string(APPEND _msvc_std_target
+ "target_sources(__cmake_cxx${std} INTERFACE \"$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>:$<TARGET_OBJECTS:__cmake_cxx${std}>>\")\n")
+ string(APPEND _msvc_std_target
+ "set_property(TARGET __cmake_cxx${std} PROPERTY EXCLUDE_FROM_ALL 1)\n")
+ string(APPEND _msvc_std_target
+ "set_property(TARGET __cmake_cxx${std} PROPERTY CXX_SCAN_FOR_MODULES 1)\n")
+ string(APPEND _msvc_std_target
+ "set_property(TARGET __cmake_cxx${std} PROPERTY CXX_MODULE_STD 0)\n")
+ string(APPEND _msvc_std_target
+ "target_compile_features(__cmake_cxx${std} PUBLIC cxx_std_${std})\n")
+
+ set(_msvc_modules_module_paths "")
+ get_filename_component(_msvc_modules_dir "${_msvc_modules_json_file}" DIRECTORY)
+
+ # Add module sources.
+ math(EXPR _msvc_modules_json_nmodules_range "${_msvc_json_nmodules} - 1")
+ foreach (_msvc_modules_json_modules_idx RANGE 0 "${_msvc_modules_json_nmodules_range}")
+ string(JSON _msvc_modules_json_module_source GET "${_msvc_modules_json}" "module-sources" "${_msvc_modules_json_modules_idx}")
+
+ if (NOT IS_ABSOLUTE "${_msvc_modules_json_module_source}")
+ string(PREPEND _msvc_modules_json_module_source "${_msvc_modules_dir}/")
+ endif ()
+ list(APPEND _msvc_modules_module_paths
+ "${_msvc_modules_json_module_source}")
+ endforeach ()
+
+ # Split the paths into basedirs and module paths.
+ set(_msvc_modules_base_dirs_list "")
+ set(_msvc_modules_files "")
+ foreach (_msvc_modules_module_path IN LISTS _msvc_modules_module_paths)
+ get_filename_component(_msvc_module_dir "${_msvc_modules_module_path}" DIRECTORY)
+
+ list(APPEND _msvc_modules_base_dirs_list
+ "${_msvc_module_dir}")
+ string(APPEND _msvc_modules_files
+ " \"${_msvc_modules_module_path}\"")
+ endforeach ()
+ list(REMOVE_DUPLICATES _msvc_modules_base_dirs_list)
+ set(_msvc_modules_base_dirs "")
+ foreach (_msvc_modules_base_dir IN LISTS _msvc_modules_base_dirs_list)
+ string(APPEND _msvc_modules_base_dirs
+ " \"${_msvc_modules_base_dir}\"")
+ endforeach ()
+
+ # Create the file set for the modules.
+ string(APPEND _msvc_std_target
+ "target_sources(__cmake_cxx${std}
+ PUBLIC
+ FILE_SET std TYPE CXX_MODULES
+ BASE_DIRS ${_msvc_modules_base_dirs}
+ FILES ${_msvc_modules_files})\n")
+
+ # Wrap the `__cmake_cxx${std}` target in a check.
+ string(PREPEND _msvc_std_target
+ "if (NOT TARGET \"__cmake_cxx${std}\")\n")
+ string(APPEND _msvc_std_target
+ "endif ()\n")
+ string(APPEND _msvc_std_target
+ "add_library(__CMAKE::CXX${std} ALIAS __cmake_cxx${std})\n")
+
+ set("${variable}" "${_msvc_std_target}" PARENT_SCOPE)
+endfunction ()
diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake
index 79cd2e0..2243a14 100644
--- a/Modules/Compiler/MSVC-CXX.cmake
+++ b/Modules/Compiler/MSVC-CXX.cmake
@@ -30,14 +30,18 @@ if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0.24215.1 AND
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++latest")
endif()
+ set(CMAKE_CXX_STANDARD_LATEST 17)
+
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30129)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++20")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std:c++20")
set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std:c++latest")
set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std:c++latest")
+ set(CMAKE_CXX_STANDARD_LATEST 23)
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.12.25835)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++latest")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std:c++latest")
+ set(CMAKE_CXX_STANDARD_LATEST 20)
endif()
__compiler_check_default_language_standard(CXX 19.0 14)
@@ -57,6 +61,14 @@ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "")
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)
+ set(CMAKE_CXX_STANDARD_LATEST 17)
+ elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18.0)
+ set(CMAKE_CXX_STANDARD_LATEST 14)
+ else()
+ set(CMAKE_CXX_STANDARD_LATEST 11)
+ endif()
+
# There is no meaningful default for this
set(CMAKE_CXX_STANDARD_DEFAULT "")
diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake
index b946cfd..a6636c4 100644
--- a/Modules/Compiler/NAG-Fortran.cmake
+++ b/Modules/Compiler/NAG-Fortran.cmake
@@ -28,6 +28,13 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED)
endif()
endif()
+# Initial configuration flags.
+string(APPEND CMAKE_Fortran_FLAGS_INIT " ")
+string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -g")
+string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -O2 -DNDEBUG")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O4 -DNDEBUG")
+string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
+
set(CMAKE_Fortran_SUBMODULE_SEP ".")
set(CMAKE_Fortran_SUBMODULE_EXT ".sub")
set(CMAKE_Fortran_MODDIR_FLAG "-mdir ")
@@ -39,3 +46,6 @@ set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-PIC")
set(CMAKE_Fortran_COMPILE_OPTIONS_PIE "-PIC")
set(CMAKE_Fortran_RESPONSE_FILE_LINK_FLAG "-Wl,@")
set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp")
+
+set(CMAKE_Fortran_PREPROCESS_SOURCE
+ "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -F <SOURCE> -o <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/NVHPC-C.cmake b/Modules/Compiler/NVHPC-C.cmake
index 9295abd..3838ebd 100644
--- a/Modules/Compiler/NVHPC-C.cmake
+++ b/Modules/Compiler/NVHPC-C.cmake
@@ -7,6 +7,7 @@ set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 20.11)
set(CMAKE_C17_STANDARD_COMPILE_OPTION -std=c17)
set(CMAKE_C17_EXTENSION_COMPILE_OPTION -std=gnu17)
+ set(CMAKE_C_STANDARD_LATEST 17)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.07)
diff --git a/Modules/Compiler/NVHPC-CXX.cmake b/Modules/Compiler/NVHPC-CXX.cmake
index 59ba7bf..0d804f4 100644
--- a/Modules/Compiler/NVHPC-CXX.cmake
+++ b/Modules/Compiler/NVHPC-CXX.cmake
@@ -7,6 +7,7 @@ set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 20.11)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION -std=c++20)
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION -std=gnu++20)
+ set(CMAKE_CXX_STANDARD_LATEST 20)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 21.07)
diff --git a/Modules/Compiler/NVIDIA.cmake b/Modules/Compiler/NVIDIA.cmake
index a126c57..21e71cc 100644
--- a/Modules/Compiler/NVIDIA.cmake
+++ b/Modules/Compiler/NVIDIA.cmake
@@ -17,6 +17,8 @@ macro(__compiler_nvidia_cxx_standards lang)
set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "")
set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_${lang}_STANDARD_LATEST 11)
+
if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 9.0)
if(CMAKE_${lang}_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017)
set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "-std=c++14")
@@ -25,12 +27,15 @@ macro(__compiler_nvidia_cxx_standards lang)
set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "")
set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "")
endif()
+
+ set(CMAKE_${lang}_STANDARD_LATEST 14)
endif()
if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 11.0)
if(CMAKE_${lang}_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.11.25505)
set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std=c++17")
+ set(CMAKE_${lang}_STANDARD_LATEST 17)
endif()
endif()
@@ -38,6 +43,7 @@ macro(__compiler_nvidia_cxx_standards lang)
if(CMAKE_${lang}_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.11.25505)
set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std=c++20")
set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=c++20")
+ set(CMAKE_${lang}_STANDARD_LATEST 20)
endif()
endif()
else()
@@ -47,21 +53,27 @@ macro(__compiler_nvidia_cxx_standards lang)
set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "-std=c++11")
set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "-std=c++11")
+ set(CMAKE_${lang}_STANDARD_LATEST 11)
+
if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 9.0)
set(CMAKE_${lang}03_STANDARD_COMPILE_OPTION "-std=c++03")
set(CMAKE_${lang}03_EXTENSION_COMPILE_OPTION "-std=c++03")
set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "-std=c++14")
+
+ set(CMAKE_${lang}_STANDARD_LATEST 14)
endif()
if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 11.0)
set(CMAKE_${lang}17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_${lang}17_EXTENSION_COMPILE_OPTION "-std=c++17")
+ set(CMAKE_${lang}_STANDARD_LATEST 17)
endif()
if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0)
set(CMAKE_${lang}20_STANDARD_COMPILE_OPTION "-std=c++20")
set(CMAKE_${lang}20_EXTENSION_COMPILE_OPTION "-std=c++20")
+ set(CMAKE_${lang}_STANDARD_LATEST 20)
endif()
endif()
diff --git a/Modules/Compiler/OrangeC-C.cmake b/Modules/Compiler/OrangeC-C.cmake
index 15a6476..f0dfcd1 100644
--- a/Modules/Compiler/OrangeC-C.cmake
+++ b/Modules/Compiler/OrangeC-C.cmake
@@ -15,6 +15,8 @@ set(CMAKE_C11_STANDARD_COMPILE_OPTION -std=c11)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION -std=c11)
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+set(CMAKE_C_STANDARD_LATEST 11)
+
__compiler_orangec(C)
#- 6.38 is the earliest version which version info is available in the preprocessor
__compiler_check_default_language_standard(C 6.38 11)
diff --git a/Modules/Compiler/OrangeC-CXX.cmake b/Modules/Compiler/OrangeC-CXX.cmake
index 3f9d59c..575c09d 100644
--- a/Modules/Compiler/OrangeC-CXX.cmake
+++ b/Modules/Compiler/OrangeC-CXX.cmake
@@ -20,6 +20,8 @@ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
+set(CMAKE_CXX_STANDARD_LATEST 14)
+
__compiler_orangec(CXX)
#- 6.38 is the earliest version which version info is available in the preprocessor
__compiler_check_default_language_standard(CXX 6.38 14)
diff --git a/Modules/Compiler/PGI-C.cmake b/Modules/Compiler/PGI-C.cmake
index c39dbe5..798fc84 100644
--- a/Modules/Compiler/PGI-C.cmake
+++ b/Modules/Compiler/PGI-C.cmake
@@ -10,10 +10,13 @@ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.10)
set(CMAKE_C99_STANDARD_COMPILE_OPTION -c99)
set(CMAKE_C99_EXTENSION_COMPILE_OPTION -c99)
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_C_STANDARD_LATEST 99)
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.3)
set(CMAKE_C11_STANDARD_COMPILE_OPTION -c11)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION -c11)
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_C_STANDARD_LATEST 11)
endif ()
endif ()
diff --git a/Modules/Compiler/PGI-CXX.cmake b/Modules/Compiler/PGI-CXX.cmake
index 1279c19..972e43a 100644
--- a/Modules/Compiler/PGI-CXX.cmake
+++ b/Modules/Compiler/PGI-CXX.cmake
@@ -7,19 +7,23 @@ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.10)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION --gnu_extensions)
set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 98)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.10)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION --c++03)
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION --c++03 --gnu_extensions)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION --c++11)
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION --c++11 --gnu_extensions)
set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 11)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.7)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION --c++14)
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION --c++14 --gnu_extensions)
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 14)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.1)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION --c++17)
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION --c++17 --gnu_extensions)
+ set(CMAKE_CXX_STANDARD_LATEST 17)
endif()
endif()
endif()
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index b06719d..7b4478c 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -52,11 +52,15 @@ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.13)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_C_STANDARD_LATEST 11)
elseif (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.11)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
set(CMAKE_C99_STANDARD_COMPILE_OPTION "-xc99")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-xc99")
+
+ set(CMAKE_C_STANDARD_LATEST 99)
endif()
__compiler_check_default_language_standard(C 5.11 90 5.14 11)
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index f835f2d..1db6aa7 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -54,14 +54,18 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")
set(CMAKE_CXX_LINK_WITH_STANDARD_COMPILE_OPTION 1)
+ set(CMAKE_CXX_STANDARD_LATEST 11)
+
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.14)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++14")
+ set(CMAKE_CXX_STANDARD_LATEST 14)
endif()
else()
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-library=stlport4")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-library=stlport4")
set(CMAKE_CXX_LINK_WITH_STANDARD_COMPILE_OPTION 1)
+ set(CMAKE_CXX_STANDARD_LATEST 98)
endif()
__compiler_check_default_language_standard(CXX 1 98)
diff --git a/Modules/Compiler/TI-C.cmake b/Modules/Compiler/TI-C.cmake
index bd88989..7f3b67c 100644
--- a/Modules/Compiler/TI-C.cmake
+++ b/Modules/Compiler/TI-C.cmake
@@ -34,18 +34,23 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C99_VERSION_$
set(CMAKE_C99_STANDARD_COMPILE_OPTION "--c99" "--strict_ansi")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--c99" "--relaxed_ansi")
+ set(CMAKE_C_STANDARD_LATEST 99)
+
if(DEFINED __COMPILER_TI_C11_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID} AND
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C11_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID}}")
set(CMAKE_C11_STANDARD_COMPILE_OPTION "--c11" "--strict_ansi")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "--c11" "--relaxed_ansi")
+ set(CMAKE_C_STANDARD_LATEST 11)
+
endif()
else()
set(CMAKE_C90_STANDARD_COMPILE_OPTION "--strict_ansi")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "--relaxed_ansi")
+ set(CMAKE_C_STANDARD_LATEST 90)
endif()
diff --git a/Modules/Compiler/TI-CXX.cmake b/Modules/Compiler/TI-CXX.cmake
index 4b6efcd..c904239 100644
--- a/Modules/Compiler/TI-CXX.cmake
+++ b/Modules/Compiler/TI-CXX.cmake
@@ -39,16 +39,19 @@ if(DEFINED __COMPILER_TI_CXX14_VERSION AND
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "--c++14" "--strict_ansi")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "--c++14" "--relaxed_ansi")
+ set(CMAKE_CXX_STANDARD_LATEST 14)
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_CXX03_VERSION}")
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "--c++03" "--strict_ansi")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "--c++03" "--relaxed_ansi")
+ set(CMAKE_CXX_STANDARD_LATEST 98)
else()
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "--strict_ansi")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "--relaxed_ansi")
+ set(CMAKE_CXX_STANDARD_LATEST 98)
endif()
diff --git a/Modules/Compiler/TIClang-ASM.cmake b/Modules/Compiler/TIClang-ASM.cmake
new file mode 100644
index 0000000..6bb07e3
--- /dev/null
+++ b/Modules/Compiler/TIClang-ASM.cmake
@@ -0,0 +1,9 @@
+include(Compiler/TIClang)
+
+set(CMAKE_ASM_OUTPUT_EXTENSION ".o")
+set(CMAKE_ASM_OUTPUT_EXTENSION_REPLACE 1)
+
+set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -c -o <OBJECT> <SOURCE>")
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS S;s;asm;msa)
+
+__compiler_ticlang(ASM)
diff --git a/Modules/Compiler/TIClang-C-FeatureTests.cmake b/Modules/Compiler/TIClang-C-FeatureTests.cmake
new file mode 100644
index 0000000..ef79229
--- /dev/null
+++ b/Modules/Compiler/TIClang-C-FeatureTests.cmake
@@ -0,0 +1 @@
+include(Compiler/Clang-C-FeatureTests)
diff --git a/Modules/Compiler/TIClang-C.cmake b/Modules/Compiler/TIClang-C.cmake
new file mode 100644
index 0000000..b6ce3dc
--- /dev/null
+++ b/Modules/Compiler/TIClang-C.cmake
@@ -0,0 +1,33 @@
+include(Compiler/Clang-C)
+include(Compiler/TIClang)
+__compiler_ticlang(C)
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_C_DEPFILE_FORMAT gcc)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+endif()
+
+set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
+set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
+set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
+
+set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
+set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
+set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
+
+set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
+set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
+set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+
+set(CMAKE_C_STANDARD_LATEST 11)
+
+# Including the "${CMAKE_ROOT}/Modules/Compiler/Clang-C.cmake" script above may set several other compile option
+# variables which do not necessarily apply here. So, we unset those variables accordingly.
+unset(CMAKE_C17_STANDARD_COMPILE_OPTION)
+unset(CMAKE_C17_EXTENSION_COMPILE_OPTION)
+
+unset(CMAKE_C23_STANDARD_COMPILE_OPTION)
+unset(CMAKE_C23_EXTENSION_COMPILE_OPTION)
diff --git a/Modules/Compiler/TIClang-CXX-FeatureTests.cmake b/Modules/Compiler/TIClang-CXX-FeatureTests.cmake
new file mode 100644
index 0000000..e038e80
--- /dev/null
+++ b/Modules/Compiler/TIClang-CXX-FeatureTests.cmake
@@ -0,0 +1 @@
+include(Compiler/Clang-CXX-FeatureTests)
diff --git a/Modules/Compiler/TIClang-CXX.cmake b/Modules/Compiler/TIClang-CXX.cmake
new file mode 100644
index 0000000..e1367df
--- /dev/null
+++ b/Modules/Compiler/TIClang-CXX.cmake
@@ -0,0 +1,38 @@
+include(Compiler/Clang-CXX)
+include(Compiler/TIClang)
+__compiler_ticlang(CXX)
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_CXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_CXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+endif()
+
+set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
+set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
+set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
+
+set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
+set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
+
+set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
+set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
+set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
+
+set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
+set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
+
+set(CMAKE_CXX_STANDARD_LATEST 17)
+
+# Including the "${CMAKE_ROOT}/Modules/Compiler/Clang-CXX.cmake" script above may set several other compile option
+# variables which do not necessarily apply here. So, we unset those variables accordingly.
+unset(CMAKE_CXX20_STANDARD_COMPILE_OPTION)
+unset(CMAKE_CXX20_EXTENSION_COMPILE_OPTION)
+
+unset(CMAKE_CXX23_STANDARD_COMPILE_OPTION)
+unset(CMAKE_CXX23_EXTENSION_COMPILE_OPTION)
+
+unset(CMAKE_CXX26_STANDARD_COMPILE_OPTION)
+unset(CMAKE_CXX26_EXTENSION_COMPILE_OPTION)
diff --git a/Modules/Compiler/TIClang-DetermineCompiler.cmake b/Modules/Compiler/TIClang-DetermineCompiler.cmake
new file mode 100644
index 0000000..2447fdf
--- /dev/null
+++ b/Modules/Compiler/TIClang-DetermineCompiler.cmake
@@ -0,0 +1,10 @@
+# TI Clang-based Toolchains
+set(_compiler_id_pp_test "defined(__clang__) && defined(__ti__)")
+
+set(_compiler_id_version_compute "
+ # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ti_major__)
+ # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ti_minor__)
+ # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ti_patchlevel__)")
+
+string(APPEND _compiler_id_version_compute "
+# define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__ti_version__)")
diff --git a/Modules/Compiler/TIClang.cmake b/Modules/Compiler/TIClang.cmake
new file mode 100644
index 0000000..4965e62
--- /dev/null
+++ b/Modules/Compiler/TIClang.cmake
@@ -0,0 +1,30 @@
+if(__COMPILER_TICLANG)
+ return()
+endif()
+set(__COMPILER_TICLANG TRUE)
+
+include(Compiler/CMakeCommonCompilerMacros)
+
+# get linker supported cpu list
+macro(__compiler_ticlang lang)
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Xlinker ")
+
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+
+ 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}_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_FINISH "")
+
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
+endmacro()
+
+set(CMAKE_EXECUTABLE_SUFFIX ".out")
+set(CMAKE_LIBRARY_PATH_FLAG "-Wl,--search_path=")
+set(CMAKE_LINK_LIBRARY_FLAG "-Wl,--library=")
diff --git a/Modules/Compiler/Tasking-C.cmake b/Modules/Compiler/Tasking-C.cmake
index 0ea3cd2..938f46e 100644
--- a/Modules/Compiler/Tasking-C.cmake
+++ b/Modules/Compiler/Tasking-C.cmake
@@ -10,6 +10,8 @@ set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--iso=99" " ")
set(CMAKE_C11_STANDARD_COMPILE_OPTION "--iso=11" "--strict")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "--iso=11" " ")
+set(CMAKE_C_STANDARD_LATEST 11)
+
if(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "TriCore")
if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
__compiler_check_default_language_standard(C 10.1 11)
diff --git a/Modules/Compiler/Tasking-CXX.cmake b/Modules/Compiler/Tasking-CXX.cmake
index 635104c..20e007f 100644
--- a/Modules/Compiler/Tasking-CXX.cmake
+++ b/Modules/Compiler/Tasking-CXX.cmake
@@ -12,6 +12,8 @@ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "--c++=11" " ")
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "--c++=14" "--strict")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "--c++=14" " ")
+set(CMAKE_CXX_STANDARD_LATEST 14)
+
if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "TriCore")
if(CMAKE_TASKING_TOOLSET STREQUAL "SmartCode")
__compiler_check_default_language_standard(CXX 10.1 14)
diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake
index 2077bda..d14ac85 100644
--- a/Modules/Compiler/XL-C.cmake
+++ b/Modules/Compiler/XL-C.cmake
@@ -13,10 +13,13 @@ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
set(CMAKE_C99_STANDARD_COMPILE_OPTION "-qlanglvl=stdc99")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-qlanglvl=extc99")
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_C_STANDARD_LATEST 99)
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.1)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-qlanglvl=extc1x")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-qlanglvl=extc1x")
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_C_STANDARD_LATEST 11)
endif ()
endif()
diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake
index 41e3e11..57bd5a9 100644
--- a/Modules/Compiler/XL-CXX.cmake
+++ b/Modules/Compiler/XL-CXX.cmake
@@ -24,10 +24,13 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
# compiler mode for the corresponding standard.
set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 11)
+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.1.0 AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-qlanglvl=extended1y")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-qlanglvl=extended1y")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
+ set(CMAKE_CXX_STANDARD_LATEST 14)
endif()
endif ()
diff --git a/Modules/Compiler/XLClang-C.cmake b/Modules/Compiler/XLClang-C.cmake
index 1668a4d..7ca76e4 100644
--- a/Modules/Compiler/XLClang-C.cmake
+++ b/Modules/Compiler/XLClang-C.cmake
@@ -12,11 +12,14 @@ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1)
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-qlanglvl=extc1x")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-qlanglvl=extc1x")
+
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.2)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
endif ()
+
+ set(CMAKE_C_STANDARD_LATEST 11)
endif()
__compiler_check_default_language_standard(C 13.1.1 99)
diff --git a/Modules/Compiler/XLClang-CXX.cmake b/Modules/Compiler/XLClang-CXX.cmake
index 02638c7..b324987 100644
--- a/Modules/Compiler/XLClang-CXX.cmake
+++ b/Modules/Compiler/XLClang-CXX.cmake
@@ -10,12 +10,17 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-qlanglvl=extended0x")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-qlanglvl=extended0x")
set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_CXX_STANDARD_LATEST 11)
+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.2)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
+
+ set(CMAKE_CXX_STANDARD_LATEST 14)
endif ()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.1.0)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
diff --git a/Modules/CompilerId/VS-Intel.vfproj.in b/Modules/CompilerId/VS-Intel.vfproj.in
index 044dd20..fdd9d9d 100644
--- a/Modules/CompilerId/VS-Intel.vfproj.in
+++ b/Modules/CompilerId/VS-Intel.vfproj.in
@@ -13,7 +13,7 @@
Name="Debug|@id_platform@"
OutputDirectory="."
IntermediateDirectory="$(ConfigurationName)"
- >
+ @id_UseCompiler@>
<Tool
Name="VFFortranCompilerTool"
DebugInformationFormat="debugEnabled"
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index afa36f7..67d9f8f 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -95,6 +95,9 @@ TimeOut: @DART_TESTING_TIMEOUT@
# so would cause the system load to exceed this value.
TestLoad: @CTEST_TEST_LOAD@
+TLSVerify: @CTEST_TLS_VERIFY@
+TLSVersion: @CTEST_TLS_VERSION@
+
UseLaunchers: @CTEST_USE_LAUNCHERS@
CurlOptions: @CTEST_CURL_OPTIONS@
# warning, if you add new options here that have to do with submit,
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index a5dceaa..3323b18 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -225,22 +225,45 @@ URL
Provides an arbitrary list of HTTP headers for the download operation.
This can be useful for accessing content in systems like AWS, etc.
+``TLS_VERSION <min>``
+ .. versionadded:: 3.30
+
+ Specify minimum TLS version for ``https://`` URLs. If this option is
+ not provided, the value of the :variable:`CMAKE_TLS_VERSION` variable
+ or the :envvar:`CMAKE_TLS_VERSION` environment variable will be used
+ instead (see :command:`file(DOWNLOAD)`).
+
+ This option also applies to ``git clone`` invocations, although the
+ default behavior is different. If none of the ``TLS_VERSION`` option,
+ :variable:`CMAKE_TLS_VERSION` variable, or :envvar:`CMAKE_TLS_VERSION`
+ environment variable is specified, the behavior will be determined by
+ git's default or a ``http.sslVersion`` git config option the user may
+ have set at a global level.
+
``TLS_VERIFY <bool>``
Specifies whether certificate verification should be performed for
- https URLs. If this option is not provided, the default behavior is
- determined by the :variable:`CMAKE_TLS_VERIFY` variable (see
- :command:`file(DOWNLOAD)`). If that is also not set, certificate
- verification will not be performed. In situations where ``URL_HASH``
- cannot be provided, this option can be an alternative verification
- measure.
+ ``https://`` URLs. If this option is not provided, the value of the
+ :variable:`CMAKE_TLS_VERIFY` variable or the :envvar:`CMAKE_TLS_VERIFY`
+ environment variable will be used instead (see :command:`file(DOWNLOAD)`).
+ If neither of those is set, certificate verification will not be performed.
+ In situations where ``URL_HASH`` cannot be provided, this option can
+ be an alternative verification measure.
+
+ This option also applies to ``git clone`` invocations, although the
+ default behavior is different. If none of the ``TLS_VERIFY`` option,
+ :variable:`CMAKE_TLS_VERIFY` variable, or :envvar:`CMAKE_TLS_VERIFY`
+ environment variable is specified, the behavior will be determined by
+ git's default (true) or a ``http.sslVerify`` git config option the
+ user may have set at a global level.
.. versionchanged:: 3.6
- This option also applies to ``git clone`` invocations, although the
- default behavior is different. If ``TLS_VERIFY`` is not given and
- :variable:`CMAKE_TLS_VERIFY` is not set, the behavior will be
- determined by git's defaults. Normally, the ``sslVerify`` git
- config setting defaults to true, but the user may have overridden
- this at a global level.
+
+ Previously this option did not apply to ``git clone`` invocations.
+
+ .. versionchanged:: 3.30
+
+ Previously the :envvar:`CMAKE_TLS_VERIFY` environment variable
+ was not checked.
``TLS_CAINFO <file>``
Specify a custom certificate authority file to use if ``TLS_VERIFY``
@@ -906,10 +929,21 @@ Miscellaneous Options
``LIST_SEPARATOR <sep>``
For any of the various ``..._COMMAND`` options, and ``CMAKE_ARGS``,
- replace ``;`` with ``<sep>`` in the specified command lines.
- This can be useful where list variables may be given in commands where
- they should end up as space-separated arguments (``<sep>`` would be a
- single space character string in this case).
+ ``ExternalProject`` will replace ``<sep>`` with ``;`` in the specified
+ command lines. This can be used to ensure a command has a literal ``;`` in it
+ where direct usage would otherwise be interpreted as argument separators to
+ CMake APIs instead. Note that the separator should be chosen to avoid being
+ confused for non-list-separator usages of the sequence. For example, using
+ ``LIST_SEPARATOR`` allows for passing list values to CMake cache variables on
+ the command line:
+
+ .. code-block:: cmake
+
+ ExternalProject_Add(example
+ ... # Download options, etc.
+ LIST_SEPARATOR ","
+ CMAKE_ARGS "-DCMAKE_PREFIX_PATH:STRING=${first_prefix},${second_prefix}"
+ )
``COMMAND <cmd>...``
Any of the other ``..._COMMAND`` options can have additional commands
@@ -1346,6 +1380,63 @@ define_property(DIRECTORY PROPERTY "EP_STEP_TARGETS" INHERITED)
define_property(DIRECTORY PROPERTY "EP_INDEPENDENT_STEP_TARGETS" INHERITED)
define_property(DIRECTORY PROPERTY "EP_UPDATE_DISCONNECTED" INHERITED)
+function(_ep_get_tls_version name tls_version_var)
+ set(tls_version_regex "^1\\.[0-3]$")
+ get_property(tls_version TARGET ${name} PROPERTY _EP_TLS_VERSION)
+ if(NOT "x${tls_version}" STREQUAL "x")
+ if(NOT tls_version MATCHES "${tls_version_regex}")
+ message(FATAL_ERROR "TLS_VERSION '${tls_version}' not known")
+ endif()
+ elseif(NOT "x${CMAKE_TLS_VERSION}" STREQUAL "x")
+ set(tls_version "${CMAKE_TLS_VERSION}")
+ if(NOT tls_version MATCHES "${tls_version_regex}")
+ message(FATAL_ERROR "CMAKE_TLS_VERSION '${tls_version}' not known")
+ endif()
+ elseif(NOT "x$ENV{CMAKE_TLS_VERSION}" STREQUAL "x")
+ set(tls_version "$ENV{CMAKE_TLS_VERSION}")
+ if(NOT tls_version MATCHES "${tls_version_regex}")
+ message(FATAL_ERROR "ENV{CMAKE_TLS_VERSION} '${tls_version}' not known")
+ endif()
+ endif()
+ set("${tls_version_var}" "${tls_version}" PARENT_SCOPE)
+endfunction()
+
+function(_ep_get_tls_verify name tls_verify_var)
+ get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY)
+ if("x${tls_verify}" STREQUAL "x")
+ if(NOT "x${CMAKE_TLS_VERIFY}" STREQUAL "x")
+ set(tls_verify "${CMAKE_TLS_VERIFY}")
+ elseif(NOT "x$ENV{CMAKE_TLS_VERIFY}" STREQUAL "x")
+ set(tls_verify "$ENV{CMAKE_TLS_VERIFY}")
+ endif()
+ endif()
+ set("${tls_verify_var}" "${tls_verify}" PARENT_SCOPE)
+endfunction()
+
+function(_ep_get_tls_cainfo name tls_cainfo_var)
+ get_property(tls_cainfo TARGET ${name} PROPERTY _EP_TLS_CAINFO)
+ if("x${tls_cainfo}" STREQUAL "x" AND DEFINED CMAKE_TLS_CAINFO)
+ set(tls_cainfo "${CMAKE_TLS_CAINFO}")
+ endif()
+ set("${tls_cainfo_var}" "${tls_cainfo}" PARENT_SCOPE)
+endfunction()
+
+function(_ep_get_netrc name netrc_var)
+ get_property(netrc TARGET ${name} PROPERTY _EP_NETRC)
+ if("x${netrc}" STREQUAL "x" AND DEFINED CMAKE_NETRC)
+ set(netrc "${CMAKE_NETRC}")
+ endif()
+ set("${netrc_var}" "${netrc}" PARENT_SCOPE)
+endfunction()
+
+function(_ep_get_netrc_file name netrc_file_var)
+ get_property(netrc_file TARGET ${name} PROPERTY _EP_NETRC_FILE)
+ if("x${netrc_file}" STREQUAL "x" AND DEFINED CMAKE_NETRC_FILE)
+ set(netrc_file "${CMAKE_NETRC_FILE}")
+ endif()
+ set("${netrc_file_var}" "${netrc_file}" PARENT_SCOPE)
+endfunction()
+
function(_ep_write_gitclone_script
script_filename
source_dir
@@ -1363,6 +1454,7 @@ function(_ep_write_gitclone_script
work_dir
gitclone_infofile
gitclone_stampfile
+ tls_version
tls_verify
)
@@ -1379,8 +1471,6 @@ function(_ep_write_gitclone_script
message(FATAL_ERROR "Tag for git checkout should not be empty.")
endif()
- set(git_submodules_config_options "")
-
if(GIT_VERSION_STRING VERSION_LESS 2.20 OR
2.21 VERSION_LESS_EQUAL GIT_VERSION_STRING)
set(git_clone_options "--no-checkout")
@@ -1403,21 +1493,27 @@ function(_ep_write_gitclone_script
if(NOT ${git_remote_name} STREQUAL "origin")
list(APPEND git_clone_options --origin \"${git_remote_name}\")
endif()
+
+ # The clone config option is sticky, it will apply to all subsequent git
+ # update operations. The submodules config option is not sticky, because
+ # git doesn't provide any way to do that. Thus, we will have to pass the
+ # same config option in the update step too for submodules, but not for
+ # the main git repo.
+ set(git_submodules_config_options "")
+ if(NOT "x${tls_version}" STREQUAL "x")
+ list(APPEND git_clone_options -c http.sslVersion=tlsv${tls_version})
+ list(APPEND git_submodules_config_options -c http.sslVersion=tlsv${tls_version})
+ endif()
if(NOT "x${tls_verify}" STREQUAL "x")
- # The clone config option is sticky, it will apply to all subsequent git
- # update operations. The submodules config option is not sticky, because
- # git doesn't provide any way to do that. Thus, we will have to pass the
- # same config option in the update step too for submodules, but not for
- # the main git repo.
if(tls_verify)
# Default git behavior is "true", but the user might have changed the
# global default to "false". Since TLS_VERIFY was given, ensure we honor
# the specified setting regardless of what the global default might be.
list(APPEND git_clone_options -c http.sslVerify=true)
- set(git_submodules_config_options -c http.sslVerify=true)
+ list(APPEND git_submodules_config_options -c http.sslVerify=true)
else()
list(APPEND git_clone_options -c http.sslVerify=false)
- set(git_submodules_config_options -c http.sslVerify=false)
+ list(APPEND git_submodules_config_options -c http.sslVerify=false)
endif()
endif()
@@ -1465,6 +1561,7 @@ function(_ep_write_gitupdate_script
git_repository
work_dir
git_update_strategy
+ tls_version
tls_verify
)
@@ -1480,19 +1577,22 @@ function(_ep_write_gitupdate_script
list(APPEND git_stash_save_options --all)
endif()
+ # The submodules config option is not sticky, git doesn't provide any way
+ # to do that. We have to pass this config option for the update step too.
+ # We don't need to set it for the non-submodule update because it gets
+ # recorded as part of the clone operation in a sticky manner.
set(git_submodules_config_options "")
+ if(NOT "x${tls_version}" STREQUAL "x")
+ list(APPEND git_submodules_config_options -c http.sslVersion=tlsv${tls_version})
+ endif()
if(NOT "x${tls_verify}" STREQUAL "x")
- # The submodules config option is not sticky, git doesn't provide any way
- # to do that. We have to pass this config option for the update step too.
- # We don't need to set it for the non-submodule update because it gets
- # recorded as part of the clone operation in a sticky manner.
if(tls_verify)
# Default git behavior is "true", but the user might have changed the
# global default to "false". Since TLS_VERIFY was given, ensure we honor
# the specified setting regardless of what the global default might be.
- set(git_submodules_config_options -c http.sslVerify=true)
+ list(APPEND git_submodules_config_options -c http.sslVerify=true)
else()
- set(git_submodules_config_options -c http.sslVerify=false)
+ list(APPEND git_submodules_config_options -c http.sslVerify=false)
endif()
endif()
@@ -1511,6 +1611,7 @@ function(_ep_write_downloadfile_script
inactivity_timeout
no_progress
hash
+ tls_version
tls_verify
tls_cainfo
userpwd
@@ -1518,6 +1619,21 @@ function(_ep_write_downloadfile_script
netrc
netrc_file
)
+ if("x${REMOTE}" STREQUAL "x")
+ message(FATAL_ERROR "REMOTE can't be empty")
+ endif()
+ if("x${LOCAL}" STREQUAL "x")
+ message(FATAL_ERROR "LOCAL can't be empty")
+ endif()
+
+ # REMOTE could contain special characters that parse as separate arguments.
+ # Things like parentheses are legitimate characters in a URL, but would be
+ # seen as the start of a new unquoted argument by the cmake language parser.
+ # Avoid those special cases by preparing quoted strings for direct inclusion
+ # in the foreach() call that iterates over the set of URLs in REMOTE.
+ set(REMOTE "[====[${REMOTE}]====]")
+ string(REPLACE ";" "]====] [====[" REMOTE "${REMOTE}")
+
if(timeout)
set(TIMEOUT_ARGS TIMEOUT ${timeout})
set(TIMEOUT_MSG "${timeout} seconds")
@@ -1548,46 +1664,28 @@ function(_ep_write_downloadfile_script
set(EXPECT_VALUE "")
endif()
- set(TLS_VERIFY_CODE "")
- set(TLS_CAINFO_CODE "")
- set(NETRC_CODE "")
- set(NETRC_FILE_CODE "")
-
- # check for curl globals in the project
- if(DEFINED CMAKE_TLS_VERIFY)
- set(TLS_VERIFY_CODE "set(CMAKE_TLS_VERIFY ${CMAKE_TLS_VERIFY})")
- endif()
- if(DEFINED CMAKE_TLS_CAINFO)
- set(TLS_CAINFO_CODE "set(CMAKE_TLS_CAINFO \"${CMAKE_TLS_CAINFO}\")")
- endif()
- if(DEFINED CMAKE_NETRC)
- set(NETRC_CODE "set(CMAKE_NETRC \"${CMAKE_NETRC}\")")
+ set(TLS_VERSION_CODE "")
+ if(NOT "x${tls_version}" STREQUAL "x")
+ set(TLS_VERSION_CODE "set(CMAKE_TLS_VERSION \"${tls_version}\")")
endif()
- if(DEFINED CMAKE_NETRC_FILE)
- set(NETRC_FILE_CODE "set(CMAKE_NETRC_FILE \"${CMAKE_NETRC_FILE}\")")
- endif()
-
- # now check for curl locals so that the local values
- # will override the globals
- # check for tls_verify argument
- string(LENGTH "${tls_verify}" tls_verify_len)
- if(tls_verify_len GREATER 0)
- set(TLS_VERIFY_CODE "set(CMAKE_TLS_VERIFY ${tls_verify})")
+ set(TLS_VERIFY_CODE "")
+ if(NOT "x${tls_verify}" STREQUAL "x")
+ set(TLS_VERIFY_CODE "set(CMAKE_TLS_VERIFY \"${tls_verify}\")")
endif()
- # check for tls_cainfo argument
- string(LENGTH "${tls_cainfo}" tls_cainfo_len)
- if(tls_cainfo_len GREATER 0)
+
+ set(TLS_CAINFO_CODE "")
+ if(NOT "x${tls_cainfo}" STREQUAL "x")
set(TLS_CAINFO_CODE "set(CMAKE_TLS_CAINFO \"${tls_cainfo}\")")
endif()
- # check for netrc argument
- string(LENGTH "${netrc}" netrc_len)
- if(netrc_len GREATER 0)
+
+ set(NETRC_CODE "")
+ if(NOT "x${netrc}" STREQUAL "x")
set(NETRC_CODE "set(CMAKE_NETRC \"${netrc}\")")
endif()
- # check for netrc_file argument
- string(LENGTH "${netrc_file}" netrc_file_len)
- if(netrc_file_len GREATER 0)
+
+ set(NETRC_FILE_CODE "")
+ if(NOT "x${netrc_file}" STREQUAL "x")
set(NETRC_FILE_CODE "set(CMAKE_NETRC_FILE \"${netrc_file}\")")
endif()
@@ -1599,7 +1697,7 @@ function(_ep_write_downloadfile_script
set(HTTP_HEADERS_ARGS "")
if(NOT http_headers STREQUAL "")
- foreach(header ${http_headers})
+ foreach(header IN LISTS http_headers)
string(PREPEND HTTP_HEADERS_ARGS
"HTTPHEADER \"${header}\"\n "
)
@@ -1607,6 +1705,7 @@ function(_ep_write_downloadfile_script
endif()
# Used variables:
+ # * TLS_VERSION_CODE
# * TLS_VERIFY_CODE
# * TLS_CAINFO_CODE
# * ALGO
@@ -1724,7 +1823,7 @@ function(_ep_set_directories name)
# Apply defaults and convert to absolute paths.
set(places stamp download source binary install tmp)
- foreach(var ${places})
+ foreach(var IN LISTS places)
string(TOUPPER "${var}" VAR)
get_property(${var}_dir TARGET ${name} PROPERTY _EP_${VAR}_DIR)
if(NOT ${var}_dir)
@@ -1796,9 +1895,9 @@ endfunction()
#
macro(_ep_replace_location_tags target_name)
set(vars ${ARGN})
- foreach(var ${vars})
- if(${var})
- foreach(dir
+ foreach(var IN LISTS vars)
+ if(var)
+ foreach(dir IN ITEMS
SOURCE_DIR
SOURCE_SUBDIR
BINARY_DIR
@@ -1828,7 +1927,7 @@ function(_ep_command_line_to_initial_cache
if(force)
set(forceArg "FORCE")
endif()
- foreach(line ${args})
+ foreach(line IN LISTS args)
if("${line}" MATCHES "^-D(.*)")
set(line "${CMAKE_MATCH_1}")
if(NOT "${setArg}" STREQUAL "")
@@ -1884,7 +1983,7 @@ endfunction()
function(ExternalProject_Get_Property name)
- foreach(var ${ARGN})
+ foreach(var IN LISTS ARGN)
string(TOUPPER "${var}" VAR)
get_property(is_set TARGET ${name} PROPERTY _EP_${VAR} SET)
if(NOT is_set)
@@ -1934,8 +2033,10 @@ function(_ep_get_build_command
set(args)
_ep_get_configure_command_id(${name} cfg_cmd_id)
if(cfg_cmd_id STREQUAL "cmake")
- # CMake project. Select build command based on generator.
- get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR)
+ # Adding a CMake project as an External Project. Select command based on generator
+ get_property(cmake_generator TARGET ${name} PROPERTY _EP_CMAKE_GENERATOR)
+ # cmake_generator is the CMake generator of the ExternalProject target being added
+ # CMAKE_GENERATOR is the CMake generator of the Current Project
if("${CMAKE_GENERATOR}" MATCHES "Make" AND
("${cmake_generator}" MATCHES "Make" OR NOT cmake_generator))
# The project uses the same Makefile generator. Use recursive make.
@@ -1948,6 +2049,11 @@ function(_ep_get_build_command
endif()
else()
# Drive the project with "cmake --build".
+ if(NOT cmake_generator)
+ # If there is no CMake Generator defined on the ExternalProject,
+ # use the same Generator as the current project
+ set(cmake_generator "${CMAKE_GENERATOR}")
+ endif()
get_target_property(cmake_command ${name} _EP_CMAKE_COMMAND)
if(cmake_command)
set(cmd "${cmake_command}")
@@ -1977,7 +2083,11 @@ function(_ep_get_build_command
list(APPEND args --config ${config})
endif()
if(step STREQUAL "INSTALL")
- list(APPEND args --target install)
+ if("${cmake_generator}" MATCHES "Green Hills MULTI")
+ list(APPEND args --target INSTALL)
+ else()
+ list(APPEND args --target install)
+ endif()
endif()
# But for "TEST" drive the project with corresponding "ctest".
if("x${step}x" STREQUAL "xTESTx")
@@ -2361,7 +2471,7 @@ function(ExternalProject_Add_StepTargets name)
endif()
message(AUTHOR_WARNING "${_cmp0114_warning}")
endif()
- foreach(step ${steps})
+ foreach(step IN LISTS steps)
_ep_step_add_target("${name}" "${step}" "${no_deps}")
endforeach()
endfunction()
@@ -2542,7 +2652,7 @@ function(ExternalProject_Add_Step name step)
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_isMultiConfig)
_ep_get_configuration_subdir_genex(cfgdir)
- foreach(cfg ${CMAKE_CONFIGURATION_TYPES})
+ foreach(cfg IN LISTS CMAKE_CONFIGURATION_TYPES)
string(REPLACE "${cfgdir}" "/${cfg}"
stamp_file_config "${stamp_file}"
)
@@ -2617,7 +2727,7 @@ function(ExternalProject_Add_Step name step)
PROPERTY EP_STEP_TARGETS
)
endif()
- foreach(st ${step_targets})
+ foreach(st IN LISTS step_targets)
if("${st}" STREQUAL "${step}")
_ep_step_add_target("${name}" "${step}" "FALSE")
break()
@@ -2664,7 +2774,7 @@ function(ExternalProject_Add_Step name step)
message(AUTHOR_WARNING "${_cmp0114_warning}")
endif()
endif()
- foreach(st ${independent_step_targets})
+ foreach(st IN LISTS independent_step_targets)
if("${st}" STREQUAL "${step}")
_ep_step_add_target("${name}" "${step}" "TRUE")
break()
@@ -2730,17 +2840,15 @@ function(ExternalProject_Add_StepDependencies name step)
# Always add file-level dependency, but add target-level dependency
# only if the target exists for that step.
_ep_get_step_stampfile(${name} ${step} stamp_file)
- foreach(dep ${dependencies})
+ foreach(dep IN LISTS dependencies)
add_custom_command(APPEND
OUTPUT ${stamp_file}
DEPENDS ${dep}
)
- if(TARGET ${name}-${step})
- foreach(dep ${dependencies})
- add_dependencies(${name}-${step} ${dep})
- endforeach()
- endif()
endforeach()
+ if(TARGET ${name}-${step})
+ add_dependencies(${name}-${step} ${dependencies})
+ endif()
endfunction()
@@ -2935,10 +3043,8 @@ function(_ep_add_download_command name)
set(git_remote_name "origin")
endif()
- get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY)
- if("x${tls_verify}" STREQUAL "x" AND DEFINED CMAKE_TLS_VERIFY)
- set(tls_verify "${CMAKE_TLS_VERIFY}")
- endif()
+ _ep_get_tls_version(${name} tls_version)
+ _ep_get_tls_verify(${name} tls_verify)
get_property(git_shallow TARGET ${name} PROPERTY _EP_GIT_SHALLOW)
get_property(git_progress TARGET ${name} PROPERTY _EP_GIT_PROGRESS)
get_property(git_config TARGET ${name} PROPERTY _EP_GIT_CONFIG)
@@ -2988,6 +3094,7 @@ CMP0097=${_EP_CMP0097}
${work_dir}
${stamp_dir}/${name}-gitinfo.txt
${stamp_dir}/${name}-gitclone-lastrun.txt
+ "${tls_version}"
"${tls_verify}"
)
set(comment "Performing download step (git clone) for '${name}'")
@@ -3068,7 +3175,7 @@ hash=${hash}
list(LENGTH url url_list_length)
if(NOT "${url_list_length}" STREQUAL "1")
- foreach(entry ${url})
+ foreach(entry IN LISTS url)
if(NOT "${entry}" MATCHES "^[a-z]+://")
message(FATAL_ERROR
"At least one entry of URL is a path (invalid in a list)"
@@ -3122,10 +3229,11 @@ hash=${hash}
TARGET ${name}
PROPERTY _EP_DOWNLOAD_NO_PROGRESS
)
- get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY)
- get_property(tls_cainfo TARGET ${name} PROPERTY _EP_TLS_CAINFO)
- get_property(netrc TARGET ${name} PROPERTY _EP_NETRC)
- get_property(netrc_file TARGET ${name} PROPERTY _EP_NETRC_FILE)
+ _ep_get_tls_version(${name} tls_version)
+ _ep_get_tls_verify(${name} tls_verify)
+ _ep_get_tls_cainfo(${name} tls_cainfo)
+ _ep_get_netrc(${name} netrc)
+ _ep_get_netrc_file(${name} netrc_file)
get_property(http_username TARGET ${name} PROPERTY _EP_HTTP_USERNAME)
get_property(http_password TARGET ${name} PROPERTY _EP_HTTP_PASSWORD)
get_property(http_headers TARGET ${name} PROPERTY _EP_HTTP_HEADER)
@@ -3138,6 +3246,7 @@ hash=${hash}
"${inactivity_timeout}"
"${no_progress}"
"${hash}"
+ "${tls_version}"
"${tls_verify}"
"${tls_cainfo}"
"${http_username}:${http_password}"
@@ -3448,10 +3557,8 @@ function(_ep_add_update_command name)
_ep_get_git_submodules_recurse(git_submodules_recurse)
- get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY)
- if("x${tls_verify}" STREQUAL "x" AND DEFINED CMAKE_TLS_VERIFY)
- set(tls_verify "${CMAKE_TLS_VERIFY}")
- endif()
+ _ep_get_tls_version(${name} tls_version)
+ _ep_get_tls_verify(${name} tls_verify)
set(update_script "${tmp_dir}/${name}-gitupdate.cmake")
list(APPEND file_deps ${update_script})
@@ -3466,6 +3573,7 @@ function(_ep_add_update_command name)
"${git_repository}"
"${work_dir}"
"${git_update_strategy}"
+ "${tls_version}"
"${tls_verify}"
)
set(cmd ${CMAKE_COMMAND} -Dcan_fetch=YES -P ${update_script})
@@ -3763,6 +3871,9 @@ function(_ep_extract_configure_command var name)
list(APPEND cmd "-G${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
else()
list(APPEND cmd "-G${CMAKE_GENERATOR}")
+ # GreenHills needs to know about the compiler and toolset.
+ # Be sure to update the similar section in
+ # FetchContent.cmake:__FetchContent_directPopulate()
if("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
set(has_cmake_cache_default_args 1)
list(APPEND cmake_cache_default_args
@@ -4236,6 +4347,7 @@ function(ExternalProject_Add name)
HTTP_USERNAME
HTTP_PASSWORD
HTTP_HEADER
+ TLS_VERSION # Also used for git clone operations
TLS_VERIFY # Also used for git clone operations
TLS_CAINFO
NETRC
diff --git a/Modules/ExternalProject/download.cmake.in b/Modules/ExternalProject/download.cmake.in
index bf7f209..f21a91a 100644
--- a/Modules/ExternalProject/download.cmake.in
+++ b/Modules/ExternalProject/download.cmake.in
@@ -71,14 +71,6 @@ function(sleep_before_download attempt)
execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep "${sleep_seconds}")
endfunction()
-if("@LOCAL@" STREQUAL "")
- message(FATAL_ERROR "LOCAL can't be empty")
-endif()
-
-if("@REMOTE@" STREQUAL "")
- message(FATAL_ERROR "REMOTE can't be empty")
-endif()
-
if(EXISTS "@LOCAL@")
check_file_hash(has_hash hash_is_good)
if(has_hash)
@@ -108,17 +100,18 @@ message(STATUS "Downloading...
timeout='@TIMEOUT_MSG@'
inactivity timeout='@INACTIVITY_TIMEOUT_MSG@'"
)
-set(download_retry_codes 7 6 8 15 28)
+set(download_retry_codes 7 6 8 15 28 35)
set(skip_url_list)
set(status_code)
foreach(i RANGE ${retry_number})
if(status_code IN_LIST download_retry_codes)
sleep_before_download(${i})
endif()
- foreach(url @REMOTE@)
+ foreach(url IN ITEMS @REMOTE@)
if(NOT url IN_LIST skip_url_list)
message(STATUS "Using src='${url}'")
+ @TLS_VERSION_CODE@
@TLS_VERIFY_CODE@
@TLS_CAINFO_CODE@
@NETRC_CODE@
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index 9bbeac0..3c01c2a 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -195,6 +195,12 @@ Commands
still be called if :variable:`FETCHCONTENT_TRY_FIND_PACKAGE_MODE` is
set to ``OPT_IN`` or is not set.
+ It would not normally be appropriate to specify ``REQUIRED`` as one of
+ the additional arguments after ``FIND_PACKAGE_ARGS``. Doing so would
+ mean the :command:`find_package` call must succeed, so none of the other
+ details specified in the ``FetchContent_Declare()`` call would get a
+ chance to be used as a fall-back.
+
Everything after the ``FIND_PACKAGE_ARGS`` keyword is appended to the
:command:`find_package` call, so all other ``<contentOptions>`` must
come before the ``FIND_PACKAGE_ARGS`` keyword. If the
@@ -373,6 +379,10 @@ Commands
:command:`FetchContent_Declare`, the ``EXCLUDE_FROM_ALL`` keyword will
be added to the :command:`add_subdirectory` command as well.
+ .. versionadded:: 3.29
+ :variable:`CMAKE_EXPORT_FIND_PACKAGE_NAME` is set to the dependency name
+ before calling :command:`add_subdirectory`.
+
Projects should aim to declare the details of all dependencies they might
use before they call ``FetchContent_MakeAvailable()`` for any of them.
This ensures that if any of the dependencies are also sub-dependencies of
@@ -675,6 +685,17 @@ A number of cache variables can influence the behavior where details from a
any content details, turning this option ``ON`` can significantly speed up
the configure stage. It is ``OFF`` by default.
+ .. note::
+
+ The ``FETCHCONTENT_FULLY_DISCONNECTED`` variable is not an appropriate way
+ to prevent any network access on the first run in a build directory.
+ Doing so can break projects, lead to misleading error messages, and hide
+ subtle population failures. This variable is specifically intended to
+ only be turned on *after* the first time CMake has been run.
+ If you want to prevent network access even on the first run, use a
+ :ref:`dependency provider <dependency_providers>` and populate the
+ dependency from local content instead.
+
.. variable:: FETCHCONTENT_UPDATES_DISCONNECTED
This is a less severe download/update control compared to
@@ -1194,10 +1215,10 @@ function(__FetchContent_declareDetails contentName)
set(propertyName "_FetchContent_${contentNameLower}_find_package_args")
define_property(GLOBAL PROPERTY ${propertyName})
if(NOT __sawQuietKeyword)
- list(INSERT __findPackageArgs 0 QUIET)
+ string(PREPEND __findPackageArgs "QUIET ")
endif()
if(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL AND NOT __sawGlobalKeyword)
- list(APPEND __findPackageArgs GLOBAL)
+ string(APPEND __findPackageArgs " GLOBAL")
endif()
cmake_language(EVAL CODE
"set_property(GLOBAL PROPERTY ${propertyName} ${__findPackageArgs})"
@@ -1596,6 +1617,20 @@ ExternalProject_Add_Step(${contentName}-populate copyfile
list(APPEND subCMakeOpts "-DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}")
endif()
+ # GreenHills needs to know about the compiler and toolset to run the
+ # subbuild commands. Be sure to update the similar section in
+ # ExternalProject.cmake:_ep_extract_configure_command()
+ if(CMAKE_GENERATOR MATCHES "Green Hills MULTI")
+ list(APPEND subCMakeOpts
+ "-DGHS_TARGET_PLATFORM:STRING=${GHS_TARGET_PLATFORM}"
+ "-DGHS_PRIMARY_TARGET:STRING=${GHS_PRIMARY_TARGET}"
+ "-DGHS_TOOLSET_ROOT:STRING=${GHS_TOOLSET_ROOT}"
+ "-DGHS_OS_ROOT:STRING=${GHS_OS_ROOT}"
+ "-DGHS_OS_DIR:STRING=${GHS_OS_DIR}"
+ "-DGHS_BSP_NAME:STRING=${GHS_BSP_NAME}"
+ )
+ endif()
+
# Override the sub-build's configuration types for multi-config generators.
# This ensures we are not affected by any custom setting from the project
# and can always request a known configuration further below.
@@ -1615,6 +1650,7 @@ ExternalProject_Add_Step(${contentName}-populate copyfile
set(__FETCHCONTENT_CACHED_INFO "")
set(__passthrough_vars
CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY
+ CMAKE_TLS_VERSION
CMAKE_TLS_VERIFY
CMAKE_TLS_CAINFO
CMAKE_NETRC
@@ -1930,6 +1966,15 @@ macro(FetchContent_MakeAvailable)
"Trying FETCHCONTENT_MAKEAVAILABLE_SERIAL dependency provider for "
"${__cmake_contentName}"
)
+
+ if(DEFINED CMAKE_EXPORT_FIND_PACKAGE_NAME)
+ list(APPEND __cmake_fcCurrentVarsStack "${CMAKE_EXPORT_FIND_PACKAGE_NAME}")
+ else()
+ # This just needs to be something that can't be a real package name
+ list(APPEND __cmake_fcCurrentVarsStack "<<::VAR_NOT_SET::>>")
+ endif()
+ set(CMAKE_EXPORT_FIND_PACKAGE_NAME "${__cmake_contentName}")
+
# It's still valid if there are no saved details. The project may have
# been written to assume a dependency provider is always set and will
# provide dependencies without having any declared details for them.
@@ -1947,12 +1992,12 @@ macro(FetchContent_MakeAvailable)
# This property might be defined but empty. As long as it is defined,
# find_package() can be called.
get_property(__cmake_addfpargs GLOBAL PROPERTY
- _FetchContent_${contentNameLower}_find_package_args
+ _FetchContent_${__cmake_contentNameLower}_find_package_args
DEFINED
)
if(__cmake_addfpargs)
get_property(__cmake_fpargs GLOBAL PROPERTY
- _FetchContent_${contentNameLower}_find_package_args
+ _FetchContent_${__cmake_contentNameLower}_find_package_args
)
string(APPEND __cmake_providerArgs " FIND_PACKAGE_ARGS")
foreach(__cmake_item IN LISTS __cmake_fpargs)
@@ -1975,7 +2020,11 @@ macro(FetchContent_MakeAvailable)
list(POP_BACK __cmake_fcCurrentVarsStack
__cmake_contentNameLower
__cmake_contentName
+ CMAKE_EXPORT_FIND_PACKAGE_NAME
)
+ if(CMAKE_EXPORT_FIND_PACKAGE_NAME STREQUAL "<<::VAR_NOT_SET::>>")
+ unset(CMAKE_EXPORT_FIND_PACKAGE_NAME)
+ endif()
unset(__cmake_fcProvider_${__cmake_contentNameLower})
unset(__cmake_providerArgs)
@@ -2053,6 +2102,14 @@ macro(FetchContent_MakeAvailable)
endif()
if(EXISTS ${__cmake_srcdir}/CMakeLists.txt)
+ if(DEFINED CMAKE_EXPORT_FIND_PACKAGE_NAME)
+ list(APPEND __cmake_fcCurrentVarsStack "${CMAKE_EXPORT_FIND_PACKAGE_NAME}")
+ else()
+ # This just needs to be something that can't be a real package name
+ list(APPEND __cmake_fcCurrentVarsStack "<<::VAR_NOT_SET::>>")
+ endif()
+ set(CMAKE_EXPORT_FIND_PACKAGE_NAME "${__cmake_contentName}")
+
set(__cmake_add_subdirectory_args ${__cmake_srcdir} ${${__cmake_contentNameLower}_BINARY_DIR})
if(__cmake_arg_EXCLUDE_FROM_ALL)
list(APPEND __cmake_add_subdirectory_args EXCLUDE_FROM_ALL)
@@ -2061,6 +2118,11 @@ macro(FetchContent_MakeAvailable)
list(APPEND __cmake_add_subdirectory_args SYSTEM)
endif()
add_subdirectory(${__cmake_add_subdirectory_args})
+
+ list(POP_BACK __cmake_fcCurrentVarsStack CMAKE_EXPORT_FIND_PACKAGE_NAME)
+ if(CMAKE_EXPORT_FIND_PACKAGE_NAME STREQUAL "<<::VAR_NOT_SET::>>")
+ unset(CMAKE_EXPORT_FIND_PACKAGE_NAME)
+ endif()
endif()
unset(__cmake_srcdir)
diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index 627866a..e332c14 100644
--- a/Modules/FindALSA.cmake
+++ b/Modules/FindALSA.cmake
@@ -43,6 +43,9 @@ The following cache variables may also be set:
the absolute path of the asound library
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
DOC "The ALSA (asound) include directory"
)
@@ -74,3 +77,5 @@ if(ALSA_FOUND)
endif()
mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY)
+
+cmake_policy(POP)
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
index f959356..8faa653 100644
--- a/Modules/FindArmadillo.cmake
+++ b/Modules/FindArmadillo.cmake
@@ -34,6 +34,9 @@ This module sets the following variables:
ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(ARMADILLO_INCLUDE_DIR
NAMES armadillo
PATHS "$ENV{ProgramFiles}/Armadillo/include"
@@ -133,3 +136,5 @@ unset(_ARMA_USE_ARPACK)
unset(_ARMA_USE_HDF5)
unset(_ARMA_CONFIG_CONTENTS)
unset(_ARMA_HEADER_CONTENTS)
+
+cmake_policy(POP)
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 39a1163..e9b118f 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -746,7 +746,11 @@ if(BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All")
set(_blas_openblas_lib "openblas")
if(_blas_sizeof_integer EQUAL 8)
- string(APPEND _blas_openblas_lib "64")
+ if(MINGW)
+ string(APPEND _blas_openblas_lib "_64")
+ else()
+ string(APPEND _blas_openblas_lib "64")
+ endif()
endif()
if(NOT BLAS_LIBRARIES)
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 326e700..4714dfc 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -55,6 +55,9 @@ The following variables are provided for backward compatibility:
Superseded by ``BZIP2_VERSION``.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
set(_BZIP2_PATHS PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Bzip2;InstallPath]"
)
@@ -120,3 +123,5 @@ if (BZIP2_FOUND)
endif ()
mark_as_advanced(BZIP2_INCLUDE_DIR)
+
+cmake_policy(POP)
diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake
index 46b62d2..4d3186c 100644
--- a/Modules/FindBacktrace.cmake
+++ b/Modules/FindBacktrace.cmake
@@ -36,6 +36,17 @@ with the contents like the following::
#endif
And then reference that generated header file in actual source.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.30
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``Backtrace::Backtrace``
+ An interface library providing usage requirements for the found components.
+
#]=======================================================================]
include(CMakePushCheckState)
@@ -89,3 +100,14 @@ set(Backtrace_HEADER "${_Backtrace_HEADER_TRY}" CACHE STRING "Header providing b
find_package_handle_standard_args(Backtrace FOUND_VAR Backtrace_FOUND REQUIRED_VARS ${_Backtrace_STD_ARGS})
mark_as_advanced(Backtrace_HEADER Backtrace_INCLUDE_DIR Backtrace_LIBRARY)
+
+if(Backtrace_FOUND AND NOT TARGET Backtrace::Backtrace)
+ if(Backtrace_LIBRARY)
+ add_library(Backtrace::Backtrace UNKNOWN IMPORTED)
+ set_property(TARGET Backtrace::Backtrace PROPERTY IMPORTED_LOCATION "${Backtrace_LIBRARY}")
+ else()
+ add_library(Backtrace::Backtrace INTERFACE IMPORTED)
+ target_link_libraries(Backtrace::Backtrace INTERFACE ${Backtrace_LIBRARIES})
+ endif()
+ target_include_directories(Backtrace::Backtrace INTERFACE ${Backtrace_INCLUDE_DIRS})
+endif()
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 248ea8b..df71350 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -387,6 +387,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
cmake_policy(SET CMP0102 NEW) # if mark_as_advanced(non_cache_var)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
function(_boost_get_existing_target component target_var)
set(names "${component}")
@@ -1394,7 +1395,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
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.85.0 AND NOT Boost_NO_WARN_NEW_VERSIONS)
+ if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.86.0 AND NOT Boost_NO_WARN_NEW_VERSIONS)
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
endif()
endif()
@@ -1669,7 +1670,7 @@ else()
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
# _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
- "1.84.0" "1.84"
+ "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/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 203a473..130b239 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -891,26 +891,29 @@ if(CMAKE_CROSSCOMPILING)
SET (CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT})
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
# Support for NVPACK
- set (CUDA_TOOLKIT_TARGET_NAME "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_NAME "armv7-linux-gnueabihf")
+ 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")
- set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi")
+ set(CUDA_TOOLKIT_TARGET_NAMES "aarch64-linux-androideabi")
elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- set(CUDA_TOOLKIT_TARGET_NAME "aarch64-qnx")
+ set(CUDA_TOOLKIT_TARGET_NAMES "aarch64-qnx")
else()
- set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux")
+ set(CUDA_TOOLKIT_TARGET_NAMES "aarch64-linux" "sbsa-linux")
endif (ANDROID_ARCH_NAME STREQUAL "arm64")
endif()
- if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}")
- set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.")
- SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT})
- mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR)
- endif()
+ foreach(CUDA_TOOLKIT_TARGET_NAME IN LISTS CUDA_TOOLKIT_TARGET_NAMES)
+ if (EXISTS "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}")
+ set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT}/targets/${CUDA_TOOLKIT_TARGET_NAME}" CACHE PATH "CUDA Toolkit target location.")
+ SET (CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT} CACHE PATH "Toolkit location." FORCE)
+ mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR)
+ break()
+ endif()
+ endforeach()
# add known CUDA targetr root path to the set of directories we search for programs, libraries and headers
set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}")
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 6b8b08e..44d09f5 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -123,6 +123,8 @@ of the following libraries that are part of the CUDAToolkit:
- :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>`
@@ -158,7 +160,7 @@ Targets Created:
cuBLAS
""""""
-The `cuBLAS <https://docs.nvidia.com/cuda/cublas/index.html>`_ library.
+The `cuBLAS <https://docs.nvidia.com/cuda/cublas>`_ library.
Targets Created:
@@ -174,7 +176,7 @@ cuDLA
.. versionadded:: 3.27
-The NVIDIA Tegra Deep Learning Accelerator `cuDLA <https://docs.nvidia.com/cuda/cublas/index.html>`_ library.
+The NVIDIA Tegra Deep Learning Accelerator `cuDLA <https://docs.nvidia.com/cuda/cublas>`_ library.
Targets Created:
@@ -187,7 +189,7 @@ cuFile
.. versionadded:: 3.25
-The NVIDIA GPUDirect Storage `cuFile <https://docs.nvidia.com/gpudirect-storage/api-reference-guide/index.html>`_ library.
+The NVIDIA GPUDirect Storage `cuFile <https://docs.nvidia.com/gpudirect-storage/api-reference-guide>`_ library.
Targets Created:
@@ -201,7 +203,7 @@ Targets Created:
cuFFT
"""""
-The `cuFFT <https://docs.nvidia.com/cuda/cufft/index.html>`_ library.
+The `cuFFT <https://docs.nvidia.com/cuda/cufft>`_ library.
Targets Created:
@@ -214,7 +216,7 @@ Targets Created:
cuRAND
""""""
-The `cuRAND <https://docs.nvidia.com/cuda/curand/index.html>`_ library.
+The `cuRAND <https://docs.nvidia.com/cuda/curand>`_ library.
Targets Created:
@@ -226,7 +228,7 @@ Targets Created:
cuSOLVER
""""""""
-The `cuSOLVER <https://docs.nvidia.com/cuda/cusolver/index.html>`_ library.
+The `cuSOLVER <https://docs.nvidia.com/cuda/cusolver>`_ library.
Targets Created:
@@ -238,7 +240,7 @@ Targets Created:
cuSPARSE
""""""""
-The `cuSPARSE <https://docs.nvidia.com/cuda/cusparse/index.html>`_ library.
+The `cuSPARSE <https://docs.nvidia.com/cuda/cusparse>`_ library.
Targets Created:
@@ -269,7 +271,7 @@ Targets Created:
NPP
"""
-The `NPP <https://docs.nvidia.com/cuda/npp/index.html>`_ libraries.
+The `NPP <https://docs.nvidia.com/cuda/npp>`_ libraries.
Targets Created:
@@ -339,7 +341,7 @@ Targets Created:
nvBLAS
""""""
-The `nvBLAS <https://docs.nvidia.com/cuda/nvblas/index.html>`_ libraries.
+The `nvBLAS <https://docs.nvidia.com/cuda/nvblas>`_ libraries.
This is a shared library only.
Targets Created:
@@ -365,7 +367,7 @@ Targets Created:
nvJPEG
""""""
-The `nvJPEG <https://docs.nvidia.com/cuda/nvjpeg/index.html>`_ library.
+The `nvJPEG <https://docs.nvidia.com/cuda/nvjpeg>`_ library.
Introduced in CUDA 10.
Targets Created:
@@ -380,7 +382,7 @@ nvPTX Compiler
.. versionadded:: 3.25
-The `nvPTX <https://docs.nvidia.com/cuda/ptx-compiler-api/index.html>`_ (PTX Compilation) library.
+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.
Introduced in CUDA 11.1
This is a static library only.
@@ -394,7 +396,7 @@ Targets Created:
nvRTC
"""""
-The `nvRTC <https://docs.nvidia.com/cuda/nvrtc/index.html>`_ (Runtime Compilation) library.
+The `nvRTC <https://docs.nvidia.com/cuda/nvrtc>`_ (Runtime Compilation) library.
Targets Created:
@@ -418,12 +420,26 @@ Targets Created:
- ``CUDA::nvJitLink`` starting in CUDA 12.0
- ``CUDA::nvJitLink_static`` starting in CUDA 12.0
+.. _`cuda_toolkit_nvfatbin`:
+
+nvFatBin
+"""""""""
+
+.. versionadded:: 3.30
+
+The `nvFatBin <https://docs.nvidia.com/cuda/>`_ (Runtime fatbin creation) library.
+
+Targets Created:
+
+- ``CUDA::nvfatbin`` starting in CUDA 12.4
+- ``CUDA::nvfatbin_static`` starting in CUDA 12.4
+
.. _`cuda_toolkit_nvml`:
nvidia-ML
"""""""""
-The `NVIDIA Management Library <https://developer.nvidia.com/nvidia-management-library-nvml>`_.
+The `NVIDIA Management Library <https://developer.nvidia.com/management-library-nvml>`_.
This is a shared library only.
Targets Created:
@@ -451,7 +467,7 @@ nvtx3
.. versionadded:: 3.25
-The header-only `NVIDIA Tools Extension Library <https://nvidia.github.io/NVTX/doxygen/index.html>`_.
+The header-only `NVIDIA Tools Extension Library <https://nvidia.github.io/NVTX/doxygen>`_.
Introduced in CUDA 10.0.
Targets created:
@@ -1100,7 +1116,10 @@ if(CUDAToolkit_FOUND)
if(CUDA_${lib_name}_LIBRARY MATCHES "/stubs/" AND NOT WIN32)
# Use a SHARED library with IMPORTED_IMPLIB, but not IMPORTED_LOCATION,
# to indicate that the stub is for linkers but not dynamic loaders.
- # It will not contribute any RPATH entry.
+ # It will not contribute any RPATH entry. When encountered as
+ # a private transitive dependency of another shared library,
+ # it will be passed explicitly to linkers so they can find it
+ # even when the runtime library file does not exist on disk.
set(CUDA_IMPORT_PROPERTY IMPORTED_IMPLIB)
set(CUDA_IMPORT_TYPE SHARED)
endif()
@@ -1134,9 +1153,6 @@ if(CUDAToolkit_FOUND)
target_link_directories(CUDA::toolkit INTERFACE "${CUDAToolkit_LIBRARY_DIR}")
endif()
- _CUDAToolkit_find_and_add_import_lib(cuda_driver ALT cuda)
-
-
# setup dependencies that are required for cudart/cudart_static when building
# on linux. These are generally only required when using the CUDA toolkit
# when CUDA language is disabled
@@ -1159,6 +1175,7 @@ if(CUDAToolkit_FOUND)
endif()
endif()
+ _CUDAToolkit_find_and_add_import_lib(cuda_driver ALT cuda DEPS cudart_static_deps)
_CUDAToolkit_find_and_add_import_lib(cudart DEPS cudart_static_deps)
_CUDAToolkit_find_and_add_import_lib(cudart_static DEPS cudart_static_deps)
@@ -1167,6 +1184,11 @@ if(CUDAToolkit_FOUND)
_CUDAToolkit_find_and_add_import_lib(nvJitLink_static DEPS cudart_static_deps)
endif()
+ if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.4.0)
+ _CUDAToolkit_find_and_add_import_lib(nvfatbin DEPS cudart_static_deps)
+ _CUDAToolkit_find_and_add_import_lib(nvfatbin_static DEPS cudart_static_deps)
+ endif()
+
_CUDAToolkit_find_and_add_import_lib(culibos) # it's a static library
foreach (cuda_lib cublasLt cufft nvjpeg)
_CUDAToolkit_find_and_add_import_lib(${cuda_lib})
@@ -1182,7 +1204,7 @@ if(CUDAToolkit_FOUND)
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.0.0)
# cublas depends on cublasLt
- # https://docs.nvidia.com/cuda/archive/11.0/cublas/index.html#static-library
+ # https://docs.nvidia.com/cuda/archive/11.0/cublas#static-library
_CUDAToolkit_find_and_add_import_lib(cublas DEPS cublasLt culibos)
_CUDAToolkit_find_and_add_import_lib(cublas_static DEPS cublasLt_static culibos)
else()
@@ -1215,14 +1237,14 @@ if(CUDAToolkit_FOUND)
set(cusolver_static_deps cublas_static cusparse_static culibos)
if(CUDAToolkit_VERSION VERSION_GREATER 11.2.1)
# cusolver depends on libcusolver_metis and cublasLt
- # https://docs.nvidia.com/cuda/archive/11.2.2/cusolver/index.html#link-dependency
+ # https://docs.nvidia.com/cuda/archive/11.2.2/cusolver#link-dependency
list(APPEND cusolver_deps cublasLt)
_CUDAToolkit_find_and_add_import_lib(cusolver_metis_static ALT metis_static) # implementation detail static lib
list(APPEND cusolver_static_deps cusolver_metis_static cublasLt_static)
endif()
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.1.2)
# cusolver depends on liblapack_static.a starting with CUDA 10.1 update 2,
- # https://docs.nvidia.com/cuda/archive/11.5.0/cusolver/index.html#static-link-lapack
+ # https://docs.nvidia.com/cuda/archive/11.5.0/cusolver#static-link-lapack
_CUDAToolkit_find_and_add_import_lib(cusolver_lapack_static ALT lapack_static) # implementation detail static lib
list(APPEND cusolver_static_deps cusolver_lapack_static)
endif()
@@ -1280,17 +1302,17 @@ if(CUDAToolkit_FOUND)
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.1.0)
if(NOT TARGET CUDA::nvptxcompiler_static)
- _CUDAToolkit_find_and_add_import_lib(nvptxcompiler_static DEPS cuda_driver)
+ _CUDAToolkit_find_and_add_import_lib(nvptxcompiler_static)
if(TARGET CUDA::nvptxcompiler_static)
target_link_libraries(CUDA::nvptxcompiler_static INTERFACE CUDA::cudart_static_deps)
endif()
endif()
endif()
- _CUDAToolkit_find_and_add_import_lib(nvrtc_builtins ALT nvrtc-builtins DEPS cuda_driver)
+ _CUDAToolkit_find_and_add_import_lib(nvrtc_builtins ALT nvrtc-builtins)
_CUDAToolkit_find_and_add_import_lib(nvrtc DEPS nvrtc_builtins nvJitLink)
if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.5.0)
- _CUDAToolkit_find_and_add_import_lib(nvrtc_builtins_static ALT nvrtc-builtins_static DEPS cuda_driver)
+ _CUDAToolkit_find_and_add_import_lib(nvrtc_builtins_static ALT nvrtc-builtins_static)
if(NOT TARGET CUDA::nvrtc_static)
_CUDAToolkit_find_and_add_import_lib(nvrtc_static DEPS nvrtc_builtins_static nvptxcompiler_static nvJitLink_static)
if(TARGET CUDA::nvrtc_static AND WIN32 AND NOT (BORLAND OR MINGW OR CYGWIN))
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index 2f33dac..5ce8a90 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -72,6 +72,9 @@ Hints
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
if(NOT CURL_NO_CURL_CMAKE)
@@ -86,6 +89,8 @@ if(NOT CURL_NO_CURL_CMAKE)
find_package_handle_standard_args(CURL HANDLE_COMPONENTS CONFIG_MODE)
# The upstream curl package sets CURL_VERSION, not CURL_VERSION_STRING.
set(CURL_VERSION_STRING "${CURL_VERSION}")
+
+ cmake_policy(POP)
return()
endif()
endif()
@@ -94,8 +99,10 @@ find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_CURL QUIET libcurl)
if(PC_CURL_FOUND)
- pkg_get_variable(CURL_SUPPORTED_PROTOCOLS libcurl supported_protocols)
- pkg_get_variable(CURL_SUPPORTED_FEATURES libcurl supported_features)
+ pkg_get_variable(CURL_SUPPORTED_PROTOCOLS_STRING libcurl supported_protocols)
+ string(REPLACE " " ";" CURL_SUPPORTED_PROTOCOLS "${CURL_SUPPORTED_PROTOCOLS_STRING}")
+ pkg_get_variable(CURL_SUPPORTED_FEATURES_STRING libcurl supported_features)
+ string(REPLACE " " ";" CURL_SUPPORTED_FEATURES "${CURL_SUPPORTED_FEATURES_STRING}")
endif()
endif()
@@ -115,6 +122,8 @@ if(NOT CURL_LIBRARY)
curllib_static
# Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
libcurl
+ # Some Windows prebuilt versions distribute `libcurl_a.lib` instead of `libcurl.lib`
+ libcurl_a
NAMES_PER_DIR
HINTS ${PC_CURL_LIBRARY_DIRS}
)
@@ -237,3 +246,5 @@ if(CURL_FOUND)
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake
index cf0d341..ceed009 100644
--- a/Modules/FindCups.cmake
+++ b/Modules/FindCups.cmake
@@ -41,6 +41,9 @@ The following cache variables may also be set:
the directory containing the Cups headers
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(CUPS_INCLUDE_DIR cups/cups.h )
find_library(CUPS_LIBRARIES NAMES cups )
@@ -98,3 +101,5 @@ if (CUPS_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${CUPS_INCLUDE_DIR}")
endif ()
endif ()
+
+cmake_policy(POP)
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index 714927f..a3283fa 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -10,7 +10,7 @@ Find CxxTest unit testing framework.
Find the `CxxTest`_ suite and declare a helper macro for creating
unit tests and integrating them with CTest.
-.. _`CxxTest`: https://github.com/CxxTest/cxxtest#readme
+.. _`CxxTest`: https://github.com/CxxTest/cxxtest
Input Variables
^^^^^^^^^^^^^^^
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 762931e..398a415 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -41,6 +41,9 @@ Hints
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_package(PkgConfig QUIET)
pkg_check_modules(PC_EXPAT QUIET expat)
@@ -156,3 +159,5 @@ if(EXPAT_FOUND)
endif()
mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
+
+cmake_policy(POP)
diff --git a/Modules/FindFontconfig.cmake b/Modules/FindFontconfig.cmake
index 5228831..9cce952 100644
--- a/Modules/FindFontconfig.cmake
+++ b/Modules/FindFontconfig.cmake
@@ -34,6 +34,8 @@ This will define the following variables in your project:
#]=======================================================================]
+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
@@ -101,3 +103,5 @@ if(Fontconfig_FOUND)
set(Fontconfig_LIBRARIES ${Fontconfig_LIBRARY})
set(Fontconfig_INCLUDE_DIRS ${Fontconfig_INCLUDE_DIR})
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index 82885cb..6d0ed68 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -47,6 +47,9 @@ The user may set the environment variable ``FREETYPE_DIR`` to the root
directory of a Freetype installation.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
# Created by Eric Wing.
# Modifications by Alexander Neundorf.
# This file has been renamed to "FindFreetype.cmake" instead of the correct
@@ -202,3 +205,5 @@ if(Freetype_FOUND)
endif()
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake
index e6eac30..a9c5740 100644
--- a/Modules/FindGDAL.cmake
+++ b/Modules/FindGDAL.cmake
@@ -72,6 +72,9 @@ The following variables may be set to modify the search strategy:
#
#include "gdal.h"
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(GDAL_INCLUDE_DIR gdal.h
HINTS
ENV GDAL_DIR
@@ -197,3 +200,5 @@ if (GDAL_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${GDAL_INCLUDE_DIR}")
endif ()
endif ()
+
+cmake_policy(POP)
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index cea9cd8..9a11b88 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -46,6 +46,9 @@ Hints
``./configure --prefix=$GIF_DIR``.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
# Created by Eric Wing.
# Modifications by Alexander Neundorf, Ben Campbell
@@ -126,3 +129,5 @@ if(GIF_FOUND)
endif()
mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY)
+
+cmake_policy(POP)
diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake
index dff53e1..f6b7b1a 100644
--- a/Modules/FindGLEW.cmake
+++ b/Modules/FindGLEW.cmake
@@ -223,7 +223,10 @@ endif()
# Read version from GL/glew.h file
if(EXISTS "${GLEW_INCLUDE_DIR}/GL/glew.h")
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS "${GLEW_INCLUDE_DIR}/GL/glew.h" _contents REGEX "^VERSION_.+ [0-9]+")
+ cmake_policy(POP)
if(_contents)
string(REGEX REPLACE ".*VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" GLEW_VERSION_MAJOR "${_contents}")
string(REGEX REPLACE ".*VERSION_MINOR[ \t]+([0-9]+).*" "\\1" GLEW_VERSION_MINOR "${_contents}")
diff --git a/Modules/FindGSL.cmake b/Modules/FindGSL.cmake
index 1943847..e9d8109 100644
--- a/Modules/FindGSL.cmake
+++ b/Modules/FindGSL.cmake
@@ -59,6 +59,9 @@ help this module find the correct files::
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
#=============================================================================
@@ -229,3 +232,5 @@ if( GSL_FOUND AND NOT TARGET GSL::gsl )
INTERFACE_LINK_LIBRARIES GSL::gslcblas )
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 4634876..f91d2fd 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -175,7 +175,10 @@ Use the results:
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
function(_GTK2_GET_VERSION _OUT_major _OUT_minor _OUT_micro _gtkversion_hdr)
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS ${_gtkversion_hdr} _contents REGEX "#define GTK_M[A-Z]+_VERSION[ \t]+")
+ cmake_policy(POP)
if(_contents)
string(REGEX REPLACE ".*#define GTK_MAJOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_major} "${_contents}")
string(REGEX REPLACE ".*#define GTK_MINOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_minor} "${_contents}")
@@ -211,7 +214,10 @@ endfunction()
#=============================================================
function(_GTK2_SIGCXX_GET_VERSION _OUT_major _OUT_minor _OUT_micro _sigcxxversion_hdr)
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS ${_sigcxxversion_hdr} _contents REGEX "#define SIGCXX_M[A-Z]+_VERSION[ \t]+")
+ cmake_policy(POP)
if(_contents)
string(REGEX REPLACE ".*#define SIGCXX_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" ${_OUT_major} "${_contents}")
string(REGEX REPLACE ".*#define SIGCXX_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" ${_OUT_minor} "${_contents}")
@@ -300,6 +306,10 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
endif()
find_path(GTK2_${_var}_INCLUDE_DIR ${_hdr}
PATHS
+ ${PC_GLIB2_INCLUDEDIR}
+ ${PC_GLIB2_LIBDIR}
+ ${PC_GTK2_INCLUDEDIR}
+ ${PC_GTK2_LIBDIR}
${_gtk2_arch_dir}
/usr/local/libx32
/usr/local/lib64
@@ -610,6 +620,23 @@ if(NOT GTK2_FIND_COMPONENTS)
set(GTK2_FIND_COMPONENTS gtk)
endif()
+# Retrieve LIBDIR from the GTK2 and GLIB2 pkg-config files, which are
+# used to compute the arch-specific include prefixes. While at it,
+# also retrieve their INCLUDEDIR, to accommodate non-standard layouts.
+find_package(PkgConfig QUIET)
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules(PC_GTK2 QUIET gtk+-2.0)
+ if(PC_GTK2_FOUND)
+ pkg_get_variable(PC_GTK2_INCLUDEDIR gtk+-2.0 includedir)
+ pkg_get_variable(PC_GTK2_LIBDIR gtk+-2.0 libdir)
+ endif()
+ pkg_check_modules(PC_GLIB2 QUIET glib-2.0)
+ if(PC_GLIB2_FOUND)
+ pkg_get_variable(PC_GLIB2_INCLUDEDIR glib-2.0 includedir)
+ pkg_get_variable(PC_GLIB2_LIBDIR glib-2.0 libdir)
+ endif()
+endif()
+
#
# If specified, enforce version number
#
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index 92334e4..c2128a9 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -125,7 +125,10 @@ macro(__gtest_determine_windows_library_type _var)
if(EXISTS "${${_var}}")
file(TO_NATIVE_PATH "${${_var}}" _lib_path)
get_filename_component(_name "${${_var}}" NAME_WE)
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS "${${_var}}" _match REGEX "${_name}\\.dll" LIMIT_COUNT 1)
+ cmake_policy(POP)
if(NOT _match STREQUAL "")
set(${_var}_TYPE SHARED PARENT_SCOPE)
else()
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index a44c6f9..bd21e3d 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -157,6 +157,9 @@ The following variables can be set to guide the search for HDF5 libraries and in
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
# We haven't found HDF5 yet. Clear its state in case it is set in the parent
# scope somewhere else. We can't rely on it because different components may
# have been requested for this call.
@@ -987,7 +990,7 @@ if( NOT HDF5_FOUND )
HDF5_VERSION_DEFINE
REGEX "^[ \t]*#[ \t]*define[ \t]+H5_VERSION[ \t]+" )
if( "${HDF5_VERSION_DEFINE}" MATCHES
- "H5_VERSION[ \t]+\"([0-9]+\\.[0-9]+\\.[0-9]+)(-patch([0-9]+))?\"" )
+ "H5_VERSION[ \t]+\"([0-9\\.]+)(-patch([0-9]+))?\"" )
set( HDF5_VERSION "${CMAKE_MATCH_1}" )
if( CMAKE_MATCH_3 )
set( HDF5_VERSION ${HDF5_VERSION}.${CMAKE_MATCH_3})
@@ -1243,3 +1246,5 @@ if (HDF5_FIND_DEBUG)
endif()
unset(_lang)
unset(_HDF5_NEED_TO_SEARCH)
+
+cmake_policy(POP)
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index 9724d2c..ca09444 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -25,6 +25,9 @@ Once done this will define
HSPELL_MINOR_VERSION - The minor version of Hspell
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(HSPELL_INCLUDE_DIR hspell.h)
find_library(HSPELL_LIBRARIES NAMES hspell)
@@ -43,3 +46,5 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL
VERSION_VAR HSPELL_VERSION_STRING)
mark_as_advanced(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)
+
+cmake_policy(POP)
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index b4f4d71..63c2576 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -24,10 +24,10 @@ platform-specific library name will be automatically selected.
This module reports information about the ICU installation in
several variables. General variables::
- ICU_VERSION - ICU release version
ICU_FOUND - true if the main programs and libraries were found
- ICU_LIBRARIES - component libraries to be linked
ICU_INCLUDE_DIRS - the directories containing the ICU headers
+ ICU_LIBRARIES - component libraries to be linked
+ ICU_VERSION - ICU release version
Imported targets::
@@ -83,12 +83,10 @@ The following cache variables may also be set::
In most cases none of the above variables will require setting,
unless multiple ICU versions are available and a specific version
is required.
-
-Other variables one may set to control this module are::
-
- ICU_DEBUG - Set to ON to enable debug output from FindICU.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
# Written by Roger Leigh <rleigh@codelibre.net>
set(icu_programs
@@ -136,6 +134,7 @@ function(_ICU_FIND)
HINTS ${icu_roots}
PATH_SUFFIXES ${icu_include_suffixes}
DOC "ICU include directory")
+ mark_as_advanced(ICU_INCLUDE_DIR)
set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
# Get version
@@ -178,7 +177,6 @@ function(_ICU_FIND)
# Find all ICU libraries
list(APPEND icu_library_suffixes "${_lib64}" "lib")
- set(ICU_REQUIRED_LIBS_FOUND ON)
set(static_prefix )
# static icu libraries compiled with MSVC have the prefix 's'
if(MSVC)
@@ -189,8 +187,9 @@ function(_ICU_FIND)
set(component_cache "ICU_${component_upcase}_LIBRARY")
set(component_cache_release "${component_cache}_RELEASE")
set(component_cache_debug "${component_cache}_DEBUG")
- set(component_found "ICU_${component_upcase}_FOUND")
+ set(component_found "ICU_${component}_FOUND")
set(component_found_compat "${component_upcase}_FOUND")
+ set(component_found_compat2 "ICU_${component_upcase}_FOUND")
set(component_libnames "icu${component}")
set(component_debug_libnames "icu${component}d")
@@ -253,27 +252,17 @@ function(_ICU_FIND)
if(${component_cache})
set("${component_found}" ON)
set("${component_found_compat}" ON)
+ set("${component_found_compat2}" ON)
list(APPEND ICU_LIBRARY "${${component_cache}}")
- if (ICU_FIND_REQUIRED_${component})
- list(APPEND ICU_LIBS_FOUND "${component} (required): ${${component_cache}}")
- else()
- list(APPEND ICU_LIBS_FOUND "${component} (optional): ${${component_cache}}")
- endif()
- else()
- if (ICU_FIND_REQUIRED_${component})
- set(ICU_REQUIRED_LIBS_FOUND OFF)
- list(APPEND ICU_LIBS_NOTFOUND "${component} (required)")
- else()
- list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
- endif()
endif()
mark_as_advanced("${component_found}")
mark_as_advanced("${component_found_compat}")
+ mark_as_advanced("${component_found_compat2}")
set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
set("${component_found}" "${${component_found}}" PARENT_SCOPE)
set("${component_found_compat}" "${${component_found_compat}}" PARENT_SCOPE)
+ set("${component_found_compat2}" "${${component_found_compat2}}" PARENT_SCOPE)
endforeach()
- set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
# Find all ICU data files
@@ -302,43 +291,21 @@ function(_ICU_FIND)
mark_as_advanced("${cache_var}")
set("${data_var}" "${${cache_var}}" PARENT_SCOPE)
endforeach()
-
- if(NOT ICU_FIND_QUIETLY)
- if(ICU_LIBS_FOUND)
- message(STATUS "Found the following ICU libraries:")
- foreach(found ${ICU_LIBS_FOUND})
- message(STATUS " ${found}")
- endforeach()
- endif()
- if(ICU_LIBS_NOTFOUND)
- message(STATUS "The following ICU libraries were not found:")
- foreach(notfound ${ICU_LIBS_NOTFOUND})
- message(STATUS " ${notfound}")
- endforeach()
- endif()
- endif()
-
- if(ICU_DEBUG)
- message(STATUS "--------FindICU.cmake search debug--------")
- message(STATUS "ICU binary path search order: ${icu_roots}")
- message(STATUS "ICU include path search order: ${icu_roots}")
- message(STATUS "ICU library path search order: ${icu_roots}")
- message(STATUS "----------------")
- endif()
endfunction()
_ICU_FIND()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ICU
- FOUND_VAR ICU_FOUND
- REQUIRED_VARS ICU_INCLUDE_DIR
- ICU_LIBRARY
- _ICU_REQUIRED_LIBS_FOUND
- VERSION_VAR ICU_VERSION
- FAIL_MESSAGE "Failed to find all ICU components")
-
-unset(_ICU_REQUIRED_LIBS_FOUND)
+find_package_handle_standard_args(ICU
+ REQUIRED_VARS
+ ICU_INCLUDE_DIR
+ ICU_LIBRARY
+ VERSION_VAR
+ ICU_VERSION
+ HANDLE_COMPONENTS
+ FAIL_MESSAGE
+ "Failed to find all ICU components"
+)
if(ICU_FOUND)
set(ICU_INCLUDE_DIRS "${ICU_INCLUDE_DIR}")
@@ -392,45 +359,5 @@ if(ICU_FOUND)
endforeach()
endif()
-if(ICU_DEBUG)
- message(STATUS "--------FindICU.cmake results debug--------")
- message(STATUS "ICU found: ${ICU_FOUND}")
- message(STATUS "ICU_VERSION number: ${ICU_VERSION}")
- message(STATUS "ICU_ROOT directory: ${ICU_ROOT}")
- message(STATUS "ICU_INCLUDE_DIR directory: ${ICU_INCLUDE_DIR}")
- message(STATUS "ICU_LIBRARIES: ${ICU_LIBRARIES}")
-
- foreach(program IN LISTS icu_programs)
- string(TOUPPER "${program}" program_upcase)
- set(program_lib "ICU_${program_upcase}_EXECUTABLE")
- message(STATUS "${program} program: ${program_lib}=${${program_lib}}")
- unset(program_upcase)
- unset(program_lib)
- endforeach()
-
- foreach(data IN LISTS icu_data)
- string(TOUPPER "${data}" data_upcase)
- string(REPLACE "." "_" data_upcase "${data_upcase}")
- set(data_lib "ICU_${data_upcase}")
- message(STATUS "${data} data: ${data_lib}=${${data_lib}}")
- unset(data_upcase)
- unset(data_lib)
- endforeach()
-
- foreach(component IN LISTS ICU_FIND_COMPONENTS)
- string(TOUPPER "${component}" component_upcase)
- set(component_lib "ICU_${component_upcase}_LIBRARIES")
- set(component_found "ICU_${component_upcase}_FOUND")
- set(component_found_compat "${component_upcase}_FOUND")
- message(STATUS "${component} library found: ${component_found}=${${component_found}}")
- message(STATUS "${component} library found (compat name): ${component_found_compat}=${${component_found_compat}}")
- message(STATUS "${component} library: ${component_lib}=${${component_lib}}")
- unset(component_upcase)
- unset(component_lib)
- unset(component_found)
- unset(component_found_compat)
- endforeach()
- message(STATUS "----------------")
-endif()
-
unset(icu_programs)
+cmake_policy(POP)
diff --git a/Modules/FindIconv.cmake b/Modules/FindIconv.cmake
index 566330f..879ff16f 100644
--- a/Modules/FindIconv.cmake
+++ b/Modules/FindIconv.cmake
@@ -75,6 +75,9 @@ The following cache variables may also be set:
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
if(CMAKE_C_COMPILER_LOADED)
include(${CMAKE_CURRENT_LIST_DIR}/CheckCSourceCompiles.cmake)
@@ -101,7 +104,7 @@ if(NOT DEFINED Iconv_IS_BUILT_IN)
"
#include <stddef.h>
#include <iconv.h>
- int main() {
+ int main(void) {
char *a, *b;
size_t i, j;
iconv_t ic;
@@ -180,3 +183,5 @@ if(Iconv_FOUND)
set_property(TARGET Iconv::Iconv PROPERTY INTERFACE_LINK_LIBRARIES "${Iconv_LIBRARIES}")
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindIntl.cmake b/Modules/FindIntl.cmake
index 95eeabd..04f5a23 100644
--- a/Modules/FindIntl.cmake
+++ b/Modules/FindIntl.cmake
@@ -82,6 +82,9 @@ The following cache variables may also be set:
``msgfmt``, etc.), use :module:`FindGettext`.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
if(CMAKE_C_COMPILER_LOADED)
include(${CMAKE_CURRENT_LIST_DIR}/CheckCSourceCompiles.cmake)
@@ -181,3 +184,5 @@ if(Intl_FOUND)
INTERFACE_LINK_LIBRARIES "${Intl_LIBRARIES}")
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index 3f243de..08a0bd3 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -56,6 +56,9 @@ Obsolete variables
where to find the JPEG library.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(JPEG_INCLUDE_DIR jpeglib.h)
set(jpeg_names ${JPEG_NAMES} jpeg jpeg-static libjpeg libjpeg-static)
@@ -140,3 +143,5 @@ if(JPEG_FOUND)
endif()
mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR)
+
+cmake_policy(POP)
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index 9a62669..79afcd5 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -42,6 +42,9 @@ The following cache variables may also be set:
where to find the Jasper library (debug).
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(JASPER_INCLUDE_DIR jasper/jasper.h)
mark_as_advanced(JASPER_INCLUDE_DIR)
@@ -74,17 +77,19 @@ if(JASPER_FOUND)
endif()
if(EXISTS "${JASPER_LIBRARY_RELEASE}")
set_property(TARGET Jasper::Jasper APPEND PROPERTY
- IMPORTED CONFIGURATION RELEASE)
+ IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Jasper::Jasper PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
IMPORTED_LOCATION "${JASPER_LIBRARY_RELEASE}")
endif()
if(EXISTS "${JASPER_LIBRARY_DEBUG}")
set_property(TARGET Jasper::Jasper APPEND PROPERTY
- IMPORTED CONFIGURATION DEBUG)
+ IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Jasper::Jasper PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
IMPORTED_LOCATION "${JASPER_LIBRARY_DEBUG}")
endif()
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 4d3ab5a..e142516 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -487,7 +487,11 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
set(_lapack_openblas_lib "openblas")
if(_lapack_sizeof_integer EQUAL 8)
- string(APPEND _lapack_openblas_lib "64")
+ if(MINGW)
+ string(APPEND _lapack_openblas_lib "_64")
+ else()
+ string(APPEND _lapack_openblas_lib "64")
+ endif()
endif()
check_lapack_libraries(
diff --git a/Modules/FindLTTngUST.cmake b/Modules/FindLTTngUST.cmake
index eaace4f..34b2e82 100644
--- a/Modules/FindLTTngUST.cmake
+++ b/Modules/FindLTTngUST.cmake
@@ -37,6 +37,9 @@ This module sets the following
``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(LTTNGUST_INCLUDE_DIRS NAMES lttng/tracepoint.h)
find_library(LTTNGUST_LIBRARIES NAMES lttng-ust)
@@ -100,3 +103,5 @@ find_package_handle_standard_args(LTTngUST FOUND_VAR LTTNGUST_FOUND
LTTNGUST_INCLUDE_DIRS
VERSION_VAR LTTNGUST_VERSION_STRING)
mark_as_advanced(LTTNGUST_LIBRARIES LTTNGUST_INCLUDE_DIRS)
+
+cmake_policy(POP)
diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
index 9d3ac13..38a43db 100644
--- a/Modules/FindLibArchive.cmake
+++ b/Modules/FindLibArchive.cmake
@@ -31,6 +31,9 @@ The module defines the following ``IMPORTED`` targets:
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(LibArchive_INCLUDE_DIR
NAMES archive.h
PATHS
@@ -81,3 +84,5 @@ if(LibArchive_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${LibArchive_INCLUDE_DIR}")
endif ()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index 1b3929b..7b0c530 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -58,6 +58,9 @@ The following variables are provided for backward compatibility:
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(LIBLZMA_INCLUDE_DIR lzma.h )
if(NOT LIBLZMA_LIBRARY)
find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma NAMES_PER_DIR PATH_SUFFIXES lib)
@@ -140,3 +143,5 @@ if (LIBLZMA_FOUND)
endif()
endif()
endif ()
+
+cmake_policy(POP)
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index ce28d03..1c5f9be 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -52,6 +52,9 @@ The following cache variables may also be set:
path to the LibXml2 library
#]=======================================================================]
+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
find_package(PkgConfig QUIET)
@@ -122,3 +125,5 @@ if(LIBXML2_XMLLINT_EXECUTABLE AND NOT TARGET LibXml2::xmllint)
add_executable(LibXml2::xmllint IMPORTED)
set_target_properties(LibXml2::xmllint PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLLINT_EXECUTABLE}")
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index a9920ee..1154ae1 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -45,6 +45,9 @@ for using xslt):
Contains the full path to the xsltproc executable if found.
#]=======================================================================]
+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
find_package(PkgConfig QUIET)
@@ -133,3 +136,5 @@ if(LIBXSLT_XSLTPROC_EXECUTABLE AND NOT TARGET LibXslt::xsltproc)
add_executable(LibXslt::xsltproc IMPORTED)
set_target_properties(LibXslt::xsltproc PROPERTIES IMPORTED_LOCATION "${LIBXSLT_XSLTPROC_EXECUTABLE}")
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index b56a7b1..b4106c4 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -45,6 +45,7 @@ locations other than lua/
cmake_policy(PUSH) # Policies apply to functions at definition-time
cmake_policy(SET CMP0012 NEW) # For while(TRUE)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
unset(_lua_include_subdirs)
unset(_lua_library_names)
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index 405a7a7..2249ab1 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -26,6 +26,9 @@ This is because, the lua location is not standardized and may exist in
locations other than lua/
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(LUA_INCLUDE_DIR lua.h
HINTS
ENV LUA_DIR
@@ -73,3 +76,5 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51
VERSION_VAR LUA_VERSION_STRING)
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
+
+cmake_policy(POP)
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index a25f113..e35697e 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -265,6 +265,7 @@ Additionally, the following variables are deprecated:
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package(PkgConfig QUIET)
@@ -301,9 +302,9 @@ if(WIN32)
set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort.bat mpif77.bat mpif90.bat)
# Intel MPI compiler names
- set(_MPI_IntelLLVM_C_COMPILER_NAMES mpiicc.bat)
- set(_MPI_IntelLLVM_CXX_COMPILER_NAMES mpiicpc.bat)
- set(_MPI_IntelLLVM_Fortran_COMPILER_NAMES mpiifort.bat mpif77.bat mpif90.bat)
+ set(_MPI_IntelLLVM_C_COMPILER_NAMES mpiicx.bat mpiicc.bat)
+ set(_MPI_IntelLLVM_CXX_COMPILER_NAMES mpiicx.bat mpiicpc.bat) # Not GNU-like mpiicpx.bat
+ set(_MPI_IntelLLVM_Fortran_COMPILER_NAMES mpiifx.bat mpiifort.bat mpif77.bat mpif90.bat)
# Intel MPI compiler names for MSMPI
set(_MPI_MSVC_C_COMPILER_NAMES mpicl.bat)
@@ -315,9 +316,9 @@ else()
set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77)
# Intel compiler names
- set(_MPI_IntelLLVM_C_COMPILER_NAMES mpiicc)
- set(_MPI_IntelLLVM_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++)
- set(_MPI_IntelLLVM_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77)
+ set(_MPI_IntelLLVM_C_COMPILER_NAMES mpiicx mpiicc)
+ set(_MPI_IntelLLVM_CXX_COMPILER_NAMES mpiicpx mpiicpc mpiicxx mpiic++)
+ set(_MPI_IntelLLVM_Fortran_COMPILER_NAMES mpiifx mpiifort mpiif95 mpiif90 mpiif77)
endif()
# PGI compiler names
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 15c3f64..84f7c62 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -42,6 +42,13 @@ The module supports the following components:
Removed the ``MX_LIBRARY``, ``ENGINE_LIBRARY`` and ``DATAARRAY_LIBRARY``
components. These libraries are found unconditionally.
+.. versionadded:: 3.30
+ Added support for specifying a version range to :command:`find_package` and
+ added support for specifying ``REGISTRY_VIEW`` to :command:`find_package`,
+ :command:`matlab_extract_all_installed_versions_from_registry` and
+ :command:`matlab_get_all_valid_matlab_roots_from_registry`. The default
+ behavior remained unchanged, by using the registry view ``TARGET``.
+
.. note::
The version given to the :command:`find_package` directive is the Matlab
@@ -56,7 +63,8 @@ the path of the desired Matlab version. Otherwise, the behavior is platform
specific:
* Windows: The installed versions of Matlab/MCR are retrieved from the
- Windows registry
+ Windows registry. The ``REGISTRY_VIEW`` argument may optionally be specified
+ to manually control whether 32bit or 64bit versions shall be searched for.
* macOS: The installed versions of Matlab/MCR are given by the MATLAB
default installation paths in ``/Application``. If no such application is
found, it falls back to the one that might be accessible from the ``PATH``.
@@ -283,13 +291,17 @@ Reference
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
set(_FindMatlab_SELF_DIR "${CMAKE_CURRENT_LIST_DIR}")
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-include(CheckCXXCompilerFlag)
-include(CheckCCompilerFlag)
+if(NOT WIN32 AND NOT APPLE AND NOT Threads_FOUND)
+ # MEX files use pthread if available
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads)
+endif()
# The currently supported versions. Other version can be added by the user by
# providing MATLAB_ADDITIONAL_VERSIONS
@@ -298,6 +310,7 @@ if(NOT MATLAB_ADDITIONAL_VERSIONS)
endif()
set(MATLAB_VERSIONS_MAPPING
+ "R2024a=24.1"
"R2023b=23.2"
"R2023a=9.14"
"R2022b=9.13"
@@ -437,20 +450,33 @@ endmacro()
#[=======================================================================[.rst:
.. command:: matlab_extract_all_installed_versions_from_registry
- .. code-block:: cmake
+ This function parses the Windows registry and finds the Matlab versions that
+ are installed. The found versions are stored in ``matlab_versions``.
+
+ .. signature::
+ matlab_extract_all_installed_versions_from_registry(matlab_versions
+ [REGISTRY_VIEW view])
+
+ .. versionadded:: 3.30
+ * Output: ``matlab_versions`` is a list of all the versions of Matlab found
+ * Input: ``REGISTRY_VIEW`` Optional registry view to use for registry
+ interaction. The argument is passed (or omitted) to
+ :command:`cmake_host_system_information` without further checks or
+ modification.
+
+ .. signature::
matlab_extract_all_installed_versions_from_registry(win64 matlab_versions)
- * Input: ``win64`` is a boolean to search for the 64 bit version of Matlab
- * Output: ``matlab_versions`` is a list of all the versions of Matlab found
+ * Input: ``win64`` is a boolean to search for the 64 bit version of
+ Matlab. Set to ``ON`` to use the 64bit registry view or ``OFF`` to use the
+ 32bit registry view. If finer control is needed, see signature above.
+ * Output: ``matlab_versions`` is a list of all the versions of Matlab found
- This function parses the Windows registry and founds the Matlab versions that
- are installed. The found versions are returned in `matlab_versions`.
- Set `win64` to `TRUE` if the 64 bit version of Matlab should be looked for
The returned list contains all versions under
- ``HKLM\\SOFTWARE\\Mathworks\\MATLAB``,
- ``HKLM\\SOFTWARE\\Mathworks\\MATLAB Runtime`` and
- ``HKLM\\SOFTWARE\\Mathworks\\MATLAB Compiler Runtime`` or an empty list in
+ ``HKLM\SOFTWARE\Mathworks\MATLAB``,
+ ``HKLM\SOFTWARE\Mathworks\MATLAB Runtime`` and
+ ``HKLM\SOFTWARE\Mathworks\MATLAB Compiler Runtime`` or an empty list in
case an error occurred (or nothing found).
.. note::
@@ -459,16 +485,32 @@ endmacro()
installation referenced in the registry,
#]=======================================================================]
-function(matlab_extract_all_installed_versions_from_registry win64 matlab_versions)
+function(matlab_extract_all_installed_versions_from_registry win64_or_matlab_versions)
if(NOT CMAKE_HOST_WIN32)
message(FATAL_ERROR "[MATLAB] This function can only be called by a Windows host")
endif()
- if(${win64} AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "64")
- set(_view "64")
+ set(_registry_view_args)
+ if("${ARGC}" EQUAL "2")
+ # Old API: <win64> <matlab_versions>
+ if(${win64_or_matlab_versions})
+ set(_registry_view_args VIEW 64)
+ else()
+ set(_registry_view_args VIEW 32)
+ endif()
+ set(matlab_versions ${ARGV1})
else()
- set(_view "32")
+ # New API: <matlab_versions> [REGISTRY_VIEW <view>]
+ set(matlab_versions ${win64_or_matlab_versions})
+ cmake_parse_arguments(_Matlab "" "REGISTRY_VIEW" "" ${ARGN})
+ if(_Matlab_REGISTRY_VIEW)
+ set(_registry_view_args VIEW "${_Matlab_REGISTRY_VIEW}")
+ endif()
+ endif()
+
+ if(MATLAB_FIND_DEBUG)
+ message(STATUS "[MATLAB] Extracting MATLAB versions with registry view args '${_registry_view_args}'")
endif()
set(matlabs_from_registry)
@@ -476,20 +518,15 @@ function(matlab_extract_all_installed_versions_from_registry win64 matlab_versio
foreach(_installation_type IN ITEMS "MATLAB" "MATLAB Runtime" "MATLAB Compiler Runtime")
cmake_host_system_information(RESULT _reg
- QUERY WINDOWS_REGISTRY "HKLM/SOFTWARE/Mathworks/${_installation_type}"
- SUBKEYS VIEW ${_view}
+ QUERY WINDOWS_REGISTRY "HKLM/SOFTWARE/Mathworks/${_installation_type}"
+ SUBKEYS
+ ${_registry_view_args}
)
- if(_reg)
- string(REGEX MATCHALL "([0-9]+(\\.[0-9]+)+)" _versions_regex "${_reg}")
+ string(REGEX MATCHALL "([0-9]+(\\.[0-9]+)+)" _versions_regex "${_reg}")
- foreach(_match IN LISTS _versions_regex)
- if(_match MATCHES "([0-9]+(\\.[0-9]+)+)")
- list(APPEND matlabs_from_registry ${_match})
- endif()
- endforeach()
+ list(APPEND matlabs_from_registry ${_versions_regex})
- endif()
endforeach()
if(matlabs_from_registry)
@@ -530,10 +567,19 @@ endmacro()
.. code-block:: cmake
- matlab_get_all_valid_matlab_roots_from_registry(matlab_versions matlab_roots)
+ matlab_get_all_valid_matlab_roots_from_registry(matlab_versions matlab_roots [REGISTRY_VIEW view])
* Input: ``matlab_versions`` of each of the Matlab or MCR installations
* Output: ``matlab_roots`` location of each of the Matlab or MCR installations
+ * Input: ``REGISTRY_VIEW`` Optional registry view to use for registry
+ interaction. The argument is passed (or omitted) to
+ :command:`cmake_host_system_information` without further checks or
+ modification.
+
+ .. versionadded:: 3.30
+ The optional ``REGISTRY_VIEW`` argument was added to provide a more precise
+ interface on how to interact with the Windows Registry.
+
#]=======================================================================]
function(matlab_get_all_valid_matlab_roots_from_registry matlab_versions matlab_roots)
@@ -541,6 +587,15 @@ function(matlab_get_all_valid_matlab_roots_from_registry matlab_versions matlab_
# extract_matlab_versions_from_registry_brute_force or
# matlab_extract_all_installed_versions_from_registry.
+ cmake_parse_arguments(_Matlab "" "REGISTRY_VIEW" "" ${ARGN})
+ set(_registry_view_args)
+ if(_Matlab_REGISTRY_VIEW)
+ set(_registry_view_args VIEW "${_Matlab_REGISTRY_VIEW}")
+ endif()
+ if(MATLAB_FIND_DEBUG)
+ message(STATUS "[MATLAB] Getting MATLAB roots with registry view args '${_registry_view_args}'")
+ endif()
+
# Mostly the major.minor version is used in Mathworks Windows Registry keys.
# If the patch is not zero, major.minor.patch is used.
list(TRANSFORM matlab_versions REPLACE "^([0-9]+\\.[0-9]+(\\.[1-9][0-9]*)?).*" "\\1")
@@ -551,57 +606,41 @@ function(matlab_get_all_valid_matlab_roots_from_registry matlab_versions matlab_
cmake_host_system_information(RESULT current_MATLAB_ROOT
QUERY WINDOWS_REGISTRY "HKLM/SOFTWARE/Mathworks/MATLAB/${_matlab_current_version}"
VALUE "MATLABROOT"
+ ${_registry_view_args}
)
cmake_path(CONVERT "${current_MATLAB_ROOT}" TO_CMAKE_PATH_LIST current_MATLAB_ROOT)
if(IS_DIRECTORY "${current_MATLAB_ROOT}")
_Matlab_VersionInfoXML("${current_MATLAB_ROOT}" _matlab_version_tmp)
if("${_matlab_version_tmp}" STREQUAL "unknown")
- list(APPEND _matlab_roots_list "MATLAB" ${_matlab_current_version} ${current_MATLAB_ROOT})
- else()
- list(APPEND _matlab_roots_list "MATLAB" ${_matlab_version_tmp} ${current_MATLAB_ROOT})
+ set(_matlab_version_tmp ${_matlab_current_version})
endif()
+ list(APPEND _matlab_roots_list "MATLAB" ${_matlab_version_tmp} ${current_MATLAB_ROOT})
endif()
endforeach()
# Check for MCR installations
- foreach(_matlab_current_version IN LISTS matlab_versions)
- cmake_host_system_information(RESULT current_MATLAB_ROOT
- QUERY WINDOWS_REGISTRY "HKLM/SOFTWARE/Mathworks/MATLAB Runtime/${_matlab_current_version}"
- VALUE "MATLABROOT"
- )
- cmake_path(CONVERT "${current_MATLAB_ROOT}" TO_CMAKE_PATH_LIST current_MATLAB_ROOT)
+ foreach(_installation_type IN ITEMS "MATLAB Runtime" "MATLAB Compiler Runtime")
+ foreach(_matlab_current_version IN LISTS matlab_versions)
+ cmake_host_system_information(RESULT current_MATLAB_ROOT
+ QUERY WINDOWS_REGISTRY "HKLM/SOFTWARE/Mathworks/${_installation_type}/${_matlab_current_version}"
+ VALUE "MATLABROOT"
+ ${_registry_view_args}
+ )
+ cmake_path(CONVERT "${current_MATLAB_ROOT}" TO_CMAKE_PATH_LIST current_MATLAB_ROOT)
- # remove the dot
- string(REPLACE "." "" _matlab_current_version_without_dot "${_matlab_current_version}")
+ # remove the dot
+ string(REPLACE "." "" _matlab_current_version_without_dot "${_matlab_current_version}")
- if(IS_DIRECTORY "${current_MATLAB_ROOT}")
- _Matlab_VersionInfoXML("${current_MATLAB_ROOT}" _matlab_version_tmp)
- if("${_matlab_version_tmp}" STREQUAL "unknown")
- list(APPEND _matlab_roots_list "MCR" ${_matlab_current_version} "${current_MATLAB_ROOT}/v${_matlab_current_version_without_dot}")
- else()
+ if(IS_DIRECTORY "${current_MATLAB_ROOT}")
+ _Matlab_VersionInfoXML("${current_MATLAB_ROOT}" _matlab_version_tmp)
+ if("${_matlab_version_tmp}" STREQUAL "unknown")
+ set(_matlab_version_tmp ${_matlab_current_version})
+ endif()
list(APPEND _matlab_roots_list "MCR" ${_matlab_version_tmp} "${current_MATLAB_ROOT}/v${_matlab_current_version_without_dot}")
endif()
- endif()
-
- endforeach()
-
- # Check for old MCR installations
- foreach(_matlab_current_version IN LISTS matlab_versions)
- cmake_host_system_information(RESULT current_MATLAB_ROOT
- QUERY WINDOWS_REGISTRY "HKLM/SOFTWARE/Mathworks/MATLAB Compiler Runtime/${_matlab_current_version}"
- VALUE "MATLABROOT"
- )
- cmake_path(CONVERT "${current_MATLAB_ROOT}" TO_CMAKE_PATH_LIST current_MATLAB_ROOT)
-
- # remove the dot
- string(REPLACE "." "" _matlab_current_version_without_dot "${_matlab_current_version}")
-
- if(IS_DIRECTORY "${current_MATLAB_ROOT}")
- list(APPEND _matlab_roots_list "MCR" ${_matlab_current_version} "${current_MATLAB_ROOT}/v${_matlab_current_version_without_dot}")
- endif()
-
+ endforeach()
endforeach()
set(${matlab_roots} ${_matlab_roots_list} PARENT_SCOPE)
endfunction()
@@ -658,23 +697,23 @@ function(matlab_get_mex_suffix matlab_root mex_suffix)
set(devnull INPUT_FILE NUL)
endif()
+ set(_arch)
if(WIN32)
# this environment variable is used to determine the arch on Windows
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(ENV{MATLAB_ARCH} "win64")
+ set(_arch "MATLAB_ARCH=win64")
else()
- set(ENV{MATLAB_ARCH} "win32")
+ set(_arch "MATLAB_ARCH=win32")
endif()
endif()
# this is the preferred way. If this does not work properly (eg. MCR on Windows), then we use our own knowledge
execute_process(
- COMMAND ${Matlab_MEXEXTENSIONS_PROG}
+ COMMAND ${CMAKE_COMMAND} -E env ${_arch} ${Matlab_MEXEXTENSIONS_PROG}
OUTPUT_VARIABLE _matlab_mex_extension
ERROR_VARIABLE _matlab_mex_extension_error
OUTPUT_STRIP_TRAILING_WHITESPACE
${devnull})
- unset(ENV{MATLAB_ARCH})
if(_matlab_mex_extension_error)
if(WIN32)
@@ -1068,20 +1107,6 @@ endfunction()
#]=======================================================================]
function(matlab_add_mex)
- if(NOT WIN32)
- # we do not need all this on Windows
- # pthread options
- if(CMAKE_CXX_COMPILER_LOADED)
- check_cxx_compiler_flag(-pthread HAS_MINUS_PTHREAD)
- elseif(CMAKE_C_COMPILER_LOADED)
- check_c_compiler_flag(-pthread HAS_MINUS_PTHREAD)
- endif()
- # we should use try_compile instead, the link flags are discarded from
- # this compiler_flag function.
- #check_cxx_compiler_flag(-Wl,--exclude-libs,ALL HAS_SYMBOL_HIDING_CAPABILITY)
-
- endif()
-
set(options EXECUTABLE MODULE SHARED R2017b R2018a EXCLUDE_FROM_ALL NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES)
set(oneValueArgs NAME DOCUMENTATION OUTPUT_NAME)
set(multiValueArgs LINK_TO SRC)
@@ -1098,14 +1123,27 @@ function(matlab_add_mex)
endif()
if(NOT Matlab_VERSION_STRING VERSION_LESS "9.1") # For 9.1 (R2016b) and newer, add version source file
+ # Compilers officially supported by Matlab 9.1 (R2016b):
+ # MinGW 4.9, MSVC 2012, Intel C++ 2013, Xcode 6, GCC 4.9
+ # These compilers definitely support the -w flag to suppress warnings.
+ # Other compilers (Clang) may support the -w flag and can be added here.
+ set(_Matlab_silenceable_compilers AppleClang Clang GNU Intel IntelLLVM MSVC)
+
# Add the correct version file depending on which languages are enabled in the project
if(CMAKE_C_COMPILER_LOADED)
# If C is enabled, use the .c file as it will work fine also with C++
set(MEX_VERSION_FILE "${Matlab_ROOT_DIR}/extern/version/c_mexapi_version.c")
+ # Silence warnings for version source file
+ if("${CMAKE_C_COMPILER_ID}" IN_LIST _Matlab_silenceable_compilers)
+ set_source_files_properties("${MEX_VERSION_FILE}" PROPERTIES COMPILE_OPTIONS -w)
+ endif()
elseif(CMAKE_CXX_COMPILER_LOADED)
# If C is not enabled, check if CXX is enabled and use the .cpp file
# to avoid that the .c file is silently ignored
set(MEX_VERSION_FILE "${Matlab_ROOT_DIR}/extern/version/cpp_mexapi_version.cpp")
+ if("${CMAKE_CXX_COMPILER_ID}" IN_LIST _Matlab_silenceable_compilers)
+ set_source_files_properties("${MEX_VERSION_FILE}" PROPERTIES COMPILE_OPTIONS -w)
+ endif()
else()
# If neither C or CXX is enabled, warn because we cannot add the source.
# TODO: add support for fortran mex files
@@ -1236,10 +1274,8 @@ function(matlab_add_mex)
else() # Linux
- if(HAS_MINUS_PTHREAD)
- # Apparently, compiling with -pthread generated the proper link flags
- # and some defines at compilation
- target_compile_options(${${prefix}_NAME} PRIVATE "-pthread")
+ if(Threads_FOUND)
+ target_link_libraries(${${prefix}_NAME} Threads::Threads)
endif()
string(APPEND _link_flags " -Wl,--as-needed")
@@ -1330,7 +1366,7 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve
find_program(
_matlab_current_program
- matlab
+ NAMES matlab
${_find_matlab_options}
DOC "Matlab main program"
)
@@ -1432,13 +1468,7 @@ function(_Matlab_find_instances_win32 matlab_roots)
# testing if we are able to extract the needed information from the registry
set(_matlab_versions_from_registry)
- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(_matlab_win64 ON)
- else()
- set(_matlab_win64 OFF)
- endif()
-
- matlab_extract_all_installed_versions_from_registry(_matlab_win64 _matlab_versions_from_registry)
+ matlab_extract_all_installed_versions_from_registry(_matlab_versions_from_registry ${ARGN})
# the returned list is empty, doing the search on all known versions
if(NOT _matlab_versions_from_registry)
@@ -1449,7 +1479,7 @@ function(_Matlab_find_instances_win32 matlab_roots)
endif()
# filtering the results with the registry keys
- matlab_get_all_valid_matlab_roots_from_registry("${_matlab_versions_from_registry}" _matlab_possible_roots)
+ matlab_get_all_valid_matlab_roots_from_registry("${_matlab_versions_from_registry}" _matlab_possible_roots ${ARGN})
set(${matlab_roots} ${_matlab_possible_roots} PARENT_SCOPE)
endfunction()
@@ -1599,7 +1629,10 @@ else()
# one installation using the appropriate heuristics.
# There is apparently no standard way on Linux.
if(CMAKE_HOST_WIN32)
- _Matlab_find_instances_win32(_matlab_possible_roots_win32)
+ if(NOT DEFINED Matlab_FIND_REGISTRY_VIEW)
+ set(Matlab_FIND_REGISTRY_VIEW TARGET)
+ endif()
+ _Matlab_find_instances_win32(_matlab_possible_roots_win32 REGISTRY_VIEW ${Matlab_FIND_REGISTRY_VIEW})
list(APPEND _matlab_possible_roots ${_matlab_possible_roots_win32})
elseif(APPLE)
_Matlab_find_instances_macos(_matlab_possible_roots_macos)
@@ -1624,62 +1657,29 @@ list(LENGTH _matlab_possible_roots _numbers_of_matlab_roots)
set(Matlab_VERSION_STRING "NOTFOUND")
set(Matlab_Or_MCR "UNKNOWN")
if(_numbers_of_matlab_roots GREATER 0)
- if(Matlab_FIND_VERSION_EXACT)
- set(_list_index -1)
- foreach(_matlab_root_index RANGE 1 ${_numbers_of_matlab_roots} 3)
- list(GET _matlab_possible_roots ${_matlab_root_index} _matlab_root_version)
- # only the major.minor version is used
- string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _matlab_root_version "${_matlab_root_version}")
- if(_matlab_root_version VERSION_EQUAL Matlab_FIND_VERSION)
- set(_list_index ${_matlab_root_index})
- break()
- endif()
- endforeach()
-
- if(_list_index LESS 0)
- set(_list_index 1)
+ set(_list_index -1)
+ foreach(_matlab_root_index RANGE 1 ${_numbers_of_matlab_roots} 3)
+ list(GET _matlab_possible_roots ${_matlab_root_index} _matlab_root_version)
+ find_package_check_version(${_matlab_root_version} _matlab_version_ok HANDLE_VERSION_RANGE)
+ if(_matlab_version_ok)
+ set(_list_index ${_matlab_root_index})
+ break()
endif()
+ endforeach()
- math(EXPR _matlab_or_mcr_index "${_list_index} - 1")
- math(EXPR _matlab_root_dir_index "${_list_index} + 1")
-
- list(GET _matlab_possible_roots ${_matlab_or_mcr_index} Matlab_Or_MCR)
- list(GET _matlab_possible_roots ${_list_index} Matlab_VERSION_STRING)
- list(GET _matlab_possible_roots ${_matlab_root_dir_index} Matlab_ROOT_DIR)
- elseif(DEFINED Matlab_FIND_VERSION)
- set(_list_index -1)
- foreach(_matlab_root_index RANGE 1 ${_numbers_of_matlab_roots} 3)
- list(GET _matlab_possible_roots ${_matlab_root_index} _matlab_root_version)
- if(_matlab_root_version VERSION_GREATER_EQUAL Matlab_FIND_VERSION)
- set(_list_index ${_matlab_root_index})
- break()
- endif()
- endforeach()
-
- if(_list_index LESS 0)
- set(_list_index 1)
- endif()
+ if(_list_index LESS 0)
+ set(_list_index 1)
+ endif()
- math(EXPR _matlab_or_mcr_index "${_list_index} - 1")
- math(EXPR _matlab_root_dir_index "${_list_index} + 1")
- list(GET _matlab_possible_roots ${_matlab_or_mcr_index} Matlab_Or_MCR)
- list(GET _matlab_possible_roots ${_list_index} Matlab_VERSION_STRING)
- list(GET _matlab_possible_roots ${_matlab_root_dir_index} Matlab_ROOT_DIR)
- # adding a warning in case of ambiguity
- if(_numbers_of_matlab_roots GREATER 3 AND MATLAB_FIND_DEBUG)
- message(WARNING "[MATLAB] Found several distributions of Matlab. Setting the current version to ${Matlab_VERSION_STRING} (located ${Matlab_ROOT_DIR})."
- " If this is not the desired behavior, use the EXACT keyword or provide the -DMatlab_ROOT_DIR=... on the command line")
- endif()
- else()
- list(GET _matlab_possible_roots 0 Matlab_Or_MCR)
- list(GET _matlab_possible_roots 1 Matlab_VERSION_STRING)
- list(GET _matlab_possible_roots 2 Matlab_ROOT_DIR)
-
- # adding a warning in case of ambiguity
- if(_numbers_of_matlab_roots GREATER 3 AND MATLAB_FIND_DEBUG)
- message(WARNING "[MATLAB] Found several distributions of Matlab. Setting the current version to ${Matlab_VERSION_STRING} (located ${Matlab_ROOT_DIR})."
- " If this is not the desired behavior, use the EXACT keyword or provide the -DMatlab_ROOT_DIR=... on the command line")
- endif()
+ math(EXPR _matlab_or_mcr_index "${_list_index} - 1")
+ math(EXPR _matlab_root_dir_index "${_list_index} + 1")
+ list(GET _matlab_possible_roots ${_matlab_or_mcr_index} Matlab_Or_MCR)
+ list(GET _matlab_possible_roots ${_list_index} Matlab_VERSION_STRING)
+ list(GET _matlab_possible_roots ${_matlab_root_dir_index} Matlab_ROOT_DIR)
+ # adding a warning in case of ambiguity
+ if(_numbers_of_matlab_roots GREATER 3 AND NOT Matlab_FIND_VERSION_EXACT AND MATLAB_FIND_DEBUG)
+ message(WARNING "[MATLAB] Found several distributions of Matlab. Setting the current version to ${Matlab_VERSION_STRING} (located ${Matlab_ROOT_DIR})."
+ " If this is not the desired behavior, use the EXACT keyword or provide the -DMatlab_ROOT_DIR=... on the command line")
endif()
endif()
@@ -1743,12 +1743,6 @@ if(Matlab_ROOT_DIR)
file(TO_CMAKE_PATH ${Matlab_ROOT_DIR} Matlab_ROOT_DIR)
endif()
-if(CMAKE_SIZEOF_VOID_P EQUAL 4)
- set(_matlab_64Build FALSE)
-else()
- set(_matlab_64Build TRUE)
-endif()
-
if(NOT DEFINED Matlab_MEX_EXTENSION)
set(_matlab_mex_extension "")
@@ -1782,7 +1776,7 @@ endif()
set(MATLAB_INCLUDE_DIR_TO_LOOK ${Matlab_ROOT_DIR}/extern/include)
-if(_matlab_64Build)
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_matlab_current_suffix ${_matlab_bin_suffix_64bits})
else()
set(_matlab_current_suffix ${_matlab_bin_suffix_32bits})
@@ -1807,11 +1801,9 @@ else()
set(_matlab_lib_prefix_for_search "lib")
endif()
-unset(_matlab_64Build)
-
if(MATLAB_FIND_DEBUG)
- message(STATUS "[MATLAB] [DEBUG]_matlab_lib_prefix_for_search = ${_matlab_lib_prefix_for_search} | _matlab_lib_dir_for_search = ${_matlab_lib_dir_for_search}")
+ message(STATUS "[MATLAB] _matlab_lib_prefix_for_search = ${_matlab_lib_prefix_for_search} | _matlab_lib_dir_for_search = ${_matlab_lib_dir_for_search}")
endif()
@@ -1835,7 +1827,7 @@ set(_matlab_required_variables)
# the MEX library/header are required
find_path(
Matlab_INCLUDE_DIRS
- mex.h
+ NAMES mex.h
PATHS ${MATLAB_INCLUDE_DIR_TO_LOOK}
NO_DEFAULT_PATH
)
@@ -1845,7 +1837,7 @@ if(Matlab_Or_MCR STREQUAL "MATLAB" OR Matlab_Or_MCR STREQUAL "UNKNOWN")
_Matlab_find_library(
${_matlab_lib_prefix_for_search}
Matlab_MEX_LIBRARY
- mex
+ NAMES mex
PATHS ${_matlab_lib_dir_for_search}
NO_DEFAULT_PATH
)
@@ -1861,7 +1853,7 @@ if(Matlab_Or_MCR STREQUAL "MATLAB" OR Matlab_Or_MCR STREQUAL "UNKNOWN")
_Matlab_find_library(
${_matlab_lib_prefix_for_search}
Matlab_MX_LIBRARY
- mx
+ NAMES mx
PATHS ${_matlab_lib_dir_for_search}
NO_DEFAULT_PATH
)
@@ -1877,7 +1869,7 @@ if(Matlab_HAS_CPP_API)
_Matlab_find_library(
${_matlab_lib_prefix_for_search}
Matlab_ENGINE_LIBRARY
- MatlabEngine
+ NAMES MatlabEngine
PATHS ${_matlab_lib_dir_for_search}
DOC "MatlabEngine Library"
NO_DEFAULT_PATH
@@ -1890,7 +1882,7 @@ if(Matlab_HAS_CPP_API)
_Matlab_find_library(
${_matlab_lib_prefix_for_search}
Matlab_DATAARRAY_LIBRARY
- MatlabDataArray
+ NAMES MatlabDataArray
PATHS ${_matlab_lib_dir_for_search}
DOC "MatlabDataArray Library"
NO_DEFAULT_PATH
@@ -1906,7 +1898,7 @@ if("ENG_LIBRARY" IN_LIST Matlab_FIND_COMPONENTS)
_Matlab_find_library(
${_matlab_lib_prefix_for_search}
Matlab_ENG_LIBRARY
- eng
+ NAMES eng
PATHS ${_matlab_lib_dir_for_search}
NO_DEFAULT_PATH
)
@@ -1920,7 +1912,7 @@ if("MAT_LIBRARY" IN_LIST Matlab_FIND_COMPONENTS)
_Matlab_find_library(
${_matlab_lib_prefix_for_search}
Matlab_MAT_LIBRARY
- mat
+ NAMES mat
PATHS ${_matlab_lib_dir_for_search}
NO_DEFAULT_PATH
)
@@ -1933,7 +1925,7 @@ endif()
if("SIMULINK" IN_LIST Matlab_FIND_COMPONENTS)
find_path(
Matlab_SIMULINK_INCLUDE_DIR
- simstruc.h
+ NAMES simstruc.h
PATHS "${Matlab_ROOT_DIR}/simulink/include"
NO_DEFAULT_PATH
)
@@ -1947,7 +1939,7 @@ endif()
if("MAIN_PROGRAM" IN_LIST Matlab_FIND_COMPONENTS)
find_program(
Matlab_MAIN_PROGRAM
- matlab
+ NAMES matlab
PATHS ${Matlab_ROOT_DIR} ${Matlab_ROOT_DIR}/bin
DOC "Matlab main program"
NO_DEFAULT_PATH
@@ -1961,7 +1953,7 @@ endif()
if("MEX_COMPILER" IN_LIST Matlab_FIND_COMPONENTS)
find_program(
Matlab_MEX_COMPILER
- "mex"
+ NAMES "mex"
PATHS ${Matlab_BINARIES_DIR}
DOC "Matlab MEX compiler"
NO_DEFAULT_PATH
@@ -1975,7 +1967,7 @@ endif()
if("MCC_COMPILER" IN_LIST Matlab_FIND_COMPONENTS)
find_program(
Matlab_MCC_COMPILER
- "mcc"
+ NAMES "mcc"
PATHS ${Matlab_BINARIES_DIR}
DOC "Matlab MCC compiler"
NO_DEFAULT_PATH
@@ -2030,6 +2022,7 @@ find_package_handle_standard_args(
FOUND_VAR Matlab_FOUND
REQUIRED_VARS ${_matlab_required_variables}
VERSION_VAR Matlab_VERSION
+ HANDLE_VERSION_RANGE
HANDLE_COMPONENTS)
unset(_matlab_required_variables)
diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake
index 436f5ea..d5d26a1 100644
--- a/Modules/FindOpenACC.cmake
+++ b/Modules/FindOpenACC.cmake
@@ -70,9 +70,12 @@ If set, will the correct target accelerator flag set to the <target> will
be returned with OpenACC_<lang>_FLAGS.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
set(OpenACC_C_CXX_TEST_SOURCE
"
-int main(){
+int main(void){
#ifdef _OPENACC
return 0;
#else
@@ -102,7 +105,7 @@ const char accver_str[] = { 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'A',
('0' + ((_OPENACC/10)%10)),
('0' + ((_OPENACC/1)%10)),
']', '\\0' };
-int main()
+int main(void)
{
puts(accver_str);
return 0;
@@ -147,6 +150,7 @@ function(_OPENACC_GET_FLAGS_CANDIDATE LANG FLAG_VAR)
set(ACC_FLAG_PGI "-acc")
set(ACC_FLAG_GNU "-fopenacc")
set(ACC_FLAG_Cray "-h acc")
+ set(ACC_FLAG_Clang "-fopenacc")
if(DEFINED ACC_FLAG_${CMAKE_${LANG}_COMPILER_ID})
set("${FLAG_VAR}" "${ACC_FLAG_${CMAKE_${LANG}_COMPILER_ID}}" PARENT_SCOPE)
@@ -305,3 +309,5 @@ unset(OpenACC_C_CXX_TEST_SOURCE)
unset(OpenACC_Fortran_TEST_SOURCE)
unset(OpenACC_C_CXX_CHECK_VERSION_SOURCE)
unset(OpenACC_Fortran_CHECK_VERSION_SOURCE)
+
+cmake_policy(POP)
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 1527c31..0c77cfc 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -92,12 +92,17 @@ This module sets the following variables:
Defined if the system has GLES3.
``OPENGL_INCLUDE_DIR``
Path to the OpenGL include directory.
+ The ``OPENGL_INCLUDE_DIRS`` variable is preferred.
``OPENGL_EGL_INCLUDE_DIRS``
Path to the EGL include directory.
``OPENGL_LIBRARIES``
Paths to the OpenGL library, windowing system libraries, and GLU libraries.
On Linux, this assumes GLX and is never correct for EGL-based targets.
Clients are encouraged to use the ``OpenGL::*`` import targets instead.
+``OPENGL_INCLUDE_DIRS``
+ .. versionadded:: 3.29
+
+ Paths to the OpenGL include directories.
.. versionadded:: 3.10
Variables for GLVND-specific libraries ``OpenGL``, ``EGL`` and ``GLX``.
@@ -127,6 +132,11 @@ The following cache variables may also be set:
Path to the OpenGL GLES3 library.
+``OPENGL_GLU_INCLUDE_DIR``
+ .. versionadded:: 3.29
+
+ Path to the OpenGL GLU include directory.
+
.. versionadded:: 3.10
Variables for GLVND-specific libraries ``OpenGL``, ``EGL`` and ``GLX``.
@@ -177,9 +187,24 @@ GLVND. For non-GLVND Linux and other systems these are left undefined.
macOS-Specific
^^^^^^^^^^^^^^
-On OSX FindOpenGL defaults to using the framework version of OpenGL. People
-will have to change the cache values of OPENGL_glu_LIBRARY and
-OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
+On macOS this module defaults to using the macOS-native framework
+version of OpenGL. To use the X11 version of OpenGL on macOS, one
+can disable searching of frameworks. For example:
+
+.. code-block:: cmake
+
+ find_package(X11)
+ if(APPLE AND X11_FOUND)
+ set(CMAKE_FIND_FRAMEWORK NEVER)
+ find_package(OpenGL)
+ unset(CMAKE_FIND_FRAMEWORK)
+ else()
+ find_package(OpenGL)
+ endif()
+
+An end user building this project may need to point CMake at their
+X11 installation, e.g., with ``-DOpenGL_ROOT=/opt/X11``.
+
#]=======================================================================]
set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
@@ -207,15 +232,21 @@ if (WIN32)
OPENGL_glu_LIBRARY
)
elseif (APPLE)
- # The OpenGL.framework provides both gl and glu
- find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X")
- find_library(OPENGL_glu_LIBRARY OpenGL DOC
- "GLU library for OS X (usually same as OpenGL library)")
- find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OS X")
+ # The OpenGL.framework provides both gl and glu in OpenGL
+ # XQuartz provides libgl and libglu
+ find_library(OPENGL_gl_LIBRARY NAMES OpenGL GL DOC
+ "OpenGL GL library")
+ find_library(OPENGL_glu_LIBRARY NAMES OpenGL GLU DOC
+ "OpenGL GLU library")
+ find_path(OPENGL_INCLUDE_DIR NAMES OpenGL/gl.h GL/gl.h DOC
+ "Include for OpenGL")
+ find_path(OPENGL_GLU_INCLUDE_DIR NAMES OpenGL/glu.h GL/glu.h DOC
+ "Include for the OpenGL GLU library")
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
list(APPEND _OpenGL_CACHE_VARS
OPENGL_INCLUDE_DIR
+ OPENGL_GLU_INCLUDE_DIR
OPENGL_gl_LIBRARY
OPENGL_glu_LIBRARY
)
@@ -271,6 +302,8 @@ else()
/opt/graphics/OpenGL/include
)
+ find_path(OPENGL_GLU_INCLUDE_DIR GL/glu.h ${_OPENGL_INCLUDE_PATH})
+
list(APPEND _OpenGL_CACHE_VARS
OPENGL_INCLUDE_DIR
OPENGL_GLX_INCLUDE_DIR
@@ -278,6 +311,7 @@ else()
OPENGL_GLES2_INCLUDE_DIR
OPENGL_GLES3_INCLUDE_DIR
OPENGL_xmesa_INCLUDE_DIR
+ OPENGL_GLU_INCLUDE_DIR
)
# Search for the GLVND libraries. We do this regardless of COMPONENTS; we'll
@@ -491,7 +525,7 @@ else()
set( OPENGL_XMESA_FOUND "NO" )
endif()
-if(OPENGL_glu_LIBRARY)
+if(OPENGL_glu_LIBRARY AND (WIN32 OR OPENGL_GLU_INCLUDE_DIR))
set( OPENGL_GLU_FOUND "YES" )
else()
set( OPENGL_GLU_FOUND "NO" )
@@ -549,6 +583,8 @@ unset(_OpenGL_REQUIRED_VARS)
# OpenGL:: targets
if(OPENGL_FOUND)
+ set(OPENGL_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
+
# ::OpenGL is a GLVND library, and thus Linux-only: we don't bother checking
# for a framework version of this library.
if(OPENGL_opengl_LIBRARY AND NOT TARGET OpenGL::OpenGL)
@@ -582,6 +618,7 @@ if(OPENGL_FOUND)
OpenGL::OpenGL)
set_target_properties(OpenGL::GLX PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_GLX_INCLUDE_DIR}")
+ list(APPEND OPENGL_INCLUDE_DIRS ${OPENGL_GLX_INCLUDE_DIR})
endif()
# ::GLES2 is a GLVND library, and thus Linux-only: we don't bother checking
@@ -611,6 +648,7 @@ if(OPENGL_FOUND)
INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_GLES2_INCLUDE_DIR}"
)
+ list(APPEND OPENGL_INCLUDE_DIRS ${OPENGL_GLES2_INCLUDE_DIR})
if (OPENGL_USE_GLES2)
set(_OpenGL_EGL_IMPL OpenGL::GLES2)
@@ -644,6 +682,7 @@ if(OPENGL_FOUND)
INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_GLES3_INCLUDE_DIR}"
)
+ list(APPEND OPENGL_INCLUDE_DIRS ${OPENGL_GLES3_INCLUDE_DIR})
if (OPENGL_USE_GLES3)
set(_OpenGL_EGL_IMPL OpenGL::GLES3)
@@ -695,6 +734,7 @@ if(OPENGL_FOUND)
# Note that EGL's include directory is different from OpenGL/GLX's!
set_target_properties(OpenGL::EGL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${OPENGL_EGL_INCLUDE_DIR}")
+ list(APPEND OPENGL_INCLUDE_DIRS ${OPENGL_EGL_INCLUDE_DIR})
endif()
if(OPENGL_GLU_FOUND AND NOT TARGET OpenGL::GLU)
@@ -709,6 +749,10 @@ if(OPENGL_FOUND)
endif()
set_target_properties(OpenGL::GLU PROPERTIES
INTERFACE_LINK_LIBRARIES OpenGL::GL)
+ # Note that GLU's include directory may be different from OpenGL's!
+ set_target_properties(OpenGL::GLU PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
+ "${OPENGL_GLU_INCLUDE_DIR}")
+ list(APPEND OPENGL_INCLUDE_DIRS ${OPENGL_GLU_INCLUDE_DIR})
endif()
# OPENGL_LIBRARIES mirrors OpenGL::GL's logic ...
@@ -725,6 +769,8 @@ if(OPENGL_FOUND)
endif()
endif()
+list(REMOVE_DUPLICATES OPENGL_INCLUDE_DIRS)
+
# This deprecated setting is for backward compatibility with CMake1.4
set(OPENGL_LIBRARY ${OPENGL_LIBRARIES})
# This deprecated setting is for backward compatibility with CMake1.4
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 69099f7..f88e43c 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -16,8 +16,22 @@ flag to support OpenMP.
.. versionadded:: 3.5
Clang support.
-Variables
-^^^^^^^^^
+Input Variables
+^^^^^^^^^^^^^^^
+
+The following variables may be set to influence this module's behavior:
+
+``OpenMP_RUNTIME_MSVC``
+ .. versionadded:: 3.30
+
+ Specify the `OpenMP Runtime <msvc-openmp_>`_ when compiling with MSVC.
+ If set to a non-empty value, such as ``experimental`` or ``llvm``, it
+ will be passed as the value of the ``-openmp:`` flag.
+
+.. _`msvc-openmp`: https://learn.microsoft.com/en-us/cpp/build/reference/openmp-enable-openmp-2-0-support
+
+Result Variables
+^^^^^^^^^^^^^^^^
.. versionadded:: 3.10
The module exposes the components ``C``, ``CXX``, and ``Fortran``.
@@ -96,6 +110,7 @@ cmake_policy(PUSH)
cmake_policy(SET CMP0012 NEW) # if() recognizes numbers and booleans
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
cmake_policy(SET CMP0057 NEW) # if IN_LIST
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
function(_OPENMP_FLAG_CANDIDATES LANG)
if(NOT OpenMP_${LANG}_FLAG)
@@ -120,7 +135,11 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
else()
set(OMP_FLAG_IntelLLVM "-fiopenmp")
endif()
- set(OMP_FLAG_MSVC "-openmp")
+ if(OpenMP_RUNTIME_MSVC)
+ set(OMP_FLAG_MSVC "-openmp:${OpenMP_RUNTIME_MSVC}")
+ else()
+ set(OMP_FLAG_MSVC "-openmp")
+ endif()
set(OMP_FLAG_PathScale "-openmp")
set(OMP_FLAG_NAG "-openmp")
set(OMP_FLAG_Absoft "-openmp")
@@ -224,7 +243,8 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR)
OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT
)
- if(OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG})
+ if(OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} AND
+ NOT "${CMAKE_${LANG}_COMPILER_ID};${CMAKE_${LANG}_SIMULATE_ID}" STREQUAL "Clang;MSVC")
set("${OPENMP_FLAG_VAR}" "${OPENMP_FLAG}" PARENT_SCOPE)
if(CMAKE_${LANG}_VERBOSE_FLAG)
diff --git a/Modules/FindOpenSP.cmake b/Modules/FindOpenSP.cmake
index 25d0e6f..4255aef 100644
--- a/Modules/FindOpenSP.cmake
+++ b/Modules/FindOpenSP.cmake
@@ -63,6 +63,9 @@ The following cache variables may also be set:
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_package(PkgConfig QUIET)
if (PkgConfig_FOUND)
pkg_check_modules(PC_OpenSP QUIET opensp)
@@ -158,3 +161,5 @@ set_package_properties(OpenSP PROPERTIES
URL "http://openjade.sourceforge.net/doc/index.htm"
DESCRIPTION "An SGML System Conforming to International Standard ISO 8879"
)
+
+cmake_policy(POP)
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 10282a0..01b18f3 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -111,6 +111,9 @@ The following variables may be set to control search behavior:
locations. Useful on multi-lib systems.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
macro(_OpenSSL_test_and_find_dependencies ssl_library crypto_library)
unset(_OpenSSL_extra_static_deps)
if(UNIX AND
@@ -310,15 +313,24 @@ if(WIN32 AND NOT CYGWIN)
# Since OpenSSL 1.1, lib names are like libcrypto32MTd.lib and libssl32MTd.lib
if( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" )
set(_OPENSSL_MSVC_ARCH_SUFFIX "64")
+ set(_OPENSSL_MSVC_FOLDER_SUFFIX "64")
else()
set(_OPENSSL_MSVC_ARCH_SUFFIX "32")
+ set(_OPENSSL_MSVC_FOLDER_SUFFIX "86")
endif()
if(OPENSSL_USE_STATIC_LIBS)
set(_OPENSSL_STATIC_SUFFIX
"_static"
)
- set(_OPENSSL_PATH_SUFFIXES
+ set(_OPENSSL_PATH_SUFFIXES_DEBUG
+ "lib/VC/x${_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/static"
"VC/static"
"lib"
@@ -327,7 +339,14 @@ if(WIN32 AND NOT CYGWIN)
set(_OPENSSL_STATIC_SUFFIX
""
)
- set(_OPENSSL_PATH_SUFFIXES
+ set(_OPENSSL_PATH_SUFFIXES_DEBUG
+ "lib/VC/x${_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"
"VC"
"lib"
@@ -342,6 +361,7 @@ if(WIN32 AND NOT CYGWIN)
libcrypto${_OPENSSL_STATIC_SUFFIX}${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
libcrypto${_OPENSSL_STATIC_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
libcrypto${_OPENSSL_STATIC_SUFFIX}d
+ libcrypto${_OPENSSL_STATIC_SUFFIX}
libeay32${_OPENSSL_STATIC_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
libeay32${_OPENSSL_STATIC_SUFFIX}d
crypto${_OPENSSL_STATIC_SUFFIX}d
@@ -356,7 +376,7 @@ if(WIN32 AND NOT CYGWIN)
NAMES_PER_DIR
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
- ${_OPENSSL_PATH_SUFFIXES}
+ ${_OPENSSL_PATH_SUFFIXES_DEBUG}
)
find_library(LIB_EAY_RELEASE
@@ -381,7 +401,7 @@ if(WIN32 AND NOT CYGWIN)
NAMES_PER_DIR
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
- ${_OPENSSL_PATH_SUFFIXES}
+ ${_OPENSSL_PATH_SUFFIXES_RELEASE}
)
find_library(SSL_EAY_DEBUG
@@ -392,6 +412,7 @@ if(WIN32 AND NOT CYGWIN)
libssl${_OPENSSL_STATIC_SUFFIX}${_OPENSSL_MSVC_ARCH_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
libssl${_OPENSSL_STATIC_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
libssl${_OPENSSL_STATIC_SUFFIX}d
+ libssl${_OPENSSL_STATIC_SUFFIX}
ssleay32${_OPENSSL_STATIC_SUFFIX}${_OPENSSL_MSVC_RT_MODE}d
ssleay32${_OPENSSL_STATIC_SUFFIX}d
ssl${_OPENSSL_STATIC_SUFFIX}d
@@ -406,7 +427,7 @@ if(WIN32 AND NOT CYGWIN)
NAMES_PER_DIR
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
- ${_OPENSSL_PATH_SUFFIXES}
+ ${_OPENSSL_PATH_SUFFIXES_DEBUG}
)
find_library(SSL_EAY_RELEASE
@@ -431,7 +452,7 @@ if(WIN32 AND NOT CYGWIN)
NAMES_PER_DIR
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
- ${_OPENSSL_PATH_SUFFIXES}
+ ${_OPENSSL_PATH_SUFFIXES_RELEASE}
)
set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")
@@ -778,3 +799,5 @@ unset(_OpenSSL_extra_static_deps)
unset(_OpenSSL_has_dependency_dl)
unset(_OpenSSL_has_dependency_threads)
unset(_OpenSSL_has_dependency_zlib)
+
+cmake_policy(POP)
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 27909bc..9df2a62 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -101,6 +101,9 @@ This module defines the following output variables:
target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
#]=======================================================================]
+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
@@ -230,3 +233,5 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenSceneGraph
unset(_osg_component_founds)
set(OPENSCENEGRAPH_INCLUDE_DIRS ${OPENSCENEGRAPH_INCLUDE_DIR})
+
+cmake_policy(POP)
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index bc45eea..6be3422 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -5,26 +5,32 @@
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
+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.
-Locate OpenThreads This module defines OPENTHREADS_LIBRARY
-OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
-OPENTHREADS_INCLUDE_DIR, where to find the headers
+This module defines:
+
+``OPENTHREADS_LIBRARY``
+
+``OPENTHREADS_FOUND``
+ if false, do not try to link to OpenThreads
+``OPENTHREADS_INCLUDE_DIR``
+ where to find the headers
+
+``$OPENTHREADS_DIR`` is an environment variable that would correspond to the::
+
+ ./configure --prefix=$OPENTHREADS_DIR
-$OPENTHREADS_DIR is an environment variable that would correspond to
-the ./configure --prefix=$OPENTHREADS_DIR used in building osg.
+used in building osg.
-[CMake 2.8.10]: 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.
+.. versionadded:: 2.8.10
-Created by Eric Wing.
+ 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.
#]=======================================================================]
# Header files are presumed to be included like
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 043b69c..4294326 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -48,6 +48,9 @@ Since PNG depends on the ZLib compression library, none of the above
will be defined unless ZLib can be found.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
# Default install location on windows when installing from included cmake build
# From FindZLIB.cmake
set(_PNG_x86 "(x86)")
@@ -177,3 +180,5 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PNG
REQUIRED_VARS PNG_LIBRARY PNG_PNG_INCLUDE_DIR
VERSION_VAR PNG_VERSION_STRING)
+
+cmake_policy(POP)
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 56ba1e6..c6db433 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -225,6 +225,9 @@ macro(_FPHSA_FAILURE_MESSAGE _msg)
set (__msg "${_msg}")
if (FPHSA_REASON_FAILURE_MESSAGE)
string(APPEND __msg "\n Reason given by package: ${FPHSA_REASON_FAILURE_MESSAGE}\n")
+ elseif(NOT DEFINED PROJECT_NAME)
+ string(APPEND __msg "\n"
+ "Hint: The project() command has not yet been called. It sets up system-specific search paths.")
endif()
if (${_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "${__msg}")
@@ -342,7 +345,7 @@ function(FIND_PACKAGE_CHECK_VERSION version result)
set(version_msg "Found unsuitable version \"${version}\", but required is exact version \"${${package}_FIND_VERSION}\"")
else ()
set(version_ok TRUE)
- set(version_msg "(found suitable exact version \"${_FOUND_VERSION}\")")
+ set(version_msg "(found suitable exact version \"${version}\")")
endif ()
else ()
if (NOT ${package}_FIND_VERSION VERSION_EQUAL version)
diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake
index 0628b98..7efbe18 100644
--- a/Modules/FindPackageMessage.cmake
+++ b/Modules/FindPackageMessage.cmake
@@ -37,6 +37,7 @@ function(find_package_message pkg msg details)
set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.
+ string(STRIP "${msg}" msg)
message(STATUS "${msg}")
# Save the find details in the cache to avoid printing the same
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake
index 26962df..49bc54c 100644
--- a/Modules/FindPerl.cmake
+++ b/Modules/FindPerl.cmake
@@ -5,15 +5,20 @@
FindPerl
--------
-Find perl
+Find a Perl interpreter.
-this module looks for Perl
+This module defines the following variables:
-::
+``PERL_EXECUTABLE``
+ The full path to Perl.
- PERL_EXECUTABLE - the full path to perl
- PERL_FOUND - If false, don't attempt to use perl.
- PERL_VERSION_STRING - version of perl found (since CMake 2.8.8)
+``PERL_FOUND``
+ True if the Perl executable was found.
+
+``PERL_VERSION_STRING``
+ .. versionadded:: 2.8.8
+
+ The version of Perl found.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 27d25fb..450acf4 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -56,14 +56,29 @@ endif()
set(PKG_CONFIG_NAMES "pkg-config")
if(CMAKE_HOST_WIN32)
list(PREPEND PKG_CONFIG_NAMES "pkg-config.bat")
+ set(_PKG_CONFIG_VALIDATOR VALIDATOR __FindPkgConfig_EXECUTABLE_VALIDATOR)
+ function(__FindPkgConfig_EXECUTABLE_VALIDATOR result_var candidate)
+ if(candidate MATCHES "\\.[Ee][Xx][Ee]$")
+ return()
+ endif()
+ # Exclude the pkg-config distributed with Strawberry Perl.
+ execute_process(COMMAND "${candidate}" --help OUTPUT_VARIABLE _output ERROR_VARIABLE _output RESULT_VARIABLE _result)
+ if(NOT _result EQUAL 0 OR _output MATCHES "Pure-Perl")
+ set("${result_var}" FALSE PARENT_SCOPE)
+ endif()
+ endfunction()
+else()
+ set(_PKG_CONFIG_VALIDATOR "")
endif()
list(APPEND PKG_CONFIG_NAMES "pkgconf")
find_program(PKG_CONFIG_EXECUTABLE
NAMES ${PKG_CONFIG_NAMES}
NAMES_PER_DIR
- DOC "pkg-config executable")
+ DOC "pkg-config executable"
+ ${_PKG_CONFIG_VALIDATOR})
mark_as_advanced(PKG_CONFIG_EXECUTABLE)
+unset(_PKG_CONFIG_VALIDATOR)
set(PKG_CONFIG_ARGN "${PKG_CONFIG_ARGN}" CACHE STRING "Arguments to supply to pkg-config")
mark_as_advanced(PKG_CONFIG_ARGN)
@@ -143,6 +158,17 @@ macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
endif()
+ # pkg-config <0.29.1 and pkgconf <1.5.1 prints quoted variables without unquoting
+ # unquote only if quotes are first and last characters
+ if((PKG_CONFIG_VERSION_STRING VERSION_LESS 0.29.1) OR
+ (PKG_CONFIG_VERSION_STRING VERSION_GREATER_EQUAL 1.0 AND PKG_CONFIG_VERSION_STRING VERSION_LESS 1.5.1))
+ if (_pkgconfig_invoke_result MATCHES "^\"(.*)\"$")
+ set(_pkgconfig_invoke_result "${CMAKE_MATCH_1}")
+ elseif(_pkgconfig_invoke_result MATCHES "^'(.*)'$")
+ set(_pkgconfig_invoke_result "${CMAKE_MATCH_1}")
+ endif()
+ endif()
+
# pkg-config can represent "spaces within an argument" by backslash-escaping the space.
# UNIX_COMMAND mode treats backslash-escaped spaces as "not a space that delimits arguments".
separate_arguments(_pkgconfig_invoke_result UNIX_COMMAND "${_pkgconfig_invoke_result}")
@@ -656,6 +682,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
if (APPLE AND "-framework" IN_LIST ${_prefix}_LDFLAGS_OTHER)
_pkgconfig_extract_frameworks("${_prefix}")
+ # Using _pkgconfig_set in this scope so that a future policy can switch to normal variables
+ _pkgconfig_set("${_pkg_check_prefix}_LIBRARIES" "${${_pkg_check_prefix}_LIBRARIES}")
+ _pkgconfig_set("${_pkg_check_prefix}_LDFLAGS_OTHER" "${${_pkg_check_prefix}_LDFLAGS_OTHER}")
endif()
_pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS "(^| )(-I|-isystem ?)" --cflags-only-I )
@@ -664,6 +693,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
if (${_prefix}_CFLAGS_OTHER MATCHES "-isystem")
_pkgconfig_extract_isystem("${_prefix}")
+ # Using _pkgconfig_set in this scope so that a future policy can switch to normal variables
+ _pkgconfig_set("${_pkg_check_prefix}_CFLAGS_OTHER" "${${_pkg_check_prefix}_CFLAGS_OTHER}")
+ _pkgconfig_set("${_pkg_check_prefix}_INCLUDE_DIRS" "${${_pkg_check_prefix}_INCLUDE_DIRS}")
endif ()
_pkg_recalculate("${_prefix}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global})
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 84bc1ed..1984e18 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -93,6 +93,7 @@ is set regardless of the presence of the ``Server`` component in find_package ca
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include")
set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}")
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index a7ee0c4..8ad3270 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -218,6 +218,9 @@ Example:
GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc)
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
function(protobuf_generate)
set(_options APPEND_PATH DESCRIPTORS)
set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN PLUGIN_OPTIONS DEPENDENCIES)
@@ -782,3 +785,5 @@ foreach(Camel
string(TOUPPER ${Camel} UPPER)
set(${UPPER} ${${Camel}})
endforeach()
+
+cmake_policy(POP)
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 08ab9c0..410b736 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -20,6 +20,8 @@ cmake_policy (SET CMP0057 NEW)
cmake_policy (SET CMP0124 NEW)
# registry view behavior
cmake_policy (SET CMP0134 NEW)
+# file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+cmake_policy(SET CMP0159 NEW)
if (NOT DEFINED _PYTHON_PREFIX)
message (FATAL_ERROR "FindPython: INTERNAL ERROR")
@@ -3782,6 +3784,14 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
endif()
endif()
+ # Workaround Intel MKL library outputting a message in stdout, which cause
+ # incorrect detection of numpy.get_include() and numpy.__version__
+ # See https://github.com/numpy/numpy/issues/23775
+ if(DEFINED ENV{MKL_ENABLE_INSTRUCTIONS})
+ set(_${_PYTHON_PREFIX}_BACKUP_ENV_VAR_MKL_ENABLE_INSTRUCTIONS ENV{MKL_ENABLE_INSTRUCTIONS})
+ endif()
+ set(ENV{MKL_ENABLE_INSTRUCTIONS} "SSE4_2")
+
if (NOT _${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
execute_process(COMMAND ${${_PYTHON_PREFIX}_INTERPRETER_LAUNCHER} "${_${_PYTHON_PREFIX}_EXECUTABLE}" -c
"import sys\ntry: import numpy; sys.stdout.write(numpy.get_include())\nexcept:pass\n"
@@ -3822,6 +3832,14 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
set (${_PYTHON_PREFIX}_NumPy_FOUND FALSE)
endif()
+ # Restore previous value of MKL_ENABLE_INSTRUCTIONS
+ if(DEFINED _${_PYTHON_PREFIX}_BACKUP_ENV_VAR_MKL_ENABLE_INSTRUCTIONS)
+ set(ENV{MKL_ENABLE_INSTRUCTIONS} ${_${_PYTHON_PREFIX}_BACKUP_ENV_VAR_MKL_ENABLE_INSTRUCTIONS})
+ unset(_${_PYTHON_PREFIX}_BACKUP_ENV_VAR_MKL_ENABLE_INSTRUCTIONS)
+ else()
+ unset(ENV{MKL_ENABLE_INSTRUCTIONS})
+ endif()
+
if (${_PYTHON_PREFIX}_NumPy_FOUND)
unset (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE CACHE)
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index b13d96b..112adae 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -48,6 +48,9 @@ get the currently active Python version by default with a consistent version
of PYTHON_LIBRARIES.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
cmake_policy(GET CMP0148 _FindPythonLibs_CMP0148)
if(_FindPythonLibs_CMP0148 STREQUAL "NEW")
message(FATAL_ERROR "The FindPythonLibs module has been removed by policy CMP0148.")
@@ -55,6 +58,7 @@ endif()
if(_FindPythonLibs_testing)
set(_FindPythonLibs_included TRUE)
+ cmake_policy(POP)
return()
endif()
@@ -410,3 +414,5 @@ extern \"C\" {
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
endfunction()
+
+cmake_policy(POP)
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index da82e59..5a0037c 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -34,6 +34,9 @@ Also defined, but not for general use are:
library. This is only required by Qt3 on Windows.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
# These are around for backwards compatibility
# they will be set
# QT_WRAP_CPP, set true if QT_MOC_EXECUTABLE is found
@@ -47,6 +50,7 @@ if(QT4_FOUND)
if(NOT Qt3_FIND_QUIETLY)
message( STATUS "Qt3 and Qt4 cannot be used together in one project.")
endif()
+ cmake_policy(POP)
return()
endif()
endif()
@@ -304,3 +308,5 @@ mark_as_advanced(
QT_WRAP_CPP
QT_WRAP_UI
)
+
+cmake_policy(POP)
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 4fe8bd5..4cc17c7 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -8,7 +8,7 @@ FindRuby
Find Ruby
This module finds if Ruby is installed and determines where the
-include files and libraries are. Ruby 1.8 through 3.2 are
+include files and libraries are. Ruby 1.8 through 3.3 are
supported.
The minimum required version of Ruby can be specified using the
@@ -136,13 +136,13 @@ set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${Ruby_FIND_VERSION
# Set name of possible executables, ignoring the minor
# Eg:
-# 2.1.1 => from ruby32 to ruby21 included
-# 2.1 => from ruby32 to ruby21 included
-# 2 => from ruby32 to ruby20 included
-# empty => from ruby32 to ruby18 included
+# 2.1.1 => from ruby33 to ruby21 included
+# 2.1 => from ruby33 to ruby21 included
+# 2 => from ruby33 to ruby20 included
+# empty => from ruby33 to ruby18 included
if(NOT Ruby_FIND_VERSION_EXACT)
- foreach(_ruby_version RANGE 32 18 -1)
+ foreach(_ruby_version RANGE 33 18 -1)
string(SUBSTRING "${_ruby_version}" 0 1 _ruby_major_version)
string(SUBSTRING "${_ruby_version}" 1 1 _ruby_minor_version)
@@ -417,7 +417,7 @@ endif()
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})
if(WIN32)
- set(_Ruby_POSSIBLE_MSVC_RUNTIMES "msvcrt;vcruntime140;vcruntime140_1")
+ 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()
@@ -426,16 +426,19 @@ if(WIN32)
set(_Ruby_POSSIBLE_VERSION_SUFFICES "${_Ruby_NODOT_VERSION};${_Ruby_NODOT_VERSION_ZERO_PATCH}")
- set(_Ruby_ARCH_PREFIX "")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(_Ruby_ARCH_PREFIX "x64-")
+ set(_Ruby_POSSIBLE_ARCH_PREFIXS "libx64-;x64-")
+ else()
+ set(_Ruby_POSSIBLE_ARCH_PREFIXS "lib")
endif()
foreach(_Ruby_MSVC_RUNTIME ${_Ruby_POSSIBLE_MSVC_RUNTIMES})
foreach(_Ruby_VERSION_SUFFIX ${_Ruby_POSSIBLE_VERSION_SUFFICES})
- 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")
+ foreach(_Ruby_ARCH_PREFIX ${_Ruby_POSSIBLE_ARCH_PREFIXS})
+ 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")
+ endforeach()
endforeach()
endforeach()
endif()
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 7691eb7..a4c8668 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -110,6 +110,9 @@ This needed to change because "proper" SDL convention is #include
because not all systems place things in SDL/ (see FreeBSD).
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(SDL_INCLUDE_DIR SDL.h
HINTS
ENV SDLDIR
@@ -235,3 +238,5 @@ if(SDL_FOUND)
INTERFACE_LINK_LIBRARIES "${SDL_LIBRARY}")
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindSDL_gfx.cmake b/Modules/FindSDL_gfx.cmake
index 2dd96e9..82c2039 100644
--- a/Modules/FindSDL_gfx.cmake
+++ b/Modules/FindSDL_gfx.cmake
@@ -24,6 +24,9 @@ This module defines:
``./configure --prefix=$SDLDIR`` used in building SDL.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
find_path(SDL_GFX_INCLUDE_DIRS
NAMES
SDL_framerate.h
@@ -84,3 +87,5 @@ if(SDL_gfx_FOUND)
INTERFACE_LINK_LIBRARIES "${SDL_GFX_LIBRARIES}")
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index 324fef5..33a0695 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -33,6 +33,9 @@ $SDLDIR is an environment variable that would correspond to the
./configure --prefix=$SDLDIR used in building SDL.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
if(NOT SDL_IMAGE_INCLUDE_DIR AND SDLIMAGE_INCLUDE_DIR)
set(SDL_IMAGE_INCLUDE_DIR ${SDLIMAGE_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
@@ -95,3 +98,5 @@ set(SDLIMAGE_INCLUDE_DIR ${SDL_IMAGE_INCLUDE_DIRS})
set(SDLIMAGE_FOUND ${SDL_IMAGE_FOUND})
mark_as_advanced(SDL_IMAGE_LIBRARY SDL_IMAGE_INCLUDE_DIR)
+
+cmake_policy(POP)
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 8ed3cb4..f48015e 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -33,6 +33,9 @@ $SDLDIR is an environment variable that would correspond to the
./configure --prefix=$SDLDIR used in building SDL.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
if(NOT SDL_MIXER_INCLUDE_DIR AND SDLMIXER_INCLUDE_DIR)
set(SDL_MIXER_INCLUDE_DIR ${SDLMIXER_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
@@ -95,3 +98,5 @@ set(SDLMIXER_INCLUDE_DIR ${SDL_MIXER_INCLUDE_DIRS})
set(SDLMIXER_FOUND ${SDL_MIXER_FOUND})
mark_as_advanced(SDL_MIXER_LIBRARY SDL_MIXER_INCLUDE_DIR)
+
+cmake_policy(POP)
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index 639e5bd..9d0b949 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -32,6 +32,9 @@ $SDLDIR is an environment variable that would correspond to the
./configure --prefix=$SDLDIR used in building SDL.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
if(NOT SDL_NET_INCLUDE_DIR AND SDLNET_INCLUDE_DIR)
set(SDL_NET_INCLUDE_DIR ${SDLNET_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
@@ -94,3 +97,5 @@ set(SDLNET_INCLUDE_DIR ${SDL_NET_INCLUDE_DIRS})
set(SDLNET_FOUND ${SDL_NET_FOUND})
mark_as_advanced(SDL_NET_LIBRARY SDL_NET_INCLUDE_DIR)
+
+cmake_policy(POP)
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 3443959..50b4b55 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -84,6 +84,9 @@ parses the error output for known symbol names to figure out which
libraries are needed.
#]]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
set(SDL_SOUND_EXTRAS "" CACHE STRING "SDL_sound extra flags")
mark_as_advanced(SDL_SOUND_EXTRAS)
@@ -371,3 +374,5 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_sound
REQUIRED_VARS SDL_SOUND_LIBRARY SDL_SOUND_INCLUDE_DIR
VERSION_VAR SDL_SOUND_VERSION_STRING)
+
+cmake_policy(POP)
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index d67c089..8f3b02a 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -32,6 +32,9 @@ $SDLDIR is an environment variable that would correspond to the
./configure --prefix=$SDLDIR used in building SDL.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
if(NOT SDL_TTF_INCLUDE_DIR AND SDLTTF_INCLUDE_DIR)
set(SDL_TTF_INCLUDE_DIR ${SDLTTF_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
@@ -94,3 +97,5 @@ set(SDLTTF_INCLUDE_DIR ${SDL_TTF_INCLUDE_DIRS})
set(SDLTTF_FOUND ${SDL_TTF_FOUND})
mark_as_advanced(SDL_TTF_LIBRARY SDL_TTF_INCLUDE_DIR)
+
+cmake_policy(POP)
diff --git a/Modules/FindSQLite3.cmake b/Modules/FindSQLite3.cmake
index 88c7dd2..308a444 100644
--- a/Modules/FindSQLite3.cmake
+++ b/Modules/FindSQLite3.cmake
@@ -32,12 +32,24 @@ This module will set the following variables if found:
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_SQLite3 QUIET sqlite3)
+
# Look for the necessary header
-find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h)
+find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h
+ HINTS
+ ${PC_SQLite3_INCLUDE_DIRS}
+)
mark_as_advanced(SQLite3_INCLUDE_DIR)
# Look for the necessary library
-find_library(SQLite3_LIBRARY NAMES sqlite3 sqlite)
+find_library(SQLite3_LIBRARY NAMES sqlite3 sqlite
+ HINTS
+ ${PC_SQLite3_LIBRARY_DIRS}
+)
mark_as_advanced(SQLite3_LIBRARY)
# Extract version information from the header file
@@ -66,3 +78,5 @@ if(SQLite3_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIR}")
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 370fff0..3104b2c 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -58,6 +58,50 @@ optional Fortran support:
#]=======================================================================]
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+function(_swig_get_version _swig_executable _swig_version)
+ unset(${_swig_version} PARENT_SCOPE)
+ # Determine SWIG version
+ execute_process(COMMAND "${_swig_executable}" -version
+ OUTPUT_VARIABLE _swig_output
+ ERROR_VARIABLE _swig_output
+ RESULT_VARIABLE _swig_result)
+ if(_swig_result)
+ set_property (CACHE _SWIG_REASON_FAILURE PROPERTY VALUE "Cannot use the executable \"${_swig_executable}\"")
+ if (_swig_output)
+ set_property (CACHE _SWIG_REASON_FAILURE APPEND_STRING PROPERTY VALUE ": ${_swig_output}")
+ endif()
+ else()
+ string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1"
+ _swig_output "${_swig_output}")
+ set(${_swig_version} ${_swig_output} PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(_swig_validate_find_executable status executable)
+ _swig_get_version("${executable}" _swig_find_version)
+ if(NOT _swig_find_version)
+ # executable is unusable
+ set (${status} FALSE PARENT_SCOPE)
+ return()
+ endif()
+ if(NOT SWIG_FIND_VERSION)
+ return()
+ endif()
+
+ find_package_check_version(${_swig_find_version} _swig_version_is_valid HANDLE_VERSION_RANGE)
+ if(_swig_version_is_valid)
+ unset(_SWIG_REASON_FAILURE CACHE)
+ else()
+ set (${status} FALSE PARENT_SCOPE)
+ set_property (CACHE _SWIG_REASON_FAILURE PROPERTY VALUE "Could NOT find SWIG: Found unsuitable version \"${_swig_find_version}\" for the executable \"${executable}\"")
+ endif()
+endfunction()
+
+unset (_SWIG_REASON_FAILURE)
+set (_SWIG_REASON_FAILURE CACHE INTERNAL "SWIG reason failure")
+
# compute list of possible names
unset (_SWIG_NAMES)
if (SWIG_FIND_VERSION_RANGE)
@@ -86,7 +130,8 @@ if (NOT _SWIG_NAMES)
set (_SWIG_NAMES swig4.0 swig3.0 swig2.0)
endif()
-find_program(SWIG_EXECUTABLE NAMES ${_SWIG_NAMES} swig)
+find_program(SWIG_EXECUTABLE NAMES ${_SWIG_NAMES} swig NAMES_PER_DIR
+ VALIDATOR _swig_validate_find_executable)
unset(_SWIG_NAMES)
if(SWIG_EXECUTABLE AND NOT SWIG_DIR)
@@ -115,17 +160,8 @@ endif()
if(SWIG_EXECUTABLE AND SWIG_DIR AND NOT SWIG_VERSION)
# Determine SWIG version
- execute_process(COMMAND "${SWIG_EXECUTABLE}" -version
- OUTPUT_VARIABLE _swig_output
- ERROR_VARIABLE _swig_output
- RESULT_VARIABLE _swig_result)
- if(_swig_result)
- message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -version\" failed with output:\n${_swig_output}")
- else()
- string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1"
- _swig_output "${_swig_output}")
- set(SWIG_VERSION ${_swig_output} CACHE STRING "Swig version" FORCE)
- endif()
+ _swig_get_version("${SWIG_EXECUTABLE}" _swig_output)
+ set(SWIG_VERSION ${_swig_output} CACHE STRING "Swig version" FORCE)
endif()
if(SWIG_EXECUTABLE AND SWIG_FIND_COMPONENTS)
@@ -145,16 +181,18 @@ if(SWIG_EXECUTABLE AND SWIG_FIND_COMPONENTS)
endif()
endif()
-unset(_swig_output)
-unset(_swig_error)
-unset(_swig_result)
-
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(
SWIG HANDLE_COMPONENTS
REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
VERSION_VAR SWIG_VERSION
- HANDLE_VERSION_RANGE)
+ HANDLE_VERSION_RANGE
+ FAIL_MESSAGE "${_SWIG_REASON_FAILURE}")
+
+unset(_swig_output)
+unset(_swig_error)
+unset(_swig_result)
+
+unset(_SWIG_REASON_FAILURE CACHE)
if(SWIG_FOUND)
set(SWIG_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/UseSWIG.cmake")
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index fe1e94e..27beaa0 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -67,6 +67,7 @@ The following cache variables may also be set:
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
set(_TIFF_args)
if (TIFF_FIND_VERSION)
diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake
index 581763d..2262119 100644
--- a/Modules/FindVulkan.cmake
+++ b/Modules/FindVulkan.cmake
@@ -221,6 +221,7 @@ environment.
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
# Provide compatibility with a common invalid component request that
# was silently ignored prior to CMake 3.24.
@@ -537,13 +538,7 @@ _Vulkan_set_library_component_found(glslang-oglcompiler NO_WARNING)
_Vulkan_set_library_component_found(glslang-osdependent NO_WARNING)
_Vulkan_set_library_component_found(glslang-machineindependent NO_WARNING)
_Vulkan_set_library_component_found(glslang-genericcodegen NO_WARNING)
-_Vulkan_set_library_component_found(glslang
- DEPENDENT_COMPONENTS
- glslang-spirv
- glslang-oglcompiler
- glslang-osdependent
- glslang-machineindependent
- glslang-genericcodegen)
+_Vulkan_set_library_component_found(glslang DEPENDENT_COMPONENTS glslang-spirv)
_Vulkan_set_library_component_found(shaderc_combined)
_Vulkan_set_library_component_found(SPIRV-Tools)
_Vulkan_set_library_component_found(volk)
@@ -747,10 +742,6 @@ if(Vulkan_FOUND)
if((Vulkan_glslang_LIBRARY OR Vulkan_glslang_DEBUG_LIBRARY)
AND TARGET Vulkan::glslang-spirv
- AND TARGET Vulkan::glslang-oglcompiler
- AND TARGET Vulkan::glslang-osdependent
- AND TARGET Vulkan::glslang-machineindependent
- AND TARGET Vulkan::glslang-genericcodegen
AND NOT TARGET Vulkan::glslang)
add_library(Vulkan::glslang STATIC IMPORTED)
set_property(TARGET Vulkan::glslang
@@ -775,10 +766,13 @@ if(Vulkan_FOUND)
target_link_libraries(Vulkan::glslang
INTERFACE
Vulkan::glslang-spirv
- Vulkan::glslang-oglcompiler
- Vulkan::glslang-osdependent
- Vulkan::glslang-machineindependent
- Vulkan::glslang-genericcodegen
+ # OGLCompiler library has been fully removed since version 14.0.0
+ # OSDependent, MachineIndependent, and GenericCodeGen may also be removed in the future.
+ # See https://github.com/KhronosGroup/glslang/issues/3462
+ $<TARGET_NAME_IF_EXISTS:Vulkan::glslang-oglcompiler>
+ $<TARGET_NAME_IF_EXISTS:Vulkan::glslang-osdependent>
+ $<TARGET_NAME_IF_EXISTS:Vulkan::glslang-machineindependent>
+ $<TARGET_NAME_IF_EXISTS:Vulkan::glslang-genericcodegen>
)
endif()
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index 1047e4f..491ea46 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -89,6 +89,7 @@ and also the following more fine grained variables and targets:
X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND, X11::Xutil
X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND, X11::Xv
X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND
+ X11_Xdbe_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xdbe_FOUND
X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
@@ -121,6 +122,10 @@ and also the following more fine grained variables and targets:
``xcb_shm``, ``xcb_sync``, ``xcb_xf86dri``, ``xcb_xinerama``, ``xcb_xinput``,
``xcb_xrm``, ``xcb_xvmc``, and ``xcb_xv`` libraries.
+.. versionadded:: 3.29
+ Added coverage of double buffer extension (variables
+ ``X11_Xdbe_INCLUDE_PATH`` and ``X11_Xdbe_FOUND``).
+
#]=======================================================================]
if (UNIX)
@@ -200,6 +205,7 @@ if (UNIX)
find_path(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xdbe_INCLUDE_PATH X11/extensions/Xdbe.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xext_INCLUDE_PATH X11/extensions/Xext.h ${X11_INC_SEARCH_PATH})
find_path(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h ${X11_INC_SEARCH_PATH})
@@ -643,6 +649,11 @@ if (UNIX)
set(X11_Xaw_FOUND TRUE)
endif()
+ if (X11_Xdbe_INCLUDE_PATH)
+ set(X11_Xdbe_FOUND TRUE)
+ list(APPEND X11_INCLUDE_DIR ${X11_Xdbe_INCLUDE_PATH})
+ endif ()
+
# Most of the X11 headers will be in the same directories, avoid
# creating a huge list of duplicates.
if (X11_INCLUDE_DIR)
@@ -1358,6 +1369,7 @@ if (UNIX)
X11_XSync_INCLUDE_PATH
X11_Xaw_LIB
X11_Xaw_INCLUDE_PATH
+ X11_Xdbe_INCLUDE_PATH
)
set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake
index a7fb766..338d0c0 100644
--- a/Modules/FindXalanC.cmake
+++ b/Modules/FindXalanC.cmake
@@ -44,6 +44,9 @@ The following cache variables may also be set:
the Xalan library
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
# Written by Roger Leigh <rleigh@codelibre.net>
function(_XalanC_GET_VERSION version_hdr)
@@ -153,3 +156,5 @@ if(XalanC_FOUND)
set_target_properties(XalanC::XalanC PROPERTIES INTERFACE_LINK_LIBRARIES XercesC::XercesC)
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake
index d39bbf6..ee6a401 100644
--- a/Modules/FindXercesC.cmake
+++ b/Modules/FindXercesC.cmake
@@ -47,6 +47,9 @@ The following cache variables may also be set:
Debug and Release variants are found separately.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
# Written by Roger Leigh <rleigh@codelibre.net>
function(_XercesC_GET_VERSION version_hdr)
@@ -149,3 +152,5 @@ if(XercesC_FOUND)
endif()
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index 4e7d5d6..0842f4c 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -84,6 +84,9 @@ module where to look.
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
if(ZLIB_FIND_COMPONENTS AND NOT ZLIB_FIND_QUIETLY)
message(AUTHOR_WARNING
"ZLIB does not provide any COMPONENTS. Calling\n"
@@ -232,3 +235,5 @@ if(ZLIB_FOUND)
endif()
endif()
endif()
+
+cmake_policy(POP)
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 78fa481..b42a85e 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -37,7 +37,7 @@ select a configuration):
wxWidgets_EXCLUDE_COMMON_LIBRARIES
- Set to TRUE to exclude linking of
commonly required libs (e.g., png tiff
- jpeg zlib regex expat).
+ jpeg zlib regex expat scintilla lexilla).
@@ -188,6 +188,9 @@ macro(DBG_MSG_V _MSG)
# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
endmacro()
+cmake_policy(PUSH)
+cmake_policy(SET CMP0057 NEW) # if IN_LIST
+
# Clear return values in case the module is loaded more than once.
set(wxWidgets_FOUND FALSE)
set(wxWidgets_INCLUDE_DIRS "")
@@ -244,8 +247,14 @@ macro(wx_extract_version)
"\\2" wxWidgets_VERSION_MINOR "${_wx_version_h}" )
string(REGEX REPLACE "^(.*\n)?#define +wxRELEASE_NUMBER +([0-9]+).*"
"\\2" wxWidgets_VERSION_PATCH "${_wx_version_h}" )
+ string(REGEX REPLACE "^(.*\n)?#define +wxSUBRELEASE_NUMBER +([0-9]+).*"
+ "\\2" wxWidgets_VERSION_TWEAK "${_wx_version_h}" )
+
set(wxWidgets_VERSION_STRING
"${wxWidgets_VERSION_MAJOR}.${wxWidgets_VERSION_MINOR}.${wxWidgets_VERSION_PATCH}" )
+ if(${wxWidgets_VERSION_TWEAK} GREATER 0)
+ string(APPEND wxWidgets_VERSION_STRING ".${wxWidgets_VERSION_TWEAK}")
+ endif()
dbg_msg("wxWidgets_VERSION_STRING: ${wxWidgets_VERSION_STRING}")
endmacro()
@@ -265,6 +274,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Useful common wx libs needed by almost all components.
set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
+ # Libraries needed by stc component
+ set(wxWidgets_STC_LIBRARIES scintilla lexilla)
+
# DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead.
if(NOT wxWidgets_FIND_COMPONENTS)
if(wxWidgets_USE_MONOLITHIC)
@@ -277,10 +289,15 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Add the common (usually required libs) unless
# wxWidgets_EXCLUDE_COMMON_LIBRARIES has been set.
if(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES)
- list(APPEND wxWidgets_FIND_COMPONENTS
- ${wxWidgets_COMMON_LIBRARIES})
+ if(stc IN_LIST wxWidgets_FIND_COMPONENTS)
+ list(APPEND wxWidgets_FIND_COMPONENTS ${wxWidgets_STC_LIBRARIES})
+ endif()
+ list(APPEND wxWidgets_FIND_COMPONENTS ${wxWidgets_COMMON_LIBRARIES})
endif()
+ # Remove duplicates, for example when user has specified common libraries.
+ list(REMOVE_DUPLICATES wxWidgets_FIND_COMPONENTS)
+
#-------------------------------------------------------------------
# WIN32: Helper MACROS
#-------------------------------------------------------------------
@@ -312,7 +329,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# FIXME: What if both regex libs are available. regex should be
# found outside the loop and only wx${LIB}${_UCD}${_DBG}.
# Find wxWidgets common libraries.
- foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
+ foreach(LIB ${wxWidgets_COMMON_LIBRARIES} ${wxWidgets_STC_LIBRARIES})
find_library(WX_${LIB}${_DBG}
NAMES
wx${LIB}${_UCD}${_DBG} # for regex
@@ -371,7 +388,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
# Clear all debug or release library paths (arguments are "d" or "").
macro(WX_CLEAR_ALL_LIBS _DBG)
# Clear wxWidgets common libraries.
- foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla)
+ foreach(LIB ${wxWidgets_COMMON_LIBRARIES} ${wxWidgets_STC_LIBRARIES})
WX_CLEAR_LIB(WX_${LIB}${_DBG})
endforeach()
@@ -441,12 +458,15 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
endif()
DBG_MSG_V("OpenGL")
- list(FIND ${_LIBS} gl WX_USE_GL)
- if(NOT WX_USE_GL EQUAL -1)
+ if(gl IN_LIST ${_LIBS})
DBG_MSG_V("- is required.")
list(APPEND wxWidgets_LIBRARIES opengl32 glu32)
endif()
+ if(stc IN_LIST ${_LIBS})
+ list(APPEND wxWidgets_LIBRARIES imm32)
+ endif()
+
list(APPEND wxWidgets_LIBRARIES winmm comctl32 uuid oleacc uxtheme rpcrt4 shlwapi version wsock32)
endmacro()
@@ -458,6 +478,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
foreach(version ${wx_versions})
foreach(patch RANGE 15 0 -1)
list(APPEND wx_paths "wxWidgets-${version}.${patch}")
+ foreach(tweak RANGE 3 1 -1)
+ list(APPEND wx_paths "wxWidgets-${version}.${patch}.${tweak}")
+ endforeach()
endforeach()
endforeach()
@@ -937,35 +960,38 @@ if(wxWidgets_FIND_STYLE STREQUAL "unix")
endif()
unset(_cygpath_exe CACHE)
endif()
-endif()
-# Check that all libraries are present, as wx-config does not check it
-set(_wx_lib_missing "")
-foreach(_wx_lib_ ${wxWidgets_LIBRARIES})
- if("${_wx_lib_}" MATCHES "^-l(.*)")
- set(_wx_lib_name "${CMAKE_MATCH_1}")
- 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)
- list(APPEND _wx_lib_missing ${_wx_lib_name})
- endif()
- unset(_wx_lib_found CACHE)
- endif()
-endforeach()
+ # Check that all libraries are present, as wx-config does not check it
+ set(_wx_lib_missing "")
+ foreach(_wx_lib_ ${wxWidgets_LIBRARIES})
+ if("${_wx_lib_}" MATCHES "^-l(.*)")
+ set(_wx_lib_name "${CMAKE_MATCH_1}")
+ 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)
+ list(APPEND _wx_lib_missing ${_wx_lib_name})
+ endif()
+ unset(_wx_lib_found CACHE)
+ endif()
+ endforeach()
-if (_wx_lib_missing)
- string(REPLACE ";" " " _wx_lib_missing "${_wx_lib_missing}")
- DBG_MSG_V("wxWidgets not found due to following missing libraries: ${_wx_lib_missing}")
- set(wxWidgets_FOUND FALSE)
- unset(wxWidgets_LIBRARIES)
+ if (_wx_lib_missing)
+ string(REPLACE ";" " " _wx_lib_missing "${_wx_lib_missing}")
+ DBG_MSG_V("wxWidgets not found due to following missing libraries: ${_wx_lib_missing}")
+ set(wxWidgets_FOUND FALSE)
+ unset(wxWidgets_LIBRARIES)
+ endif()
+ unset(_wx_lib_missing)
endif()
-unset(_wx_lib_missing)
# Check if a specific version was requested by find_package().
if(wxWidgets_FOUND)
wx_extract_version()
endif()
+file(TO_CMAKE_PATH "${wxWidgets_INCLUDE_DIRS}" wxWidgets_INCLUDE_DIRS)
+file(TO_CMAKE_PATH "${wxWidgets_LIBRARY_DIRS}" wxWidgets_LIBRARY_DIRS)
+
# Debug output:
DBG_MSG("wxWidgets_FOUND : ${wxWidgets_FOUND}")
DBG_MSG("wxWidgets_INCLUDE_DIRS : ${wxWidgets_INCLUDE_DIRS}")
@@ -1215,3 +1241,5 @@ function(WXWIDGETS_ADD_RESOURCES _outfiles)
set(${_outfiles} ${${_outfiles}} PARENT_SCOPE)
endfunction()
+
+cmake_policy(POP)
diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index a0f1862..2e8e14f 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -113,11 +113,15 @@ target_link_libraries(FortranCInterface PUBLIC symbols)
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND
CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
target_compile_options(FortranCInterface PRIVATE "-fno-lto")
- target_compile_options(myfort PRIVATE "-flto=auto" "-ffat-lto-objects")
+ if(NOT APPLE)
+ target_compile_options(myfort PRIVATE "-flto=auto" "-ffat-lto-objects")
+ endif()
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
- target_compile_options(symbols PRIVATE "-flto=auto" "-ffat-lto-objects")
+ if(NOT APPLE)
+ target_compile_options(symbols PRIVATE "-flto=auto" "-ffat-lto-objects")
+ endif()
endif()
file(GENERATE OUTPUT exe-$<CONFIG>.cmake CONTENT [[
diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake
index 010661e..c975a4b 100644
--- a/Modules/FortranCInterface/Detect.cmake
+++ b/Modules/FortranCInterface/Detect.cmake
@@ -10,7 +10,7 @@ if(NOT EXISTS ${FortranCInterface_BINARY_DIR}/Output.cmake
OR NOT EXISTS ${FortranCInterface_BINARY_DIR}/Input.cmake
OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake
IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Input.cmake
- OR NOT ${FortranCInterface_SOURCE_DIR}/Output.cmake
+ OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake
IS_NEWER_THAN ${FortranCInterface_SOURCE_DIR}/Output.cmake.in
OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake
IS_NEWER_THAN ${FortranCInterface_SOURCE_DIR}/CMakeLists.txt
@@ -76,8 +76,11 @@ endif()
# Load symbols from INFO:symbol[] strings in the executable.
set(FortranCInterface_SYMBOLS)
if(FortranCInterface_EXE)
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS "${FortranCInterface_EXE}" _info_strings
LIMIT_COUNT 8 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]")
+ cmake_policy(POP)
foreach(info ${_info_strings})
if("${info}" MATCHES "INFO:symbol\\[([^]]*)\\]")
list(APPEND FortranCInterface_SYMBOLS ${CMAKE_MATCH_1})
@@ -177,7 +180,6 @@ endforeach()
# Record the detection results.
configure_file(${FortranCInterface_SOURCE_DIR}/Output.cmake.in
${FortranCInterface_BINARY_DIR}/Output.cmake @ONLY)
-file(APPEND ${FortranCInterface_BINARY_DIR}/Output.cmake "\n")
# Report the results.
if(FortranCInterface_GLOBAL_FOUND)
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index 9796854..ed34c4a 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -20,11 +20,16 @@ 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 typically be a path relative to
- the installation prefix so that it can be converted to an absolute
- path in a relocatable way (see ``CMAKE_INSTALL_FULL_<dir>``).
- However, an absolute path is also allowed.
+ 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.
+
+ While absolute paths are allowed, they are not recommended as they
+ do not work with the ``cmake --install`` command's
+ :option:`--prefix <cmake--install --prefix>` option, or with the
+ :manual:`cpack <cpack(1)>` installer generators. In particular, there is no
+ need to make paths absolute by prepending :variable:`CMAKE_INSTALL_PREFIX`;
+ this prefix is used by default if the DESTINATION is a relative path.
``CMAKE_INSTALL_FULL_<dir>``
@@ -34,6 +39,11 @@ Inclusion of this module defines the following variables:
:variable:`CMAKE_INSTALL_PREFIX` variable. However, there are some
`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
+ :option:`--prefix <cmake--install --prefix>` option, or with the
+ :manual:`cpack <cpack(1)>` installer generators.
+
where ``<dir>`` is one of:
``BINDIR``
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 9fdc783..c959168 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -210,8 +210,8 @@ endmacro()
# TODO: Install this macro separately?
macro(_check_c_compiler_attribute _ATTRIBUTE _RESULT)
- check_source_compiles(C "${_ATTRIBUTE} int somefunc() { return 0; }
- int main() { return somefunc();}" ${_RESULT}
+ check_source_compiles(C "${_ATTRIBUTE} int somefunc(void) { return 0; }
+ int main(void) { return somefunc();}" ${_RESULT}
)
endmacro()
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 0ba35b6..b77f650 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -514,7 +514,7 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
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/)")
set(is_system 1)
endif()
endif()
@@ -748,7 +748,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(gp_regex_cmp_count 1)
elseif(gp_tool MATCHES "objdump(\\.exe)?$")
set(gp_cmd_args "-p")
- set(gp_regex "^\t*DLL Name: (.*\\.[Dd][Ll][Ll])${eol_char}$")
+ set(gp_regex "^[\t ]*DLL Name: (.*\\.[Dd][Ll][Ll])${eol_char}$")
set(gp_regex_error "")
set(gp_regex_fallback "")
set(gp_regex_cmp_count 1)
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index 57a7476..e187804 100644
--- a/Modules/GoogleTest.cmake
+++ b/Modules/GoogleTest.cmake
@@ -347,16 +347,51 @@ function(gtest_add_tests)
unset(testList)
- set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
+ set(gtest_case_name_regex ".*\\([ \r\n\t]*([A-Za-z_0-9]+)[ \r\n\t]*,[ \r\n\t]*([A-Za-z_0-9]+)[ \r\n\t]*\\).*")
set(gtest_test_type_regex "(TYPED_TEST|TEST)_?[FP]?")
+ set(each_line_regex "([^\r\n]*[\r\n])")
foreach(source IN LISTS ARGS_SOURCES)
if(NOT ARGS_SKIP_DEPENDENCY)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source})
endif()
file(READ "${source}" contents)
- string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests "${contents}")
- foreach(hit ${found_tests})
+ # Replace characters in file content that are special to CMake
+ string(REPLACE "[" "<OPEN_BRACKET>" contents "${contents}")
+ string(REPLACE "]" "<CLOSE_BRACKET>" contents "${contents}")
+ string(REPLACE ";" "\\;" contents "${contents}")
+ # Split into lines
+ string(REGEX MATCHALL "${each_line_regex}" content_lines "${contents}")
+ set(line "0")
+ # Stores the line number of the start of a test definition
+ set(accumulate_line "0")
+ # Stores accumulated lines to match multi-line test definitions
+ set(accumulated "")
+ # Iterate over each line in the file so that we know the line number of a test definition
+ foreach(line_str IN LISTS content_lines)
+ MATH(EXPR line "${line}+1")
+ # Check if the current line is the start of a test definition
+ string(REGEX MATCH "[ \t]*${gtest_test_type_regex}[ \t]*[\\(]*" accumlate_start_hit "${line_str}")
+ if(accumlate_start_hit)
+ set(accumulate_line "${line}")
+ endif()
+ # Append the current line to the accumulated string
+ set(accumulated "${accumulated}${line_str}")
+ # Attempt to match a complete test definition in the accumulated string
+ string(REGEX MATCH "${gtest_test_type_regex}[ \r\n\t]*\\(([A-Za-z_0-9 ,\r\n\t]+)\\)" hit "${accumulated}")
+ if(hit)
+ # Reset accumulated for the next match
+ set(accumulated "")
+ else()
+ # Continue accumulating lines
+ continue()
+ endif()
+ # At this point, the start line of the test definition is known
+ # Hence, we can set the test's DEF_SOURCE_LINE property with
+ # ${source}:${accumulate_line} below.
+ # VS Code CMake Tools extension looks for DEF_SOURCE_LINE
+ # to locate the test definition for its "Go to test" feature.
+
string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})
# Parameterized tests have a different signature for the filter
@@ -394,7 +429,8 @@ function(gtest_add_tests)
--gtest_filter=${gtest_test_name}
${ARGS_EXTRA_ARGS}
)
- set_tests_properties(${ctest_test_name} PROPERTIES DISABLED TRUE)
+ set_tests_properties(${ctest_test_name} PROPERTIES DISABLED TRUE
+ DEF_SOURCE_LINE "${source}:${accumulate_line}")
list(APPEND testList ${ctest_test_name})
endif()
else()
@@ -410,6 +446,7 @@ function(gtest_add_tests)
${ctest_test_name}
PROPERTIES
SKIP_REGULAR_EXPRESSION "\\[ SKIPPED \\]"
+ DEF_SOURCE_LINE "${source}:${accumulate_line}"
)
list(APPEND testList ${ctest_test_name})
endif()
@@ -475,10 +512,29 @@ function(gtest_discover_tests TARGET)
set(ctest_file_base "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}[${counter}]")
set(ctest_include_file "${ctest_file_base}_include.cmake")
set(ctest_tests_file "${ctest_file_base}_tests.cmake")
- get_property(crosscompiling_emulator
+ get_property(test_launcher
TARGET ${TARGET}
- PROPERTY CROSSCOMPILING_EMULATOR
+ PROPERTY TEST_LAUNCHER
+ )
+ cmake_policy(GET CMP0158 _CMP0158
+ PARENT_SCOPE # undocumented, do not use outside of CMake
)
+ if(NOT _CMP0158 OR _CMP0158 STREQUAL "OLD" OR _CMP0158 STREQUAL "NEW" AND CMAKE_CROSSCOMPILING)
+ get_property(crosscompiling_emulator
+ TARGET ${TARGET}
+ PROPERTY CROSSCOMPILING_EMULATOR
+ )
+ endif()
+
+ if(test_launcher AND crosscompiling_emulator)
+ set(test_executor "${test_launcher}" "${crosscompiling_emulator}")
+ elseif(test_launcher)
+ set(test_executor "${test_launcher}")
+ elseif(crosscompiling_emulator)
+ set(test_executor "${crosscompiling_emulator}")
+ else()
+ set(test_executor "")
+ endif()
if(_DISCOVERY_MODE STREQUAL "POST_BUILD")
add_custom_command(
@@ -487,7 +543,7 @@ function(gtest_discover_tests TARGET)
COMMAND "${CMAKE_COMMAND}"
-D "TEST_TARGET=${TARGET}"
-D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
- -D "TEST_EXECUTOR=${crosscompiling_emulator}"
+ -D "TEST_EXECUTOR=${test_executor}"
-D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
-D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
-D "TEST_PROPERTIES=${_PROPERTIES}"
@@ -500,7 +556,7 @@ function(gtest_discover_tests TARGET)
-D "CTEST_FILE=${ctest_tests_file}"
-D "TEST_DISCOVERY_TIMEOUT=${_DISCOVERY_TIMEOUT}"
-D "TEST_XML_OUTPUT_DIR=${_XML_OUTPUT_DIR}"
- -P "${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}"
+ -P "${CMAKE_ROOT}/Modules/GoogleTestAddTests.cmake"
VERBATIM
)
@@ -526,10 +582,10 @@ function(gtest_discover_tests TARGET)
" if(NOT EXISTS \"${ctest_tests_file}\" OR" "\n"
" NOT \"${ctest_tests_file}\" IS_NEWER_THAN \"$<TARGET_FILE:${TARGET}>\" OR\n"
" NOT \"${ctest_tests_file}\" IS_NEWER_THAN \"\${CMAKE_CURRENT_LIST_FILE}\")\n"
- " include(\"${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}\")" "\n"
+ " include(\"${CMAKE_ROOT}/Modules/GoogleTestAddTests.cmake\")" "\n"
" gtest_discover_tests_impl(" "\n"
" TEST_EXECUTABLE" " [==[" "$<TARGET_FILE:${TARGET}>" "]==]" "\n"
- " TEST_EXECUTOR" " [==[" "${crosscompiling_emulator}" "]==]" "\n"
+ " TEST_EXECUTOR" " [==[" "${test_executor}" "]==]" "\n"
" TEST_WORKING_DIR" " [==[" "${_WORKING_DIRECTORY}" "]==]" "\n"
" TEST_EXTRA_ARGS" " [==[" "${_EXTRA_ARGS}" "]==]" "\n"
" TEST_PROPERTIES" " [==[" "${_PROPERTIES}" "]==]" "\n"
@@ -573,9 +629,5 @@ endfunction()
###############################################################################
-set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
- ${CMAKE_CURRENT_LIST_DIR}/GoogleTestAddTests.cmake
-)
-
# Restore project's policies
cmake_policy(POP)
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index de0f7d6..eea267d 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -112,6 +112,7 @@ function(gtest_discover_tests_impl)
message(FATAL_ERROR
"Error running test executable.\n"
" Path: '${path}'\n"
+ " Working directory: '${_TEST_WORKING_DIR}'\n"
" Result: ${result}\n"
" Output:\n"
" ${output}\n"
diff --git a/Modules/Internal/AppleArchitectureSelection.cmake.in b/Modules/Internal/AppleArchitectureSelection.cmake.in
new file mode 100644
index 0000000..0c3a3a2
--- /dev/null
+++ b/Modules/Internal/AppleArchitectureSelection.cmake.in
@@ -0,0 +1,23 @@
+# Save this now so we can restore it before returning
+if(NOT DEFINED PACKAGE_PREFIX_DIR)
+ list(APPEND _gasf_PACKAGE_PREFIX_DIR "<__CMAKE_UNDEFINED__>")
+elseif("${PACKAGE_PREFIX_DIR}" STREQUAL "")
+ list(APPEND _gasf_PACKAGE_PREFIX_DIR "<__CMAKE_EMPTY__>")
+else()
+ list(APPEND _gasf_PACKAGE_PREFIX_DIR "${PACKAGE_PREFIX_DIR}")
+endif()
+
+@PACKAGE_INIT@
+@_branch_code@
+
+# Restore PACKAGE_PREFIX_DIR
+list(LENGTH _gasf_PACKAGE_PREFIX_DIR _gasf_tmp)
+math(EXPR _gasf_tmp "${_gasf_tmp} - 1")
+list(GET _gasf_PACKAGE_PREFIX_DIR ${_gasf_tmp} PACKAGE_PREFIX_DIR)
+list(REMOVE_AT _gasf_PACKAGE_PREFIX_DIR ${_gasf_tmp})
+unset(_gasf_tmp)
+if("${PACKAGE_PREFIX_DIR}" STREQUAL "<__CMAKE_UNDEFINED__>")
+ unset(PACKAGE_PREFIX_DIR)
+elseif("${PACKAGE_PREFIX_DIR}" STREQUAL "<__CMAKE_EMPTY__>")
+ set(PACKAGE_PREFIX_DIR "")
+endif()
diff --git a/Modules/Internal/ApplePlatformSelection.cmake.in b/Modules/Internal/ApplePlatformSelection.cmake.in
new file mode 100644
index 0000000..c07f139
--- /dev/null
+++ b/Modules/Internal/ApplePlatformSelection.cmake.in
@@ -0,0 +1,46 @@
+# Save this now so we can restore it before returning
+if(NOT DEFINED PACKAGE_PREFIX_DIR)
+ list(APPEND _gpsf_PACKAGE_PREFIX_DIR "<__CMAKE_UNDEFINED__>")
+elseif("${PACKAGE_PREFIX_DIR}" STREQUAL "")
+ list(APPEND _gpsf_PACKAGE_PREFIX_DIR "<__CMAKE_EMPTY__>")
+else()
+ list(APPEND _gpsf_PACKAGE_PREFIX_DIR "${PACKAGE_PREFIX_DIR}")
+endif()
+
+@PACKAGE_INIT@
+
+string(TOLOWER "${CMAKE_OSX_SYSROOT}" _CMAKE_OSX_SYSROOT_LOWER)
+@_branch_INIT@
+if(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)iphonesimulator")
+ @_branch_IOS_SIMULATOR_INCLUDE_FILE@
+elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)iphoneos")
+ @_branch_IOS_INCLUDE_FILE@
+elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)appletvsimulator")
+ @_branch_TVOS_SIMULATOR_INCLUDE_FILE@
+elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)appletvos")
+ @_branch_TVOS_INCLUDE_FILE@
+elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)watchsimulator")
+ @_branch_WATCHOS_SIMULATOR_INCLUDE_FILE@
+elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)watchos")
+ @_branch_WATCHOS_INCLUDE_FILE@
+elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)xrsimulator")
+ @_branch_VISIONOS_SIMULATOR_INCLUDE_FILE@
+elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)xros")
+ @_branch_VISIONOS_INCLUDE_FILE@
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ @_branch_MACOS_INCLUDE_FILE@
+else()
+ @_branch_ELSE@
+endif()
+
+# Restore PACKAGE_PREFIX_DIR
+list(LENGTH _gpsf_PACKAGE_PREFIX_DIR _gpsf_tmp)
+math(EXPR _gpsf_tmp "${_gpsf_tmp} - 1")
+list(GET _gpsf_PACKAGE_PREFIX_DIR ${_gpsf_tmp} PACKAGE_PREFIX_DIR)
+list(REMOVE_AT _gpsf_PACKAGE_PREFIX_DIR ${_gpsf_tmp})
+unset(_gpsf_tmp)
+if("${PACKAGE_PREFIX_DIR}" STREQUAL "<__CMAKE_UNDEFINED__>")
+ unset(PACKAGE_PREFIX_DIR)
+elseif("${PACKAGE_PREFIX_DIR}" STREQUAL "<__CMAKE_EMPTY__>")
+ set(PACKAGE_PREFIX_DIR "")
+endif()
diff --git a/Modules/Internal/CMakeDetermineLinkerId.cmake b/Modules/Internal/CMakeDetermineLinkerId.cmake
new file mode 100644
index 0000000..45499a5
--- /dev/null
+++ b/Modules/Internal/CMakeDetermineLinkerId.cmake
@@ -0,0 +1,107 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# Function to identify the linker. This is used internally by CMake and should
+# not be included by user code.
+# If successful, sets CMAKE_<lang>_COMPILER_LINKER_ID and
+# CMAKE_<lang>_COMPILER_LINKER_VERSION
+
+cmake_policy(PUSH)
+cmake_policy(SET CMP0053 NEW)
+cmake_policy(SET CMP0054 NEW)
+
+function(cmake_determine_linker_id lang linker)
+ if (NOT linker)
+ # linker was not identified
+ unset(CMAKE_${lang}_COMPILER_LINKER_ID PARENT_SCOPE)
+ unset(CMAKE_${lang}_COMPILER_LINKER_VERSION PARENT_SCOPE)
+ unset(CMAKE_${lang}_COMPILER_LINKER_FRONTEND_VARIANT PARENT_SCOPE)
+ return()
+ endif()
+
+ set(linker_id)
+ set(linker_frontend)
+ set(linker_version)
+
+ # Compute the linker ID and version.
+ foreach(flags IN ITEMS
+ "-v" # AppleClang, GNU, GNUgold, MOLD
+ "-V" # AIX, Solaris
+ "--version" # LLD
+ )
+ execute_process(COMMAND "${linker}" ${flags}
+ OUTPUT_VARIABLE linker_desc
+ ERROR_VARIABLE linker_desc
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE)
+
+ string(JOIN "\" \"" flags_string ${flags})
+ string(REGEX REPLACE "\n\n.*" "" linker_desc_head "${linker_desc}")
+ message(CONFIGURE_LOG
+ "Running the ${lang} compiler's linker: \"${linker}\" \"${flags_string}\"\n"
+ "${linker_desc_head}\n"
+ )
+
+ if(CMAKE_EFFECTIVE_SYSTEM_NAME STREQUAL "Apple" AND linker_desc MATCHES "@\\(#\\)PROGRAM:ld.+PROJECT:[a-z0-9]+-([0-9.]+).+")
+ set(linker_id "AppleClang")
+ set(linker_frontend "GNU")
+ set(linker_version "${CMAKE_MATCH_1}")
+ break()
+ elseif(linker_desc MATCHES "mold \\(sold\\) ([0-9.]+)")
+ set(linker_id "MOLD")
+ set(linker_frontend "GNU")
+ set(linker_version "${CMAKE_MATCH_1}")
+ break()
+ elseif(linker_desc MATCHES "mold ([0-9.]+)")
+ set(linker_id "MOLD")
+ set(linker_frontend "GNU")
+ set(linker_version "${CMAKE_MATCH_1}")
+ break()
+ elseif(linker_desc MATCHES "LLD ([0-9.]+)")
+ set(linker_id "LLD")
+ set(linker_frontend "GNU")
+ set(linker_version "${CMAKE_MATCH_1}")
+ if(WIN32 AND NOT linker_desc MATCHES "compatible with GNU")
+ set(linker_frontend "MSVC")
+ endif()
+ break()
+ elseif(linker_desc MATCHES "GNU ld (\\([^)]+\\)|version) ([0-9.]+)")
+ set(linker_id "GNU")
+ set(linker_frontend "GNU")
+ set(linker_version "${CMAKE_MATCH_2}")
+ break()
+ elseif(linker_desc MATCHES "GNU gold \\([^)]+\\) ([0-9.]+)")
+ set(linker_id "GNUgold")
+ set(linker_frontend "GNU")
+ set(linker_version "${CMAKE_MATCH_1}")
+ break()
+ elseif(linker_desc MATCHES "Microsoft \\(R\\) Incremental Linker Version ([0-9.]+)")
+ set(linker_id "MSVC")
+ set(linker_frontend "MSVC")
+ set(linker_version "${CMAKE_MATCH_1}")
+ break()
+ elseif (CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND linker_desc MATCHES "Solaris Link Editors: ([0-9.-]+)")
+ set(linker_id "Solaris")
+ set(linker_version "${CMAKE_MATCH_1}")
+ break()
+ elseif (CMAKE_SYSTEM_NAME STREQUAL "AIX" AND linker_desc MATCHES " LD ([0-9.]+)")
+ set(linker_id "AIX")
+ set(linker_version "${CMAKE_MATCH_1}")
+ break()
+ endif()
+ endforeach()
+
+ set(CMAKE_${lang}_COMPILER_LINKER_ID "${linker_id}" PARENT_SCOPE)
+ if (linker_frontend)
+ set(CMAKE_${lang}_COMPILER_LINKER_FRONTEND_VARIANT "${linker_frontend}" PARENT_SCOPE)
+ else()
+ unset(CMAKE_${lang}_COMPILER_LINKER_FRONTEND_VARIANT PARENT_SCOPE)
+ endif()
+ if (linker_version)
+ set(CMAKE_${lang}_COMPILER_LINKER_VERSION "${linker_version}" PARENT_SCOPE)
+ else()
+ unset(CMAKE_${lang}_COMPILER_LINKER_VERSION PARENT_SCOPE)
+ endif()
+endfunction()
+
+cmake_policy(POP)
diff --git a/Modules/Internal/CPack/CPack.NuGet.nuspec.in b/Modules/Internal/CPack/CPack.NuGet.nuspec.in
index d89d69f..4548a59 100644
--- a/Modules/Internal/CPack/CPack.NuGet.nuspec.in
+++ b/Modules/Internal/CPack/CPack.NuGet.nuspec.in
@@ -15,12 +15,14 @@
@_CPACK_NUGET_LICENSE_TAG@
@_CPACK_NUGET_ICONURL_TAG@
@_CPACK_NUGET_ICON_TAG@
+ @_CPACK_NUGET_README_TAG@
@_CPACK_NUGET_REQUIRELICENSEACCEPTANCE_TAG@
@_CPACK_NUGET_SUMMARY_TAG@
@_CPACK_NUGET_RELEASENOTES_TAG@
@_CPACK_NUGET_COPYRIGHT_TAG@
@_CPACK_NUGET_LANGUAGE_TAG@
@_CPACK_NUGET_TAGS_TAG@
+ @_CPACK_NUGET_REPOSITORY_TAG@
@_CPACK_NUGET_DEPENDENCIES_TAG@
</metadata>
@_CPACK_NUGET_FILES_TAG@
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake
index 38e32c2..5a78e3f 100644
--- a/Modules/Internal/CPack/CPackDeb.cmake
+++ b/Modules/Internal/CPack/CPackDeb.cmake
@@ -487,7 +487,7 @@ function(cpack_deb_prepare_package_vars)
if(DEFINED ${_component_var})
set(CPACK_DEBIAN_PACKAGE_${value_type_} "${${_component_var}}")
if(CPACK_DEBIAN_PACKAGE_DEBUG)
- message("CPackDeb Debug: component '${_local_component_name}' ${value_type_} "
+ message("CPackDeb Debug: component '${CPACK_DEB_PACKAGE_COMPONENT}' ${value_type_} "
"value set to '${CPACK_DEBIAN_PACKAGE_${value_type_}}'")
endif()
endif()
@@ -710,7 +710,7 @@ function(cpack_deb_prepare_package_vars)
"${CPACK_DEBIAN_PACKAGE_NAME}-dbgsym_${CPACK_DEBIAN_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.ddeb")
else()
if(NOT CPACK_DEBIAN_FILE_NAME MATCHES ".*\\.(deb|ipk)")
- message(FATAL_ERROR "'${CPACK_DEBIAN_FILE_NAME}' is not a valid DEB package file name as it must end with '.deb' or '.ipk'!")
+ set(CPACK_DEBIAN_FILE_NAME "${CPACK_DEBIAN_FILE_NAME}.deb")
endif()
set(CPACK_OUTPUT_FILE_NAME "${CPACK_DEBIAN_FILE_NAME}")
diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake
index 056d025..67f318a 100644
--- a/Modules/Internal/CPack/CPackNuGet.cmake
+++ b/Modules/Internal/CPack/CPackNuGet.cmake
@@ -294,6 +294,27 @@ function(_cpack_nuget_render_spec)
# attributes: "type", "url", "branch", and "commit". While all fields are
# considered optional, they are not independent. Currently unsupported.
+ # NuGet >= 5.10
+ _cpack_nuget_variable_fallback_and_wrap_into_element(readme README)
+
+ set(_CPACK_NUGET_REPOSITORY_TAG)
+ _cpack_nuget_variable_fallback(_repo_type REPOSITORY_TYPE)
+ _cpack_nuget_variable_fallback(_repo_url REPOSITORY_URL)
+ if(_repo_type AND _repo_url)
+ set(_CPACK_NUGET_REPOSITORY_TAG "<repository type=\"${_repo_type}\" url=\"${_repo_url}\"")
+ _cpack_nuget_variable_fallback(_repo_br REPOSITORY_BRANCH)
+ if(_repo_br)
+ string(APPEND _CPACK_NUGET_REPOSITORY_TAG " branch=\"${_repo_br}\"")
+ endif()
+ _cpack_nuget_variable_fallback(_repo_commit REPOSITORY_COMMIT)
+ if(_repo_commit)
+ string(APPEND _CPACK_NUGET_REPOSITORY_TAG " commit=\"${_repo_commit}\"")
+ endif()
+ string(APPEND _CPACK_NUGET_REPOSITORY_TAG " />")
+ else()
+ message(AUTHOR_WARNING "Skip adding the `<repository .../>` element due to missing URL or type")
+ endif()
+
# Handle dependencies
_cpack_nuget_variable_fallback(_deps DEPENDENCIES)
set(_collected_deps)
diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake
index ace2c6b..23fb823 100644
--- a/Modules/Internal/CPack/CPackRPM.cmake
+++ b/Modules/Internal/CPack/CPackRPM.cmake
@@ -861,7 +861,7 @@ function(cpack_rpm_generate_package)
# If rpmbuild is found
# we try to discover alien since we may be on non RPM distro like Debian.
- # In this case we may try to to use more advanced features
+ # In this case we may try to use more advanced features
# like generating RPM directly from DEB using alien.
# FIXME feature not finished (yet)
find_program(ALIEN_EXECUTABLE alien)
@@ -1041,7 +1041,11 @@ function(cpack_rpm_generate_package)
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
- set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
+ if(CPACK_THREADS GREATER "0")
+ set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7T${CPACK_THREADS}.xzdio")
+ else()
+ set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7T.xzdio")
+ endif()
endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
@@ -1577,7 +1581,7 @@ ${TMP_DEBUGINFO_ADDITIONAL_SOURCES}
if(NOT CPACK_RPM_FILE_NAME STREQUAL "RPM-DEFAULT")
if(CPACK_RPM_FILE_NAME)
if(NOT CPACK_RPM_FILE_NAME MATCHES ".*\\.rpm")
- message(FATAL_ERROR "'${CPACK_RPM_FILE_NAME}' is not a valid RPM package file name as it must end with '.rpm'!")
+ set(CPACK_RPM_FILE_NAME "${CPACK_RPM_FILE_NAME}.rpm")
endif()
else()
# old file name format for back compatibility
diff --git a/Modules/Internal/CPack/CPackWIX.cmake b/Modules/Internal/CPack/CPackWIX.cmake
index d1875f2..103d21c 100644
--- a/Modules/Internal/CPack/CPackWIX.cmake
+++ b/Modules/Internal/CPack/CPackWIX.cmake
@@ -5,16 +5,26 @@ if(NOT CPACK_WIX_ROOT)
string(REPLACE "\\" "/" CPACK_WIX_ROOT "$ENV{WIX}")
endif()
-find_program(CPACK_WIX_CANDLE_EXECUTABLE candle
- PATHS "${CPACK_WIX_ROOT}" PATH_SUFFIXES "bin")
+if(CPACK_WIX_VERSION VERSION_GREATER_EQUAL 4)
+ find_program(CPACK_WIX_EXECUTABLE NAMES wix
+ PATHS "${CPACK_WIX_ROOT}" PATH_SUFFIXES "bin")
+ if(NOT CPACK_WIX_EXECUTABLE)
+ message(FATAL_ERROR "Could not find the 'wix' executable.")
+ endif()
+else()
+ find_program(CPACK_WIX_CANDLE_EXECUTABLE candle
+ PATHS "${CPACK_WIX_ROOT}" PATH_SUFFIXES "bin")
+ if(NOT CPACK_WIX_CANDLE_EXECUTABLE)
+ message(FATAL_ERROR "Could not find the WiX candle executable.")
+ endif()
-if(NOT CPACK_WIX_CANDLE_EXECUTABLE)
- message(FATAL_ERROR "Could not find the WiX candle executable.")
+ find_program(CPACK_WIX_LIGHT_EXECUTABLE light
+ PATHS "${CPACK_WIX_ROOT}" PATH_SUFFIXES "bin")
+ if(NOT CPACK_WIX_LIGHT_EXECUTABLE)
+ message(FATAL_ERROR "Could not find the WiX light executable.")
+ endif()
endif()
-find_program(CPACK_WIX_LIGHT_EXECUTABLE light
- PATHS "${CPACK_WIX_ROOT}" PATH_SUFFIXES "bin")
-
-if(NOT CPACK_WIX_LIGHT_EXECUTABLE)
- message(FATAL_ERROR "Could not find the WiX light executable.")
+if(NOT DEFINED CPACK_WIX_INSTALL_SCOPE)
+ set(CPACK_WIX_INSTALL_SCOPE "perMachine")
endif()
diff --git a/Modules/Internal/CPack/WIX-v3/WIX.template.in b/Modules/Internal/CPack/WIX-v3/WIX.template.in
new file mode 100644
index 0000000..71ec5b2
--- /dev/null
+++ b/Modules/Internal/CPack/WIX-v3/WIX.template.in
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?include "cpack_variables.wxi"?>
+
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"@CPACK_WIX_CUSTOM_XMLNS_EXPANDED@
+ RequiredVersion="3.6.3303.0">
+
+ <Product Id="$(var.CPACK_WIX_PRODUCT_GUID)"
+ Name="$(var.CPACK_PACKAGE_NAME)"
+ Language="1033"
+ Version="$(var.CPACK_PACKAGE_VERSION)"
+ Manufacturer="$(var.CPACK_PACKAGE_VENDOR)"
+ UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)">
+
+
+ <?if $(var.CPACK_WIX_INSTALL_SCOPE) = "NONE" ?>
+ <Package InstallerVersion="301" Compressed="yes"/>
+ <?else?>
+ <Package InstallerVersion="301" Compressed="yes" InstallScope="$(var.CPACK_WIX_INSTALL_SCOPE)"/>
+ <?endif?>
+
+ <Media Id="1" Cabinet="media1.cab" EmbedCab="yes"/>
+
+ <MajorUpgrade
+ Schedule="afterInstallInitialize"
+ AllowSameVersionUpgrades="yes"
+ DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/>
+
+ <WixVariable Id="WixUILicenseRtf" Value="$(var.CPACK_WIX_LICENSE_RTF)"/>
+ <Property Id="WIXUI_INSTALLDIR" Value="INSTALL_ROOT"/>
+
+ <?ifdef CPACK_WIX_PRODUCT_ICON?>
+ <Property Id="ARPPRODUCTICON">ProductIcon.ico</Property>
+ <Icon Id="ProductIcon.ico" SourceFile="$(var.CPACK_WIX_PRODUCT_ICON)"/>
+ <?endif?>
+
+ <?ifdef CPACK_WIX_UI_BANNER?>
+ <WixVariable Id="WixUIBannerBmp" Value="$(var.CPACK_WIX_UI_BANNER)"/>
+ <?endif?>
+
+ <?ifdef CPACK_WIX_UI_DIALOG?>
+ <WixVariable Id="WixUIDialogBmp" Value="$(var.CPACK_WIX_UI_DIALOG)"/>
+ <?endif?>
+
+ <FeatureRef Id="ProductFeature"/>
+
+ <UIRef Id="$(var.CPACK_WIX_UI_REF)" />
+ <UIRef Id="WixUI_ErrorProgressText" />
+
+ <?include "properties.wxi"?>
+ <?include "product_fragment.wxi"?>
+ </Product>
+</Wix>
diff --git a/Modules/Internal/CPack/WIX.template.in b/Modules/Internal/CPack/WIX.template.in
index c0bf935..7cad186 100644
--- a/Modules/Internal/CPack/WIX.template.in
+++ b/Modules/Internal/CPack/WIX.template.in
@@ -2,17 +2,22 @@
<?include "cpack_variables.wxi"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" @CPACK_WIX_CUSTOM_XMLNS_EXPANDED@
- RequiredVersion="3.6.3303.0">
+<Wix
+ xmlns="http://wixtoolset.org/schemas/v4/wxs"@CPACK_WIX_CUSTOM_XMLNS_EXPANDED@
+ RequiredVersion="4.0"
+ >
- <Product Id="$(var.CPACK_WIX_PRODUCT_GUID)"
+ <Package
Name="$(var.CPACK_PACKAGE_NAME)"
- Language="1033"
Version="$(var.CPACK_PACKAGE_VERSION)"
Manufacturer="$(var.CPACK_PACKAGE_VENDOR)"
- UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)">
-
- <Package InstallerVersion="301" Compressed="yes"/>
+ UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)"
+ ProductCode="$(var.CPACK_WIX_PRODUCT_GUID)"
+ Scope="$(var.CPACK_WIX_INSTALL_SCOPE)"
+ InstallerVersion="500"
+ Language="1033"
+ Compressed="yes"
+ >
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes"/>
@@ -25,7 +30,7 @@
<Property Id="WIXUI_INSTALLDIR" Value="INSTALL_ROOT"/>
<?ifdef CPACK_WIX_PRODUCT_ICON?>
- <Property Id="ARPPRODUCTICON">ProductIcon.ico</Property>
+ <Property Id="ARPPRODUCTICON" Value="ProductIcon.ico" />
<Icon Id="ProductIcon.ico" SourceFile="$(var.CPACK_WIX_PRODUCT_ICON)"/>
<?endif?>
@@ -39,9 +44,10 @@
<FeatureRef Id="ProductFeature"/>
- <UIRef Id="$(var.CPACK_WIX_UI_REF)" />
+ <ui:WixUI Id="$(var.CPACK_WIX_UI_REF)" />
+ <UIRef Id="WixUI_ErrorProgressText" />
<?include "properties.wxi"?>
<?include "product_fragment.wxi"?>
- </Product>
+ </Package>
</Wix>
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake
index c2bd14f..64d477b 100644
--- a/Modules/Internal/FeatureTesting.cmake
+++ b/Modules/Internal/FeatureTesting.cmake
@@ -52,8 +52,11 @@ macro(_record_compiler_features lang compile_flags feature_list)
if (_result EQUAL 0)
if(EXISTS "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin")
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin"
features REGEX "${lang}_FEATURE:.*")
+ cmake_policy(POP)
foreach(info ${features})
string(REPLACE "${lang}_FEATURE:" "" info ${info})
string(SUBSTRING ${info} 0 1 has_feature)
diff --git a/Modules/KDE3Macros.cmake b/Modules/KDE3Macros.cmake
index 1c353ba..42f6d2c 100644
--- a/Modules/KDE3Macros.cmake
+++ b/Modules/KDE3Macros.cmake
@@ -213,7 +213,10 @@ macro(KDE3_AUTOMOC)
if (EXISTS ${_abs_FILE} AND NOT _skip)
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS ${_abs_FILE} _match REGEX "#include +[^ ]+\\.moc[\">]")
+ cmake_policy(POP)
get_filename_component(_abs_PATH ${_abs_FILE} PATH)
diff --git a/Modules/Platform/ADSP-Common.cmake b/Modules/Platform/ADSP-Common.cmake
index 2ba90b2..7ec8a6f 100644
--- a/Modules/Platform/ADSP-Common.cmake
+++ b/Modules/Platform/ADSP-Common.cmake
@@ -9,9 +9,9 @@ macro(__platform_adsp_init)
set(CMAKE_ADSP_PROCESSOR "ADSP-${CMAKE_SYSTEM_PROCESSOR}")
string(TOUPPER "${CMAKE_ADSP_PROCESSOR}" CMAKE_ADSP_PROCESSOR)
- set(CMAKE_ADSP_COMPILER_NAME cc21k.exe)
+ set(CMAKE_ADSP_COMPILER_NAME "cc21k${CMAKE_EXECUTABLE_SUFFIX}")
if(CMAKE_ADSP_PROCESSOR MATCHES "^ADSP-BF")
- set(CMAKE_ADSP_COMPILER_NAME ccblkfn.exe)
+ set(CMAKE_ADSP_COMPILER_NAME "ccblkfn${CMAKE_EXECUTABLE_SUFFIX}")
endif()
set(CMAKE_ADSP_PLATFORM_INITIALIZED TRUE)
@@ -20,7 +20,12 @@ endmacro()
macro(__platform_adsp lang)
__platform_adsp_init()
- set(CMAKE_${lang}_COMPILER "${CMAKE_ADSP_ROOT}/${CMAKE_ADSP_COMPILER_NAME}")
+ find_program(
+ CMAKE_${lang}_COMPILER
+ "${CMAKE_ADSP_COMPILER_NAME}"
+ PATHS "${CMAKE_ADSP_ROOT}"
+ REQUIRED
+ )
execute_process(
COMMAND "${CMAKE_${lang}_COMPILER}" "-proc=${CMAKE_ADSP_PROCESSOR}" "-version"
diff --git a/Modules/Platform/ADSP-Determine.cmake b/Modules/Platform/ADSP-Determine.cmake
index 6ccf1ea..1588c92 100644
--- a/Modules/Platform/ADSP-Determine.cmake
+++ b/Modules/Platform/ADSP-Determine.cmake
@@ -21,6 +21,6 @@ endif()
if(NOT CMAKE_ADSP_ROOT)
_find_adsp_root("C:/Program Files (x86)/Analog Devices/VisualDSP *")
endif()
-if(NOT IS_DIRECTORY "${CMAKE_ADSP_ROOT}")
- message(FATAL_ERROR "ADSP: could not find CCES/VDSP++ install directory ${CMAKE_ADSP_ROOT}")
+if(NOT CMAKE_ADSP_ROOT)
+ _find_adsp_root("/opt/analog/cces *")
endif()
diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake
index a9aa8e0..55a6680 100644
--- a/Modules/Platform/AIX-GNU.cmake
+++ b/Modules/Platform/AIX-GNU.cmake
@@ -14,8 +14,11 @@ macro(__aix_compiler_gnu lang)
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS " -Wl,-bnoipath")
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall") # CMP0065 old behavior
set(CMAKE_${lang}_USE_IMPLICIT_LINK_DIRECTORIES_IN_RUNTIME_PATH 1)
+ set(CMAKE_${lang}_VERBOSE_LINK_FLAG "-Wl,-v")
set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath")
+ set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE UNICITY=ALL)
+
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 7 OR CMAKE_SYSTEM_VERSION VERSION_LESS 7.1)
unset(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY)
endif()
diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake
index 902cbb3..c225de9 100644
--- a/Modules/Platform/AIX-XL.cmake
+++ b/Modules/Platform/AIX-XL.cmake
@@ -17,6 +17,7 @@ macro(__aix_compiler_xl lang)
set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ")
set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath")
+ set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE UNICITY=ALL)
set(_OBJECTS " <OBJECTS>")
if(DEFINED CMAKE_XL_CreateExportList AND CMAKE_XL_CreateExportList STREQUAL "")
diff --git a/Modules/Platform/AIX/ExportImportList b/Modules/Platform/AIX/ExportImportList
index 5e16fcb..7c269fd 100755
--- a/Modules/Platform/AIX/ExportImportList
+++ b/Modules/Platform/AIX/ExportImportList
@@ -63,7 +63,7 @@ if test -z "$no_objects"; then
V["EXPORTED"]=" export"
V["PROTECTED"]=" protected"
}
- /^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / {
+ /^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|tdata|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / {
if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) {
print $NF V[$(NF-1)]
}
diff --git a/Modules/Platform/ARTOS.cmake b/Modules/Platform/ARTOS.cmake
index f9365d6..1448191 100644
--- a/Modules/Platform/ARTOS.cmake
+++ b/Modules/Platform/ARTOS.cmake
@@ -7,7 +7,7 @@ set(CMAKE_SHARED_LIBRARY_SUFFIX ".a")
set(CMAKE_EXECUTABLE_SUFFIX ".x")
set(CMAKE_DL_LIBS "")
-set(CMAKE_FIND_LIBRARY_PREFIXES "")
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
# ARTOS does not support shared libs
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake
index 307e4c9..cecdde8 100644
--- a/Modules/Platform/Android-Determine.cmake
+++ b/Modules/Platform/Android-Determine.cmake
@@ -32,6 +32,7 @@ endif()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
# If using Android tools for Visual Studio, compile a sample project to get the
# NDK path and set the processor from the generator platform.
diff --git a/Modules/Platform/Android/Determine-Compiler-NDK.cmake b/Modules/Platform/Android/Determine-Compiler-NDK.cmake
index a4d67c4..4e58d69 100644
--- a/Modules/Platform/Android/Determine-Compiler-NDK.cmake
+++ b/Modules/Platform/Android/Determine-Compiler-NDK.cmake
@@ -46,6 +46,9 @@ endif()
# -target <triple>
# -gcc-toolchain <ndk>/toolchains/<triple-or-arch>-<gcc-version>
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
# Glob available toolchains in the NDK, restricted by any version request.
if(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION STREQUAL "clang")
set(_ANDROID_TOOL_PATTERNS "*-clang" "*-clang[0-9].[0-9]")
@@ -269,3 +272,5 @@ unset(_ANDROID_TOOL_PREFIX)
unset(_ANDROID_TOOL_CLANG_NAME)
unset(_ANDROID_TOOL_CLANG_VERS)
unset(_ANDROID_TOOL_LLVM_NAME)
+
+cmake_policy(POP)
diff --git a/Modules/Platform/Apple-Apple-Swift.cmake b/Modules/Platform/Apple-Apple-Swift.cmake
index 7ca3e36..9f27efa 100644
--- a/Modules/Platform/Apple-Apple-Swift.cmake
+++ b/Modules/Platform/Apple-Apple-Swift.cmake
@@ -1 +1,17 @@
set(CMAKE_Swift_SYSROOT_FLAG "-sdk")
+
+# Linker Selections
+if("${CMAKE_GENERATOR}" STREQUAL Xcode)
+ # Xcode always uses clang to link, regardless of what the cmake link language
+ # is. Pass the clang flags when linking with Xcode.
+ set(CMAKE_Swift_USING_LINKER_APPLE_CLASSIC "-fuse-ld=ld" "LINKER:-ld_classic")
+ set(CMAKE_Swift_USING_LINKER_LLD "-fuse-ld=lld")
+ set(CMAKE_Swift_USING_LINKER_SYSTEM "-fuse-ld=ld")
+ set(CMAKE_SHARED_MODULE_LOADER_Swift_FLAG "-Wl,-bundle_loader,")
+else()
+ set(CMAKE_Swift_USING_LINKER_APPLE_CLASSIC "-use-ld=ld" "LINKER:-ld_classic")
+ set(CMAKE_Swift_USING_LINKER_LLD "-use-ld=lld")
+ set(CMAKE_Swift_USING_LINKER_SYSTEM "-use-ld=ld")
+ set(CMAKE_SHARED_MODULE_LOADER_Swift_FLAG "-Xclang-linker -Wl,-bundle_loader,")
+ set(CMAKE_SHARED_MODULE_CREATE_Swift_FLAGS "-Xlinker -bundle")
+endif()
diff --git a/Modules/Platform/Apple-Clang.cmake b/Modules/Platform/Apple-Clang.cmake
index 61a6cd2..bd5ba9a 100644
--- a/Modules/Platform/Apple-Clang.cmake
+++ b/Modules/Platform/Apple-Clang.cmake
@@ -15,9 +15,18 @@ macro(__apple_compiler_clang lang)
set(CMAKE_${lang}_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ")
endif()
+ set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=REVERSE UNICITY=ALL)
+
set(CMAKE_${lang}_LINK_LIBRARY_USING_FRAMEWORK "-framework <LIBRARY>")
set(CMAKE_${lang}_LINK_LIBRARY_USING_FRAMEWORK_SUPPORTED TRUE)
+ # linker selection
+ set(CMAKE_${lang}_USING_LINKER_SYSTEM "-fuse-ld=ld")
+ set(CMAKE_${lang}_USING_LINKER_APPLE_CLASSIC "-fuse-ld=ld" "LINKER:-ld_classic")
+ set(CMAKE_${lang}_USING_LINKER_LLD "-fuse-ld=lld")
+ set(CMAKE_${lang}_USING_LINKER_MOLD "-fuse-ld=mold")
+ set(CMAKE_${lang}_USING_LINKER_SOLD "-fuse-ld=sold")
+
if(_CMAKE_OSX_SYSROOT_PATH MATCHES "/iPhoneOS")
set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-miphoneos-version-min=")
elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/iPhoneSimulator")
diff --git a/Modules/Platform/Apple-GNU.cmake b/Modules/Platform/Apple-GNU.cmake
index 823c790..15f6a71 100644
--- a/Modules/Platform/Apple-GNU.cmake
+++ b/Modules/Platform/Apple-GNU.cmake
@@ -17,6 +17,9 @@ macro(__apple_compiler_gnu lang)
set(CMAKE_${lang}_LINK_LIBRARY_USING_FRAMEWORK "-framework <LIBRARY>")
set(CMAKE_${lang}_LINK_LIBRARY_USING_FRAMEWORK_SUPPORTED TRUE)
+
+ set(CMAKE_${lang}_USING_LINKER_SYSTEM "")
+ set(CMAKE_${lang}_USING_LINKER_APPLE_CLASSIC "LINKER:-ld_classic")
endmacro()
macro(cmake_gnu_set_sysroot_flag lang)
diff --git a/Modules/Platform/Apple-NAG-Fortran.cmake b/Modules/Platform/Apple-NAG-Fortran.cmake
index 8d3e741..828d7ab 100644
--- a/Modules/Platform/Apple-NAG-Fortran.cmake
+++ b/Modules/Platform/Apple-NAG-Fortran.cmake
@@ -3,12 +3,17 @@
set(CMAKE_Fortran_VERBOSE_FLAG "-Wl,-v") # Runs gcc under the hood.
-# Need -fpp explicitly on case-insensitive filesystem.
-set(CMAKE_Fortran_COMPILE_OBJECT
- "<CMAKE_Fortran_COMPILER> -fpp -o <OBJECT> <DEFINES> <INCLUDES> <FLAGS> -c <SOURCE>")
+# FIXME(#25900): We need -fpp explicitly on case-insensitive filesystems,
+# but this does not work with the Ninja generator's separate preprocessing
+# and compilation steps.
+if(NOT CMAKE_GENERATOR MATCHES "^Ninja")
+ set(CMAKE_Fortran_COMPILE_OBJECT
+ "<CMAKE_Fortran_COMPILER> -fpp -o <OBJECT> <DEFINES> <INCLUDES> <FLAGS> -c <SOURCE>")
+endif()
set(CMAKE_Fortran_OSX_COMPATIBILITY_VERSION_FLAG "-Wl,-compatibility_version -Wl,")
set(CMAKE_Fortran_OSX_CURRENT_VERSION_FLAG "-Wl,-current_version -Wl,")
+set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS "-Wl,-bundle")
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
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index ef64012..070b24d 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -52,6 +52,8 @@ macro(__cygwin_compiler_gnu lang)
"<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_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")
+
# No -fPIC on cygwin
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "")
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "")
diff --git a/Modules/Platform/CrayLinuxEnvironment.cmake b/Modules/Platform/CrayLinuxEnvironment.cmake
index 648806f..daff647 100644
--- a/Modules/Platform/CrayLinuxEnvironment.cmake
+++ b/Modules/Platform/CrayLinuxEnvironment.cmake
@@ -6,7 +6,10 @@ if(DEFINED ENV{CRAYOS_VERSION})
elseif(DEFINED ENV{XTOS_VERSION})
set(CMAKE_SYSTEM_VERSION "$ENV{XTOS_VERSION}")
elseif(EXISTS /etc/opt/cray/release/cle-release)
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS /etc/opt/cray/release/cle-release release REGEX "^RELEASE=.*")
+ cmake_policy(POP)
string(REGEX REPLACE "^RELEASE=(.*)$" "\\1" CMAKE_SYSTEM_VERSION "${release}")
unset(release)
elseif(EXISTS /etc/opt/cray/release/clerelease)
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 8d5bf8c..1b9cece 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -159,7 +159,10 @@ function(_apple_resolve_supported_archs_for_sdk_from_system_lib sdk_path ret ret
# Newer SDKs ship text based dylib stub files which contain the architectures supported by the
# library in text form.
if(EXISTS "${system_lib_tbd_path}")
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS "${system_lib_tbd_path}" tbd_lines REGEX "^(archs|targets): +\\[.+\\]")
+ cmake_policy(POP)
if(NOT tbd_lines)
set(${ret_failed} TRUE PARENT_SCOPE)
return()
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index d614182..533b9ce 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -125,17 +125,17 @@ set(CMAKE_LINK_LIBRARY_USING_WEAK_FRAMEWORK "LINKER:-weak_framework,<LIBRARY>")
set(CMAKE_LINK_LIBRARY_USING_WEAK_FRAMEWORK_SUPPORTED TRUE)
# Defines LINK_LIBRARY features for libraries
-set(CMAKE_LINK_LIBRARY_USING_NEEDED_LIBRARY "PATH{LINKER:-needed_library <LIBRARY>}NAME{LINKER:-needed-l<LIBRARY>}")
+set(CMAKE_LINK_LIBRARY_USING_NEEDED_LIBRARY "PATH{LINKER:-needed_library,<LIBRARY>}NAME{LINKER:-needed-l<LIBRARY>}")
set(CMAKE_LINK_LIBRARY_USING_NEEDED_LIBRARY_SUPPORTED TRUE)
-set(CMAKE_LINK_LIBRARY_USING_REEXPORT_LIBRARY "PATH{LINKER:-reexport_library <LIBRARY>}NAME{LINKER:-reexport-l<LIBRARY>}")
+set(CMAKE_LINK_LIBRARY_USING_REEXPORT_LIBRARY "PATH{LINKER:-reexport_library,<LIBRARY>}NAME{LINKER:-reexport-l<LIBRARY>}")
set(CMAKE_LINK_LIBRARY_USING_REEXPORT_LIBRARY_SUPPORTED TRUE)
-set(CMAKE_LINK_LIBRARY_USING_WEAK_LIBRARY "PATH{LINKER:-weak_library <LIBRARY>}NAME{LINKER:-weak-l<LIBRARY>}")
+set(CMAKE_LINK_LIBRARY_USING_WEAK_LIBRARY "PATH{LINKER:-weak_library,<LIBRARY>}NAME{LINKER:-weak-l<LIBRARY>}")
set(CMAKE_LINK_LIBRARY_USING_WEAK_LIBRARY_SUPPORTED TRUE)
# Defines LINK_LIBRARY feature to Force loading of all members of an archive
-set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:-force_load <LIB_ITEM>")
+set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE "LINKER:-force_load,<LIB_ITEM>")
set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED TRUE)
# default to searching for frameworks first
diff --git a/Modules/Platform/Linux-Apple-Swift.cmake b/Modules/Platform/Linux-Apple-Swift.cmake
new file mode 100644
index 0000000..248d2de
--- /dev/null
+++ b/Modules/Platform/Linux-Apple-Swift.cmake
@@ -0,0 +1,7 @@
+set(CMAKE_EXE_EXPORTS_Swift_FLAG "-Xclang-linker -Wl,--export-dynamic")
+
+# Linker Selection
+# BFD is known to mislink Swift objects resulting in missing type info
+set(CMAKE_Swift_USING_LINKER_SYSTEM "")
+set(CMAKE_Swift_USING_LINKER_GOLD "-use-ld=gold")
+set(CMAKE_Swift_USING_LINKER_LLD "-use-ld=lld")
diff --git a/Modules/Platform/Linux-Clang-CUDA.cmake b/Modules/Platform/Linux-Clang-CUDA.cmake
new file mode 100644
index 0000000..4a9337e
--- /dev/null
+++ b/Modules/Platform/Linux-Clang-CUDA.cmake
@@ -0,0 +1,2 @@
+include(Platform/Linux-GNU)
+__linux_compiler_gnu(CUDA)
diff --git a/Modules/Platform/Linux-GNU.cmake b/Modules/Platform/Linux-GNU.cmake
index 6878254..24bf1bb 100644
--- a/Modules/Platform/Linux-GNU.cmake
+++ b/Modules/Platform/Linux-GNU.cmake
@@ -12,4 +12,16 @@ macro(__linux_compiler_gnu lang)
# We pass this for historical reasons. Projects may have
# executables that use dlopen but do not set ENABLE_EXPORTS.
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
+
+ set(CMAKE_${lang}_VERBOSE_LINK_FLAG "-Wl,-v")
+
+ # linker selection
+ set(CMAKE_${lang}_USING_LINKER_SYSTEM "")
+ set(CMAKE_${lang}_USING_LINKER_LLD "-fuse-ld=lld")
+ set(CMAKE_${lang}_USING_LINKER_BFD "-fuse-ld=bfd")
+ set(CMAKE_${lang}_USING_LINKER_GOLD "-fuse-ld=gold")
+ if(NOT CMAKE_${lang}_COMPILER_ID STREQUAL "GNU"
+ OR CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1")
+ set(CMAKE_${lang}_USING_LINKER_MOLD "-fuse-ld=mold")
+ endif()
endmacro()
diff --git a/Modules/Platform/Linux-LLVMFlang-Fortran.cmake b/Modules/Platform/Linux-LLVMFlang-Fortran.cmake
new file mode 100644
index 0000000..ceecc2f
--- /dev/null
+++ b/Modules/Platform/Linux-LLVMFlang-Fortran.cmake
@@ -0,0 +1 @@
+include(Platform/Linux-GNU-Fortran)
diff --git a/Modules/Platform/Linux-NVIDIA-CUDA.cmake b/Modules/Platform/Linux-NVIDIA-CUDA.cmake
new file mode 100644
index 0000000..f383720
--- /dev/null
+++ b/Modules/Platform/Linux-NVIDIA-CUDA.cmake
@@ -0,0 +1,9 @@
+
+set(CMAKE_CUDA_VERBOSE_LINK_FLAG "-Wl,-v")
+
+# linker selection
+set(CMAKE_CUDA_USING_LINKER_SYSTEM "")
+set(CMAKE_CUDA_USING_LINKER_LLD "-fuse-ld=lld")
+set(CMAKE_CUDA_USING_LINKER_BFD "-fuse-ld=bfd")
+set(CMAKE_CUDA_USING_LINKER_GOLD "-fuse-ld=gold")
+set(CMAKE_CUDA_USING_LINKER_MOLD "-fuse-ld=mold")
diff --git a/Modules/Platform/Windows-Apple-Swift.cmake b/Modules/Platform/Windows-Apple-Swift.cmake
index 3f754fd..87c81d6 100644
--- a/Modules/Platform/Windows-Apple-Swift.cmake
+++ b/Modules/Platform/Windows-Apple-Swift.cmake
@@ -1,3 +1,8 @@
set(CMAKE_Swift_IMPLIB_LINKER_FLAGS "-Xlinker -implib:<TARGET_IMPLIB>")
set(CMAKE_Swift_FLAGS_DEBUG_LINKER_FLAGS "-Xlinker -debug")
set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_LINKER_FLAGS "-Xlinker -debug")
+
+# Linker Selection
+set(CMAKE_Swift_USING_LINKER_SYSTEM "-use-ld=link")
+set(CMAKE_Swift_USING_LINKER_LLD "-use-ld=lld")
+set(CMAKE_Swift_USING_LINKER_MSVC "-use-ld=link")
diff --git a/Modules/Platform/Windows-Clang-C.cmake b/Modules/Platform/Windows-Clang-C.cmake
index 322e3fb..a90e4b7 100644
--- a/Modules/Platform/Windows-Clang-C.cmake
+++ b/Modules/Platform/Windows-Clang-C.cmake
@@ -1,7 +1,7 @@
include(Platform/Windows-Clang)
__windows_compiler_clang(C)
-if("x${MAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
AND CMAKE_DEPFILE_FLAGS_C)
diff --git a/Modules/Platform/Windows-Clang-CUDA.cmake b/Modules/Platform/Windows-Clang-CUDA.cmake
new file mode 100644
index 0000000..c37df3b
--- /dev/null
+++ b/Modules/Platform/Windows-Clang-CUDA.cmake
@@ -0,0 +1,16 @@
+include(Platform/Windows-Clang)
+__windows_compiler_clang(CUDA)
+
+# Tell Clang where to find the CUDA libraries.
+set(__IMPLICIT_LINKS)
+foreach(dir ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
+ string(APPEND __IMPLICIT_LINKS " -L\"${dir}\"")
+endforeach()
+string(APPEND CMAKE_CUDA_LINK_EXECUTABLE "${__IMPLICIT_LINKS}")
+string(APPEND CMAKE_CUDA_CREATE_SHARED_LIBRARY "${__IMPLICIT_LINKS}")
+string(APPEND CMAKE_CUDA_CREATE_SHARED_MODULE "${__IMPLICIT_LINKS}")
+unset(__IMPLICIT_LINKS)
+
+# Device linking is just regular linking so these are the same.
+set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG ${CMAKE_CUDA_LINKER_WRAPPER_FLAG})
+set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG_SEP ${CMAKE_CUDA_LINKER_WRAPPER_FLAG_SEP})
diff --git a/Modules/Platform/Windows-Clang-CXX.cmake b/Modules/Platform/Windows-Clang-CXX.cmake
index b4aaf1e..af2a48f 100644
--- a/Modules/Platform/Windows-Clang-CXX.cmake
+++ b/Modules/Platform/Windows-Clang-CXX.cmake
@@ -2,7 +2,7 @@ include(Platform/Windows-Clang)
set(_COMPILE_CXX_MSVC " -TP")
__windows_compiler_clang(CXX)
-if("x${MAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
AND CMAKE_DEPFILE_FLAGS_CXX)
diff --git a/Modules/Platform/Windows-Clang-OBJC.cmake b/Modules/Platform/Windows-Clang-OBJC.cmake
new file mode 100644
index 0000000..7babb98
--- /dev/null
+++ b/Modules/Platform/Windows-Clang-OBJC.cmake
@@ -0,0 +1,18 @@
+include(Platform/Windows-Clang)
+__windows_compiler_clang(OBJC)
+
+if("x${CMAKE_OBJC_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_OBJC)
+ set(CMAKE_OBJC_DEPENDS_USE_COMPILER TRUE)
+ endif()
+elseif("x${CMAKE_OBJC_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_OBJC)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_OBJC_DEPFILE_FORMAT gcc)
+ set(CMAKE_OBJC_DEPENDS_USE_COMPILER TRUE)
+ endif()
+endif()
diff --git a/Modules/Platform/Windows-Clang-OBJCXX.cmake b/Modules/Platform/Windows-Clang-OBJCXX.cmake
new file mode 100644
index 0000000..3bc1673
--- /dev/null
+++ b/Modules/Platform/Windows-Clang-OBJCXX.cmake
@@ -0,0 +1,18 @@
+include(Platform/Windows-Clang)
+__windows_compiler_clang(OBJCXX)
+
+if("x${CMAKE_OBJCXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_OBJCXX)
+ set(CMAKE_OBJCXX_DEPENDS_USE_COMPILER TRUE)
+ endif()
+elseif("x${CMAKE_OBJCXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_OBJCXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_OBJCXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_OBJCXX_DEPENDS_USE_COMPILER TRUE)
+ endif()
+endif()
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 33d271d..b9e6394 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -45,6 +45,7 @@ macro(__windows_compiler_clang_gnu lang)
math(EXPR MSVC_VERSION "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}")
endif()
+ set(CMAKE_${lang}_VERBOSE_LINK_FLAG "-v")
# No -fPIC on Windows
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "")
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "")
@@ -52,6 +53,15 @@ macro(__windows_compiler_clang_gnu lang)
set(CMAKE_${lang}_LINK_OPTIONS_PIE "")
set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
+
+ set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD UNICITY=ALL)
+
+ # linker selection
+ set(CMAKE_${lang}_USING_LINKER_DEFAULT "-fuse-ld=lld-link")
+ set(CMAKE_${lang}_USING_LINKER_SYSTEM "-fuse-ld=link")
+ set(CMAKE_${lang}_USING_LINKER_LLD "-fuse-ld=lld-link")
+ set(CMAKE_${lang}_USING_LINKER_MSVC "-fuse-ld=link")
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
@@ -74,10 +84,10 @@ macro(__windows_compiler_clang_gnu lang)
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> -fuse-ld=lld-link -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> <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>")
set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
set(CMAKE_${lang}_LINK_EXECUTABLE
- "<CMAKE_${lang}_COMPILER> -fuse-ld=lld-link -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> <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>")
set(CMAKE_${lang}_CREATE_WIN32_EXE "-Xlinker /subsystem:windows")
set(CMAKE_${lang}_CREATE_CONSOLE_EXE "-Xlinker /subsystem:console")
@@ -157,36 +167,32 @@ macro(__enable_llvm_rc_preprocessing clang_option_prefix extra_pp_flags)
endif()
endmacro()
-macro(__verify_same_language_values variable)
- foreach(lang "C" "CXX" "HIP")
- if(DEFINED CMAKE_${lang}_${variable})
- list(APPEND __LANGUAGE_VALUES_${variable} "${CMAKE_${lang}_${variable}}")
- endif()
+function(__verify_same_language_values variable langs)
+ foreach(lang IN LISTS langs)
+ list(APPEND __LANGUAGE_VALUES_${variable} ${CMAKE_${lang}_${variable}})
endforeach()
list(REMOVE_DUPLICATES __LANGUAGE_VALUES_${variable})
list(LENGTH __LANGUAGE_VALUES_${variable} __NUM_VALUES)
-
if(__NUM_VALUES GREATER 1)
message(FATAL_ERROR ${ARGN})
endif()
- unset(__NUM_VALUES)
- unset(__LANGUAGE_VALUES_${variable})
-endmacro()
+endfunction()
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
+ OR "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_HIP_SIMULATE_ID}" STREQUAL "xMSVC")
- __verify_same_language_values(COMPILER_ID
+ __verify_same_language_values(COMPILER_ID "C;CXX;HIP"
"The current configuration mixes Clang and MSVC or "
"some other CL compatible compiler tool. This is not supported. "
- "Use either clang or MSVC as both C, C++ and/or HIP compilers.")
+ "Use either Clang or MSVC as the compiler for all of C, C++, and/or HIP.")
- __verify_same_language_values(COMPILER_FRONTEND_VARIANT
+ __verify_same_language_values(COMPILER_FRONTEND_VARIANT "C;CXX;CUDA;HIP"
"The current configuration uses the Clang compiler "
"tool with mixed frontend variants, both the GNU and in MSVC CL "
"like variants. This is not supported. Use either clang/clang++ "
- "or clang-cl as both C, C++ and/or HIP compilers.")
+ "or clang-cl as all C, C++, CUDA, and/or HIP compilers.")
if(NOT CMAKE_RC_COMPILER_INIT)
# Check if rc is already in the path
@@ -208,6 +214,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
if ( "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"
OR "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"
+ OR "x${CMAKE_CUDA_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"
OR "x${CMAKE_HIP_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
include(Platform/Windows-MSVC)
diff --git a/Modules/Platform/Windows-GNU-OBJC-ABI.cmake b/Modules/Platform/Windows-GNU-OBJC-ABI.cmake
new file mode 100644
index 0000000..c8b2ea6
--- /dev/null
+++ b/Modules/Platform/Windows-GNU-OBJC-ABI.cmake
@@ -0,0 +1 @@
+__windows_compiler_gnu_abi(OBJC)
diff --git a/Modules/Platform/Windows-GNU-OBJC.cmake b/Modules/Platform/Windows-GNU-OBJC.cmake
new file mode 100644
index 0000000..42cf3f8
--- /dev/null
+++ b/Modules/Platform/Windows-GNU-OBJC.cmake
@@ -0,0 +1,2 @@
+include(Platform/Windows-GNU)
+__windows_compiler_gnu(OBJC)
diff --git a/Modules/Platform/Windows-GNU-OBJCXX-ABI.cmake b/Modules/Platform/Windows-GNU-OBJCXX-ABI.cmake
new file mode 100644
index 0000000..9a11514
--- /dev/null
+++ b/Modules/Platform/Windows-GNU-OBJCXX-ABI.cmake
@@ -0,0 +1 @@
+__windows_compiler_gnu_abi(OBJCXX)
diff --git a/Modules/Platform/Windows-GNU-OBJCXX.cmake b/Modules/Platform/Windows-GNU-OBJCXX.cmake
new file mode 100644
index 0000000..072cf28
--- /dev/null
+++ b/Modules/Platform/Windows-GNU-OBJCXX.cmake
@@ -0,0 +1,2 @@
+include(Platform/Windows-GNU)
+__windows_compiler_gnu(OBJCXX)
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index 412af6b..9f81882 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -112,6 +112,13 @@ macro(__windows_compiler_gnu lang)
set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
endforeach()
+ set(CMAKE_${lang}_VERBOSE_LINK_FLAG "-Wl,-v")
+
+ # linker selection
+ set(CMAKE_${lang}_USING_LINKER_SYSTEM "")
+ set(CMAKE_${lang}_USING_LINKER_BFD "-fuse-ld=bfd")
+ set(CMAKE_${lang}_USING_LINKER_LLD "-fuse-ld=lld")
+
# No -fPIC on Windows
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "")
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "")
diff --git a/Modules/Platform/Windows-IntelLLVM.cmake b/Modules/Platform/Windows-IntelLLVM.cmake
index eac3f0a..b1a336b 100644
--- a/Modules/Platform/Windows-IntelLLVM.cmake
+++ b/Modules/Platform/Windows-IntelLLVM.cmake
@@ -8,30 +8,19 @@ if(__WINDOWS_INTEL_LLVM)
endif()
set(__WINDOWS_INTEL_LLVM 1)
-# Platform/Windows-MSVC adds some linking options icx/ifx do not understand,
-# but that need to be passed to the linker. Wrap all the linking options from
-# Platform/Windows-MSVC so that the compiler will hand them off to the linker
-# without interpreting them.
-
-# Save original CMAKE_${t}_LINKER_FLAGS_INIT
-foreach(t EXE SHARED MODULE STATIC)
- set(_saved_cmake_${t}_linker_flags_init ${CMAKE_${t}_LINKER_FLAGS_INIT})
- set(CMAKE_${t}_LINKER_FLAGS_INIT "")
-endforeach()
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ # MSBuild invokes the "link" tool directly.
+ set(_IntelLLVM_LINKER_WRAPPER_FLAG "")
+ set(_IntelLLVM_LINKER_WRAPPER_FLAG_SEP "")
+else()
+ # Our rules below drive linking through the compiler front-end.
+ # Wrap flags meant for the linker.
+ set(_IntelLLVM_LINKER_WRAPPER_FLAG "/Qoption,link,")
+ set(_IntelLLVM_LINKER_WRAPPER_FLAG_SEP ",")
+endif()
+set(_Wl "${_IntelLLVM_LINKER_WRAPPER_FLAG}")
include(Platform/Windows-MSVC)
-# Wrap linker flags from Windows-MSVC
-set(_IntelLLVM_LINKER_WRAPPER_FLAG "/Qoption,link,")
-set(_IntelLLVM_LINKER_WRAPPER_FLAG_SEP ",")
-foreach(t EXE SHARED MODULE STATIC)
- set(_wrapped_linker_flags "")
- foreach(flag ${CMAKE_${t}_LINKER_FLAGS_INIT})
- string(STRIP ${flag} flag)
- list(APPEND _wrapped_linker_flags "${_IntelLLVM_LINKER_WRAPPER_FLAG}${flag}")
- endforeach()
- set(CMAKE_${t}_LINKER_FLAGS_INIT "")
- list(APPEND CMAKE_${t}_LINKER_FLAGS_INIT
- ${_saved_cmake_${t}_linker_flags_init} ${_wrapped_linker_flags})
-endforeach()
+unset(_Wl)
macro(__windows_compiler_intel lang)
__windows_compiler_msvc(${lang})
diff --git a/Modules/Platform/Windows-LLVMFlang-Fortran.cmake b/Modules/Platform/Windows-LLVMFlang-Fortran.cmake
index 57e36c6..10e3b2c 100644
--- a/Modules/Platform/Windows-LLVMFlang-Fortran.cmake
+++ b/Modules/Platform/Windows-LLVMFlang-Fortran.cmake
@@ -5,17 +5,22 @@ elseif("x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC")
include(Platform/Windows-MSVC)
__windows_compiler_msvc(Fortran)
- # FIXME(LLVMFlang): It does not provides MSVC runtime library selection flags.
- # It should be given a flag like classic Flang's `-Xclang --dependent-lib=`, or a
- # dedicated flag to select among multiple `Fortran*.lib` runtime library variants
- # that each depend on a different MSVC runtime library. For now, LLVMFlang's
- # `Fortran*.lib` runtime libraries hard-code use of msvcrt (MultiThreadedDLL),
- # so we link to it ourselves.
- set(_LLVMFlang_LINK_RUNTIME "-defaultlib:msvcrt")
- set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
- set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "")
- set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
- set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
+ if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 18.0)
+ set(_LLVMFlang_LINK_RUNTIME "")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "-fms-runtime-lib=static")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "-fms-runtime-lib=dll")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "-fms-runtime-lib=static_dbg")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "-fms-runtime-lib=dll_dbg")
+ else()
+ # LLVMFlang < 18.0 does not have MSVC runtime library selection flags.
+ # The official distrubtion's `Fortran*.lib` runtime libraries hard-code
+ # use of msvcrt (MultiThreadedDLL), so we link to it ourselves.
+ set(_LLVMFlang_LINK_RUNTIME "-defaultlib:msvcrt")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
+ endif()
# LLVMFlang, like Clang, does not provide all debug information format flags.
# In order to provide easy integration with C and C++ projects that use the
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 829ab9b..ef57031 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -206,7 +206,7 @@ if(WINCE)
set(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib")
foreach(t EXE SHARED MODULE)
- string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " /NODEFAULTLIB:libc.lib /NODEFAULTLIB:oldnames.lib")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_Wl}/NODEFAULTLIB:libc.lib ${_Wl}/NODEFAULTLIB:oldnames.lib")
endforeach()
if (MSVC_VERSION LESS 1600)
@@ -230,7 +230,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver")
set(_FLAGS_C " -kernel")
set(_FLAGS_CXX " -kernel")
foreach(t EXE SHARED MODULE)
- string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " -NODEFAULTLIB")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_Wl}-NODEFAULTLIB")
endforeach()
if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "x64") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "x64"))
set(_PLATFORM_DEFINES "${_PLATFORM_DEFINES} -D_AMD64_ -DAMD64")
@@ -279,30 +279,30 @@ 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 "/machine:THUMB")
+ set(_MACHINE_ARCH_FLAG "${_Wl}/machine:THUMB")
elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64")
- set(_MACHINE_ARCH_FLAG "/machine:ARM64")
+ set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM64")
elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")
- set(_MACHINE_ARCH_FLAG "/machine:ARM64EC")
+ set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM64EC")
elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM")
- set(_MACHINE_ARCH_FLAG "/machine:ARM")
+ set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM")
else()
- set(_MACHINE_ARCH_FLAG "/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 "/machine:THUMB")
+ set(_MACHINE_ARCH_FLAG "${_Wl}/machine:THUMB")
elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64")
- set(_MACHINE_ARCH_FLAG "/machine:ARM64")
+ set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM64")
elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")
- set(_MACHINE_ARCH_FLAG "/machine:ARM64EC")
+ set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM64EC")
elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM")
- set(_MACHINE_ARCH_FLAG "/machine:ARM")
+ set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM")
else()
- set(_MACHINE_ARCH_FLAG "/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 "/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
@@ -310,28 +310,28 @@ endif()
set( MSVC_INCREMENTAL_YES_FLAG "")
if(NOT WINDOWS_PHONE AND NOT WINDOWS_STORE AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver")
if(NOT MSVC_INCREMENTAL_DEFAULT)
- set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
+ set(MSVC_INCREMENTAL_YES_FLAG "${_Wl}/INCREMENTAL:YES")
else()
- set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
+ set(MSVC_INCREMENTAL_YES_FLAG "${_Wl}/INCREMENTAL" )
endif()
endif()
foreach(t EXE SHARED MODULE)
string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}")
if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- string(APPEND CMAKE_${t}_LINKER_FLAGS_DEBUG_INIT " /debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
- string(APPEND CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO_INIT " /debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
+ 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}")
else ()
- string(APPEND CMAKE_${t}_LINKER_FLAGS_DEBUG_INIT " /debug ${MSVC_INCREMENTAL_YES_FLAG}")
- string(APPEND CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO_INIT " /debug ${MSVC_INCREMENTAL_YES_FLAG}")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_DEBUG_INIT " ${_Wl}/debug ${MSVC_INCREMENTAL_YES_FLAG}")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO_INIT " ${_Wl}/debug ${MSVC_INCREMENTAL_YES_FLAG}")
endif ()
# for release and minsize release default to no incremental linking
- string(APPEND CMAKE_${t}_LINKER_FLAGS_MINSIZEREL_INIT " /INCREMENTAL:NO")
- string(APPEND CMAKE_${t}_LINKER_FLAGS_RELEASE_INIT " /INCREMENTAL:NO")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_MINSIZEREL_INIT " ${_Wl}/INCREMENTAL:NO")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_RELEASE_INIT " ${_Wl}/INCREMENTAL:NO")
endforeach()
if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC"))
- string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " /machine:ARM64X")
+ string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " ${_Wl}/machine:ARM64X")
else()
string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}")
endif()
@@ -512,6 +512,14 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_DEPFILE_FLAGS_${lang} "/showIncludes")
set(CMAKE_${lang}_DEPFILE_FORMAT msvc)
endif()
+
+ set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD UNICITY=ALL)
+
+ # linker selection
+ set(CMAKE_${lang}_USING_LINKER_SYSTEM "${CMAKE_LINKER_LINK}")
+ set(CMAKE_${lang}_USING_LINKER_LLD "${CMAKE_LINKER_LLD}")
+ set(CMAKE_${lang}_USING_LINKER_MSVC "${CMAKE_LINKER_LINK}")
+ set(CMAKE_${lang}_USING_LINKER_MODE TOOL)
endmacro()
macro(__windows_compiler_msvc_enable_rc flags)
diff --git a/Modules/Platform/Windows-NVIDIA-CUDA.cmake b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
index 326e715..6489841 100644
--- a/Modules/Platform/Windows-NVIDIA-CUDA.cmake
+++ b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
@@ -47,6 +47,12 @@ set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS${__IMPLICIT_DLINK_FLAGS}")
unset(__IMPLICIT_DLINK_FLAGS)
+# linker selection
+set(CMAKE_CUDA_USING_LINKER_SYSTEM "${CMAKE_LINKER_LINK}")
+set(CMAKE_CUDA_USING_LINKER_LLD "${CMAKE_LINKER_LLD}")
+set(CMAKE_CUDA_USING_LINKER_MSVC "${CMAKE_LINKER_LINK}")
+set(CMAKE_CUDA_USING_LINKER_MODE TOOL)
+
string(REPLACE "/D" "-D" _PLATFORM_DEFINES_CUDA "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_CXX}")
if(CMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT)
diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake
index 1bf39cf..af7335b 100644
--- a/Modules/Platform/Windows.cmake
+++ b/Modules/Platform/Windows.cmake
@@ -13,8 +13,15 @@ set(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
set(CMAKE_DL_LIBS "")
set(CMAKE_EXTRA_LINK_EXTENSIONS ".targets")
-set(CMAKE_FIND_LIBRARY_PREFIXES "")
-set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
+set(CMAKE_FIND_LIBRARY_PREFIXES
+ "" # static or import library from MSVC tooling
+ "lib" # static library from Meson with MSVC tooling
+ )
+set(CMAKE_FIND_LIBRARY_SUFFIXES
+ ".dll.lib" # import library from Rust toolchain for MSVC ABI
+ ".lib" # static or import library from MSVC tooling
+ ".a" # static library from Meson with MSVC tooling
+ )
# for borland make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use
diff --git a/Modules/Platform/Windows3x-OpenWatcom.cmake b/Modules/Platform/Windows3x-OpenWatcom.cmake
index 6fcceea..0882df6 100644
--- a/Modules/Platform/Windows3x-OpenWatcom.cmake
+++ b/Modules/Platform/Windows3x-OpenWatcom.cmake
@@ -8,8 +8,8 @@ set(CMAKE_BUILD_TYPE_INIT Debug)
if(DEFINED CMAKE_SYSTEM_PROCESSOR AND CMAKE_SYSTEM_PROCESSOR STREQUAL "I86")
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " system windows")
- string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " system windows")
- string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " system windows")
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " system windows_dll")
+ string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " system windows_dll")
else()
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " system win386")
string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " system win386")
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 47e266d..9e1d473 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -207,7 +207,10 @@ function(ProcessorCount var)
# Systems with /proc/cpuinfo:
set(cpuinfo_file /proc/cpuinfo)
if(EXISTS "${cpuinfo_file}")
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
+ cmake_policy(POP)
list(LENGTH procs count)
#message("ProcessorCount: trying cpuinfo '${cpuinfo_file}'")
endif()
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake
index 12b6816..03c8588 100644
--- a/Modules/TestBigEndian.cmake
+++ b/Modules/TestBigEndian.cmake
@@ -91,12 +91,17 @@ macro(__TEST_BIG_ENDIAN_LEGACY_IMPL VARIABLE)
if(HAVE_${VARIABLE})
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
file(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin"
CMAKE_TEST_ENDIANESS_STRINGS_LE LIMIT_COUNT 1 REGEX "THIS IS LITTLE ENDIAN")
file(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin"
CMAKE_TEST_ENDIANESS_STRINGS_BE LIMIT_COUNT 1 REGEX "THIS IS BIG ENDIAN")
+ cmake_policy(POP)
+
# on mac, if there are universal binaries built both will be true
# return the result depending on the machine on which cmake runs
if(CMAKE_TEST_ENDIANESS_STRINGS_BE AND CMAKE_TEST_ENDIANESS_STRINGS_LE)
diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake
index 83c9b20..5e6f606 100644
--- a/Modules/UseEcos.cmake
+++ b/Modules/UseEcos.cmake
@@ -8,21 +8,31 @@ UseEcos
This module defines variables and macros required to build eCos application.
This file contains the following macros:
-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
-
-Macros for selecting the toolchain: 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
-
-It contains the following variables: ECOS_DEFINITIONS
-ECOSCONFIG_EXECUTABLE ECOS_CONFIG_FILE - defaults to ecos.ecc, if your
-eCos configuration file has a different name, adjust this variable for
-internal use only:
+
+``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``
+
+Macros for selecting the toolchain:
+
+``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
+
+It contains the following variables:
+
+``ECOS_DEFINITIONS``
+
+``ECOSCONFIG_EXECUTABLE``
+
+``ECOS_CONFIG_FILE``
+ defaults to ecos.ecc, if your eCos configuration file has a different name, adjust this variable for internal use only:
::
diff --git a/Modules/UseJava/ClearClassFiles.cmake b/Modules/UseJava/ClearClassFiles.cmake
index f3115c6..2c41665 100644
--- a/Modules/UseJava/ClearClassFiles.cmake
+++ b/Modules/UseJava/ClearClassFiles.cmake
@@ -3,6 +3,9 @@
# This script deletes compiled Java class files.
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
+
if(CMAKE_JAVA_CLASS_OUTPUT_PATH)
if(EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist")
file(STRINGS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist" classes)
@@ -15,3 +18,5 @@ if(CMAKE_JAVA_CLASS_OUTPUT_PATH)
else()
message(FATAL_ERROR "Can't find CMAKE_JAVA_CLASS_OUTPUT_PATH")
endif()
+
+cmake_policy(POP)
diff --git a/Modules/UseJava/javaTargets.cmake.in b/Modules/UseJava/javaTargets.cmake.in
index 6e14256..dc20c82 100644
--- a/Modules/UseJava/javaTargets.cmake.in
+++ b/Modules/UseJava/javaTargets.cmake.in
@@ -1,6 +1,5 @@
-cmake_minimum_required(VERSION 2.8.12)
cmake_policy(PUSH)
-cmake_policy(VERSION 2.8)
+cmake_policy(VERSION 2.8.12...3.28)
#----------------------------------------------------------------
# Generated CMake Java target import file.
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index cece973..c58511a 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -466,7 +466,10 @@ function(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
# try to get module name from "%module foo" syntax
if ( EXISTS "${infile}" )
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file ( STRINGS "${infile}" module_basename REGEX "[ ]*%module[ ]*[a-zA-Z0-9_]+.*" )
+ cmake_policy(POP)
endif ()
if ( module_basename )
string ( REGEX REPLACE "[ ]*%module[ ]*([a-zA-Z0-9_]+).*" "\\1" module_basename "${module_basename}" )
@@ -474,7 +477,10 @@ function(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
else ()
# try to get module name from "%module (options=...) foo" syntax
if ( EXISTS "${infile}" )
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
file ( STRINGS "${infile}" module_basename REGEX "[ ]*%module[ ]*\\(.*\\)[ ]*[a-zA-Z0-9_]+.*" )
+ cmake_policy(POP)
endif ()
if ( module_basename )
string ( REGEX REPLACE "[ ]*%module[ ]*\\(.*\\)[ ]*([a-zA-Z0-9_]+).*" "\\1" module_basename "${module_basename}" )
@@ -657,7 +663,7 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
if(NOT ("-dllimport" IN_LIST swig_source_file_flags OR "-dllimport" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS))
# This makes sure that the name used in the generated DllImport
# matches the library name created by CMake
- list (APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport" "$<TARGET_FILE_PREFIX:${target_name}>$<TARGET_FILE_BASE_NAME:${target_name}>")
+ list (APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport" "$<TARGET_FILE_BASE_NAME:${target_name}>")
endif()
endif()
if (SWIG_MODULE_${name}_LANGUAGE STREQUAL "PYTHON" AND NOT SWIG_MODULE_${name}_NOPROXY)
diff --git a/Modules/exportheader.cmake.in b/Modules/exportheader.cmake.in
index c518b3d..7659958 100644
--- a/Modules/exportheader.cmake.in
+++ b/Modules/exportheader.cmake.in
@@ -33,6 +33,7 @@
# define @DEPRECATED_MACRO_NAME@_NO_EXPORT @NO_EXPORT_MACRO_NAME@ @DEPRECATED_MACRO_NAME@
#endif
+/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if @DEFINE_NO_DEPRECATED@ /* DEFINE_NO_DEPRECATED */
# ifndef @NO_DEPRECATED_MACRO_NAME@
# define @NO_DEPRECATED_MACRO_NAME@
diff --git a/README.rst b/README.rst
index d885740..6ada17f 100644
--- a/README.rst
+++ b/README.rst
@@ -16,7 +16,7 @@ references useful guides and recipes.
CMake is maintained and supported by `Kitware`_ and developed in
collaboration with a productive community of contributors.
-.. _`Kitware`: http://www.kitware.com/cmake
+.. _`Kitware`: https://www.kitware.com/cmake
License
=======
@@ -106,7 +106,7 @@ To build the documentation, install `Sphinx`_ and configure CMake with
"man" builder. Add ``-DSPHINX_EXECUTABLE=/path/to/sphinx-build`` if the
tool is not found automatically.
-.. _`Sphinx`: http://sphinx-doc.org
+.. _`Sphinx`: https://sphinx-doc.org
Reporting Bugs
==============
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 1bc855e..8c57762 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -450,7 +450,6 @@ add_library(
cmUVProcessChain.h
cmUVStream.h
cmUVStreambuf.h
- cmUVSignalHackRAII.h
cmVariableWatch.cxx
cmVariableWatch.h
cmVersion.cxx
@@ -558,6 +557,8 @@ add_library(
cmFindLibraryCommand.h
cmFindPackageCommand.cxx
cmFindPackageCommand.h
+ cmFindPackageStack.cxx
+ cmFindPackageStack.h
cmFindPathCommand.cxx
cmFindPathCommand.h
cmFindProgramCommand.cxx
@@ -1090,6 +1091,9 @@ add_library(
CTest/cmCTestP4.cxx
CTest/cmCTestP4.h
+ CTest/cmUVJobServerClient.cxx
+ CTest/cmUVJobServerClient.h
+
LexerParser/cmCTestResourceGroupsLexer.cxx
LexerParser/cmCTestResourceGroupsLexer.h
LexerParser/cmCTestResourceGroupsLexer.in.l
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 26792a5..bcadc20 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
-set(CMake_VERSION_MINOR 28)
-set(CMake_VERSION_PATCH 4)
+set(CMake_VERSION_MINOR 29)
+set(CMake_VERSION_PATCH 20240503)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index 5724175..b3e5fe4 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -55,7 +55,6 @@ int cmCPackIFWGenerator::PackageFiles()
std::vector<std::string> cmCPackIFWGenerator::BuildRepogenCommand()
{
std::vector<std::string> ifwCmd;
- std::string ifwArg;
ifwCmd.emplace_back(this->RepoGen);
@@ -104,7 +103,7 @@ std::vector<std::string> cmCPackIFWGenerator::BuildRepogenCommand()
if (!this->OnlineOnly && !this->DownloadedPackages.empty()) {
ifwCmd.emplace_back("-i");
auto it = this->DownloadedPackages.begin();
- ifwArg = (*it)->Name;
+ std::string ifwArg = (*it)->Name;
++it;
while (it != this->DownloadedPackages.end()) {
ifwArg += "," + (*it)->Name;
@@ -417,10 +416,10 @@ int cmCPackIFWGenerator::InitializeInternal()
}
if (cmValue ifwDownloadAll = this->GetOption("CPACK_IFW_DOWNLOAD_ALL")) {
- this->OnlineOnly = cmIsOn(ifwDownloadAll);
+ this->OnlineOnly = ifwDownloadAll.IsOn();
} else if (cmValue cpackDownloadAll =
this->GetOption("CPACK_DOWNLOAD_ALL")) {
- this->OnlineOnly = cmIsOn(cpackDownloadAll);
+ this->OnlineOnly = cpackDownloadAll.IsOn();
} else {
this->OnlineOnly = false;
}
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 5077596..8532b3e 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -74,7 +74,7 @@ bool cmCPackWIXGenerator::RunWiXCommand(std::string const& command)
if (!status || returnValue) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem running WiX candle. "
+ "Problem running WiX. "
"Please check '"
<< logFileName << "' for errors." << std::endl);
@@ -166,6 +166,16 @@ int cmCPackWIXGenerator::PackageFiles()
bool cmCPackWIXGenerator::InitializeWiXConfiguration()
{
+ if (cmValue wixVersion = GetOption("CPACK_WIX_VERSION")) {
+ if (!cmStrToULong(*wixVersion, &this->WixVersion) ||
+ this->WixVersion < 3 || this->WixVersion > 4) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "CPACK_WIX_VERSION has unknown value '"
+ << *wixVersion << "'" << std::endl);
+ return false;
+ }
+ }
+
if (!ReadListFile("Internal/CPack/CPackWIX.cmake")) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error while executing CPackWIX.cmake" << std::endl);
@@ -232,14 +242,22 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
SetOption("CPACK_WIX_PROPERTY_ARPCONTACT", packageContact);
}
- CollectExtensions("CPACK_WIX_EXTENSIONS", this->CandleExtensions);
- CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", this->CandleExtensions);
+ if (this->WixVersion >= 4) {
+ CollectExtensions("CPACK_WIX_EXTENSIONS", this->WixExtensions);
+ if (!GetOption("CPACK_WIX_SKIP_WIX_UI_EXTENSION").IsOn()) {
+ this->WixExtensions.insert("WixToolset.UI.wixext");
+ }
+ } else {
+ CollectExtensions("CPACK_WIX_EXTENSIONS", this->CandleExtensions);
+ CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", this->CandleExtensions);
- if (!cmIsOn(GetOption("CPACK_WIX_SKIP_WIX_UI_EXTENSION"))) {
- this->LightExtensions.insert("WixUIExtension");
+ if (!GetOption("CPACK_WIX_SKIP_WIX_UI_EXTENSION").IsOn()) {
+ this->LightExtensions.insert("WixUIExtension");
+ }
+ CollectExtensions("CPACK_WIX_EXTENSIONS", this->LightExtensions);
+ CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", this->LightExtensions);
}
- CollectExtensions("CPACK_WIX_EXTENSIONS", this->LightExtensions);
- CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", this->LightExtensions);
+
CollectXmlNamespaces("CPACK_WIX_CUSTOM_XMLNS", this->CustomXmlNamespaces);
cmValue patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
@@ -255,7 +273,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
// if install folder is supposed to be set absolutely, the default
// component guid "*" cannot be used
- if (cmIsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
+ if (GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER").IsOn()) {
this->ComponentGuidType = cmWIXSourceWriter::CMAKE_GENERATED_GUID;
}
@@ -278,6 +296,53 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
AppendUserSuppliedExtraSources();
+ return this->WixVersion >= 4 ? this->PackageWithWix()
+ : this->PackageWithWix3();
+}
+
+bool cmCPackWIXGenerator::PackageWithWix()
+{
+ std::string wixExecutable;
+ if (!RequireOption("CPACK_WIX_EXECUTABLE", wixExecutable)) {
+ return false;
+ }
+
+ std::string arch;
+ if (cmValue archOpt = GetOption("CPACK_WIX_ARCHITECTURE")) {
+ arch = *archOpt;
+ } else {
+ arch = GetArchitecture();
+ cmCPackLogger(
+ cmCPackLog::LOG_VERBOSE,
+ "CPACK_WIX_ARCHITECTURE was not set. Invoking WiX with architecture "
+ << arch << ". " << std::endl);
+ }
+
+ std::ostringstream command;
+ command << QuotePath(wixExecutable) << " build"
+ << " -arch " << arch << " -out "
+ << QuotePath(CMakeToWixPath(packageFileNames.at(0)));
+
+ for (std::string const& ext : this->WixExtensions) {
+ command << " -ext " << QuotePath(ext);
+ }
+
+ cmList cultures{ GetOption("CPACK_WIX_CULTURES") };
+ for (std::string const& culture : cultures) {
+ command << " -culture \"" << culture << "\"";
+ }
+
+ AddCustomFlags("CPACK_WIX_BUILD_EXTRA_FLAGS", command);
+
+ for (std::string const& sourceFilename : this->WixSources) {
+ command << " -src " << QuotePath(CMakeToWixPath(sourceFilename));
+ }
+
+ return RunWiXCommand(command.str());
+}
+
+bool cmCPackWIXGenerator::PackageWithWix3()
+{
std::set<std::string> usedBaseNames;
std::ostringstream objectFiles;
@@ -341,8 +406,8 @@ void cmCPackWIXGenerator::CreateWiXVariablesIncludeFile()
std::string includeFilename =
cmStrCat(this->CPackTopLevel, "/cpack_variables.wxi");
- cmWIXSourceWriter includeFile(this->Logger, includeFilename,
- this->ComponentGuidType,
+ cmWIXSourceWriter includeFile(this->WixVersion, this->Logger,
+ includeFilename, this->ComponentGuidType,
cmWIXSourceWriter::INCLUDE_ELEMENT_ROOT);
InjectXmlNamespaces(includeFile);
@@ -359,6 +424,7 @@ void cmCPackWIXGenerator::CreateWiXVariablesIncludeFile()
GetOption("CPACK_PACKAGE_NAME"));
CopyDefinition(includeFile, "CPACK_WIX_PROGRAM_MENU_FOLDER");
CopyDefinition(includeFile, "CPACK_WIX_UI_REF");
+ CopyDefinition(includeFile, "CPACK_WIX_INSTALL_SCOPE");
}
void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
@@ -366,8 +432,8 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
std::string includeFilename =
cmStrCat(this->CPackTopLevel, "/properties.wxi");
- cmWIXSourceWriter includeFile(this->Logger, includeFilename,
- this->ComponentGuidType,
+ cmWIXSourceWriter includeFile(this->WixVersion, this->Logger,
+ includeFilename, this->ComponentGuidType,
cmWIXSourceWriter::INCLUDE_ELEMENT_ROOT);
InjectXmlNamespaces(includeFile);
@@ -416,8 +482,8 @@ void cmCPackWIXGenerator::CreateWiXProductFragmentIncludeFile()
std::string includeFilename =
cmStrCat(this->CPackTopLevel, "/product_fragment.wxi");
- cmWIXSourceWriter includeFile(this->Logger, includeFilename,
- this->ComponentGuidType,
+ cmWIXSourceWriter includeFile(this->WixVersion, this->Logger,
+ includeFilename, this->ComponentGuidType,
cmWIXSourceWriter::INCLUDE_ELEMENT_ROOT);
InjectXmlNamespaces(includeFile);
@@ -458,7 +524,8 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
this->WixSources.push_back(directoryDefinitionsFilename);
cmWIXDirectoriesSourceWriter directoryDefinitions(
- this->Logger, directoryDefinitionsFilename, this->ComponentGuidType);
+ this->WixVersion, this->Logger, directoryDefinitionsFilename,
+ this->ComponentGuidType);
InjectXmlNamespaces(directoryDefinitions);
directoryDefinitions.BeginElement("Fragment");
@@ -467,11 +534,13 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
return false;
}
- directoryDefinitions.BeginElement("Directory");
- directoryDefinitions.AddAttribute("Id", "TARGETDIR");
- directoryDefinitions.AddAttribute("Name", "SourceDir");
+ if (this->WixVersion == 3) {
+ directoryDefinitions.BeginElement("Directory");
+ directoryDefinitions.AddAttribute("Id", "TARGETDIR");
+ directoryDefinitions.AddAttribute("Name", "SourceDir");
+ }
- size_t installRootSize =
+ auto installationPrefixDirectory =
directoryDefinitions.BeginInstallationPrefixDirectory(GetRootFolderId(),
installRoot);
@@ -480,7 +549,8 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
this->WixSources.push_back(fileDefinitionsFilename);
- cmWIXFilesSourceWriter fileDefinitions(this->Logger, fileDefinitionsFilename,
+ cmWIXFilesSourceWriter fileDefinitions(this->WixVersion, this->Logger,
+ fileDefinitionsFilename,
this->ComponentGuidType);
InjectXmlNamespaces(fileDefinitions);
@@ -491,8 +561,9 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
this->WixSources.push_back(featureDefinitionsFilename);
- cmWIXFeaturesSourceWriter featureDefinitions(
- this->Logger, featureDefinitionsFilename, this->ComponentGuidType);
+ cmWIXFeaturesSourceWriter featureDefinitions(this->WixVersion, this->Logger,
+ featureDefinitionsFilename,
+ this->ComponentGuidType);
InjectXmlNamespaces(featureDefinitions);
featureDefinitions.BeginElement("Fragment");
@@ -500,7 +571,11 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
featureDefinitions.BeginElement("Feature");
featureDefinitions.AddAttribute("Id", "ProductFeature");
featureDefinitions.AddAttribute("Display", "expand");
- featureDefinitions.AddAttribute("Absent", "disallow");
+ if (this->WixVersion >= 4) {
+ featureDefinitions.AddAttribute("AllowAbsent", "no");
+ } else {
+ featureDefinitions.AddAttribute("Absent", "disallow");
+ }
featureDefinitions.AddAttribute("ConfigurableDirectory", "INSTALL_ROOT");
std::string cpackPackageName;
@@ -582,7 +657,8 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
featureDefinitions.EndElement("Fragment");
fileDefinitions.EndElement("Fragment");
- directoryDefinitions.EndInstallationPrefixDirectory(installRootSize);
+ directoryDefinitions.EndInstallationPrefixDirectory(
+ installationPrefixDirectory);
if (emittedShortcutTypes.find(cmWIXShortcuts::START_MENU) !=
emittedShortcutTypes.end()) {
@@ -600,7 +676,9 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
directoryDefinitions.EmitStartupFolder();
}
- directoryDefinitions.EndElement("Directory");
+ if (this->WixVersion == 3) {
+ directoryDefinitions.EndElement("Directory");
+ }
directoryDefinitions.EndElement("Fragment");
if (!GenerateMainSourceFileFromTemplate()) {
@@ -612,15 +690,19 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
std::string cmCPackWIXGenerator::GetRootFolderId() const
{
- if (cmIsOn(GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER"))) {
- return "";
- }
+ std::string result;
- std::string result = "ProgramFiles<64>Folder";
+ if (GetOption("CPACK_WIX_SKIP_PROGRAM_FOLDER").IsOn()) {
+ return result;
+ }
cmValue rootFolderId = GetOption("CPACK_WIX_ROOT_FOLDER_ID");
if (rootFolderId) {
result = *rootFolderId;
+ } else if (this->WixVersion >= 4) {
+ result = "ProgramFiles6432Folder";
+ } else {
+ result = "ProgramFiles<64>Folder";
}
if (GetArchitecture() == "x86"_s) {
@@ -634,9 +716,15 @@ std::string cmCPackWIXGenerator::GetRootFolderId() const
bool cmCPackWIXGenerator::GenerateMainSourceFileFromTemplate()
{
- std::string wixTemplate = FindTemplate("WIX.template.in");
+ std::string wixTemplate;
if (cmValue wixtpl = GetOption("CPACK_WIX_TEMPLATE")) {
wixTemplate = *wixtpl;
+ } else {
+ cm::optional<cm::string_view> alt;
+ if (this->WixVersion == 3) {
+ alt = "WIX-v3/"_s;
+ }
+ wixTemplate = FindTemplate("WIX.template.in"_s, alt);
}
if (wixTemplate.empty()) {
@@ -763,21 +851,31 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType(
cmWIXFeaturesSourceWriter& featureDefinitions)
{
std::string directoryId;
+ std::string directoryRef = "DirectoryRef";
switch (type) {
case cmWIXShortcuts::START_MENU: {
cmValue cpackWixProgramMenuFolder =
GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER");
if (cpackWixProgramMenuFolder && cpackWixProgramMenuFolder == "."_s) {
directoryId = "ProgramMenuFolder";
+ if (this->WixVersion >= 4) {
+ directoryRef = "StandardDirectory";
+ }
} else {
directoryId = "PROGRAM_MENU_FOLDER";
}
} break;
case cmWIXShortcuts::DESKTOP:
directoryId = "DesktopFolder";
+ if (this->WixVersion >= 4) {
+ directoryRef = "StandardDirectory";
+ }
break;
case cmWIXShortcuts::STARTUP:
directoryId = "StartupFolder";
+ if (this->WixVersion >= 4) {
+ directoryRef = "StandardDirectory";
+ }
break;
default:
return false;
@@ -809,7 +907,7 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType(
componentId += idSuffix;
- fileDefinitions.BeginElement("DirectoryRef");
+ fileDefinitions.BeginElement(directoryRef);
fileDefinitions.AddAttribute("Id", directoryId);
fileDefinitions.BeginElement("Component");
@@ -839,7 +937,7 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType(
}
fileDefinitions.EndElement("Component");
- fileDefinitions.EndElement("DirectoryRef");
+ fileDefinitions.EndElement(directoryRef);
featureDefinitions.EmitComponentRef(componentId);
featureDefinitions.EndElement("FeatureRef");
@@ -1179,12 +1277,7 @@ void cmCPackWIXGenerator::CollectExtensions(std::string const& variableName,
void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName,
xmlns_map_t& namespaces)
{
- cmValue variableContent = GetOption(variableName);
- if (!variableContent) {
- return;
- }
-
- cmList list{ variableContent };
+ cmList list{ GetOption(variableName) };
for (std::string const& str : list) {
auto pos = str.find('=');
if (pos != std::string::npos) {
@@ -1198,12 +1291,18 @@ void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName,
<< str << '"' << std::endl);
}
}
- std::ostringstream oss;
+ std::string xmlns;
+ if (this->WixVersion >= 4 &&
+ cm::contains(this->WixExtensions, "WixToolset.UI.wixext") &&
+ !cm::contains(namespaces, "ui")) {
+ xmlns = cmStrCat(
+ xmlns, "\n xmlns:ui=\"http://wixtoolset.org/schemas/v4/wxs/ui\"");
+ }
for (auto& ns : namespaces) {
- oss << " xmlns:" << ns.first << "=\""
- << cmWIXSourceWriter::EscapeAttributeValue(ns.second) << '"';
+ xmlns = cmStrCat(xmlns, "\n xmlns:", ns.first, "=\"",
+ cmWIXSourceWriter::EscapeAttributeValue(ns.second), '"');
}
- SetOption("CPACK_WIX_CUSTOM_XMLNS_EXPANDED", oss.str());
+ SetOption("CPACK_WIX_CUSTOM_XMLNS_EXPANDED", xmlns);
}
void cmCPackWIXGenerator::AddCustomFlags(std::string const& variableName,
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index 8609cf3..63530d4 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -59,6 +59,8 @@ private:
bool InitializeWiXConfiguration();
bool PackageFilesImpl();
+ bool PackageWithWix();
+ bool PackageWithWix3();
void CreateWiXVariablesIncludeFile();
@@ -160,6 +162,7 @@ private:
id_map_t PathToIdMap;
ambiguity_map_t IdAmbiguityCounter;
+ extension_set_t WixExtensions;
extension_set_t CandleExtensions;
extension_set_t LightExtensions;
xmlns_map_t CustomXmlNamespaces;
@@ -168,5 +171,7 @@ private:
std::unique_ptr<cmWIXPatch> Patch;
+ unsigned long WixVersion = 3;
+
cmWIXSourceWriter::GuidType ComponentGuidType;
};
diff --git a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
index a655d86..b1e7bd2 100644
--- a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.cxx
@@ -5,15 +5,16 @@
#include <cmext/string_view>
cmWIXDirectoriesSourceWriter::cmWIXDirectoriesSourceWriter(
- cmCPackLog* logger, std::string const& filename, GuidType componentGuidType)
- : cmWIXSourceWriter(logger, filename, componentGuidType)
+ unsigned long wixVersion, cmCPackLog* logger, std::string const& filename,
+ GuidType componentGuidType)
+ : cmWIXSourceWriter(wixVersion, logger, filename, componentGuidType)
{
}
void cmWIXDirectoriesSourceWriter::EmitStartMenuFolder(
std::string const& startMenuFolder)
{
- BeginElement("Directory");
+ BeginElement_StandardDirectory();
AddAttribute("Id", "ProgramMenuFolder");
if (startMenuFolder != "."_s) {
@@ -23,34 +24,39 @@ void cmWIXDirectoriesSourceWriter::EmitStartMenuFolder(
EndElement("Directory");
}
- EndElement("Directory");
+ EndElement_StandardDirectory();
}
void cmWIXDirectoriesSourceWriter::EmitDesktopFolder()
{
- BeginElement("Directory");
+ BeginElement_StandardDirectory();
AddAttribute("Id", "DesktopFolder");
- AddAttribute("Name", "Desktop");
- EndElement("Directory");
+ if (this->WixVersion == 3) {
+ AddAttribute("Name", "Desktop");
+ }
+ EndElement_StandardDirectory();
}
void cmWIXDirectoriesSourceWriter::EmitStartupFolder()
{
- BeginElement("Directory");
+ BeginElement_StandardDirectory();
AddAttribute("Id", "StartupFolder");
- AddAttribute("Name", "Startup");
- EndElement("Directory");
+ if (this->WixVersion == 3) {
+ AddAttribute("Name", "Startup");
+ }
+ EndElement_StandardDirectory();
}
-size_t cmWIXDirectoriesSourceWriter::BeginInstallationPrefixDirectory(
+cmWIXDirectoriesSourceWriter::InstallationPrefixDirectory
+cmWIXDirectoriesSourceWriter::BeginInstallationPrefixDirectory(
std::string const& programFilesFolderId,
std::string const& installRootString)
{
- size_t offset = 1;
+ InstallationPrefixDirectory installationPrefixDirectory;
if (!programFilesFolderId.empty()) {
- BeginElement("Directory");
+ installationPrefixDirectory.HasStandardDirectory = true;
+ this->BeginElement_StandardDirectory();
AddAttribute("Id", programFilesFolderId);
- offset = 0;
}
std::vector<std::string> installRoot;
@@ -62,6 +68,7 @@ size_t cmWIXDirectoriesSourceWriter::BeginInstallationPrefixDirectory(
}
for (size_t i = 1; i < installRoot.size(); ++i) {
+ ++installationPrefixDirectory.Depth;
BeginElement("Directory");
if (i == installRoot.size() - 1) {
@@ -75,12 +82,16 @@ size_t cmWIXDirectoriesSourceWriter::BeginInstallationPrefixDirectory(
AddAttribute("Name", installRoot[i]);
}
- return installRoot.size() - offset;
+ return installationPrefixDirectory;
}
-void cmWIXDirectoriesSourceWriter::EndInstallationPrefixDirectory(size_t size)
+void cmWIXDirectoriesSourceWriter::EndInstallationPrefixDirectory(
+ InstallationPrefixDirectory installationPrefixDirectory)
{
- for (size_t i = 0; i < size; ++i) {
+ for (size_t i = 0; i < installationPrefixDirectory.Depth; ++i) {
EndElement("Directory");
}
+ if (installationPrefixDirectory.HasStandardDirectory) {
+ this->EndElement_StandardDirectory();
+ }
}
diff --git a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h
index 0af3094..b0aa1e2 100644
--- a/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h
+++ b/Source/CPack/WiX/cmWIXDirectoriesSourceWriter.h
@@ -13,7 +13,8 @@
class cmWIXDirectoriesSourceWriter : public cmWIXSourceWriter
{
public:
- cmWIXDirectoriesSourceWriter(cmCPackLog* logger, std::string const& filename,
+ cmWIXDirectoriesSourceWriter(unsigned long wixVersion, cmCPackLog* logger,
+ std::string const& filename,
GuidType componentGuidType);
void EmitStartMenuFolder(std::string const& startMenuFolder);
@@ -22,9 +23,16 @@ public:
void EmitStartupFolder();
- size_t BeginInstallationPrefixDirectory(
+ struct InstallationPrefixDirectory
+ {
+ bool HasStandardDirectory = false;
+ size_t Depth = 0;
+ };
+
+ InstallationPrefixDirectory BeginInstallationPrefixDirectory(
std::string const& programFilesFolderId,
std::string const& installRootString);
- void EndInstallationPrefixDirectory(size_t size);
+ void EndInstallationPrefixDirectory(
+ InstallationPrefixDirectory installationPrefixDirectory);
};
diff --git a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx
index 78c2208..0d2e6e8 100644
--- a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx
@@ -5,8 +5,9 @@
#include "cmStringAlgorithms.h"
cmWIXFeaturesSourceWriter::cmWIXFeaturesSourceWriter(
- cmCPackLog* logger, std::string const& filename, GuidType componentGuidType)
- : cmWIXSourceWriter(logger, filename, componentGuidType)
+ unsigned long wixVersion, cmCPackLog* logger, std::string const& filename,
+ GuidType componentGuidType)
+ : cmWIXSourceWriter(wixVersion, logger, filename, componentGuidType)
{
}
@@ -69,7 +70,11 @@ void cmWIXFeaturesSourceWriter::EmitFeatureForComponent(
AddAttributeUnlessEmpty("Description", component.Description);
if (component.IsRequired) {
- AddAttribute("Absent", "disallow");
+ if (this->WixVersion >= 4) {
+ AddAttribute("AllowAbsent", "no");
+ } else {
+ AddAttribute("Absent", "disallow");
+ }
}
if (component.IsHidden) {
diff --git a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h
index 0facf97..95de8fe 100644
--- a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h
+++ b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.h
@@ -12,7 +12,8 @@
class cmWIXFeaturesSourceWriter : public cmWIXSourceWriter
{
public:
- cmWIXFeaturesSourceWriter(cmCPackLog* logger, std::string const& filename,
+ cmWIXFeaturesSourceWriter(unsigned long wixVersion, cmCPackLog* logger,
+ std::string const& filename,
GuidType componentGuidType);
void CreateCMakePackageRegistryEntry(std::string const& package,
diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
index b4085d5..87ac6ac 100644
--- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
@@ -15,10 +15,11 @@
#include "cmUuid.h"
#include "cmWIXAccessControlList.h"
-cmWIXFilesSourceWriter::cmWIXFilesSourceWriter(cmCPackLog* logger,
+cmWIXFilesSourceWriter::cmWIXFilesSourceWriter(unsigned long wixVersion,
+ cmCPackLog* logger,
std::string const& filename,
GuidType componentGuidType)
- : cmWIXSourceWriter(logger, filename, componentGuidType)
+ : cmWIXSourceWriter(wixVersion, logger, filename, componentGuidType)
{
}
diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.h b/Source/CPack/WiX/cmWIXFilesSourceWriter.h
index 60dddd4..f560304 100644
--- a/Source/CPack/WiX/cmWIXFilesSourceWriter.h
+++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.h
@@ -13,7 +13,8 @@
class cmWIXFilesSourceWriter : public cmWIXSourceWriter
{
public:
- cmWIXFilesSourceWriter(cmCPackLog* logger, std::string const& filename,
+ cmWIXFilesSourceWriter(unsigned long wixVersion, cmCPackLog* logger,
+ std::string const& filename,
GuidType componentGuidType);
void EmitShortcut(std::string const& id, cmWIXShortcut const& shortcut,
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx
index ef6712a..33e8a70 100644
--- a/Source/CPack/WiX/cmWIXSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx
@@ -8,11 +8,13 @@
#include "cmCryptoHash.h"
#include "cmUuid.h"
-cmWIXSourceWriter::cmWIXSourceWriter(cmCPackLog* logger,
+cmWIXSourceWriter::cmWIXSourceWriter(unsigned long wixVersion,
+ cmCPackLog* logger,
std::string const& filename,
GuidType componentGuidType,
RootElementType rootElementType)
- : Logger(logger)
+ : WixVersion(wixVersion)
+ , Logger(logger)
, File(filename.c_str())
, State(DEFAULT)
, SourceFilename(filename)
@@ -26,7 +28,11 @@ cmWIXSourceWriter::cmWIXSourceWriter(cmCPackLog* logger,
BeginElement("Wix");
}
- AddAttribute("xmlns", "http://schemas.microsoft.com/wix/2006/wi");
+ if (this->WixVersion >= 4) {
+ AddAttribute("xmlns", "http://wixtoolset.org/schemas/v4/wxs");
+ } else {
+ AddAttribute("xmlns", "http://schemas.microsoft.com/wix/2006/wi");
+ }
}
cmWIXSourceWriter::~cmWIXSourceWriter()
@@ -42,6 +48,24 @@ cmWIXSourceWriter::~cmWIXSourceWriter()
EndElement(Elements.back());
}
+void cmWIXSourceWriter::BeginElement_StandardDirectory()
+{
+ if (this->WixVersion >= 4) {
+ BeginElement("StandardDirectory");
+ } else {
+ BeginElement("Directory");
+ }
+}
+
+void cmWIXSourceWriter::EndElement_StandardDirectory()
+{
+ if (this->WixVersion >= 4) {
+ EndElement("StandardDirectory");
+ } else {
+ EndElement("Directory");
+ }
+}
+
void cmWIXSourceWriter::BeginElement(std::string const& name)
{
if (State == BEGIN) {
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h
index f643acd..1089cf5 100644
--- a/Source/CPack/WiX/cmWIXSourceWriter.h
+++ b/Source/CPack/WiX/cmWIXSourceWriter.h
@@ -27,12 +27,15 @@ public:
INCLUDE_ELEMENT_ROOT
};
- cmWIXSourceWriter(cmCPackLog* logger, std::string const& filename,
- GuidType componentGuidType,
+ cmWIXSourceWriter(unsigned long wixVersion, cmCPackLog* logger,
+ std::string const& filename, GuidType componentGuidType,
RootElementType rootElementType = WIX_ELEMENT_ROOT);
~cmWIXSourceWriter();
+ void BeginElement_StandardDirectory();
+ void EndElement_StandardDirectory();
+
void BeginElement(std::string const& name);
void EndElement(std::string const& name);
@@ -52,6 +55,7 @@ public:
static std::string EscapeAttributeValue(std::string const& value);
protected:
+ unsigned long WixVersion;
cmCPackLog* Logger;
private:
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index c9c069c..b7b6785 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -5,6 +5,8 @@
#include <cstring>
#include <map>
#include <ostream>
+#include <unordered_map>
+#include <unordered_set>
#include <utility>
#include <vector>
@@ -17,6 +19,121 @@
#include "cmValue.h"
#include "cmWorkingDirectory.h"
+enum class DeduplicateStatus
+{
+ Skip,
+ Add,
+ Error
+};
+
+/**
+ * @class cmCPackArchiveGenerator::Deduplicator
+ * @brief A utility class for deduplicating files, folders, and symlinks.
+ *
+ * This class is responsible for identifying duplicate files, folders, and
+ * symlinks when generating an archive. It keeps track of the paths that have
+ * been processed and helps in deciding whether a new path should be added,
+ * skipped, or flagged as an error.
+ */
+class cmCPackArchiveGenerator::Deduplicator
+{
+private:
+ /**
+ * @brief Compares a file with already processed files.
+ *
+ * @param path The path of the file to compare.
+ * @param localTopLevel The top-level directory for the file.
+ * @return DeduplicateStatus indicating whether to add, skip, or flag an
+ * error for the file.
+ */
+ DeduplicateStatus CompareFile(const std::string& path,
+ const std::string& localTopLevel)
+ {
+ auto fileItr = this->Files.find(path);
+ if (fileItr != this->Files.end()) {
+ return cmSystemTools::FilesDiffer(path, fileItr->second)
+ ? DeduplicateStatus::Error
+ : DeduplicateStatus::Skip;
+ }
+
+ this->Files[path] = cmStrCat(localTopLevel, "/", path);
+ return DeduplicateStatus::Add;
+ }
+
+ /**
+ * @brief Compares a folder with already processed folders.
+ *
+ * @param path The path of the folder to compare.
+ * @return DeduplicateStatus indicating whether to add or skip the folder.
+ */
+ DeduplicateStatus CompareFolder(const std::string& path)
+ {
+ if (this->Folders.find(path) != this->Folders.end()) {
+ return DeduplicateStatus::Skip;
+ }
+
+ this->Folders.emplace(path);
+ return DeduplicateStatus::Add;
+ }
+
+ /**
+ * @brief Compares a symlink with already processed symlinks.
+ *
+ * @param path The path of the symlink to compare.
+ * @return DeduplicateStatus indicating whether to add, skip, or flag an
+ * error for the symlink.
+ */
+ DeduplicateStatus CompareSymlink(const std::string& path)
+ {
+ auto symlinkItr = this->Symlink.find(path);
+ std::string symlinkValue;
+ auto status = cmSystemTools::ReadSymlink(path, symlinkValue);
+ if (!status.IsSuccess()) {
+ return DeduplicateStatus::Error;
+ }
+
+ if (symlinkItr != this->Symlink.end()) {
+ return symlinkValue == symlinkItr->second ? DeduplicateStatus::Skip
+ : DeduplicateStatus::Error;
+ }
+
+ this->Symlink[path] = symlinkValue;
+ return DeduplicateStatus::Add;
+ }
+
+public:
+ /**
+ * @brief Determines the deduplication status of a given path.
+ *
+ * This method identifies whether the given path is a file, folder, or
+ * symlink and then delegates to the appropriate comparison method.
+ *
+ * @param path The path to check for deduplication.
+ * @param localTopLevel The top-level directory for the path.
+ * @return DeduplicateStatus indicating the action to take for the given
+ * path.
+ */
+ DeduplicateStatus IsDeduplicate(const std::string& path,
+ const std::string& localTopLevel)
+ {
+ DeduplicateStatus status;
+ if (cmSystemTools::FileIsDirectory(path)) {
+ status = this->CompareFolder(path);
+ } else if (cmSystemTools::FileIsSymlink(path)) {
+ status = this->CompareSymlink(path);
+ } else {
+ status = this->CompareFile(path, localTopLevel);
+ }
+
+ return status;
+ }
+
+private:
+ std::unordered_map<std::string, std::string> Symlink;
+ std::unordered_set<std::string> Folders;
+ std::unordered_map<std::string, std::string> Files;
+};
+
cmCPackGenerator* cmCPackArchiveGenerator::Create7ZGenerator()
{
return new cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, "7zip",
@@ -110,7 +227,8 @@ int cmCPackArchiveGenerator::InitializeInternal()
}
int cmCPackArchiveGenerator::addOneComponentToArchive(
- cmArchiveWrite& archive, cmCPackComponent* component)
+ cmArchiveWrite& archive, cmCPackComponent* component,
+ Deduplicator* deduplicator)
{
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
" - packaging component: " << component->Name << std::endl);
@@ -139,8 +257,25 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
}
for (std::string const& file : component->Files) {
std::string rp = filePrefix + file;
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file: " << rp << std::endl);
- archive.Add(rp, 0, nullptr, false);
+
+ DeduplicateStatus status = DeduplicateStatus::Add;
+ if (deduplicator != nullptr) {
+ status = deduplicator->IsDeduplicate(rp, localToplevel);
+ }
+
+ if (deduplicator == nullptr || status == DeduplicateStatus::Add) {
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file: " << rp << std::endl);
+ archive.Add(rp, 0, nullptr, false);
+ } else if (status == DeduplicateStatus::Error) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "ERROR The data in files with the "
+ "same filename is different.");
+ return 0;
+ } else {
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Passing file: " << rp << std::endl);
+ }
+
if (!archive) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"ERROR while packaging files: " << archive.GetError()
@@ -197,6 +332,8 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
std::string packageFileName = std::string(this->toplevel) + "/" +
this->GetArchiveComponentFileName(compG.first, true);
+ Deduplicator deduplicator;
+
// open a block in order to automatically close archive
// at the end of the block
{
@@ -204,7 +341,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
// now iterate over the component of this group
for (cmCPackComponent* comp : (compG.second).Components) {
// Add the files of this component to the archive
- this->addOneComponentToArchive(archive, comp);
+ this->addOneComponentToArchive(archive, comp, &deduplicator);
}
}
// add the generated package to package file names list
@@ -231,7 +368,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
{
DECLARE_AND_OPEN_ARCHIVE(packageFileName, archive);
// Add the files of this component to the archive
- this->addOneComponentToArchive(archive, &(comp.second));
+ this->addOneComponentToArchive(archive, &(comp.second), nullptr);
}
// add the generated package to package file names list
this->packageFileNames.push_back(std::move(packageFileName));
@@ -252,7 +389,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
{
DECLARE_AND_OPEN_ARCHIVE(packageFileName, archive);
// Add the files of this component to the archive
- this->addOneComponentToArchive(archive, &(comp.second));
+ this->addOneComponentToArchive(archive, &(comp.second), nullptr);
}
// add the generated package to package file names list
this->packageFileNames.push_back(std::move(packageFileName));
@@ -282,10 +419,12 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne()
<< std::endl);
DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0], archive);
+ Deduplicator deduplicator;
+
// The ALL COMPONENTS in ONE package case
for (auto& comp : this->Components) {
// Add the files of this component to the archive
- this->addOneComponentToArchive(archive, &(comp.second));
+ this->addOneComponentToArchive(archive, &(comp.second), &deduplicator);
}
// archive goes out of scope so it will finalized and closed.
diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h
index 8a9bbc6..b8a1afa 100644
--- a/Source/CPack/cmCPackArchiveGenerator.h
+++ b/Source/CPack/cmCPackArchiveGenerator.h
@@ -47,6 +47,8 @@ private:
std::string GetArchiveComponentFileName(const std::string& component,
bool isGroupName);
+ class Deduplicator;
+
protected:
int InitializeInternal() override;
/**
@@ -54,9 +56,11 @@ protected:
* to the provided (already opened) archive.
* @param[in,out] archive the archive object
* @param[in] component the component whose file will be added to archive
+ * @param[in] deduplicator file deduplicator utility.
*/
int addOneComponentToArchive(cmArchiveWrite& archive,
- cmCPackComponent* component);
+ cmCPackComponent* component,
+ Deduplicator* deduplicator);
/**
* The main package file method.
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 8d16428..7693891 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -225,7 +225,7 @@ bool DebGenerator::generateDataTar() const
// XXX/application/usr/bin/myprogram with GEN_WDIR=XXX/application
// should not add XXX/application
orderedFiles.insert(currentPath);
- currentPath = cmSystemTools::CollapseFullPath("..", currentPath);
+ currentPath = cmSystemTools::GetFilenamePath(currentPath);
}
}
@@ -527,7 +527,7 @@ cmCPackDebGenerator::~cmCPackDebGenerator() = default;
int cmCPackDebGenerator::InitializeInternal()
{
this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr");
- if (cmIsOff(this->GetOption("CPACK_SET_DESTDIR"))) {
+ if (this->GetOption("CPACK_SET_DESTDIR").IsOff()) {
this->SetOption("CPACK_SET_DESTDIR", "I_ON");
}
return this->Superclass::InitializeInternal();
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 8ba015c..52eacaa 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -156,7 +156,7 @@ int cmCPackExternalGenerator::InstallCMakeProject(
bool cmCPackExternalGenerator::StagingEnabled() const
{
- return !cmIsOff(this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING"));
+ return !this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING").IsOff();
}
cmCPackExternalGenerator::cmCPackExternalVersionGenerator::
@@ -221,7 +221,7 @@ int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON(
root["setDestdir"] = false;
}
- root["stripFiles"] = !cmIsOff(this->Parent->GetOption("CPACK_STRIP_FILES"));
+ root["stripFiles"] = !this->Parent->GetOption("CPACK_STRIP_FILES").IsOff();
root["warnOnAbsoluteInstallDestination"] =
this->Parent->IsOn("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION");
root["errorOnAbsoluteInstallDestination"] =
diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx
index 0840e33..6beb644 100644
--- a/Source/CPack/cmCPackFreeBSDGenerator.cxx
+++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -405,8 +405,7 @@ int cmCPackFreeBSDGenerator::PackageFiles()
return 0;
}
- const std::string output_dir =
- cmSystemTools::CollapseFullPath("../", toplevel);
+ const std::string output_dir = cmSystemTools::GetFilenamePath(toplevel);
PkgCreate package(output_dir, toplevel, manifestname);
if (package.isValid()) {
if (!package.Create()) {
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 11d90c0..4a5580c 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -7,6 +7,8 @@
#include <memory>
#include <utility>
+#include <cmext/string_view>
+
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
#include "cmsys/RegularExpression.hxx"
@@ -77,51 +79,60 @@ int cmCPackGenerator::PrepareNames()
}
}
- std::string tempDirectory =
- cmStrCat(this->GetOption("CPACK_PACKAGE_DIRECTORY"), "/_CPack_Packages/");
- cmValue toplevelTag = this->GetOption("CPACK_TOPLEVEL_TAG");
- if (toplevelTag) {
- tempDirectory += *toplevelTag;
- tempDirectory += "/";
+ // Determine package-directory.
+ cmValue pkgDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY");
+ if (!pkgDirectory) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "CPACK_PACKAGE_DIRECTORY not specified" << std::endl);
+ return 0;
}
- tempDirectory += *this->GetOption("CPACK_GENERATOR");
- std::string topDirectory = tempDirectory;
- cmValue pfname = this->GetOption("CPACK_PACKAGE_FILE_NAME");
- if (!pfname) {
+ // Determine base-filename of the package.
+ cmValue pkgBaseFileName = this->GetOption("CPACK_PACKAGE_FILE_NAME");
+ if (!pkgBaseFileName) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_PACKAGE_FILE_NAME not specified" << std::endl);
return 0;
}
- std::string outName = *pfname;
- tempDirectory += "/" + outName;
+ // Determine filename of the package.
if (!this->GetOutputExtension()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"No output extension specified" << std::endl);
return 0;
}
- outName += this->GetOutputExtension();
- cmValue pdir = this->GetOption("CPACK_PACKAGE_DIRECTORY");
- if (!pdir) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "CPACK_PACKAGE_DIRECTORY not specified" << std::endl);
- return 0;
+ std::string pkgFileName =
+ cmStrCat(pkgBaseFileName, this->GetOutputExtension());
+ // Determine path to the package.
+ 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 += *this->GetOption("CPACK_GENERATOR");
+ // Determine temporary packaging-directory.
+ std::string tmpDirectory = cmStrCat(topDirectory, "/", pkgBaseFileName);
+ // Determine path to temporary package file.
+ std::string tmpPkgFilePath = topDirectory + "/" + pkgFileName;
- std::string destFile = *pdir;
- this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PREFIX", destFile);
- destFile += "/" + outName;
- std::string outFile = topDirectory + "/" + outName;
+ // Set CPack variables which are not set already.
+ this->SetOptionIfNotSet("CPACK_REMOVE_TOPLEVEL_DIRECTORY", "1");
this->SetOptionIfNotSet("CPACK_TOPLEVEL_DIRECTORY", topDirectory);
- this->SetOptionIfNotSet("CPACK_TEMPORARY_DIRECTORY", tempDirectory);
- this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_NAME", outName);
- this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PATH", destFile);
- this->SetOptionIfNotSet("CPACK_TEMPORARY_PACKAGE_FILE_NAME", outFile);
+ this->SetOptionIfNotSet("CPACK_TEMPORARY_DIRECTORY", tmpDirectory);
+ this->SetOptionIfNotSet("CPACK_TEMPORARY_INSTALL_DIRECTORY", tmpDirectory);
+ this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PREFIX", pkgDirectory);
+ this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_NAME", pkgFileName);
+ this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PATH", pkgFilePath);
+ this->SetOptionIfNotSet("CPACK_TEMPORARY_PACKAGE_FILE_NAME", tmpPkgFilePath);
this->SetOptionIfNotSet("CPACK_INSTALL_DIRECTORY", this->GetInstallPath());
this->SetOptionIfNotSet(
"CPACK_NATIVE_INSTALL_DIRECTORY",
cmsys::SystemTools::ConvertToOutputPath(this->GetInstallPath()));
- this->SetOptionIfNotSet("CPACK_TEMPORARY_INSTALL_DIRECTORY", tempDirectory);
+ // Determine description of the package and set as CPack variable,
+ // if not already set.
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Look for: CPACK_PACKAGE_DESCRIPTION_FILE" << std::endl);
cmValue descFileName = this->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE");
@@ -141,14 +152,14 @@ int cmCPackGenerator::PrepareNames()
<< std::endl);
return 0;
}
- std::ostringstream ostr;
- std::string line;
-
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Read description file: " << *descFileName << std::endl);
+ std::ostringstream ostr;
+ std::string line;
while (ifs && cmSystemTools::GetLineFromStream(ifs, line)) {
ostr << cmXMLSafe(line) << std::endl;
}
+
this->SetOption("CPACK_PACKAGE_DESCRIPTION", ostr.str());
cmValue defFileName =
this->GetOption("CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE");
@@ -164,6 +175,8 @@ int cmCPackGenerator::PrepareNames()
<< std::endl);
return 0;
}
+
+ // Check algorithm for calculating the checksum of the package.
cmValue algoSignature = this->GetOption("CPACK_PACKAGE_CHECKSUM");
if (algoSignature) {
if (!cmCryptoHash::New(*algoSignature)) {
@@ -174,8 +187,6 @@ int cmCPackGenerator::PrepareNames()
}
}
- this->SetOptionIfNotSet("CPACK_REMOVE_TOPLEVEL_DIRECTORY", "1");
-
return 1;
}
@@ -185,21 +196,21 @@ int cmCPackGenerator::InstallProject()
this->CleanTemporaryDirectory();
std::string bareTempInstallDirectory =
- this->GetOption("CPACK_TEMPORARY_INSTALL_DIRECTORY");
- std::string tempInstallDirectoryStr = bareTempInstallDirectory;
- bool setDestDir = cmIsOn(this->GetOption("CPACK_SET_DESTDIR")) ||
+ this->GetOption("CPACK_TEMPORARY_DIRECTORY");
+ std::string tempInstallDirectory = bareTempInstallDirectory;
+ bool setDestDir = this->GetOption("CPACK_SET_DESTDIR").IsOn() ||
cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"));
if (!setDestDir) {
- tempInstallDirectoryStr += this->GetPackagingInstallPrefix();
+ tempInstallDirectory += this->GetPackagingInstallPrefix();
}
- const char* tempInstallDirectory = tempInstallDirectoryStr.c_str();
int res = 1;
if (!cmsys::SystemTools::MakeDirectory(bareTempInstallDirectory)) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating temporary directory: "
- << (tempInstallDirectory ? tempInstallDirectory : "(NULL)")
- << std::endl);
+ cmCPackLogger(
+ cmCPackLog::LOG_ERROR,
+ "Problem creating temporary directory: "
+ << (!tempInstallDirectory.empty() ? tempInstallDirectory : "(NULL)")
+ << std::endl);
return 0;
}
@@ -360,7 +371,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Find files" << std::endl);
cmsys::Glob gl;
std::string top = *it;
- it++;
+ ++it;
std::string subdir = *it;
std::string findExpr = cmStrCat(top, "/*");
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
@@ -855,7 +866,7 @@ int cmCPackGenerator::InstallCMakeProject(
// strip on TRUE, ON, 1, one or several file names, but not on
// FALSE, OFF, 0 and an empty string
- if (!cmIsOff(this->GetOption("CPACK_STRIP_FILES"))) {
+ if (!this->GetOption("CPACK_STRIP_FILES").IsOff()) {
mf.AddDefinition("CMAKE_INSTALL_DO_STRIP", "1");
}
// Remember the list of files before installation
@@ -879,7 +890,7 @@ int cmCPackGenerator::InstallCMakeProject(
if (this->IsOn("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION")) {
mf.AddDefinition("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", "1");
}
- // If current CPack generator does support
+ // If current CPack generator does not support
// ABSOLUTE INSTALL DESTINATION or CPack has been asked for
// then ask cmake_install.cmake script to error out
// as soon as it occurs (before installing file)
@@ -972,6 +983,48 @@ int cmCPackGenerator::InstallCMakeProject(
return 1;
}
+bool cmCPackGenerator::GenerateChecksumFile(cmCryptoHash& crypto,
+ cm::string_view filename) const
+{
+ std::string packageFileName =
+ cmStrCat(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"), "/", filename);
+ std::string hashFile = cmStrCat(
+ packageFileName, "." + cmSystemTools::LowerCase(crypto.GetHashAlgoName()));
+ cmsys::ofstream outF(hashFile.c_str());
+ if (!outF) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Cannot create checksum file: " << hashFile << std::endl);
+ return false;
+ }
+ outF << crypto.HashFile(packageFileName) << " " << filename << "\n";
+ cmCPackLogger(cmCPackLog::LOG_OUTPUT,
+ "- checksum file: " << hashFile << " generated." << std::endl);
+ return true;
+}
+
+bool cmCPackGenerator::CopyPackageFile(const std::string& srcFilePath,
+ cm::string_view filename) const
+{
+ std::string destFilePath =
+ cmStrCat(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"), "/", filename);
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Copy final package(s): "
+ << (!srcFilePath.empty() ? srcFilePath : "(NULL)") << " to "
+ << (!destFilePath.empty() ? destFilePath : "(NULL)")
+ << std::endl);
+ if (!cmSystemTools::CopyFileIfDifferent(srcFilePath, destFilePath)) {
+ cmCPackLogger(
+ cmCPackLog::LOG_ERROR,
+ "Problem copying the package: "
+ << (!srcFilePath.empty() ? srcFilePath : "(NULL)") << " to "
+ << (!destFilePath.empty() ? destFilePath : "(NULL)") << std::endl);
+ return false;
+ }
+ cmCPackLogger(cmCPackLog::LOG_OUTPUT,
+ "- package: " << destFilePath << " generated." << std::endl);
+ return true;
+}
+
bool cmCPackGenerator::ReadListFile(const char* moduleName)
{
bool retval;
@@ -1041,7 +1094,8 @@ int cmCPackGenerator::DoPackage()
return 0;
}
- if (cmIsOn(this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) {
+ // Possibly remove the top-level packaging-directory.
+ if (this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY").IsOn()) {
cmValue toplevelDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
if (toplevelDirectory && cmSystemTools::FileExists(*toplevelDirectory)) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
@@ -1055,55 +1109,68 @@ int cmCPackGenerator::DoPackage()
}
}
}
+
+ // Install the project (to the temporary install-directory).
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"About to install project " << std::endl);
-
if (!this->InstallProject()) {
return 0;
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Done install project " << std::endl);
- cmValue tempPackageFileName =
- this->GetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME");
+ // Determine the temporary directory whose content shall be packaged.
cmValue tempDirectory = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
+ // Determine and store internally the list of files to be installed.
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Find files" << std::endl);
- cmsys::Glob gl;
- std::string findExpr = cmStrCat(tempDirectory, "/*");
- gl.RecurseOn();
- gl.SetRecurseListDirs(true);
- gl.SetRecurseThroughSymlinks(false);
- if (!gl.FindFiles(findExpr)) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Cannot find any files in the packaging tree" << std::endl);
- return 0;
+ {
+ cmsys::Glob gl;
+ std::string findExpr = cmStrCat(tempDirectory, "/*");
+ gl.RecurseOn();
+ gl.SetRecurseListDirs(true);
+ gl.SetRecurseThroughSymlinks(false);
+ if (!gl.FindFiles(findExpr)) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Cannot find any files in the packaging tree"
+ << std::endl);
+ return 0;
+ }
+ this->files = gl.GetFiles();
}
- cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package" << std::endl);
- cmCPackLogger(cmCPackLog::LOG_VERBOSE,
- "Package files to: "
- << (tempPackageFileName ? *tempPackageFileName : "(NULL)")
- << std::endl);
- if (tempPackageFileName && cmSystemTools::FileExists(*tempPackageFileName)) {
- cmCPackLogger(cmCPackLog::LOG_VERBOSE,
- "Remove old package file" << std::endl);
- cmSystemTools::RemoveFile(*tempPackageFileName);
- }
- if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
+ // Determine and store internally the directory that shall be packaged.
+ if (this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY").IsOn()) {
tempDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
}
+ this->toplevel = *tempDirectory;
- // The files to be installed
- this->files = gl.GetFiles();
+ cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package" << std::endl);
- this->packageFileNames.clear();
- /* Put at least one file name into the list of
- * wanted packageFileNames. The specific generator
- * may update this during PackageFiles.
- * (either putting several names or updating the provided one)
- */
- this->packageFileNames.emplace_back(tempPackageFileName);
- this->toplevel = *tempDirectory;
+ // Determine and store internally the list of packages to create.
+ // Note: Initially, this only contains a single package.
+ {
+ cmValue tempPackageFileName =
+ this->GetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME");
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE,
+ "Package files to: "
+ << (tempPackageFileName ? *tempPackageFileName : "(NULL)")
+ << std::endl);
+ if (tempPackageFileName &&
+ cmSystemTools::FileExists(*tempPackageFileName)) {
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE,
+ "Remove old package file" << std::endl);
+ cmSystemTools::RemoveFile(*tempPackageFileName);
+ }
+ this->packageFileNames.clear();
+ /* Put at least one file name into the list of
+ * wanted packageFileNames. The specific generator
+ * may update this during PackageFiles.
+ * (either putting several names or updating the provided one)
+ */
+ this->packageFileNames.emplace_back(tempPackageFileName);
+ }
+
+ // Do package the files (using the derived CPack generators.
{ // scope that enables package generators to run internal scripts with
// latest CMake policies enabled
cmMakefile::ScopePushPop pp{ this->MakefileMap };
@@ -1116,6 +1183,7 @@ int cmCPackGenerator::DoPackage()
return 0;
}
}
+
// Run post-build actions
cmValue postBuildScripts = this->GetOption("CPACK_POST_BUILD_SCRIPTS");
if (postBuildScripts) {
@@ -1151,44 +1219,15 @@ int cmCPackGenerator::DoPackage()
<< "]:" << std::endl);
/* now copy package one by one */
for (std::string const& pkgFileName : this->packageFileNames) {
- std::string tmpPF(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"));
std::string filename(cmSystemTools::GetFilenameName(pkgFileName));
- tempPackageFileName = cmValue(pkgFileName);
- tmpPF += "/" + filename;
- const char* packageFileName = tmpPF.c_str();
- cmCPackLogger(cmCPackLog::LOG_DEBUG,
- "Copy final package(s): "
- << (tempPackageFileName ? *tempPackageFileName : "(NULL)")
- << " to " << (packageFileName ? packageFileName : "(NULL)")
- << std::endl);
- if (!cmSystemTools::CopyFileIfDifferent(pkgFileName, tmpPF)) {
- cmCPackLogger(
- cmCPackLog::LOG_ERROR,
- "Problem copying the package: "
- << (tempPackageFileName ? *tempPackageFileName : "(NULL)") << " to "
- << (packageFileName ? packageFileName : "(NULL)") << std::endl);
+ if (!this->CopyPackageFile(pkgFileName, filename)) {
return 0;
}
- cmCPackLogger(cmCPackLog::LOG_OUTPUT,
- "- package: " << packageFileName << " generated."
- << std::endl);
-
/* Generate checksum file */
if (crypto) {
- std::string hashFile(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"));
- hashFile += "/" + filename;
- hashFile += "." + cmSystemTools::LowerCase(algo);
- cmsys::ofstream outF(hashFile.c_str());
- if (!outF) {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Cannot create checksum file: " << hashFile
- << std::endl);
+ if (!this->GenerateChecksumFile(*crypto, filename)) {
return 0;
}
- outF << crypto->HashFile(packageFileName) << " " << filename << "\n";
- cmCPackLogger(cmCPackLog::LOG_OUTPUT,
- "- checksum file: " << hashFile << " generated."
- << std::endl);
}
}
@@ -1216,6 +1255,60 @@ int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf)
// it, the default value should be:
this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/");
+ // Special handling for CPACK_TEMPORARY[_INSTALL]_DIRECTORY.
+ // Note: Make sure that if only one of these variables is already set, the
+ // other will be set to the same value. If they are set to different
+ // values, however, we cannot proceed.
+ cmValue val1 =
+ this->MakefileMap->GetDefinition("CPACK_TEMPORARY_INSTALL_DIRECTORY");
+ cmValue val2 = this->MakefileMap->GetDefinition("CPACK_TEMPORARY_DIRECTORY");
+ if (val1 != val2) {
+ // One variable is set but not the other?
+ // Then set the other variable to the same value (even if it is invalid).
+ if (val1.Get() != nullptr && val2.Get() == nullptr) {
+ cmCPackLogger(cmCPackLog::LOG_WARNING,
+ "Variable CPACK_TEMPORARY_INSTALL_DIRECTORY is set, which "
+ "is not recommended. For backwards-compatibility we will "
+ "also set CPACK_TEMPORARY_DIRECTORY to the same value and "
+ "proceed. However, better set neither of them!"
+ << std::endl);
+ this->MakefileMap->AddDefinition("CPACK_TEMPORARY_DIRECTORY", val1);
+ } else if (val1.Get() == nullptr && val2.Get() != nullptr) {
+ cmCPackLogger(
+ cmCPackLog::LOG_WARNING,
+ "Variable CPACK_TEMPORARY_DIRECTORY is set, which is not recommended."
+ << std::endl);
+ cmCPackLogger(
+ cmCPackLog::LOG_DEBUG,
+ "For backwards-compatibility we will set "
+ "CPACK_TEMPORARY_INSTALL_DIRECTORY to the same value as "
+ "CPACK_TEMPORARY_DIRECTORY. However, better set neither of them!"
+ << std::endl);
+ this->MakefileMap->AddDefinition("CPACK_TEMPORARY_INSTALL_DIRECTORY",
+ val2);
+ } else {
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE,
+ "CPACK_TEMPORARY_INSTALL_DIRECTORY is already set to: "
+ << val1 << std::endl);
+ cmCPackLogger(
+ cmCPackLog::LOG_VERBOSE,
+ "CPACK_TEMPORARY_DIRECTORY is already set to: " << val2 << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Variables CPACK_TEMPORARY_DIRECTORY and "
+ "CPACK_TEMPORARY_INSTALL_DIRECTORY are both set but to "
+ "different values. This is not supported!"
+ << std::endl);
+ return 0;
+ }
+ } else if (val1.Get() != nullptr && val2.Get() != nullptr) {
+ cmCPackLogger(cmCPackLog::LOG_WARNING,
+ "Variables CPACK_TEMPORARY_DIRECTORY and "
+ "CPACK_TEMPORARY_INSTALL_DIRECTORY are both set. Because "
+ "they are set to the same value we can still proceed. "
+ "However, better set neither of them!"
+ << std::endl);
+ }
+
return result;
}
@@ -1231,14 +1324,14 @@ bool cmCPackGenerator::IsSet(const std::string& name) const
bool cmCPackGenerator::IsOn(const std::string& name) const
{
- return cmIsOn(this->GetOption(name));
+ return this->GetOption(name).IsOn();
}
bool cmCPackGenerator::IsSetToOff(const std::string& op) const
{
cmValue ret = this->MakefileMap->GetDefinition(op);
if (cmNonempty(ret)) {
- return cmIsOff(*ret);
+ return ret.IsOff();
}
return false;
}
@@ -1315,17 +1408,17 @@ const char* cmCPackGenerator::GetPackagingInstallPrefix()
return this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX")->c_str();
}
-std::string cmCPackGenerator::FindTemplate(const char* name)
+std::string cmCPackGenerator::FindTemplate(cm::string_view name,
+ cm::optional<cm::string_view> alt)
{
cmCPackLogger(cmCPackLog::LOG_DEBUG,
- "Look for template: " << (name ? name : "(NULL)")
- << std::endl);
+ "Look for template: " << name << std::endl);
// Search CMAKE_MODULE_PATH for a custom template.
std::string ffile = this->MakefileMap->GetModulesFile(name);
if (ffile.empty()) {
// Fall back to our internal builtin default.
ffile = cmStrCat(cmSystemTools::GetCMakeRoot(), "/Modules/Internal/CPack/",
- name);
+ alt ? *alt : ""_s, name);
cmSystemTools::ConvertToUnixSlashes(ffile);
if (!cmSystemTools::FileExists(ffile)) {
ffile.clear();
@@ -1354,7 +1447,7 @@ bool cmCPackGenerator::ConfigureFile(const std::string& inName,
int cmCPackGenerator::CleanTemporaryDirectory()
{
std::string tempInstallDirectory =
- this->GetOption("CPACK_TEMPORARY_INSTALL_DIRECTORY");
+ this->GetOption("CPACK_TEMPORARY_DIRECTORY");
if (cmsys::SystemTools::FileExists(tempInstallDirectory)) {
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Clean temporary : " << tempInstallDirectory << std::endl);
@@ -1439,8 +1532,8 @@ int cmCPackGenerator::PrepareGroupingKind()
this->componentPackageMethod = method;
}
- const char* method_names[] = { "ALL_COMPONENTS_IN_ONE", "IGNORE_GROUPS",
- "ONE_PER_GROUP" };
+ const char* method_names[] = { "ALL_COMPONENTS_IN_ONE", "IGNORE",
+ "ONE_PER_GROUP", "UNKNOWN" };
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"[" << this->Name << "]"
@@ -1560,7 +1653,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
component->IsRequired = this->IsOn(macroPrefix + "_REQUIRED");
component->IsDisabledByDefault = this->IsOn(macroPrefix + "_DISABLED");
component->IsDownloaded = this->IsOn(macroPrefix + "_DOWNLOADED") ||
- cmIsOn(this->GetOption("CPACK_DOWNLOAD_ALL"));
+ this->GetOption("CPACK_DOWNLOAD_ALL").IsOn();
cmValue archiveFile = this->GetOption(macroPrefix + "_ARCHIVE_FILE");
if (cmNonempty(archiveFile)) {
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 8078d9f..c9af776 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -9,6 +9,9 @@
#include <string>
#include <vector>
+#include <cm/optional>
+#include <cm/string_view>
+
#include "cm_sys_stat.h"
#include "cmCPackComponentGroup.h"
@@ -16,6 +19,7 @@
#include "cmValue.h"
class cmCPackLog;
+class cmCryptoHash;
class cmGlobalGenerator;
class cmInstalledFile;
class cmMakefile;
@@ -179,7 +183,13 @@ protected:
virtual const char* GetInstallPath();
virtual const char* GetPackagingInstallPrefix();
- virtual std::string FindTemplate(const char* name);
+ bool GenerateChecksumFile(cmCryptoHash& crypto,
+ cm::string_view filename) const;
+ bool CopyPackageFile(const std::string& srcFilePath,
+ cm::string_view filename) const;
+
+ std::string FindTemplate(cm::string_view name,
+ cm::optional<cm::string_view> alt = cm::nullopt);
virtual bool ConfigureFile(const std::string& inName,
const std::string& outName,
bool copyOnly = false);
diff --git a/Source/CPack/cmCPackInnoSetupGenerator.cxx b/Source/CPack/cmCPackInnoSetupGenerator.cxx
index b8bf070..17ea89f 100644
--- a/Source/CPack/cmCPackInnoSetupGenerator.cxx
+++ b/Source/CPack/cmCPackInnoSetupGenerator.cxx
@@ -7,7 +7,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */
#include <cctype>
#include <cstdlib>
#include <ostream>
-#include <stack>
#include <utility>
#include "cmsys/RegularExpression.hxx"
@@ -25,17 +24,12 @@ cmCPackInnoSetupGenerator::~cmCPackInnoSetupGenerator() = default;
bool cmCPackInnoSetupGenerator::CanGenerate()
{
- // Inno Setup is only available for Windows
-#ifdef _WIN32
return true;
-#else
- return false;
-#endif
}
int cmCPackInnoSetupGenerator::InitializeInternal()
{
- if (cmIsOn(GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
+ if (GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY").IsOn()) {
cmCPackLogger(cmCPackLog::LOG_WARNING,
"Inno Setup Generator cannot work with "
"CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. "
@@ -64,7 +58,8 @@ int cmCPackInnoSetupGenerator::InitializeInternal()
return 0;
}
- const std::string isccCmd = cmStrCat(QuotePath(isccPath), "/?");
+ const std::string isccCmd =
+ cmStrCat(QuotePath(isccPath, PathType::Native), "/?");
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Test Inno Setup version: " << isccCmd << std::endl);
std::string output;
@@ -579,8 +574,9 @@ bool cmCPackInnoSetupGenerator::ProcessFiles()
bool cmCPackInnoSetupGenerator::ProcessComponents()
{
- codeIncludes.push_back("{ The following lines are required by CPack because "
- "this script uses components }");
+ codeIncludes.emplace_back(
+ "{ The following lines are required by CPack because "
+ "this script uses components }");
// Installation types
std::vector<cmCPackInstallationType*> types(InstallationTypes.size());
@@ -607,12 +603,11 @@ bool cmCPackInnoSetupGenerator::ProcessComponents()
"\"{code:CPackGetCustomInstallationMessage}\"";
customTypeParams["Flags"] = "iscustom";
- allTypes.push_back("custom");
+ allTypes.emplace_back("custom");
typeInstructions.push_back(ISKeyValueLine(customTypeParams));
// Components
std::vector<cmCPackComponent*> downloadedComponents;
- std::stack<cmCPackComponentGroup*> groups;
for (auto& i : Components) {
cmCPackInnoSetupKeyValuePairs params;
cmCPackComponent* component = &i.second;
@@ -633,6 +628,7 @@ bool cmCPackInnoSetupGenerator::ProcessComponents()
} else if (!component->InstallationTypes.empty()) {
std::vector<std::string> installationTypes;
+ installationTypes.reserve(component->InstallationTypes.size());
for (cmCPackInstallationType* j : component->InstallationTypes) {
installationTypes.push_back(j->Name);
}
@@ -869,8 +865,8 @@ bool cmCPackInnoSetupGenerator::Compile()
}
const std::string& isccCmd =
- cmStrCat(QuotePath(GetOption("CPACK_INSTALLER_PROGRAM")), ' ',
- cmJoin(isccArgs, " "), ' ', QuotePath(isScriptFile));
+ cmStrCat(QuotePath(GetOption("CPACK_INSTALLER_PROGRAM"), PathType::Native),
+ ' ', cmJoin(isccArgs, " "), ' ', QuotePath(isScriptFile));
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << isccCmd << std::endl);
@@ -938,7 +934,7 @@ bool cmCPackInnoSetupGenerator::BuildDownloadedComponentArchive(
// Build the list of files to go into this archive
const std::string& zipListFileName =
cmStrCat(GetOption("CPACK_TEMPORARY_DIRECTORY"), "/winZip.filelist");
- const bool needQuotesInFile = cmIsOn(GetOption("CPACK_ZIP_NEED_QUOTES"));
+ const bool needQuotesInFile = GetOption("CPACK_ZIP_NEED_QUOTES").IsOn();
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(zipListFileName);
for (const std::string& i : component->Files) {
@@ -1136,8 +1132,16 @@ std::string cmCPackInnoSetupGenerator::Quote(const std::string& string)
return cmStrCat('"', nString, '"');
}
-std::string cmCPackInnoSetupGenerator::QuotePath(const std::string& path)
+std::string cmCPackInnoSetupGenerator::QuotePath(const std::string& path,
+ PathType type)
{
+#ifdef _WIN32
+ static_cast<void>(type);
+#else
+ if (type == PathType::Native) {
+ return Quote(cmSystemTools::ConvertToUnixOutputPath(path));
+ }
+#endif
return Quote(cmSystemTools::ConvertToWindowsOutputPath(path));
}
diff --git a/Source/CPack/cmCPackInnoSetupGenerator.h b/Source/CPack/cmCPackInnoSetupGenerator.h
index 342f227..e057e6c 100644
--- a/Source/CPack/cmCPackInnoSetupGenerator.h
+++ b/Source/CPack/cmCPackInnoSetupGenerator.h
@@ -49,6 +49,12 @@ protected:
inline bool SupportsComponentInstallation() const override { return true; }
private:
+ enum class PathType
+ {
+ Windows,
+ Native,
+ };
+
bool ProcessSetupSection();
bool ProcessFiles();
bool ProcessComponents();
@@ -92,7 +98,8 @@ private:
* Paths are converted into the format used by Windows before.
*/
std::string Quote(const std::string& string);
- std::string QuotePath(const std::string& path);
+ std::string QuotePath(const std::string& path,
+ PathType type = PathType::Windows);
/**
* This function replaces the following 5 characters with their %-encoding:
diff --git a/Source/CPack/cmCPackLog.h b/Source/CPack/cmCPackLog.h
index 2ab2f8e..347b0f7 100644
--- a/Source/CPack/cmCPackLog.h
+++ b/Source/CPack/cmCPackLog.h
@@ -29,7 +29,7 @@ public:
cmCPackLog(const cmCPackLog&) = delete;
cmCPackLog& operator=(const cmCPackLog&) = delete;
- enum __log_tags
+ enum cm_log_tags
{
NOTAG = 0,
LOG_OUTPUT = 0x1,
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 7749b29..43b1d76 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -365,7 +365,7 @@ int cmCPackNSISGenerator::PackageFiles()
if (anyDownloadedComponents) {
defines += "!define CPACK_USES_DOWNLOAD\n";
- if (cmIsOn(this->GetOption("CPACK_ADD_REMOVE"))) {
+ if (this->GetOption("CPACK_ADD_REMOVE").IsOn()) {
defines += "!define CPACK_NSIS_ADD_REMOVE\n";
}
}
@@ -412,7 +412,7 @@ int cmCPackNSISGenerator::PackageFiles()
int cmCPackNSISGenerator::InitializeInternal()
{
- if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) {
+ if (this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY").IsOn()) {
cmCPackLogger(
cmCPackLog::LOG_WARNING,
"NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. "
@@ -801,7 +801,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
// size of the installed component.
std::string zipListFileName = cmStrCat(
this->GetOption("CPACK_TEMPORARY_DIRECTORY"), "/winZip.filelist");
- bool needQuotesInFile = cmIsOn(this->GetOption("CPACK_ZIP_NEED_QUOTES"));
+ bool needQuotesInFile = this->GetOption("CPACK_ZIP_NEED_QUOTES").IsOn();
unsigned long totalSize = 0;
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(zipListFileName);
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index 6ad3755..2673fee 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -3,10 +3,11 @@
#include "cmCPackSTGZGenerator.h"
#include <cstdio>
-#include <sstream>
#include <string>
#include <vector>
+#include <fcntl.h>
+
#include "cmsys/FStream.hxx"
#include "cm_sys_stat.h"
@@ -69,7 +70,6 @@ int cmCPackSTGZGenerator::PackageFiles()
int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Writing header" << std::endl);
- std::ostringstream str;
int counter = 0;
std::string inLicFile = this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 00c8fa2..39a8e85 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -404,7 +404,9 @@ int main(int argc, char const* const* argv)
"Read CPack config file: " << cpackConfigFile << '\n');
bool cpackConfigFileSpecified = true;
- if (cpackConfigFile.empty()) {
+ if (!cpackConfigFile.empty()) {
+ cpackConfigFile = cmSystemTools::CollapseFullPath(cpackConfigFile);
+ } else {
cpackConfigFile = cmStrCat(cmSystemTools::GetCurrentWorkingDirectory(),
"/CPackConfig.cmake");
cpackConfigFileSpecified = false;
@@ -446,7 +448,6 @@ int main(int argc, char const* const* argv)
}
if (cmSystemTools::FileExists(cpackConfigFile)) {
- cpackConfigFile = cmSystemTools::CollapseFullPath(cpackConfigFile);
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack configuration file: " << cpackConfigFile
<< '\n');
@@ -475,32 +476,26 @@ int main(int argc, char const* const* argv)
if (!cpackProjectVendor.empty()) {
globalMF.AddDefinition("CPACK_PACKAGE_VENDOR", cpackProjectVendor);
}
- // if this is not empty it has been set on the command line
- // go for it. Command line override values set in config file.
if (!cpackProjectDirectory.empty()) {
- globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY", cpackProjectDirectory);
- }
- // The value has not been set on the command line
- else {
- // get a default value (current working directory)
- cpackProjectDirectory = cmSystemTools::GetCurrentWorkingDirectory();
- // use default value if no value has been provided by the config file
- if (!globalMF.IsSet("CPACK_PACKAGE_DIRECTORY")) {
- globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY",
- cpackProjectDirectory);
+ // The value has been set on the command line. Ensure it is absolute.
+ cpackProjectDirectory =
+ cmSystemTools::CollapseFullPath(cpackProjectDirectory);
+ } else {
+ // The value has not been set on the command line. Check config file.
+ if (cmValue pd = globalMF.GetDefinition("CPACK_PACKAGE_DIRECTORY")) {
+ // The value has been set in the config file. Ensure it is absolute.
+ cpackProjectDirectory = cmSystemTools::CollapseFullPath(*pd);
+ } else {
+ // Default to the current working directory.
+ cpackProjectDirectory = cmSystemTools::GetCurrentWorkingDirectory();
}
}
+ globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY", cpackProjectDirectory);
+
for (auto const& cd : definitions) {
globalMF.AddDefinition(cd.first, cd.second);
}
- // Force CPACK_PACKAGE_DIRECTORY as absolute path
- cpackProjectDirectory =
- globalMF.GetSafeDefinition("CPACK_PACKAGE_DIRECTORY");
- cpackProjectDirectory =
- cmSystemTools::CollapseFullPath(cpackProjectDirectory);
- globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY", cpackProjectDirectory);
-
cmValue cpackModulesPath = globalMF.GetDefinition("CPACK_MODULE_PATH");
if (cpackModulesPath) {
globalMF.AddDefinition("CMAKE_MODULE_PATH", *cpackModulesPath);
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index 246e811..87081f0 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -135,14 +135,14 @@ private:
std::string cmCTestBZR::LoadInfo()
{
// Run "bzr info" to get the repository info from the work tree.
- const char* bzr = this->CommandLineTool.c_str();
- const char* bzr_info[] = { bzr, "info", nullptr };
+ std::string bzr = this->CommandLineTool;
+ std::vector<std::string> bzr_info = { bzr, "info" };
InfoParser iout(this, "info-out> ");
OutputLogger ierr(this->Log, "info-err> ");
this->RunChild(bzr_info, &iout, &ierr);
// Run "bzr revno" to get the repository revision number from the work tree.
- const char* bzr_revno[] = { bzr, "revno", nullptr };
+ std::vector<std::string> bzr_revno = { bzr, "revno" };
std::string rev;
RevnoParser rout(this, "revno-out> ", rev);
OutputLogger rerr(this->Log, "revno-err> ");
@@ -372,22 +372,18 @@ bool cmCTestBZR::UpdateImpl()
// TODO: if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
// Use "bzr pull" to update the working tree.
- std::vector<char const*> bzr_update;
- bzr_update.push_back(this->CommandLineTool.c_str());
- bzr_update.push_back("pull");
+ std::vector<std::string> bzr_update;
+ bzr_update.push_back(this->CommandLineTool);
+ bzr_update.emplace_back("pull");
- for (std::string const& arg : args) {
- bzr_update.push_back(arg.c_str());
- }
-
- bzr_update.push_back(this->URL.c_str());
+ cm::append(bzr_update, args);
- bzr_update.push_back(nullptr);
+ bzr_update.push_back(this->URL);
// For some reason bzr uses stderr to display the update status.
OutputLogger out(this->Log, "pull-out> ");
UpdateParser err(this, "pull-err> ");
- return this->RunUpdateCommand(bzr_update.data(), &out, &err);
+ return this->RunUpdateCommand(bzr_update, &out, &err);
}
bool cmCTestBZR::LoadRevisions()
@@ -408,10 +404,9 @@ bool cmCTestBZR::LoadRevisions()
}
// Run "bzr log" to get all global revisions of interest.
- const char* bzr = this->CommandLineTool.c_str();
- const char* bzr_log[] = {
- bzr, "log", "-v", "-r", revs.c_str(), "--xml", this->URL.c_str(), nullptr
- };
+ std::string bzr = this->CommandLineTool;
+ std::vector<std::string> bzr_log = { bzr, "log", "-v", "-r",
+ revs, "--xml", this->URL };
{
LogParser out(this, "log-out> ");
OutputLogger err(this->Log, "log-err> ");
@@ -467,8 +462,8 @@ private:
bool cmCTestBZR::LoadModifications()
{
// Run "bzr status" which reports local modifications.
- const char* bzr = this->CommandLineTool.c_str();
- const char* bzr_status[] = { bzr, "status", "-SV", nullptr };
+ std::string bzr = this->CommandLineTool;
+ std::vector<std::string> bzr_status = { bzr, "status", "-SV" };
StatusParser out(this, "status-out> ");
OutputLogger err(this->Log, "status-err> ");
this->RunChild(bzr_status, &out, &err);
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 5feb953..9faabf7 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -7,8 +7,6 @@
#include <cstring>
#include <ratio>
-#include "cmsys/Process.h"
-
#include "cmBuildOptions.h"
#include "cmCTest.h"
#include "cmCTestTestHandler.h"
@@ -308,12 +306,11 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
return 1;
}
- std::vector<const char*> testCommand;
- testCommand.push_back(fullPath.c_str());
+ std::vector<std::string> testCommand;
+ testCommand.push_back(fullPath);
for (std::string const& testCommandArg : this->TestCommandArgs) {
- testCommand.push_back(testCommandArg.c_str());
+ testCommand.push_back(testCommandArg);
}
- testCommand.push_back(nullptr);
std::string outs;
int retval = 0;
// run the test from the this->BuildRunDir if set
@@ -349,10 +346,10 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
}
- int runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, nullptr,
- remainingTime, nullptr);
+ bool runTestRes = this->CTest->RunTest(testCommand, &outs, &retval, nullptr,
+ remainingTime, nullptr);
- if (runTestRes != cmsysProcess_State_Exited || retval != 0) {
+ if (!runTestRes || retval != 0) {
out << "Test command failed: " << testCommand[0] << "\n";
retval = 1;
}
@@ -368,8 +365,9 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
const std::string& currentArg, size_t& idx,
- const std::vector<std::string>& allArgs)
+ const std::vector<std::string>& allArgs, bool& validArg)
{
+ bool buildAndTestArg = true;
// --build-and-test options
if (cmHasLiteralPrefix(currentArg, "--build-and-test") &&
idx < allArgs.size() - 1) {
@@ -388,78 +386,68 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
<< std::endl);
return 0;
}
- }
- if (cmHasLiteralPrefix(currentArg, "--build-target") &&
- idx < allArgs.size() - 1) {
+ } else if (cmHasLiteralPrefix(currentArg, "--build-target") &&
+ idx < allArgs.size() - 1) {
idx++;
this->BuildTargets.push_back(allArgs[idx]);
- }
- if (cmHasLiteralPrefix(currentArg, "--build-nocmake")) {
+ } else if (cmHasLiteralPrefix(currentArg, "--build-nocmake")) {
this->BuildNoCMake = true;
- }
- if (cmHasLiteralPrefix(currentArg, "--build-run-dir") &&
- idx < allArgs.size() - 1) {
+ } else if (cmHasLiteralPrefix(currentArg, "--build-run-dir") &&
+ idx < allArgs.size() - 1) {
idx++;
this->BuildRunDir = allArgs[idx];
- }
- if (cmHasLiteralPrefix(currentArg, "--build-two-config")) {
+ } else if (cmHasLiteralPrefix(currentArg, "--build-two-config")) {
this->BuildTwoConfig = true;
- }
- if (cmHasLiteralPrefix(currentArg, "--build-exe-dir") &&
- idx < allArgs.size() - 1) {
+ } else if (cmHasLiteralPrefix(currentArg, "--build-exe-dir") &&
+ idx < allArgs.size() - 1) {
idx++;
this->ExecutableDirectory = allArgs[idx];
- }
- if (cmHasLiteralPrefix(currentArg, "--test-timeout") &&
- idx < allArgs.size() - 1) {
+ } else if (cmHasLiteralPrefix(currentArg, "--test-timeout") &&
+ idx < allArgs.size() - 1) {
idx++;
this->Timeout = cmDuration(atof(allArgs[idx].c_str()));
- }
- if (currentArg == "--build-generator" && idx < allArgs.size() - 1) {
+ } else if (currentArg == "--build-generator" && idx < allArgs.size() - 1) {
idx++;
this->BuildGenerator = allArgs[idx];
- }
- if (currentArg == "--build-generator-platform" && idx < allArgs.size() - 1) {
+ } else if (currentArg == "--build-generator-platform" &&
+ idx < allArgs.size() - 1) {
idx++;
this->BuildGeneratorPlatform = allArgs[idx];
- }
- if (currentArg == "--build-generator-toolset" && idx < allArgs.size() - 1) {
+ } else if (currentArg == "--build-generator-toolset" &&
+ idx < allArgs.size() - 1) {
idx++;
this->BuildGeneratorToolset = allArgs[idx];
- }
- if (cmHasLiteralPrefix(currentArg, "--build-project") &&
- idx < allArgs.size() - 1) {
+ } else if (cmHasLiteralPrefix(currentArg, "--build-project") &&
+ idx < allArgs.size() - 1) {
idx++;
this->BuildProject = allArgs[idx];
- }
- if (cmHasLiteralPrefix(currentArg, "--build-makeprogram") &&
- idx < allArgs.size() - 1) {
+ } else if (cmHasLiteralPrefix(currentArg, "--build-makeprogram") &&
+ idx < allArgs.size() - 1) {
idx++;
this->BuildMakeProgram = allArgs[idx];
- }
- if (cmHasLiteralPrefix(currentArg, "--build-config-sample") &&
- idx < allArgs.size() - 1) {
+ } else if (cmHasLiteralPrefix(currentArg, "--build-config-sample") &&
+ idx < allArgs.size() - 1) {
idx++;
this->ConfigSample = allArgs[idx];
- }
- if (cmHasLiteralPrefix(currentArg, "--build-noclean")) {
+ } else if (cmHasLiteralPrefix(currentArg, "--build-noclean")) {
this->BuildNoClean = true;
- }
- if (cmHasLiteralPrefix(currentArg, "--build-options")) {
+ } else if (cmHasLiteralPrefix(currentArg, "--build-options")) {
while (idx + 1 < allArgs.size() && allArgs[idx + 1] != "--build-target" &&
allArgs[idx + 1] != "--test-command") {
++idx;
this->BuildOptions.push_back(allArgs[idx]);
}
- }
- if (cmHasLiteralPrefix(currentArg, "--test-command") &&
- idx < allArgs.size() - 1) {
+ } else if (cmHasLiteralPrefix(currentArg, "--test-command") &&
+ idx < allArgs.size() - 1) {
++idx;
this->TestCommand = allArgs[idx];
while (idx + 1 < allArgs.size()) {
++idx;
this->TestCommandArgs.push_back(allArgs[idx]);
}
+ } else {
+ buildAndTestArg = false;
}
+ validArg = validArg || buildAndTestArg;
return 1;
}
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h
index e022e68..60b3a11 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.h
+++ b/Source/CTest/cmCTestBuildAndTestHandler.h
@@ -29,9 +29,9 @@ public:
int ProcessHandler() override;
//! Set all the build and test arguments
- int ProcessCommandLineArguments(
- const std::string& currentArg, size_t& idx,
- const std::vector<std::string>& allArgs) override;
+ int ProcessCommandLineArguments(const std::string& currentArg, size_t& idx,
+ const std::vector<std::string>& allArgs,
+ bool& validArg) override;
/*
* Get the output variable
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 00ecf42..859798e 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -3,15 +3,17 @@
#include "cmCTestBuildHandler.h"
#include <cstdlib>
+#include <memory>
#include <ratio>
#include <set>
#include <utility>
#include <cmext/algorithm>
+#include <cm3p/uv.h>
+
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
-#include "cmsys/Process.h"
#include "cmCTest.h"
#include "cmCTestLaunchReporter.h"
@@ -24,6 +26,9 @@
#include "cmStringAlgorithms.h"
#include "cmStringReplaceHelper.h"
#include "cmSystemTools.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVProcessChain.h"
+#include "cmUVStream.h"
#include "cmValue.h"
#include "cmXMLWriter.h"
@@ -420,7 +425,7 @@ int cmCTestBuildHandler::ProcessHandler()
cmStringReplaceHelper colorRemover("\x1b\\[[0-9;]*m", "", nullptr);
this->ColorRemover = &colorRemover;
int retVal = 0;
- int res = cmsysProcess_State_Exited;
+ bool res = true;
if (!this->CTest->GetShowOnly()) {
res = this->RunMakeCommand(makeCommand, &retVal, buildDirectory.c_str(), 0,
ofs);
@@ -475,7 +480,7 @@ int cmCTestBuildHandler::ProcessHandler()
}
this->GenerateXMLFooter(xml, elapsed_build_time);
- if (res != cmsysProcess_State_Exited || retVal || this->TotalErrors > 0) {
+ if (!res || retVal || this->TotalErrors > 0) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Error(s) when building project" << std::endl);
}
@@ -764,10 +769,10 @@ void cmCTestBuildHandler::LaunchHelper::WriteScrapeMatchers(
}
}
-int cmCTestBuildHandler::RunMakeCommand(const std::string& command,
- int* retVal, const char* dir,
- int timeout, std::ostream& ofs,
- Encoding encoding)
+bool cmCTestBuildHandler::RunMakeCommand(const std::string& command,
+ int* retVal, const char* dir,
+ int timeout, std::ostream& ofs,
+ Encoding encoding)
{
// First generate the command and arguments
std::vector<std::string> args = cmSystemTools::ParseArguments(command);
@@ -776,19 +781,9 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command,
return false;
}
- std::vector<const char*> argv;
- argv.reserve(args.size() + 1);
- for (std::string const& arg : args) {
- argv.push_back(arg.c_str());
- }
- argv.push_back(nullptr);
-
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Run command:", this->Quiet);
- for (char const* arg : argv) {
- if (!arg) {
- break;
- }
+ for (auto const& arg : args) {
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" \"" << arg << "\"", this->Quiet);
}
@@ -800,21 +795,20 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command,
static_cast<void>(launchHelper);
// Now create process object
- cmsysProcess* cp = cmsysProcess_New();
- cmsysProcess_SetCommand(cp, argv.data());
- cmsysProcess_SetWorkingDirectory(cp, dir);
- cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
- cmsysProcess_SetTimeout(cp, timeout);
- cmsysProcess_Execute(cp);
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand(args)
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR);
+ if (dir) {
+ builder.SetWorkingDirectory(dir);
+ }
+ auto chain = builder.Start();
// Initialize tick's
std::string::size_type tick = 0;
- const std::string::size_type tick_len = 1024;
+ static constexpr std::string::size_type tick_len = 1024;
- char* data;
- int length;
cmProcessOutput processOutput(encoding);
- std::string strdata;
cmCTestOptionalLog(
this->CTest, HANDLER_PROGRESS_OUTPUT,
" Each symbol represents "
@@ -836,39 +830,65 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command,
this->WarningQuotaReached = false;
this->ErrorQuotaReached = false;
+ cm::uv_timer_ptr timer;
+ bool timedOut = false;
+ timer.init(chain.GetLoop(), &timedOut);
+ if (timeout > 0) {
+ timer.start(
+ [](uv_timer_t* t) {
+ auto* timedOutPtr = static_cast<bool*>(t->data);
+ *timedOutPtr = true;
+ },
+ timeout * 1000, 0);
+ }
+
// For every chunk of data
- int res;
- while ((res = cmsysProcess_WaitForData(cp, &data, &length, nullptr))) {
- // Replace '\0' with '\n', since '\0' does not really make sense. This is
- // for Visual Studio output
- for (int cc = 0; cc < length; ++cc) {
- if (data[cc] == 0) {
- data[cc] = '\n';
- }
- }
+ cm::uv_pipe_ptr outputStream;
+ bool outFinished = false;
+ cm::uv_pipe_ptr errorStream;
+ bool errFinished = false;
+ auto startRead = [this, &chain, &processOutput, &tick,
+ &ofs](cm::uv_pipe_ptr& pipe, int stream,
+ t_BuildProcessingQueueType& queue, bool& finished,
+ int id) -> std::unique_ptr<cmUVStreamReadHandle> {
+ pipe.init(chain.GetLoop(), 0);
+ uv_pipe_open(pipe, stream);
+ return cmUVStreamRead(
+ pipe,
+ [this, &processOutput, &queue, id, &tick, &ofs](std::vector<char> data) {
+ // Replace '\0' with '\n', since '\0' does not really make sense. This
+ // is for Visual Studio output
+ for (auto& c : data) {
+ if (c == 0) {
+ c = '\n';
+ }
+ }
- // Process the chunk of data
- if (res == cmsysProcess_Pipe_STDERR) {
- processOutput.DecodeText(data, length, strdata, 1);
- this->ProcessBuffer(strdata.c_str(), strdata.size(), tick, tick_len, ofs,
- &this->BuildProcessingErrorQueue);
- } else {
- processOutput.DecodeText(data, length, strdata, 2);
- this->ProcessBuffer(strdata.c_str(), strdata.size(), tick, tick_len, ofs,
- &this->BuildProcessingQueue);
- }
- }
- processOutput.DecodeText(std::string(), strdata, 1);
- if (!strdata.empty()) {
- this->ProcessBuffer(strdata.c_str(), strdata.size(), tick, tick_len, ofs,
- &this->BuildProcessingErrorQueue);
- }
- processOutput.DecodeText(std::string(), strdata, 2);
- if (!strdata.empty()) {
- this->ProcessBuffer(strdata.c_str(), strdata.size(), tick, tick_len, ofs,
- &this->BuildProcessingQueue);
+ // Process the chunk of data
+ std::string strdata;
+ processOutput.DecodeText(data.data(), data.size(), strdata, id);
+ this->ProcessBuffer(strdata.c_str(), strdata.size(), tick, tick_len,
+ ofs, &queue);
+ },
+ [this, &processOutput, &queue, id, &tick, &ofs, &finished]() {
+ std::string strdata;
+ processOutput.DecodeText(std::string(), strdata, id);
+ if (!strdata.empty()) {
+ this->ProcessBuffer(strdata.c_str(), strdata.size(), tick, tick_len,
+ ofs, &queue);
+ }
+ finished = true;
+ });
+ };
+ auto outputHandle = startRead(outputStream, chain.OutputStream(),
+ this->BuildProcessingQueue, outFinished, 1);
+ auto errorHandle =
+ startRead(errorStream, chain.ErrorStream(),
+ this->BuildProcessingErrorQueue, errFinished, 2);
+
+ while (!timedOut && !(outFinished && errFinished && chain.Finished())) {
+ uv_run(&chain.GetLoop(), UV_RUN_ONCE);
}
-
this->ProcessBuffer(nullptr, 0, tick, tick_len, ofs,
&this->BuildProcessingQueue);
this->ProcessBuffer(nullptr, 0, tick, tick_len, ofs,
@@ -879,90 +899,93 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command,
<< std::endl,
this->Quiet);
- // Properly handle output of the build command
- cmsysProcess_WaitForExit(cp, nullptr);
- int result = cmsysProcess_GetState(cp);
-
- if (result == cmsysProcess_State_Exited) {
- if (retVal) {
- *retVal = cmsysProcess_GetExitValue(cp);
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Command exited with the value: " << *retVal
- << std::endl,
- this->Quiet);
- // if a non zero return value
- if (*retVal) {
- // If there was an error running command, report that on the
- // dashboard.
- if (this->UseCTestLaunch) {
- // For launchers, do not record this top-level error if other
- // more granular build errors have already been captured.
- bool launcherXMLFound = false;
- cmsys::Directory launchDir;
- launchDir.Load(this->CTestLaunchDir);
- unsigned long n = launchDir.GetNumberOfFiles();
- for (unsigned long i = 0; i < n; ++i) {
- const char* fname = launchDir.GetFile(i);
- if (cmHasLiteralSuffix(fname, ".xml")) {
- launcherXMLFound = true;
- break;
+ if (chain.Finished()) {
+ auto const& status = chain.GetStatus(0);
+ auto exception = status.GetException();
+ switch (exception.first) {
+ case cmUVProcessChain::ExceptionCode::None:
+ if (retVal) {
+ *retVal = static_cast<int>(status.ExitStatus);
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Command exited with the value: " << *retVal
+ << std::endl,
+ this->Quiet);
+ // if a non zero return value
+ if (*retVal) {
+ // If there was an error running command, report that on the
+ // dashboard.
+ if (this->UseCTestLaunch) {
+ // For launchers, do not record this top-level error if other
+ // more granular build errors have already been captured.
+ bool launcherXMLFound = false;
+ cmsys::Directory launchDir;
+ launchDir.Load(this->CTestLaunchDir);
+ unsigned long n = launchDir.GetNumberOfFiles();
+ for (unsigned long i = 0; i < n; ++i) {
+ const char* fname = launchDir.GetFile(i);
+ if (cmHasLiteralSuffix(fname, ".xml")) {
+ launcherXMLFound = true;
+ break;
+ }
+ }
+ if (!launcherXMLFound) {
+ cmCTestLaunchReporter reporter;
+ reporter.RealArgs = args;
+ reporter.ComputeFileNames();
+ reporter.ExitCode = *retVal;
+ reporter.Status = status;
+ // Use temporary BuildLog file to populate this error for
+ // CDash.
+ ofs.flush();
+ reporter.LogOut = this->LogFileNames["Build"];
+ reporter.LogOut += ".tmp";
+ reporter.WriteXML();
+ }
+ } else {
+ cmCTestBuildErrorWarning errorwarning;
+ errorwarning.LineNumber = 0;
+ errorwarning.LogLine = 1;
+ errorwarning.Text = cmStrCat(
+ "*** WARNING non-zero return value in ctest from: ", args[0]);
+ errorwarning.PreContext.clear();
+ errorwarning.PostContext.clear();
+ errorwarning.Error = false;
+ this->ErrorsAndWarnings.push_back(std::move(errorwarning));
+ this->TotalWarnings++;
}
}
- if (!launcherXMLFound) {
- cmCTestLaunchReporter reporter;
- reporter.RealArgs = args;
- reporter.ComputeFileNames();
- reporter.ExitCode = *retVal;
- reporter.Process = cp;
- // Use temporary BuildLog file to populate this error for CDash.
- ofs.flush();
- reporter.LogOut = this->LogFileNames["Build"];
- reporter.LogOut += ".tmp";
- reporter.WriteXML();
- }
- } else {
- cmCTestBuildErrorWarning errorwarning;
- errorwarning.LineNumber = 0;
- errorwarning.LogLine = 1;
- errorwarning.Text = cmStrCat(
- "*** WARNING non-zero return value in ctest from: ", argv[0]);
- errorwarning.PreContext.clear();
- errorwarning.PostContext.clear();
- errorwarning.Error = false;
- this->ErrorsAndWarnings.push_back(std::move(errorwarning));
- this->TotalWarnings++;
}
- }
- }
- } else if (result == cmsysProcess_State_Exception) {
- if (retVal) {
- *retVal = cmsysProcess_GetExitException(cp);
- cmCTestOptionalLog(this->CTest, WARNING,
- "There was an exception: " << *retVal << std::endl,
- this->Quiet);
+ break;
+ case cmUVProcessChain::ExceptionCode::Spawn: {
+ // If there was an error running command, report that on the dashboard.
+ cmCTestBuildErrorWarning errorwarning;
+ errorwarning.LineNumber = 0;
+ errorwarning.LogLine = 1;
+ errorwarning.Text =
+ cmStrCat("*** ERROR executing: ", exception.second);
+ errorwarning.PreContext.clear();
+ errorwarning.PostContext.clear();
+ errorwarning.Error = true;
+ this->ErrorsAndWarnings.push_back(std::move(errorwarning));
+ this->TotalErrors++;
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "There was an error: " << exception.second << std::endl);
+ } break;
+ default:
+ if (retVal) {
+ *retVal = status.TermSignal;
+ cmCTestOptionalLog(
+ this->CTest, WARNING,
+ "There was an exception: " << *retVal << std::endl, this->Quiet);
+ }
+ break;
}
- } else if (result == cmsysProcess_State_Expired) {
+ } else {
cmCTestOptionalLog(this->CTest, WARNING,
"There was a timeout" << std::endl, this->Quiet);
- } else if (result == cmsysProcess_State_Error) {
- // If there was an error running command, report that on the dashboard.
- cmCTestBuildErrorWarning errorwarning;
- errorwarning.LineNumber = 0;
- errorwarning.LogLine = 1;
- errorwarning.Text =
- cmStrCat("*** ERROR executing: ", cmsysProcess_GetErrorString(cp));
- errorwarning.PreContext.clear();
- errorwarning.PostContext.clear();
- errorwarning.Error = true;
- this->ErrorsAndWarnings.push_back(std::move(errorwarning));
- this->TotalErrors++;
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "There was an error: " << cmsysProcess_GetErrorString(cp)
- << std::endl);
}
- cmsysProcess_Delete(cp);
- return result;
+ return true;
}
// ######################################################################
diff --git a/Source/CTest/cmCTestBuildHandler.h b/Source/CTest/cmCTestBuildHandler.h
index e33294d..90945b1 100644
--- a/Source/CTest/cmCTestBuildHandler.h
+++ b/Source/CTest/cmCTestBuildHandler.h
@@ -53,9 +53,9 @@ private:
//! Run command specialized for make and configure. Returns process status
// and retVal is return value or exception.
- int RunMakeCommand(const std::string& command, int* retVal, const char* dir,
- int timeout, std::ostream& ofs,
- Encoding encoding = cmProcessOutput::Auto);
+ bool RunMakeCommand(const std::string& command, int* retVal, const char* dir,
+ int timeout, std::ostream& ofs,
+ Encoding encoding = cmProcessOutput::Auto);
enum
{
diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx
index 95e898c..badd43e 100644
--- a/Source/CTest/cmCTestCVS.cxx
+++ b/Source/CTest/cmCTestCVS.cxx
@@ -5,6 +5,7 @@
#include <utility>
#include <cm/string_view>
+#include <cmext/algorithm>
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
@@ -89,18 +90,15 @@ bool cmCTestCVS::UpdateImpl()
}
// Run "cvs update" to update the work tree.
- std::vector<char const*> cvs_update;
- cvs_update.push_back(this->CommandLineTool.c_str());
- cvs_update.push_back("-z3");
- cvs_update.push_back("update");
- for (std::string const& arg : args) {
- cvs_update.push_back(arg.c_str());
- }
- cvs_update.push_back(nullptr);
+ std::vector<std::string> cvs_update;
+ cvs_update.push_back(this->CommandLineTool);
+ cvs_update.emplace_back("-z3");
+ cvs_update.emplace_back("update");
+ cm::append(cvs_update, args);
UpdateParser out(this, "up-out> ");
UpdateParser err(this, "up-err> ");
- return this->RunUpdateCommand(cvs_update.data(), &out, &err);
+ return this->RunUpdateCommand(cvs_update, &out, &err);
}
class cmCTestCVS::LogParser : public cmCTestVC::LineParser
@@ -221,10 +219,8 @@ void cmCTestCVS::LoadRevisions(std::string const& file, const char* branchFlag,
cmCTestLog(this->CTest, HANDLER_OUTPUT, "." << std::flush);
// Run "cvs log" to get revisions of this file on this branch.
- const char* cvs = this->CommandLineTool.c_str();
- const char* cvs_log[] = {
- cvs, "log", "-N", branchFlag, file.c_str(), nullptr
- };
+ std::string cvs = this->CommandLineTool;
+ std::vector<std::string> cvs_log = { cvs, "log", "-N", branchFlag, file };
LogParser out(this, "log-out> ", revisions);
OutputLogger err(this->Log, "log-err> ");
diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx
index 914930e..dd8952f 100644
--- a/Source/CTest/cmCTestConfigureHandler.cxx
+++ b/Source/CTest/cmCTestConfigureHandler.cxx
@@ -45,7 +45,7 @@ int cmCTestConfigureHandler::ProcessHandler()
auto elapsed_time_start = std::chrono::steady_clock::now();
std::string output;
int retVal = 0;
- int res = 0;
+ bool res = false;
if (!this->CTest->GetShowOnly()) {
cmGeneratedFileStream os;
if (!this->StartResultingXML(cmCTest::PartConfigure, "Configure", os)) {
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 2874be7..f9f9add 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -9,6 +9,7 @@
#include <cstring>
#include <iomanip>
#include <iterator>
+#include <memory>
#include <ratio>
#include <sstream>
#include <type_traits>
@@ -18,7 +19,6 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
-#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
#include "cmCTest.h"
@@ -33,6 +33,7 @@
#include "cmParsePHPCoverage.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmUVProcessChain.h"
#include "cmWorkingDirectory.h"
#include "cmXMLWriter.h"
@@ -40,85 +41,6 @@ class cmMakefile;
#define SAFEDIV(x, y) (((y) != 0) ? ((x) / (y)) : (0))
-class cmCTestRunProcess
-{
-public:
- cmCTestRunProcess()
- {
- this->Process = cmsysProcess_New();
- this->PipeState = -1;
- this->TimeOut = cmDuration(-1);
- }
- ~cmCTestRunProcess()
- {
- if (this->PipeState != -1 && this->PipeState != cmsysProcess_Pipe_None &&
- this->PipeState != cmsysProcess_Pipe_Timeout) {
- this->WaitForExit();
- }
- cmsysProcess_Delete(this->Process);
- }
- cmCTestRunProcess(const cmCTestRunProcess&) = delete;
- cmCTestRunProcess& operator=(const cmCTestRunProcess&) = delete;
- void SetCommand(const char* command)
- {
- this->CommandLineStrings.clear();
- this->CommandLineStrings.emplace_back(command);
- }
- void AddArgument(const char* arg)
- {
- if (arg) {
- this->CommandLineStrings.emplace_back(arg);
- }
- }
- void SetWorkingDirectory(const char* dir) { this->WorkingDirectory = dir; }
- void SetTimeout(cmDuration t) { this->TimeOut = t; }
- bool StartProcess()
- {
- std::vector<const char*> args;
- args.reserve(this->CommandLineStrings.size());
- for (std::string const& cl : this->CommandLineStrings) {
- args.push_back(cl.c_str());
- }
- args.push_back(nullptr); // null terminate
- cmsysProcess_SetCommand(this->Process, args.data());
- if (!this->WorkingDirectory.empty()) {
- cmsysProcess_SetWorkingDirectory(this->Process,
- this->WorkingDirectory.c_str());
- }
-
- cmsysProcess_SetOption(this->Process, cmsysProcess_Option_HideWindow, 1);
- if (this->TimeOut >= cmDuration::zero()) {
- cmsysProcess_SetTimeout(this->Process, this->TimeOut.count());
- }
- cmsysProcess_Execute(this->Process);
- this->PipeState = cmsysProcess_GetState(this->Process);
- // if the process is running or exited return true
- return this->PipeState == cmsysProcess_State_Executing ||
- this->PipeState == cmsysProcess_State_Exited;
- }
- void SetStdoutFile(const char* fname)
- {
- cmsysProcess_SetPipeFile(this->Process, cmsysProcess_Pipe_STDOUT, fname);
- }
- void SetStderrFile(const char* fname)
- {
- cmsysProcess_SetPipeFile(this->Process, cmsysProcess_Pipe_STDERR, fname);
- }
- int WaitForExit(double* timeout = nullptr)
- {
- this->PipeState = cmsysProcess_WaitForExit(this->Process, timeout);
- return this->PipeState;
- }
- int GetProcessState() const { return this->PipeState; }
-
-private:
- int PipeState;
- cmsysProcess* Process;
- std::vector<std::string> CommandLineStrings;
- std::string WorkingDirectory;
- cmDuration TimeOut;
-};
-
cmCTestCoverageHandler::cmCTestCoverageHandler() = default;
void cmCTestCoverageHandler::Initialize()
@@ -1940,34 +1862,35 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find :" << cmd << "\n");
return 0;
}
+ std::vector<std::string> args{ cmd };
if (arg) {
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Run : " << program << " " << arg << "\n", this->Quiet);
+ args.emplace_back(arg);
} else {
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Run : " << program << "\n", this->Quiet);
}
// create a process object and start it
- cmCTestRunProcess runCoverageSrc;
- runCoverageSrc.SetCommand(program.c_str());
- runCoverageSrc.AddArgument(arg);
+ cmUVProcessChainBuilder builder;
std::string stdoutFile =
cmStrCat(cont->BinaryDir, "/Testing/Temporary/",
this->GetCTestInstance()->GetCurrentTag(), '-', cmd);
std::string stderrFile = stdoutFile;
stdoutFile += ".stdout";
stderrFile += ".stderr";
- runCoverageSrc.SetStdoutFile(stdoutFile.c_str());
- runCoverageSrc.SetStderrFile(stderrFile.c_str());
- if (!runCoverageSrc.StartProcess()) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Could not run : " << program << " " << arg << "\n"
- << "kwsys process state : "
- << runCoverageSrc.GetProcessState());
- return 0;
- }
+ std::unique_ptr<FILE, int (*)(FILE*)> stdoutHandle(
+ cmsys::SystemTools::Fopen(stdoutFile, "w"), fclose);
+ std::unique_ptr<FILE, int (*)(FILE*)> stderrHandle(
+ cmsys::SystemTools::Fopen(stderrFile, "w"), fclose);
+ builder.AddCommand(args)
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT,
+ stdoutHandle.get())
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
+ stderrHandle.get());
// since we set the output file names wait for it to end
- runCoverageSrc.WaitForExit();
+ auto chain = builder.Start();
+ chain.Wait();
outputFile = stdoutFile;
return 1;
}
diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx
index 8f7d581..3a5806b 100644
--- a/Source/CTest/cmCTestCurl.cxx
+++ b/Source/CTest/cmCTestCurl.cxx
@@ -9,21 +9,18 @@
#include "cmCTest.h"
#include "cmCurl.h"
+#include "cmList.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmValue.h"
cmCTestCurl::cmCTestCurl(cmCTest* ctest)
+ : CTest(ctest)
+ , CurlOpts(ctest)
{
- this->CTest = ctest;
this->SetProxyType();
- this->UseHttp10 = false;
// In windows, this will init the winsock stuff
::curl_global_init(CURL_GLOBAL_ALL);
- // default is to verify https
- this->VerifyPeerOff = false;
- this->VerifyHostOff = false;
- this->Quiet = false;
- this->TimeOutSeconds = 0;
this->Curl = curl_easy_init();
}
@@ -59,14 +56,23 @@ size_t curlDebugCallback(CURL* /*unused*/, curl_infotype /*unused*/,
}
}
-void cmCTestCurl::SetCurlOptions(std::vector<std::string> const& args)
+cmCTestCurlOpts::cmCTestCurlOpts(cmCTest* ctest)
{
- for (std::string const& arg : args) {
- if (arg == "CURLOPT_SSL_VERIFYPEER_OFF") {
- this->VerifyPeerOff = true;
- }
- if (arg == "CURLOPT_SSL_VERIFYHOST_OFF") {
- this->VerifyHostOff = true;
+ this->TLSVersionOpt =
+ cmCurlParseTLSVersion(ctest->GetCTestConfiguration("TLSVersion"));
+
+ std::string tlsVerify = ctest->GetCTestConfiguration("TLSVerify");
+ if (!tlsVerify.empty()) {
+ this->TLSVerifyOpt = cmIsOn(tlsVerify);
+ } else {
+ cmList args{ ctest->GetCTestConfiguration("CurlOptions") };
+ for (std::string const& arg : args) {
+ if (arg == "CURLOPT_SSL_VERIFYPEER_OFF") {
+ this->TLSVerifyOpt = false;
+ }
+ if (arg == "CURLOPT_SSL_VERIFYHOST_OFF") {
+ this->VerifyHostOff = true;
+ }
}
}
}
@@ -77,10 +83,15 @@ bool cmCTestCurl::InitCurl()
return false;
}
cmCurlSetCAInfo(this->Curl);
- if (this->VerifyPeerOff) {
- curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYPEER, 0);
+ if (this->CurlOpts.TLSVersionOpt) {
+ curl_easy_setopt(this->Curl, CURLOPT_SSLVERSION,
+ *this->CurlOpts.TLSVersionOpt);
+ }
+ if (this->CurlOpts.TLSVerifyOpt) {
+ curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYPEER,
+ *this->CurlOpts.TLSVerifyOpt ? 1 : 0);
}
- if (this->VerifyHostOff) {
+ if (this->CurlOpts.VerifyHostOff) {
curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYHOST, 0);
}
if (!this->HTTPProxy.empty()) {
diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h
index d9aa916..7836f4b 100644
--- a/Source/CTest/cmCTestCurl.h
+++ b/Source/CTest/cmCTestCurl.h
@@ -7,10 +7,20 @@
#include <string>
#include <vector>
+#include <cm/optional>
+
#include <cm3p/curl/curl.h>
class cmCTest;
+struct cmCTestCurlOpts
+{
+ cmCTestCurlOpts(cmCTest* ctest);
+ cm::optional<int> TLSVersionOpt;
+ cm::optional<bool> TLSVerifyOpt;
+ bool VerifyHostOff = false;
+};
+
class cmCTestCurl
{
public:
@@ -22,9 +32,6 @@ public:
std::string const& fields, std::string& response);
bool HttpRequest(std::string const& url, std::string const& fields,
std::string& response);
- // currently only supports CURLOPT_SSL_VERIFYPEER_OFF
- // and CURLOPT_SSL_VERIFYHOST_OFF
- void SetCurlOptions(std::vector<std::string> const& args);
void SetHttpHeaders(std::vector<std::string> const& v)
{
this->HttpHeaders = v;
@@ -40,14 +47,13 @@ protected:
private:
cmCTest* CTest;
- CURL* Curl;
+ cmCTestCurlOpts CurlOpts;
+ CURL* Curl = nullptr;
std::vector<std::string> HttpHeaders;
std::string HTTPProxyAuth;
std::string HTTPProxy;
curl_proxytype HTTPProxyType;
- bool VerifyHostOff;
- bool VerifyPeerOff;
- bool UseHttp10;
- bool Quiet;
- int TimeOutSeconds;
+ bool UseHttp10 = false;
+ bool Quiet = false;
+ int TimeOutSeconds = 0;
};
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
index af495bb..2c92d77 100644
--- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
+++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
@@ -2,25 +2,27 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestEmptyBinaryDirectoryCommand.h"
-#include <sstream>
-
#include "cmCTestScriptHandler.h"
-
-class cmExecutionStatus;
+#include "cmExecutionStatus.h"
+#include "cmMakefile.h"
+#include "cmMessageType.h"
+#include "cmStringAlgorithms.h"
bool cmCTestEmptyBinaryDirectoryCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus& /*unused*/)
+ std::vector<std::string> const& args, cmExecutionStatus& status)
{
if (args.size() != 1) {
this->SetError("called with incorrect number of arguments");
return false;
}
- if (!cmCTestScriptHandler::EmptyBinaryDirectory(args[0])) {
- std::ostringstream ostr;
- ostr << "problem removing the binary directory: " << args[0];
- this->SetError(ostr.str());
- return false;
+ std::string err;
+ if (!cmCTestScriptHandler::EmptyBinaryDirectory(args[0], err)) {
+ status.GetMakefile().IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("Did not remove the binary directory:\n ", args[0],
+ "\nbecause:\n ", err));
+ return true;
}
return true;
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 5f8cb74..99c5a2b 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -2,15 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestGIT.h"
-#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <utility>
#include <vector>
+#include <cmext/algorithm>
+
#include "cmsys/FStream.hxx"
-#include "cmsys/Process.h"
#include "cmCTest.h"
#include "cmCTestVC.h"
@@ -18,6 +18,7 @@
#include "cmProcessOutput.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmUVProcessChain.h"
#include "cmValue.h"
static unsigned int cmCTestGITVersion(unsigned int epic, unsigned int major,
@@ -58,9 +59,9 @@ private:
std::string cmCTestGIT::GetWorkingRevision()
{
// Run plumbing "git rev-list" to get work tree revision.
- const char* git = this->CommandLineTool.c_str();
- const char* git_rev_list[] = { git, "rev-list", "-n", "1",
- "HEAD", "--", nullptr };
+ std::string git = this->CommandLineTool;
+ std::vector<std::string> git_rev_list = { git, "rev-list", "-n",
+ "1", "HEAD", "--" };
std::string rev;
OneLineParser out(this, "rl-out> ", rev);
OutputLogger err(this->Log, "rl-err> ");
@@ -92,13 +93,13 @@ std::string cmCTestGIT::FindGitDir()
std::string git_dir;
// Run "git rev-parse --git-dir" to locate the real .git directory.
- const char* git = this->CommandLineTool.c_str();
- char const* git_rev_parse[] = { git, "rev-parse", "--git-dir", nullptr };
+ std::string git = this->CommandLineTool;
+ std::vector<std::string> git_rev_parse = { git, "rev-parse", "--git-dir" };
std::string git_dir_line;
OneLineParser rev_parse_out(this, "rev-parse-out> ", git_dir_line);
OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
- if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, nullptr,
- cmProcessOutput::UTF8)) {
+ if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err,
+ std::string{}, cmProcessOutput::UTF8)) {
git_dir = git_dir_line;
}
if (git_dir.empty()) {
@@ -117,11 +118,10 @@ std::string cmCTestGIT::FindGitDir()
std::string cygpath_exe =
cmStrCat(cmSystemTools::GetFilenamePath(git), "/cygpath.exe");
if (cmSystemTools::FileExists(cygpath_exe)) {
- char const* cygpath[] = { cygpath_exe.c_str(), "-w", git_dir.c_str(),
- 0 };
+ std::vector<std::string> cygpath = { cygpath_exe, "-w", git_dir };
OneLineParser cygpath_out(this, "cygpath-out> ", git_dir_line);
OutputLogger cygpath_err(this->Log, "cygpath-err> ");
- if (this->RunChild(cygpath, &cygpath_out, &cygpath_err, nullptr,
+ if (this->RunChild(cygpath, &cygpath_out, &cygpath_err, std::string{},
cmProcessOutput::UTF8)) {
git_dir = git_dir_line;
}
@@ -136,12 +136,12 @@ std::string cmCTestGIT::FindTopDir()
std::string top_dir = this->SourceDirectory;
// Run "git rev-parse --show-cdup" to locate the top of the tree.
- const char* git = this->CommandLineTool.c_str();
- char const* git_rev_parse[] = { git, "rev-parse", "--show-cdup", nullptr };
+ std::string git = this->CommandLineTool;
+ std::vector<std::string> git_rev_parse = { git, "rev-parse", "--show-cdup" };
std::string cdup;
OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup);
OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
- if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, nullptr,
+ if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, "",
cmProcessOutput::UTF8) &&
!cdup.empty()) {
top_dir += "/";
@@ -153,12 +153,12 @@ std::string cmCTestGIT::FindTopDir()
bool cmCTestGIT::UpdateByFetchAndReset()
{
- const char* git = this->CommandLineTool.c_str();
+ std::string git = this->CommandLineTool;
// Use "git fetch" to get remote commits.
- std::vector<char const*> git_fetch;
+ std::vector<std::string> git_fetch;
git_fetch.push_back(git);
- git_fetch.push_back("fetch");
+ git_fetch.emplace_back("fetch");
// Add user-specified update options.
std::string opts = this->CTest->GetCTestConfiguration("UpdateOptions");
@@ -166,17 +166,12 @@ bool cmCTestGIT::UpdateByFetchAndReset()
opts = this->CTest->GetCTestConfiguration("GITUpdateOptions");
}
std::vector<std::string> args = cmSystemTools::ParseArguments(opts);
- for (std::string const& arg : args) {
- git_fetch.push_back(arg.c_str());
- }
-
- // Sentinel argument.
- git_fetch.push_back(nullptr);
+ cm::append(git_fetch, args);
// Fetch upstream refs.
OutputLogger fetch_out(this->Log, "fetch-out> ");
OutputLogger fetch_err(this->Log, "fetch-err> ");
- if (!this->RunUpdateCommand(git_fetch.data(), &fetch_out, &fetch_err)) {
+ if (!this->RunUpdateCommand(git_fetch, &fetch_out, &fetch_err)) {
return false;
}
@@ -207,25 +202,22 @@ bool cmCTestGIT::UpdateByFetchAndReset()
}
// Reset the local branch to point at that tracked from upstream.
- char const* git_reset[] = { git, "reset", "--hard", sha1.c_str(), nullptr };
+ std::vector<std::string> git_reset = { git, "reset", "--hard", sha1 };
OutputLogger reset_out(this->Log, "reset-out> ");
OutputLogger reset_err(this->Log, "reset-err> ");
- return this->RunChild(&git_reset[0], &reset_out, &reset_err);
+ return this->RunChild(git_reset, &reset_out, &reset_err);
}
bool cmCTestGIT::UpdateByCustom(std::string const& custom)
{
cmList git_custom_command{ custom, cmList::EmptyElements::Yes };
- std::vector<char const*> git_custom;
- git_custom.reserve(git_custom_command.size() + 1);
- for (std::string const& i : git_custom_command) {
- git_custom.push_back(i.c_str());
- }
- git_custom.push_back(nullptr);
+ std::vector<std::string> git_custom;
+ git_custom.reserve(git_custom_command.size());
+ cm::append(git_custom, git_custom_command);
OutputLogger custom_out(this->Log, "custom-out> ");
OutputLogger custom_err(this->Log, "custom-err> ");
- return this->RunUpdateCommand(git_custom.data(), &custom_out, &custom_err);
+ return this->RunUpdateCommand(git_custom, &custom_out, &custom_err);
}
bool cmCTestGIT::UpdateInternal()
@@ -244,13 +236,14 @@ bool cmCTestGIT::UpdateImpl()
}
std::string top_dir = this->FindTopDir();
- const char* git = this->CommandLineTool.c_str();
- const char* recursive = "--recursive";
- const char* sync_recursive = "--recursive";
+ std::string git = this->CommandLineTool;
+ std::string recursive = "--recursive";
+ std::string sync_recursive = "--recursive";
// Git < 1.6.5 did not support submodule --recursive
+ bool support_recursive = true;
if (this->GetGitVersion() < cmCTestGITVersion(1, 6, 5, 0)) {
- recursive = nullptr;
+ support_recursive = false;
// No need to require >= 1.6.5 if there are no submodules.
if (cmSystemTools::FileExists(top_dir + "/.gitmodules")) {
this->Log << "Git < 1.6.5 cannot update submodules recursively\n";
@@ -258,8 +251,9 @@ bool cmCTestGIT::UpdateImpl()
}
// Git < 1.8.1 did not support sync --recursive
+ bool support_sync_recursive = true;
if (this->GetGitVersion() < cmCTestGITVersion(1, 8, 1, 0)) {
- sync_recursive = nullptr;
+ support_sync_recursive = false;
// No need to require >= 1.8.1 if there are no submodules.
if (cmSystemTools::FileExists(top_dir + "/.gitmodules")) {
this->Log << "Git < 1.8.1 cannot synchronize submodules recursively\n";
@@ -274,35 +268,39 @@ bool cmCTestGIT::UpdateImpl()
std::string init_submodules =
this->CTest->GetCTestConfiguration("GITInitSubmodules");
if (cmIsOn(init_submodules)) {
- char const* git_submodule_init[] = { git, "submodule", "init", nullptr };
+ std::vector<std::string> git_submodule_init = { git, "submodule", "init" };
ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err,
- top_dir.c_str());
+ top_dir);
if (!ret) {
return false;
}
}
- char const* git_submodule_sync[] = { git, "submodule", "sync",
- sync_recursive, nullptr };
+ std::vector<std::string> git_submodule_sync = { git, "submodule", "sync" };
+ if (support_sync_recursive) {
+ git_submodule_sync.push_back(sync_recursive);
+ }
ret = this->RunChild(git_submodule_sync, &submodule_out, &submodule_err,
- top_dir.c_str());
+ top_dir);
if (!ret) {
return false;
}
- char const* git_submodule[] = { git, "submodule", "update", recursive,
- nullptr };
+ std::vector<std::string> git_submodule = { git, "submodule", "update" };
+ if (support_recursive) {
+ git_submodule.push_back(recursive);
+ }
return this->RunChild(git_submodule, &submodule_out, &submodule_err,
- top_dir.c_str());
+ top_dir);
}
unsigned int cmCTestGIT::GetGitVersion()
{
if (!this->CurrentGitVersion) {
- const char* git = this->CommandLineTool.c_str();
- char const* git_version[] = { git, "--version", nullptr };
+ std::string git = this->CommandLineTool;
+ std::vector<std::string> git_version = { git, "--version" };
std::string version;
OneLineParser version_out(this, "version-out> ", version);
OutputLogger version_err(this->Log, "version-err> ");
@@ -415,14 +413,14 @@ protected:
const char* ConsumeSpace(const char* c)
{
- while (*c && isspace(*c)) {
+ while (*c && cmIsSpace(*c)) {
++c;
}
return c;
}
const char* ConsumeField(const char* c)
{
- while (*c && !isspace(*c)) {
+ while (*c && !cmIsSpace(*c)) {
++c;
}
return c;
@@ -482,7 +480,7 @@ private:
{
// Person Name <person@domain.com> 1234567890 +0000
const char* c = str;
- while (*c && isspace(*c)) {
+ while (*c && cmIsSpace(*c)) {
++c;
}
@@ -491,7 +489,7 @@ private:
++c;
}
const char* name_last = c;
- while (name_last != name_first && isspace(*(name_last - 1))) {
+ while (name_last != name_first && cmIsSpace(*(name_last - 1))) {
--name_last;
}
person.Name.assign(name_first, name_last - name_first);
@@ -605,50 +603,49 @@ bool cmCTestGIT::LoadRevisions()
{
// Use 'git rev-list ... | git diff-tree ...' to get revisions.
std::string range = this->OldRevision + ".." + this->NewRevision;
- const char* git = this->CommandLineTool.c_str();
- const char* git_rev_list[] = { git, "rev-list", "--reverse",
- range.c_str(), "--", nullptr };
- const char* git_diff_tree[] = {
- git, "diff-tree", "--stdin", "--always", "-z",
- "-r", "--pretty=raw", "--encoding=utf-8", nullptr
+ std::string git = this->CommandLineTool;
+ std::vector<std::string> git_rev_list = { git, "rev-list", "--reverse",
+ range, "--" };
+ std::vector<std::string> git_diff_tree = {
+ git, "diff-tree", "--stdin", "--always",
+ "-z", "-r", "--pretty=raw", "--encoding=utf-8"
};
this->Log << cmCTestGIT::ComputeCommandLine(git_rev_list) << " | "
<< cmCTestGIT::ComputeCommandLine(git_diff_tree) << "\n";
- cmsysProcess* cp = cmsysProcess_New();
- cmsysProcess_AddCommand(cp, git_rev_list);
- cmsysProcess_AddCommand(cp, git_diff_tree);
- cmsysProcess_SetWorkingDirectory(cp, this->SourceDirectory.c_str());
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand(git_rev_list)
+ .AddCommand(git_diff_tree)
+ .SetWorkingDirectory(this->SourceDirectory);
CommitParser out(this, "dt-out> ");
OutputLogger err(this->Log, "dt-err> ");
- cmCTestGIT::RunProcess(cp, &out, &err, cmProcessOutput::UTF8);
+ cmCTestGIT::RunProcess(builder, &out, &err, cmProcessOutput::UTF8);
// Send one extra zero-byte to terminate the last record.
out.Process("", 1);
- cmsysProcess_Delete(cp);
return true;
}
bool cmCTestGIT::LoadModifications()
{
- const char* git = this->CommandLineTool.c_str();
+ std::string git = this->CommandLineTool;
// Use 'git update-index' to refresh the index w.r.t. the work tree.
- const char* git_update_index[] = { git, "update-index", "--refresh",
- nullptr };
+ std::vector<std::string> git_update_index = { git, "update-index",
+ "--refresh" };
OutputLogger ui_out(this->Log, "ui-out> ");
OutputLogger ui_err(this->Log, "ui-err> ");
- this->RunChild(git_update_index, &ui_out, &ui_err, nullptr,
+ this->RunChild(git_update_index, &ui_out, &ui_err, "",
cmProcessOutput::UTF8);
// Use 'git diff-index' to get modified files.
- const char* git_diff_index[] = { git, "diff-index", "-z",
- "HEAD", "--", nullptr };
+ std::vector<std::string> git_diff_index = { git, "diff-index", "-z", "HEAD",
+ "--" };
DiffParser out(this, "di-out> ");
OutputLogger err(this->Log, "di-err> ");
- this->RunChild(git_diff_index, &out, &err, nullptr, cmProcessOutput::UTF8);
+ this->RunChild(git_diff_index, &out, &err, "", cmProcessOutput::UTF8);
for (Change const& c : out.Changes) {
this->DoModification(PathModified, c.Path);
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index a0197d6..a189d60 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -48,7 +48,7 @@ public:
*/
virtual int ProcessCommandLineArguments(
const std::string& /*currentArg*/, size_t& /*idx*/,
- const std::vector<std::string>& /*allArgs*/)
+ const std::vector<std::string>& /*allArgs*/, bool& /*valid*/)
{
return 1;
}
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx
index 02837ba..3d56be0 100644
--- a/Source/CTest/cmCTestHG.cxx
+++ b/Source/CTest/cmCTestHG.cxx
@@ -95,8 +95,8 @@ private:
std::string cmCTestHG::GetWorkingRevision()
{
// Run plumbing "hg identify" to get work tree revision.
- const char* hg = this->CommandLineTool.c_str();
- const char* hg_identify[] = { hg, "identify", "-i", nullptr };
+ std::string hg = this->CommandLineTool;
+ std::vector<std::string> hg_identify = { hg, "identify", "-i" };
std::string rev;
IdentifyParser out(this, "rev-out> ", rev);
OutputLogger err(this->Log, "rev-err> ");
@@ -127,19 +127,19 @@ bool cmCTestHG::UpdateImpl()
{
// Use "hg pull" followed by "hg update" to update the working tree.
{
- const char* hg = this->CommandLineTool.c_str();
- const char* hg_pull[] = { hg, "pull", "-v", nullptr };
+ std::string hg = this->CommandLineTool;
+ std::vector<std::string> hg_pull = { hg, "pull", "-v" };
OutputLogger out(this->Log, "pull-out> ");
OutputLogger err(this->Log, "pull-err> ");
- this->RunChild(&hg_pull[0], &out, &err);
+ this->RunChild(hg_pull, &out, &err);
}
// TODO: if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
- std::vector<char const*> hg_update;
- hg_update.push_back(this->CommandLineTool.c_str());
- hg_update.push_back("update");
- hg_update.push_back("-v");
+ std::vector<std::string> hg_update;
+ hg_update.emplace_back(this->CommandLineTool);
+ hg_update.emplace_back("update");
+ hg_update.emplace_back("-v");
// Add user-specified update options.
std::string opts = this->CTest->GetCTestConfiguration("UpdateOptions");
@@ -147,16 +147,11 @@ bool cmCTestHG::UpdateImpl()
opts = this->CTest->GetCTestConfiguration("HGUpdateOptions");
}
std::vector<std::string> args = cmSystemTools::ParseArguments(opts);
- for (std::string const& arg : args) {
- hg_update.push_back(arg.c_str());
- }
-
- // Sentinel argument.
- hg_update.push_back(nullptr);
+ cm::append(hg_update, args);
OutputLogger out(this->Log, "update-out> ");
OutputLogger err(this->Log, "update-err> ");
- return this->RunUpdateCommand(hg_update.data(), &out, &err);
+ return this->RunUpdateCommand(hg_update, &out, &err);
}
class cmCTestHG::LogParser
@@ -277,8 +272,8 @@ bool cmCTestHG::LoadRevisions()
// the project has spaces in the path. Also, they may not have
// proper XML escapes.
std::string range = this->OldRevision + ":" + this->NewRevision;
- const char* hg = this->CommandLineTool.c_str();
- const char* hgXMLTemplate = "<logentry\n"
+ std::string hg = this->CommandLineTool;
+ std::string hgXMLTemplate = "<logentry\n"
" revision=\"{node|short}\">\n"
" <author>{author|person}</author>\n"
" <email>{author|email}</email>\n"
@@ -288,10 +283,8 @@ bool cmCTestHG::LoadRevisions()
" <file_adds>{file_adds}</file_adds>\n"
" <file_dels>{file_dels}</file_dels>\n"
"</logentry>\n";
- const char* hg_log[] = {
- hg, "log", "--removed", "-r", range.c_str(),
- "--template", hgXMLTemplate, nullptr
- };
+ std::vector<std::string> hg_log = { hg, "log", "--removed", "-r",
+ range, "--template", hgXMLTemplate };
LogParser out(this, "log-out> ");
out.Process("<?xml version=\"1.0\"?>\n"
@@ -305,8 +298,8 @@ bool cmCTestHG::LoadRevisions()
bool cmCTestHG::LoadModifications()
{
// Use 'hg status' to get modified files.
- const char* hg = this->CommandLineTool.c_str();
- const char* hg_status[] = { hg, "status", nullptr };
+ std::string hg = this->CommandLineTool;
+ std::vector<std::string> hg_status = { hg, "status" };
StatusParser out(this, "status-out> ");
OutputLogger err(this->Log, "status-err> ");
this->RunChild(hg_status, &out, &err);
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 4a33869..9669d76 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -2,11 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestLaunch.h"
+#include <cstdio>
#include <cstring>
#include <iostream>
+#include <memory>
+#include <utility>
+
+#include <cm3p/uv.h>
#include "cmsys/FStream.hxx"
-#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
#include "cmCTestLaunchReporter.h"
@@ -17,6 +21,9 @@
#include "cmStateSnapshot.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVProcessChain.h"
+#include "cmUVStream.h"
#include "cmake.h"
#ifdef _WIN32
@@ -28,8 +35,6 @@
cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv)
{
- this->Process = nullptr;
-
if (!this->ParseArguments(argc, argv)) {
return;
}
@@ -40,13 +45,9 @@ cmCTestLaunch::cmCTestLaunch(int argc, const char* const* argv)
this->ScrapeRulesLoaded = false;
this->HaveOut = false;
this->HaveErr = false;
- this->Process = cmsysProcess_New();
}
-cmCTestLaunch::~cmCTestLaunch()
-{
- cmsysProcess_Delete(this->Process);
-}
+cmCTestLaunch::~cmCTestLaunch() = default;
bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv)
{
@@ -113,15 +114,12 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv)
// Extract the real command line.
if (arg0) {
- this->RealArgC = argc - arg0;
- this->RealArgV = argv + arg0;
- for (int i = 0; i < this->RealArgC; ++i) {
- this->HandleRealArg(this->RealArgV[i]);
+ for (int i = 0; i < argc - arg0; ++i) {
+ this->RealArgV.emplace_back((argv + arg0)[i]);
+ this->HandleRealArg((argv + arg0)[i]);
}
return true;
}
- this->RealArgC = 0;
- this->RealArgV = nullptr;
std::cerr << "No launch/command separator ('--') found!\n";
return false;
}
@@ -151,17 +149,19 @@ void cmCTestLaunch::RunChild()
}
// Prepare to run the real command.
- cmsysProcess* cp = this->Process;
- cmsysProcess_SetCommand(cp, this->RealArgV);
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand(this->RealArgV);
cmsys::ofstream fout;
cmsys::ofstream ferr;
if (this->Reporter.Passthru) {
// In passthru mode we just share the output pipes.
- cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDOUT, 1);
- cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDERR, 1);
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, stdout)
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, stderr);
} else {
// In full mode we record the child output pipes to log files.
+ builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR);
fout.open(this->Reporter.LogOut.c_str(), std::ios::out | std::ios::binary);
ferr.open(this->Reporter.LogErr.c_str(), std::ios::out | std::ios::binary);
}
@@ -174,51 +174,65 @@ void cmCTestLaunch::RunChild()
#endif
// Run the real command.
- cmsysProcess_Execute(cp);
+ auto chain = builder.Start();
// Record child stdout and stderr if necessary.
+ cm::uv_pipe_ptr outPipe;
+ cm::uv_pipe_ptr errPipe;
+ bool outFinished = true;
+ bool errFinished = true;
+ cmProcessOutput processOutput;
+ std::unique_ptr<cmUVStreamReadHandle> outputHandle;
+ std::unique_ptr<cmUVStreamReadHandle> errorHandle;
if (!this->Reporter.Passthru) {
- char* data = nullptr;
- int length = 0;
- cmProcessOutput processOutput;
- std::string strdata;
- while (int p = cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
- if (p == cmsysProcess_Pipe_STDOUT) {
- processOutput.DecodeText(data, length, strdata, 1);
- fout.write(strdata.c_str(), strdata.size());
- std::cout.write(strdata.c_str(), strdata.size());
- this->HaveOut = true;
- } else if (p == cmsysProcess_Pipe_STDERR) {
- processOutput.DecodeText(data, length, strdata, 2);
- ferr.write(strdata.c_str(), strdata.size());
- std::cerr.write(strdata.c_str(), strdata.size());
- this->HaveErr = true;
- }
- }
- processOutput.DecodeText(std::string(), strdata, 1);
- if (!strdata.empty()) {
- fout.write(strdata.c_str(), strdata.size());
- std::cout.write(strdata.c_str(), strdata.size());
- }
- processOutput.DecodeText(std::string(), strdata, 2);
- if (!strdata.empty()) {
- ferr.write(strdata.c_str(), strdata.size());
- std::cerr.write(strdata.c_str(), strdata.size());
- }
+ auto beginRead = [&chain, &processOutput](
+ cm::uv_pipe_ptr& pipe, int stream, std::ostream& out,
+ cmsys::ofstream& file, bool& haveData, bool& finished,
+ int id) -> std::unique_ptr<cmUVStreamReadHandle> {
+ pipe.init(chain.GetLoop(), 0);
+ uv_pipe_open(pipe, stream);
+ finished = false;
+ return cmUVStreamRead(
+ pipe,
+ [&processOutput, &out, &file, id, &haveData](std::vector<char> data) {
+ std::string strdata;
+ processOutput.DecodeText(data.data(), data.size(), strdata, id);
+ file.write(strdata.c_str(), strdata.size());
+ out.write(strdata.c_str(), strdata.size());
+ haveData = true;
+ },
+ [&processOutput, &out, &file, &finished, id]() {
+ std::string strdata;
+ processOutput.DecodeText(std::string(), strdata, id);
+ if (!strdata.empty()) {
+ file.write(strdata.c_str(), strdata.size());
+ out.write(strdata.c_str(), strdata.size());
+ }
+ finished = true;
+ });
+ };
+ outputHandle = beginRead(outPipe, chain.OutputStream(), std::cout, fout,
+ this->HaveOut, outFinished, 1);
+ errorHandle = beginRead(errPipe, chain.ErrorStream(), std::cerr, ferr,
+ this->HaveErr, errFinished, 2);
}
// Wait for the real command to finish.
- cmsysProcess_WaitForExit(cp, nullptr);
- this->Reporter.ExitCode = cmsysProcess_GetExitValue(cp);
+ while (!(chain.Finished() && outFinished && errFinished)) {
+ uv_run(&chain.GetLoop(), UV_RUN_ONCE);
+ }
+ this->Reporter.Status = chain.GetStatus(0);
+ if (this->Reporter.Status.GetException().first ==
+ cmUVProcessChain::ExceptionCode::Spawn) {
+ this->Reporter.ExitCode = 1;
+ } else {
+ this->Reporter.ExitCode =
+ static_cast<int>(this->Reporter.Status.ExitStatus);
+ }
}
int cmCTestLaunch::Run()
{
- if (!this->Process) {
- std::cerr << "Could not allocate cmsysProcess instance!\n";
- return -1;
- }
-
this->RunChild();
if (this->CheckResults()) {
@@ -226,7 +240,6 @@ int cmCTestLaunch::Run()
}
this->LoadConfig();
- this->Reporter.Process = this->Process;
this->Reporter.WriteXML();
return this->Reporter.ExitCode;
diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h
index c5a6476..ef21a26 100644
--- a/Source/CTest/cmCTestLaunch.h
+++ b/Source/CTest/cmCTestLaunch.h
@@ -43,15 +43,12 @@ private:
bool ParseArguments(int argc, const char* const* argv);
// The real command line appearing after launcher arguments.
- int RealArgC;
- const char* const* RealArgV;
+ std::vector<std::string> RealArgV;
// The real command line after response file expansion.
std::vector<std::string> RealArgs;
void HandleRealArg(const char* arg);
- struct cmsysProcess_s* Process;
-
// Whether or not any data have been written to stdout or stderr.
bool HaveOut;
bool HaveErr;
diff --git a/Source/CTest/cmCTestLaunchReporter.cxx b/Source/CTest/cmCTestLaunchReporter.cxx
index 149ba5d..4b4e5c5 100644
--- a/Source/CTest/cmCTestLaunchReporter.cxx
+++ b/Source/CTest/cmCTestLaunchReporter.cxx
@@ -2,8 +2,9 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestLaunchReporter.h"
+#include <utility>
+
#include "cmsys/FStream.hxx"
-#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
#include "cmCryptoHash.h"
@@ -22,6 +23,7 @@
cmCTestLaunchReporter::cmCTestLaunchReporter()
{
this->Passthru = true;
+ this->Status.Finished = true;
this->ExitCode = 1;
this->CWD = cmSystemTools::GetCurrentWorkingDirectory();
@@ -231,35 +233,23 @@ void cmCTestLaunchReporter::WriteXMLResult(cmXMLElement& e2)
// ExitCondition
cmXMLElement e4(e3, "ExitCondition");
- cmsysProcess* cp = this->Process;
- switch (cmsysProcess_GetState(cp)) {
- case cmsysProcess_State_Starting:
- e4.Content("No process has been executed");
- break;
- case cmsysProcess_State_Executing:
- e4.Content("The process is still executing");
- break;
- case cmsysProcess_State_Disowned:
- e4.Content("Disowned");
- break;
- case cmsysProcess_State_Killed:
- e4.Content("Killed by parent");
- break;
-
- case cmsysProcess_State_Expired:
- e4.Content("Killed when timeout expired");
- break;
- case cmsysProcess_State_Exited:
- e4.Content(this->ExitCode);
- break;
- case cmsysProcess_State_Exception:
- e4.Content("Terminated abnormally: ");
- e4.Content(cmsysProcess_GetExceptionString(cp));
- break;
- case cmsysProcess_State_Error:
- e4.Content("Error administrating child process: ");
- e4.Content(cmsysProcess_GetErrorString(cp));
- break;
+ if (this->Status.Finished) {
+ auto exception = this->Status.GetException();
+ switch (exception.first) {
+ case cmUVProcessChain::ExceptionCode::None:
+ e4.Content(this->ExitCode);
+ break;
+ case cmUVProcessChain::ExceptionCode::Spawn:
+ e4.Content("Error administrating child process: ");
+ e4.Content(exception.second);
+ break;
+ default:
+ e4.Content("Terminated abnormally: ");
+ e4.Content(exception.second);
+ break;
+ }
+ } else {
+ e4.Content("Killed when timeout expired");
}
}
diff --git a/Source/CTest/cmCTestLaunchReporter.h b/Source/CTest/cmCTestLaunchReporter.h
index 4be0d9b..2bb78f8 100644
--- a/Source/CTest/cmCTestLaunchReporter.h
+++ b/Source/CTest/cmCTestLaunchReporter.h
@@ -10,6 +10,8 @@
#include "cmsys/RegularExpression.hxx"
+#include "cmUVProcessChain.h"
+
class cmXMLElement;
/** \class cmCTestLaunchReporter
@@ -48,7 +50,7 @@ public:
void ComputeFileNames();
bool Passthru;
- struct cmsysProcess_s* Process;
+ cmUVProcessChain::Status Status;
int ExitCode;
// Temporary log files for stdout and stderr of real command.
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index ca07a08..84ea32b 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -40,9 +40,20 @@
#include "cmRange.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
-#include "cmUVSignalHackRAII.h" // IWYU pragma: keep
+#include "cmUVJobServerClient.h"
#include "cmWorkingDirectory.h"
+namespace {
+// For unspecified parallelism, limit to the number of processors,
+// but with a minimum greater than 1 so there is some parallelism.
+constexpr unsigned long kParallelLevelMinimum = 2u;
+
+// For "unbounded" parallelism, limit to a very high value.
+// Under a job server, parallelism is effectively limited
+// only by available job server tokens.
+constexpr unsigned long kParallelLevelUnbounded = 0x10000u;
+}
+
namespace cmsys {
class RegularExpression;
}
@@ -66,50 +77,76 @@ private:
cmCTestMultiProcessHandler* Handler;
};
-cmCTestMultiProcessHandler::cmCTestMultiProcessHandler()
+cmCTestMultiProcessHandler::cmCTestMultiProcessHandler(
+ cmCTest* ctest, cmCTestTestHandler* handler)
+ : CTest(ctest)
+ , TestHandler(handler)
+ , ProcessorsAvailable(cmAffinity::GetProcessorsAvailable())
+ , HaveAffinity(this->ProcessorsAvailable.size())
+ , ParallelLevelDefault(kParallelLevelMinimum)
{
- this->ParallelLevel = 1;
- this->TestLoad = 0;
- this->FakeLoadForTesting = 0;
- this->Completed = 0;
- this->RunningCount = 0;
- this->ProcessorsAvailable = cmAffinity::GetProcessorsAvailable();
- this->HaveAffinity = this->ProcessorsAvailable.size();
- this->HasCycles = false;
- this->HasInvalidGeneratedResourceSpec = false;
- this->SerialTestRunning = false;
}
cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler() = default;
// Set the tests
-void cmCTestMultiProcessHandler::SetTests(TestMap& tests,
- PropertiesMap& properties)
+bool cmCTestMultiProcessHandler::SetTests(TestMap tests,
+ PropertiesMap properties)
{
- this->Tests = tests;
- this->Properties = properties;
- this->Total = this->Tests.size();
- // set test run map to false for all
- for (auto const& t : this->Tests) {
- this->TestRunningMap[t.first] = false;
- this->TestFinishMap[t.first] = false;
- }
+ this->PendingTests = std::move(tests);
+ this->Properties = std::move(properties);
+ this->Total = this->PendingTests.size();
if (!this->CTest->GetShowOnly()) {
this->ReadCostData();
this->HasCycles = !this->CheckCycles();
this->HasInvalidGeneratedResourceSpec =
!this->CheckGeneratedResourceSpec();
if (this->HasCycles || this->HasInvalidGeneratedResourceSpec) {
- return;
+ return false;
}
this->CreateTestCostList();
}
+ return true;
}
// Set the max number of tests that can be run at the same time.
-void cmCTestMultiProcessHandler::SetParallelLevel(size_t level)
+void cmCTestMultiProcessHandler::SetParallelLevel(cm::optional<size_t> level)
{
- this->ParallelLevel = level < 1 ? 1 : level;
+ this->ParallelLevel = level;
+
+ if (!this->ParallelLevel) {
+ // '-j' was given with no value. Limit by number of processors.
+ cmsys::SystemInformation info;
+ info.RunCPUCheck();
+ unsigned long processorCount = info.GetNumberOfLogicalCPU();
+
+ if (cm::optional<std::string> fakeProcessorCount =
+ cmSystemTools::GetEnvVar(
+ "__CTEST_FAKE_PROCESSOR_COUNT_FOR_TESTING")) {
+ unsigned long pc = 0;
+ if (cmStrToULong(*fakeProcessorCount, &pc)) {
+ processorCount = pc;
+ } else {
+ cmSystemTools::Error("Failed to parse fake processor count: " +
+ *fakeProcessorCount);
+ }
+ }
+
+ this->ParallelLevelDefault =
+ std::max(kParallelLevelMinimum, processorCount);
+ }
+}
+
+size_t cmCTestMultiProcessHandler::GetParallelLevel() const
+{
+ if ((this->ParallelLevel && *this->ParallelLevel == 0) ||
+ (!this->ParallelLevel && this->JobServerClient)) {
+ return kParallelLevelUnbounded;
+ }
+ if (this->ParallelLevel) {
+ return *this->ParallelLevel;
+ }
+ return this->ParallelLevelDefault;
}
void cmCTestMultiProcessHandler::SetTestLoad(unsigned long load)
@@ -126,25 +163,50 @@ void cmCTestMultiProcessHandler::SetTestLoad(unsigned long load)
}
}
+bool cmCTestMultiProcessHandler::Complete()
+{
+ return this->Completed == this->Total;
+}
+
+void cmCTestMultiProcessHandler::InitializeLoop()
+{
+ this->Loop.init();
+ this->StartNextTestsOnIdle_.init(*this->Loop, this);
+ this->StartNextTestsOnTimer_.init(*this->Loop, this);
+
+ this->JobServerClient = cmUVJobServerClient::Connect(
+ *this->Loop, /*onToken=*/[this]() { this->JobServerReceivedToken(); },
+ /*onDisconnect=*/nullptr);
+ if (this->JobServerClient) {
+ cmCTestLog(this->CTest, OUTPUT,
+ "Connected to MAKE jobserver" << std::endl);
+ }
+}
+
+void cmCTestMultiProcessHandler::FinalizeLoop()
+{
+ this->JobServerClient.reset();
+ this->StartNextTestsOnTimer_.reset();
+ this->StartNextTestsOnIdle_.reset();
+ this->Loop.reset();
+}
+
void cmCTestMultiProcessHandler::RunTests()
{
this->CheckResume();
if (this->HasCycles || this->HasInvalidGeneratedResourceSpec) {
return;
}
-#ifdef CMAKE_UV_SIGNAL_HACK
- cmUVSignalHackRAII hackRAII;
-#endif
this->TestHandler->SetMaxIndex(this->FindMaxIndex());
- uv_loop_init(&this->Loop);
- this->StartNextTests();
- uv_run(&this->Loop, UV_RUN_DEFAULT);
- uv_loop_close(&this->Loop);
+ this->InitializeLoop();
+ this->StartNextTestsOnIdle();
+ uv_run(this->Loop, UV_RUN_DEFAULT);
+ this->FinalizeLoop();
if (!this->StopTimePassed && !this->CheckStopOnFailure()) {
- assert(this->Completed == this->Total);
- assert(this->Tests.empty());
+ assert(this->Complete());
+ assert(this->PendingTests.empty());
}
assert(this->AllResourcesAvailable());
@@ -152,38 +214,17 @@ void cmCTestMultiProcessHandler::RunTests()
this->UpdateCostData();
}
-bool cmCTestMultiProcessHandler::StartTestProcess(int test)
+void cmCTestMultiProcessHandler::StartTestProcess(int test)
{
- if (this->HaveAffinity && this->Properties[test]->WantAffinity) {
- size_t needProcessors = this->GetProcessorsUsed(test);
- if (needProcessors > this->ProcessorsAvailable.size()) {
- return false;
- }
- std::vector<size_t> affinity;
- affinity.reserve(needProcessors);
- for (size_t i = 0; i < needProcessors; ++i) {
- auto p = this->ProcessorsAvailable.begin();
- affinity.push_back(*p);
- this->ProcessorsAvailable.erase(p);
- }
- this->Properties[test]->Affinity = std::move(affinity);
- }
-
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"test " << test << "\n", this->Quiet);
- this->TestRunningMap[test] = true; // mark the test as running
- // now remove the test itself
- this->EraseTest(test);
- this->RunningCount += this->GetProcessorsUsed(test);
- auto testRun = cm::make_unique<cmCTestRunTest>(*this);
+ auto testRun = cm::make_unique<cmCTestRunTest>(*this, test);
if (this->RepeatMode != cmCTest::Repeat::Never) {
testRun->SetRepeatMode(this->RepeatMode);
testRun->SetNumberOfRuns(this->RepeatCount);
}
- testRun->SetIndex(test);
- testRun->SetTestProperties(this->Properties[test]);
if (this->UseResourceSpec) {
testRun->SetUseAllocatedResources(true);
testRun->SetAllocatedResources(this->AllocatedResources[test]);
@@ -197,22 +238,18 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
}
}
- // Always lock the resources we'll be using, even if we fail to set the
- // working directory because FinishTestProcess() will try to unlock them
- this->LockResources(test);
-
- if (!this->ResourceAllocationErrors[test].empty()) {
+ if (!this->ResourceAvailabilityErrors[test].empty()) {
std::ostringstream e;
e << "Insufficient resources for test " << this->Properties[test]->Name
<< ":\n\n";
- for (auto const& it : this->ResourceAllocationErrors[test]) {
+ for (auto const& it : this->ResourceAvailabilityErrors[test]) {
switch (it.second) {
- case ResourceAllocationError::NoResourceType:
+ case ResourceAvailabilityError::NoResourceType:
e << " Test requested resources of type '" << it.first
<< "' which does not exist\n";
break;
- case ResourceAllocationError::InsufficientResources:
+ case ResourceAvailabilityError::InsufficientResources:
e << " Test requested resources of type '" << it.first
<< "' in the following amounts:\n";
for (auto const& group : this->Properties[test]->ResourceGroups) {
@@ -236,7 +273,7 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
e << "Resource spec file:\n\n " << this->ResourceSpecFile;
cmCTestRunTest::StartFailure(std::move(testRun), this->Total, e.str(),
"Insufficient resources");
- return false;
+ return;
}
cmWorkingDirectory workdir(this->Properties[test]->Directory);
@@ -246,13 +283,12 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
this->Properties[test]->Directory + " : " +
std::strerror(workdir.GetLastResult()),
"Failed to change working directory");
- return false;
+ return;
}
// Ownership of 'testRun' has moved to another structure.
// When the test finishes, FinishTestProcess will be called.
- return cmCTestRunTest::StartTest(std::move(testRun), this->Completed,
- this->Total);
+ cmCTestRunTest::StartTest(std::move(testRun), this->Completed, this->Total);
}
bool cmCTestMultiProcessHandler::AllocateResources(int index)
@@ -261,6 +297,12 @@ bool cmCTestMultiProcessHandler::AllocateResources(int index)
return true;
}
+ // If the test needs unavailable resources then do not allocate anything
+ // because it will never run. We will issue the recorded errors instead.
+ if (!this->ResourceAvailabilityErrors[index].empty()) {
+ return true;
+ }
+
std::map<std::string, std::vector<cmCTestBinPackerAllocation>> allocations;
if (!this->TryAllocateResources(index, allocations)) {
return false;
@@ -285,7 +327,7 @@ bool cmCTestMultiProcessHandler::AllocateResources(int index)
bool cmCTestMultiProcessHandler::TryAllocateResources(
int index,
std::map<std::string, std::vector<cmCTestBinPackerAllocation>>& allocations,
- std::map<std::string, ResourceAllocationError>* errors)
+ std::map<std::string, ResourceAvailabilityError>* errors)
{
allocations.clear();
@@ -305,7 +347,7 @@ bool cmCTestMultiProcessHandler::TryAllocateResources(
for (auto& it : allocations) {
if (!availableResources.count(it.first)) {
if (errors) {
- (*errors)[it.first] = ResourceAllocationError::NoResourceType;
+ (*errors)[it.first] = ResourceAvailabilityError::NoResourceType;
result = false;
} else {
return false;
@@ -313,7 +355,7 @@ bool cmCTestMultiProcessHandler::TryAllocateResources(
} else if (!cmAllocateCTestResourcesRoundRobin(
availableResources.at(it.first), it.second)) {
if (errors) {
- (*errors)[it.first] = ResourceAllocationError::InsufficientResources;
+ (*errors)[it.first] = ResourceAvailabilityError::InsufficientResources;
result = false;
} else {
return false;
@@ -360,14 +402,14 @@ bool cmCTestMultiProcessHandler::AllResourcesAvailable()
return true;
}
-void cmCTestMultiProcessHandler::CheckResourcesAvailable()
+void cmCTestMultiProcessHandler::CheckResourceAvailability()
{
if (this->UseResourceSpec) {
- for (auto test : this->SortedTests) {
+ for (auto const& t : this->PendingTests) {
std::map<std::string, std::vector<cmCTestBinPackerAllocation>>
allocations;
- this->TryAllocateResources(test, allocations,
- &this->ResourceAllocationErrors[test]);
+ this->TryAllocateResources(t.first, allocations,
+ &this->ResourceAvailabilityErrors[t.first]);
}
}
}
@@ -401,41 +443,70 @@ void cmCTestMultiProcessHandler::SetStopTimePassed()
}
}
+bool cmCTestMultiProcessHandler::ResourceLocksAvailable(int test)
+{
+ return std::all_of(this->Properties[test]->ProjectResources.begin(),
+ this->Properties[test]->ProjectResources.end(),
+ [this](std::string const& r) -> bool {
+ return !cm::contains(this->ProjectResourcesLocked, r);
+ });
+}
+
void cmCTestMultiProcessHandler::LockResources(int index)
{
- this->LockedResources.insert(
- this->Properties[index]->LockedResources.begin(),
- this->Properties[index]->LockedResources.end());
+ this->RunningCount += this->GetProcessorsUsed(index);
+
+ auto* properties = this->Properties[index];
- if (this->Properties[index]->RunSerial) {
+ this->ProjectResourcesLocked.insert(properties->ProjectResources.begin(),
+ properties->ProjectResources.end());
+
+ if (properties->RunSerial) {
this->SerialTestRunning = true;
}
+
+ if (this->HaveAffinity && properties->WantAffinity) {
+ size_t needProcessors = this->GetProcessorsUsed(index);
+ assert(needProcessors <= this->ProcessorsAvailable.size());
+ std::vector<size_t> affinity;
+ affinity.reserve(needProcessors);
+ for (size_t i = 0; i < needProcessors; ++i) {
+ auto p = this->ProcessorsAvailable.begin();
+ affinity.push_back(*p);
+ this->ProcessorsAvailable.erase(p);
+ }
+ properties->Affinity = std::move(affinity);
+ }
}
void cmCTestMultiProcessHandler::UnlockResources(int index)
{
- for (std::string const& i : this->Properties[index]->LockedResources) {
- this->LockedResources.erase(i);
+ auto* properties = this->Properties[index];
+
+ for (auto p : properties->Affinity) {
+ this->ProcessorsAvailable.insert(p);
+ }
+ properties->Affinity.clear();
+
+ for (std::string const& i : properties->ProjectResources) {
+ this->ProjectResourcesLocked.erase(i);
}
- if (this->Properties[index]->RunSerial) {
+
+ if (properties->RunSerial) {
this->SerialTestRunning = false;
}
-}
-void cmCTestMultiProcessHandler::EraseTest(int test)
-{
- this->Tests.erase(test);
- this->SortedTests.erase(
- std::find(this->SortedTests.begin(), this->SortedTests.end(), test));
+ this->RunningCount -= this->GetProcessorsUsed(index);
}
inline size_t cmCTestMultiProcessHandler::GetProcessorsUsed(int test)
{
size_t processors = static_cast<int>(this->Properties[test]->Processors);
+ size_t const parallelLevel = this->GetParallelLevel();
// If processors setting is set higher than the -j
// setting, we default to using all of the process slots.
- if (processors > this->ParallelLevel) {
- processors = this->ParallelLevel;
+ if (processors > parallelLevel) {
+ processors = parallelLevel;
}
// Cap tests that want affinity to the maximum affinity available.
if (this->HaveAffinity && processors > this->HaveAffinity &&
@@ -450,57 +521,48 @@ std::string cmCTestMultiProcessHandler::GetName(int test)
return this->Properties[test]->Name;
}
-bool cmCTestMultiProcessHandler::StartTest(int test)
+void cmCTestMultiProcessHandler::StartTest(int test)
{
- // Check for locked resources
- for (std::string const& i : this->Properties[test]->LockedResources) {
- if (cm::contains(this->LockedResources, i)) {
- return false;
- }
- }
-
- // Allocate resources
- if (this->ResourceAllocationErrors[test].empty() &&
- !this->AllocateResources(test)) {
- this->DeallocateResources(test);
- return false;
+ if (this->JobServerClient) {
+ // There is a job server. Request a token and queue the test to run
+ // when a token is received. Note that if we do not get a token right
+ // away it's possible that the system load will be higher when the
+ // token is received and we may violate the test-load limit. However,
+ // this is unlikely because if we do not get a token right away, some
+ // other job that's currently running must finish before we get one.
+ this->JobServerClient->RequestToken();
+ this->JobServerQueuedTests.emplace_back(test);
+ } else {
+ // There is no job server. Start the test now.
+ this->StartTestProcess(test);
}
+}
- // if there are no depends left then run this test
- if (this->Tests[test].empty()) {
- return this->StartTestProcess(test);
- }
- // This test was not able to start because it is waiting
- // on depends to run
- this->DeallocateResources(test);
- return false;
+void cmCTestMultiProcessHandler::JobServerReceivedToken()
+{
+ assert(!this->JobServerQueuedTests.empty());
+ int test = this->JobServerQueuedTests.front();
+ this->JobServerQueuedTests.pop_front();
+ this->StartTestProcess(test);
}
void cmCTestMultiProcessHandler::StartNextTests()
{
- if (this->TestLoadRetryTimer.get() != nullptr) {
- // This timer may be waiting to call StartNextTests again.
- // Since we have been called it is no longer needed.
- uv_timer_stop(this->TestLoadRetryTimer);
- }
-
- if (this->Tests.empty()) {
- this->TestLoadRetryTimer.reset();
- return;
- }
+ // One or more events may be scheduled to call this method again.
+ // Since this method has been called they are no longer needed.
+ this->StartNextTestsOnIdle_.stop();
+ this->StartNextTestsOnTimer_.stop();
- if (this->CheckStopTimePassed()) {
- return;
- }
-
- if (this->CheckStopOnFailure() && !this->Failed->empty()) {
+ if (this->PendingTests.empty() || this->CheckStopTimePassed() ||
+ (this->CheckStopOnFailure() && !this->Failed->empty())) {
return;
}
size_t numToStart = 0;
- if (this->RunningCount < this->ParallelLevel) {
- numToStart = this->ParallelLevel - this->RunningCount;
+ size_t const parallelLevel = this->GetParallelLevel();
+ if (this->RunningCount < parallelLevel) {
+ numToStart = parallelLevel - this->RunningCount;
}
if (numToStart == 0) {
@@ -514,7 +576,7 @@ void cmCTestMultiProcessHandler::StartNextTests()
}
bool allTestsFailedTestLoadCheck = false;
- size_t minProcessorsRequired = this->ParallelLevel;
+ size_t minProcessorsRequired = this->GetParallelLevel();
std::string testWithMinProcessors;
cmsys::SystemInformation info;
@@ -545,50 +607,77 @@ void cmCTestMultiProcessHandler::StartNextTests()
}
}
- TestList copy = this->SortedTests;
- for (auto const& test : copy) {
- // Take a nap if we're currently performing a RUN_SERIAL test.
- if (this->SerialTestRunning) {
- break;
- }
+ // Start tests in the preferred order, each subject to readiness checks.
+ auto ti = this->OrderedTests.begin();
+ while (numToStart > 0 && !this->SerialTestRunning &&
+ ti != this->OrderedTests.end()) {
+ // Increment the test iterator now because the current list
+ // entry may be deleted below.
+ auto cti = ti++;
+ int test = *cti;
+
// We can only start a RUN_SERIAL test if no other tests are also
// running.
if (this->Properties[test]->RunSerial && this->RunningCount > 0) {
continue;
}
+ // Exclude tests that depend on unfinished tests.
+ if (!this->PendingTests[test].Depends.empty()) {
+ continue;
+ }
+
size_t processors = this->GetProcessorsUsed(test);
- bool testLoadOk = true;
if (this->TestLoad > 0) {
- if (processors <= spareLoad) {
- cmCTestLog(this->CTest, DEBUG,
- "OK to run " << this->GetName(test) << ", it requires "
- << processors << " procs & system load is: "
- << systemLoad << std::endl);
- allTestsFailedTestLoadCheck = false;
- } else {
- testLoadOk = false;
+ // Exclude tests that are too big to fit in the spare load.
+ if (processors > spareLoad) {
+ // Keep track of the smallest excluded test to report in message below.
+ if (processors <= minProcessorsRequired) {
+ minProcessorsRequired = processors;
+ testWithMinProcessors = this->GetName(test);
+ }
+ continue;
}
+
+ // We found a test that fits in the spare load.
+ allTestsFailedTestLoadCheck = false;
+ cmCTestLog(this->CTest, DEBUG,
+ "OK to run "
+ << this->GetName(test) << ", it requires " << processors
+ << " procs & system load is: " << systemLoad << std::endl);
}
- if (processors <= minProcessorsRequired) {
- minProcessorsRequired = processors;
- testWithMinProcessors = this->GetName(test);
+ // Exclude tests that are too big to fit in the concurrency limit.
+ if (processors > numToStart) {
+ continue;
+ }
+
+ // Exclude tests that depend on currently-locked project resources.
+ if (!this->ResourceLocksAvailable(test)) {
+ continue;
}
- if (testLoadOk && processors <= numToStart && this->StartTest(test)) {
- numToStart -= processors;
- } else if (numToStart == 0) {
- break;
+ // Allocate system resources needed by this test.
+ if (!this->AllocateResources(test)) {
+ continue;
}
+
+ // Lock resources needed by this test.
+ this->LockResources(test);
+
+ // The test is ready to run.
+ numToStart -= processors;
+ this->OrderedTests.erase(cti);
+ this->PendingTests.erase(test);
+ this->StartTest(test);
}
if (allTestsFailedTestLoadCheck) {
// Find out whether there are any non RUN_SERIAL tests left, so that the
// correct warning may be displayed.
bool onlyRunSerialTestsLeft = true;
- for (auto const& test : copy) {
- if (!this->Properties[test]->RunSerial) {
+ for (auto const& t : this->PendingTests) {
+ if (!this->Properties[t.first]->RunSerial) {
onlyRunSerialTestsLeft = false;
}
}
@@ -600,7 +689,7 @@ void cmCTestMultiProcessHandler::StartNextTests()
} else if (onlyRunSerialTestsLeft) {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Only RUN_SERIAL tests remain, awaiting available slot.");
- } else {
+ } else if (!testWithMinProcessors.empty()) {
/* clang-format off */
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"System Load: " << systemLoad << ", "
@@ -608,26 +697,43 @@ void cmCTestMultiProcessHandler::StartNextTests()
"Smallest test " << testWithMinProcessors <<
" requires " << minProcessorsRequired);
/* clang-format on */
+ } else {
+ /* clang-format off */
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "System Load: " << systemLoad << ", "
+ "Max Allowed Load: " << this->TestLoad);
+ /* clang-format on */
}
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "*****" << std::endl);
- // Wait between 1 and 5 seconds before trying again.
- unsigned int milliseconds = (cmSystemTools::RandomSeed() % 5 + 1) * 1000;
- if (this->FakeLoadForTesting) {
- milliseconds = 10;
- }
- if (this->TestLoadRetryTimer.get() == nullptr) {
- this->TestLoadRetryTimer.init(this->Loop, this);
- }
- this->TestLoadRetryTimer.start(
- &cmCTestMultiProcessHandler::OnTestLoadRetryCB, milliseconds, 0);
+ // Try again later when the load might be lower.
+ this->StartNextTestsOnTimer();
}
}
-void cmCTestMultiProcessHandler::OnTestLoadRetryCB(uv_timer_t* timer)
+void cmCTestMultiProcessHandler::StartNextTestsOnIdle()
+{
+ // Start more tests on the next loop iteration.
+ this->StartNextTestsOnIdle_.start([](uv_idle_t* idle) {
+ uv_idle_stop(idle);
+ auto* self = static_cast<cmCTestMultiProcessHandler*>(idle->data);
+ self->StartNextTests();
+ });
+}
+
+void cmCTestMultiProcessHandler::StartNextTestsOnTimer()
{
- auto* self = static_cast<cmCTestMultiProcessHandler*>(timer->data);
- self->StartNextTests();
+ // Wait between 1 and 5 seconds before trying again.
+ unsigned int const milliseconds = this->FakeLoadForTesting
+ ? 10
+ : (cmSystemTools::RandomSeed() % 5 + 1) * 1000;
+ this->StartNextTestsOnTimer_.start(
+ [](uv_timer_t* timer) {
+ uv_timer_stop(timer);
+ auto* self = static_cast<cmCTestMultiProcessHandler*>(timer->data);
+ self->StartNextTests();
+ },
+ milliseconds, 0);
}
void cmCTestMultiProcessHandler::FinishTestProcess(
@@ -657,26 +763,20 @@ void cmCTestMultiProcessHandler::FinishTestProcess(
this->Failed->push_back(properties->Name);
}
- for (auto& t : this->Tests) {
- t.second.erase(test);
+ for (auto& t : this->PendingTests) {
+ t.second.Depends.erase(test);
}
- this->TestFinishMap[test] = true;
- this->TestRunningMap[test] = false;
this->WriteCheckpoint(test);
this->DeallocateResources(test);
this->UnlockResources(test);
- this->RunningCount -= this->GetProcessorsUsed(test);
-
- for (auto p : properties->Affinity) {
- this->ProcessorsAvailable.insert(p);
- }
- properties->Affinity.clear();
runner.reset();
- if (started) {
- this->StartNextTests();
+
+ if (this->JobServerClient) {
+ this->JobServerClient->ReleaseToken();
}
+ this->StartNextTestsOnIdle();
}
void cmCTestMultiProcessHandler::UpdateCostData()
@@ -769,7 +869,7 @@ void cmCTestMultiProcessHandler::ReadCostData()
this->Properties[index]->PreviousRuns = prev;
// When not running in parallel mode, don't use cost data
- if (this->ParallelLevel > 1 && this->Properties[index] &&
+ if (this->GetParallelLevel() > 1 && this->Properties[index] &&
this->Properties[index]->Cost == 0) {
this->Properties[index]->Cost = cost;
}
@@ -798,7 +898,7 @@ int cmCTestMultiProcessHandler::SearchByName(std::string const& name)
void cmCTestMultiProcessHandler::CreateTestCostList()
{
- if (this->ParallelLevel > 1) {
+ if (this->GetParallelLevel() > 1) {
this->CreateParallelTestCostList();
} else {
this->CreateSerialTestCostList();
@@ -807,7 +907,7 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
void cmCTestMultiProcessHandler::CreateParallelTestCostList()
{
- TestSet alreadySortedTests;
+ TestSet alreadyOrderedTests;
std::list<TestSet> priorityStack;
priorityStack.emplace_back();
@@ -815,11 +915,11 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
// In parallel test runs add previously failed tests to the front
// of the cost list and queue other tests for further sorting
- for (auto const& t : this->Tests) {
+ for (auto const& t : this->PendingTests) {
if (cm::contains(this->LastTestsFailed, this->Properties[t.first]->Name)) {
// If the test failed last time, it should be run first.
- this->SortedTests.push_back(t.first);
- alreadySortedTests.insert(t.first);
+ this->OrderedTests.push_back(t.first);
+ alreadyOrderedTests.insert(t.first);
} else {
topLevel.insert(t.first);
}
@@ -834,7 +934,7 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
TestSet& currentSet = priorityStack.back();
for (auto const& i : previousSet) {
- TestSet const& dependencies = this->Tests[i];
+ TestSet const& dependencies = this->PendingTests[i].Depends;
currentSet.insert(dependencies.begin(), dependencies.end());
}
@@ -855,9 +955,9 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
TestComparator(this));
for (auto const& j : sortedCopy) {
- if (!cm::contains(alreadySortedTests, j)) {
- this->SortedTests.push_back(j);
- alreadySortedTests.insert(j);
+ if (!cm::contains(alreadyOrderedTests, j)) {
+ this->OrderedTests.push_back(j);
+ alreadyOrderedTests.insert(j);
}
}
}
@@ -866,7 +966,7 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
void cmCTestMultiProcessHandler::GetAllTestDependencies(int test,
TestList& dependencies)
{
- TestSet const& dependencySet = this->Tests[test];
+ TestSet const& dependencySet = this->PendingTests[test].Depends;
for (int i : dependencySet) {
this->GetAllTestDependencies(i, dependencies);
dependencies.push_back(i);
@@ -877,17 +977,17 @@ void cmCTestMultiProcessHandler::CreateSerialTestCostList()
{
TestList presortedList;
- for (auto const& i : this->Tests) {
+ for (auto const& i : this->PendingTests) {
presortedList.push_back(i.first);
}
std::stable_sort(presortedList.begin(), presortedList.end(),
TestComparator(this));
- TestSet alreadySortedTests;
+ TestSet alreadyOrderedTests;
for (int test : presortedList) {
- if (cm::contains(alreadySortedTests, test)) {
+ if (cm::contains(alreadyOrderedTests, test)) {
continue;
}
@@ -895,14 +995,14 @@ void cmCTestMultiProcessHandler::CreateSerialTestCostList()
this->GetAllTestDependencies(test, dependencies);
for (int testDependency : dependencies) {
- if (!cm::contains(alreadySortedTests, testDependency)) {
- alreadySortedTests.insert(testDependency);
- this->SortedTests.push_back(testDependency);
+ if (!cm::contains(alreadyOrderedTests, testDependency)) {
+ alreadyOrderedTests.insert(testDependency);
+ this->OrderedTests.push_back(testDependency);
}
}
- alreadySortedTests.insert(test);
- this->SortedTests.push_back(test);
+ alreadyOrderedTests.insert(test);
+ this->OrderedTests.push_back(test);
}
}
@@ -1089,9 +1189,9 @@ static Json::Value DumpCTestProperties(
properties.append(DumpCTestProperty(
"REQUIRED_FILES", DumpToJsonArray(testProperties.RequiredFiles)));
}
- if (!testProperties.LockedResources.empty()) {
+ if (!testProperties.ProjectResources.empty()) {
properties.append(DumpCTestProperty(
- "RESOURCE_LOCK", DumpToJsonArray(testProperties.LockedResources)));
+ "RESOURCE_LOCK", DumpToJsonArray(testProperties.ProjectResources)));
}
if (testProperties.RunSerial) {
properties.append(
@@ -1116,6 +1216,11 @@ static Json::Value DumpCTestProperties(
properties.append(
DumpCTestProperty("WORKING_DIRECTORY", testProperties.Directory));
}
+ if (!testProperties.CustomProperties.empty()) {
+ for (auto const& it : testProperties.CustomProperties) {
+ properties.append(DumpCTestProperty(it.first, it.second));
+ }
+ }
return properties;
}
@@ -1259,9 +1364,7 @@ void cmCTestMultiProcessHandler::PrintOutputAsJson()
// Don't worry if this fails, we are only showing the test list, not
// running the tests
cmWorkingDirectory workdir(p.Directory);
- cmCTestRunTest testRun(*this);
- testRun.SetIndex(p.Index);
- testRun.SetTestProperties(&p);
+ cmCTestRunTest testRun(*this, p.Index);
testRun.ComputeArguments();
// Skip tests not available in this configuration.
@@ -1298,9 +1401,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
// running the tests
cmWorkingDirectory workdir(p.Directory);
- cmCTestRunTest testRun(*this);
- testRun.SetIndex(p.Index);
- testRun.SetTestProperties(&p);
+ cmCTestRunTest testRun(*this, p.Index);
testRun.ComputeArguments(); // logs the command in verbose mode
if (!p.Labels.empty()) // print the labels
@@ -1394,17 +1495,17 @@ void cmCTestMultiProcessHandler::CheckResume()
void cmCTestMultiProcessHandler::RemoveTest(int index)
{
- this->EraseTest(index);
+ this->OrderedTests.erase(
+ std::find(this->OrderedTests.begin(), this->OrderedTests.end(), index));
+ this->PendingTests.erase(index);
this->Properties.erase(index);
- this->TestRunningMap[index] = false;
- this->TestFinishMap[index] = true;
this->Completed++;
}
int cmCTestMultiProcessHandler::FindMaxIndex()
{
int max = 0;
- for (auto const& i : this->Tests) {
+ for (auto const& i : this->PendingTests) {
if (i.first > max) {
max = i.first;
}
@@ -1418,7 +1519,7 @@ bool cmCTestMultiProcessHandler::CheckCycles()
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Checking test dependency graph..." << std::endl,
this->Quiet);
- for (auto const& it : this->Tests) {
+ for (auto const& it : this->PendingTests) {
// DFS from each element to itself
int root = it.first;
std::set<int> visited;
@@ -1428,7 +1529,7 @@ bool cmCTestMultiProcessHandler::CheckCycles()
int test = s.top();
s.pop();
if (visited.insert(test).second) {
- for (auto const& d : this->Tests[test]) {
+ for (auto const& d : this->PendingTests[test].Depends) {
if (d == root) {
// cycle exists
cmCTestLog(
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 3b4e9c5..fd6c17f 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <cstddef>
+#include <list>
#include <map>
#include <memory>
#include <set>
@@ -13,13 +14,12 @@
#include <cm/optional>
-#include <cm3p/uv.h>
-
#include "cmCTest.h"
#include "cmCTestResourceAllocator.h"
#include "cmCTestResourceSpec.h"
#include "cmCTestTestHandler.h"
#include "cmUVHandlePtr.h"
+#include "cmUVJobServerClient.h"
struct cmCTestBinPackerAllocation;
class cmCTestRunTest;
@@ -38,7 +38,11 @@ public:
struct TestSet : public std::set<int>
{
};
- struct TestMap : public std::map<int, TestSet>
+ struct TestInfo
+ {
+ TestSet Depends;
+ };
+ struct TestMap : public std::map<int, TestInfo>
{
};
struct TestList : public std::vector<int>
@@ -54,12 +58,12 @@ public:
unsigned int Slots;
};
- cmCTestMultiProcessHandler();
+ cmCTestMultiProcessHandler(cmCTest* ctest, cmCTestTestHandler* handler);
virtual ~cmCTestMultiProcessHandler();
// Set the tests
- void SetTests(TestMap& tests, PropertiesMap& properties);
+ bool SetTests(TestMap tests, PropertiesMap properties);
// Set the max number of tests that can be run at the same time.
- void SetParallelLevel(size_t);
+ void SetParallelLevel(cm::optional<size_t> level);
void SetTestLoad(unsigned long load);
virtual void RunTests();
void PrintOutputAsJson();
@@ -77,13 +81,6 @@ public:
this->TestResults = r;
}
- void SetCTest(cmCTest* ctest) { this->CTest = ctest; }
-
- void SetTestHandler(cmCTestTestHandler* handler)
- {
- this->TestHandler = handler;
- }
-
cmCTestTestHandler* GetTestHandler() { return this->TestHandler; }
void SetRepeatMode(cmCTest::Repeat mode, int count)
@@ -99,14 +96,14 @@ public:
void SetQuiet(bool b) { this->Quiet = b; }
- void CheckResourcesAvailable();
+ void CheckResourceAvailability();
protected:
// Start the next test or tests as many as are allowed by
// ParallelLevel
void StartNextTests();
- bool StartTestProcess(int test);
- bool StartTest(int test);
+ void StartTestProcess(int test);
+ void StartTest(int test);
// Mark the checkpoint for the given test
void WriteCheckpoint(int index);
@@ -124,10 +121,10 @@ protected:
// Removes the checkpoint file
void MarkFinished();
- void EraseTest(int index);
void FinishTestProcess(std::unique_ptr<cmCTestRunTest> runner, bool started);
- static void OnTestLoadRetryCB(uv_timer_t* timer);
+ void StartNextTestsOnIdle();
+ void StartNextTestsOnTimer();
void RemoveTest(int index);
// Check if we need to resume an interrupted test set
@@ -143,70 +140,94 @@ protected:
bool CheckStopTimePassed();
void SetStopTimePassed();
+ void InitializeLoop();
+ void FinalizeLoop();
+
+ bool ResourceLocksAvailable(int test);
void LockResources(int index);
void UnlockResources(int index);
- enum class ResourceAllocationError
+ enum class ResourceAvailabilityError
{
NoResourceType,
InsufficientResources,
};
+ bool Complete();
bool AllocateResources(int index);
bool TryAllocateResources(
int index,
std::map<std::string, std::vector<cmCTestBinPackerAllocation>>&
allocations,
- std::map<std::string, ResourceAllocationError>* errors = nullptr);
+ std::map<std::string, ResourceAvailabilityError>* errors = nullptr);
void DeallocateResources(int index);
bool AllResourcesAvailable();
bool InitResourceAllocator(std::string& error);
bool CheckGeneratedResourceSpec();
+private:
+ cmCTest* CTest;
+ cmCTestTestHandler* TestHandler;
+
bool UseResourceSpec = false;
cmCTestResourceSpec ResourceSpec;
std::string ResourceSpecFile;
std::string ResourceSpecSetupFixture;
cm::optional<std::size_t> ResourceSpecSetupTest;
- bool HasInvalidGeneratedResourceSpec;
+ bool HasInvalidGeneratedResourceSpec = false;
- // map from test number to set of depend tests
- TestMap Tests;
- TestList SortedTests;
+ // Tests pending selection to start. They may have dependencies.
+ TestMap PendingTests;
+ // List of pending test indexes, ordered by cost.
+ std::list<int> OrderedTests;
// Total number of tests we'll be running
- size_t Total;
+ size_t Total = 0;
// Number of tests that are complete
- size_t Completed;
- size_t RunningCount;
+ size_t Completed = 0;
+ size_t RunningCount = 0;
std::set<size_t> ProcessorsAvailable;
size_t HaveAffinity;
bool StopTimePassed = false;
// list of test properties (indices concurrent to the test map)
PropertiesMap Properties;
- std::map<int, bool> TestRunningMap;
- std::map<int, bool> TestFinishMap;
std::map<int, std::string> TestOutput;
std::vector<std::string>* Passed;
std::vector<std::string>* Failed;
std::vector<std::string> LastTestsFailed;
- std::set<std::string> LockedResources;
+ std::set<std::string> ProjectResourcesLocked;
std::map<int,
std::vector<std::map<std::string, std::vector<ResourceAllocation>>>>
AllocatedResources;
- std::map<int, std::map<std::string, ResourceAllocationError>>
- ResourceAllocationErrors;
+ std::map<int, std::map<std::string, ResourceAvailabilityError>>
+ ResourceAvailabilityErrors;
cmCTestResourceAllocator ResourceAllocator;
std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults;
- size_t ParallelLevel; // max number of process that can be run at once
- unsigned long TestLoad;
- unsigned long FakeLoadForTesting;
- uv_loop_t Loop;
- cm::uv_timer_ptr TestLoadRetryTimer;
- cmCTestTestHandler* TestHandler;
- cmCTest* CTest;
- bool HasCycles;
+
+ // Get the maximum number of processors that may be used at once.
+ size_t GetParallelLevel() const;
+
+ // With no '-j' option, default to serial testing.
+ cm::optional<size_t> ParallelLevel = 1;
+
+ // Fallback parallelism limit when '-j' is given with no value.
+ size_t ParallelLevelDefault;
+
+ // 'make' jobserver client. If connected, we acquire a token
+ // for each test before running its process.
+ cm::optional<cmUVJobServerClient> JobServerClient;
+ // List of tests that are queued to run when a token is available.
+ std::list<int> JobServerQueuedTests;
+ // Callback invoked when a token is received.
+ void JobServerReceivedToken();
+
+ unsigned long TestLoad = 0;
+ unsigned long FakeLoadForTesting = 0;
+ cm::uv_loop_ptr Loop;
+ cm::uv_idle_ptr StartNextTestsOnIdle_;
+ cm::uv_timer_ptr StartNextTestsOnTimer_;
+ bool HasCycles = false;
cmCTest::Repeat RepeatMode = cmCTest::Repeat::Never;
int RepeatCount = 1;
- bool Quiet;
- bool SerialTestRunning;
+ bool Quiet = false;
+ bool SerialTestRunning = false;
};
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 0e002b9..20bd0ec 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -149,17 +149,16 @@ cmCTestP4::User cmCTestP4::GetUserData(const std::string& username)
auto it = this->Users.find(username);
if (it == this->Users.end()) {
- std::vector<char const*> p4_users;
+ std::vector<std::string> p4_users;
this->SetP4Options(p4_users);
- p4_users.push_back("users");
- p4_users.push_back("-m");
- p4_users.push_back("1");
- p4_users.push_back(username.c_str());
- p4_users.push_back(nullptr);
+ p4_users.emplace_back("users");
+ p4_users.emplace_back("-m");
+ p4_users.emplace_back("1");
+ p4_users.push_back(username);
UserParser out(this, "users-out> ");
OutputLogger err(this->Log, "users-err> ");
- this->RunChild(p4_users.data(), &out, &err);
+ this->RunChild(p4_users, &out, &err);
// The user should now be added to the map. Search again.
it = this->Users.find(username);
@@ -303,10 +302,10 @@ private:
}
};
-void cmCTestP4::SetP4Options(std::vector<char const*>& CommandOptions)
+void cmCTestP4::SetP4Options(std::vector<std::string>& CommandOptions)
{
if (this->P4Options.empty()) {
- const char* p4 = this->CommandLineTool.c_str();
+ std::string p4 = this->CommandLineTool;
this->P4Options.emplace_back(p4);
// The CTEST_P4_CLIENT variable sets the P4 client used when issuing
@@ -328,31 +327,27 @@ void cmCTestP4::SetP4Options(std::vector<char const*>& CommandOptions)
cm::append(this->P4Options, cmSystemTools::ParseArguments(opts));
}
- CommandOptions.clear();
- for (std::string const& o : this->P4Options) {
- CommandOptions.push_back(o.c_str());
- }
+ CommandOptions = this->P4Options;
}
std::string cmCTestP4::GetWorkingRevision()
{
- std::vector<char const*> p4_identify;
+ std::vector<std::string> p4_identify;
this->SetP4Options(p4_identify);
- p4_identify.push_back("changes");
- p4_identify.push_back("-m");
- p4_identify.push_back("1");
- p4_identify.push_back("-t");
+ p4_identify.emplace_back("changes");
+ p4_identify.emplace_back("-m");
+ p4_identify.emplace_back("1");
+ p4_identify.emplace_back("-t");
std::string source = this->SourceDirectory + "/...#have";
- p4_identify.push_back(source.c_str());
- p4_identify.push_back(nullptr);
+ p4_identify.push_back(source);
std::string rev;
IdentifyParser out(this, "p4_changes-out> ", rev);
OutputLogger err(this->Log, "p4_changes-err> ");
- bool result = this->RunChild(p4_identify.data(), &out, &err);
+ bool result = this->RunChild(p4_identify, &out, &err);
// If there was a problem contacting the server return "<unknown>"
if (!result) {
@@ -388,7 +383,7 @@ bool cmCTestP4::NoteNewRevision()
bool cmCTestP4::LoadRevisions()
{
- std::vector<char const*> p4_changes;
+ std::vector<std::string> p4_changes;
this->SetP4Options(p4_changes);
// Use 'p4 changes ...@old,new' to get a list of changelists
@@ -408,52 +403,49 @@ bool cmCTestP4::LoadRevisions()
.append(",")
.append(this->NewRevision);
- p4_changes.push_back("changes");
- p4_changes.push_back(range.c_str());
- p4_changes.push_back(nullptr);
+ p4_changes.emplace_back("changes");
+ p4_changes.push_back(range);
ChangesParser out(this, "p4_changes-out> ");
OutputLogger err(this->Log, "p4_changes-err> ");
this->ChangeLists.clear();
- this->RunChild(p4_changes.data(), &out, &err);
+ this->RunChild(p4_changes, &out, &err);
if (this->ChangeLists.empty()) {
return true;
}
// p4 describe -s ...@1111111,2222222
- std::vector<char const*> p4_describe;
+ std::vector<std::string> p4_describe;
for (std::string const& i : cmReverseRange(this->ChangeLists)) {
this->SetP4Options(p4_describe);
- p4_describe.push_back("describe");
- p4_describe.push_back("-s");
- p4_describe.push_back(i.c_str());
- p4_describe.push_back(nullptr);
+ p4_describe.emplace_back("describe");
+ p4_describe.emplace_back("-s");
+ p4_describe.push_back(i);
DescribeParser outDescribe(this, "p4_describe-out> ");
OutputLogger errDescribe(this->Log, "p4_describe-err> ");
- this->RunChild(p4_describe.data(), &outDescribe, &errDescribe);
+ this->RunChild(p4_describe, &outDescribe, &errDescribe);
}
return true;
}
bool cmCTestP4::LoadModifications()
{
- std::vector<char const*> p4_diff;
+ std::vector<std::string> p4_diff;
this->SetP4Options(p4_diff);
- p4_diff.push_back("diff");
+ p4_diff.emplace_back("diff");
// Ideally we would use -Od but not all clients support it
- p4_diff.push_back("-dn");
+ p4_diff.emplace_back("-dn");
std::string source = this->SourceDirectory + "/...";
- p4_diff.push_back(source.c_str());
- p4_diff.push_back(nullptr);
+ p4_diff.push_back(source);
DiffParser out(this, "p4_diff-out> ");
OutputLogger err(this->Log, "p4_diff-err> ");
- this->RunChild(p4_diff.data(), &out, &err);
+ this->RunChild(p4_diff, &out, &err);
return true;
}
@@ -461,17 +453,14 @@ bool cmCTestP4::UpdateCustom(const std::string& custom)
{
cmList p4_custom_command{ custom, cmList::EmptyElements::Yes };
- std::vector<char const*> p4_custom;
- p4_custom.reserve(p4_custom_command.size() + 1);
- for (std::string const& i : p4_custom_command) {
- p4_custom.push_back(i.c_str());
- }
- p4_custom.push_back(nullptr);
+ std::vector<std::string> p4_custom;
+ p4_custom.reserve(p4_custom_command.size());
+ cm::append(p4_custom, p4_custom_command);
OutputLogger custom_out(this->Log, "p4_customsync-out> ");
OutputLogger custom_err(this->Log, "p4_customsync-err> ");
- return this->RunUpdateCommand(p4_custom.data(), &custom_out, &custom_err);
+ return this->RunUpdateCommand(p4_custom, &custom_out, &custom_err);
}
bool cmCTestP4::UpdateImpl()
@@ -488,10 +477,10 @@ bool cmCTestP4::UpdateImpl()
return false;
}
- std::vector<char const*> p4_sync;
+ std::vector<std::string> p4_sync;
this->SetP4Options(p4_sync);
- p4_sync.push_back("sync");
+ p4_sync.emplace_back("sync");
// Get user-specified update options.
std::string opts = this->CTest->GetCTestConfiguration("UpdateOptions");
@@ -499,9 +488,7 @@ bool cmCTestP4::UpdateImpl()
opts = this->CTest->GetCTestConfiguration("P4UpdateOptions");
}
std::vector<std::string> args = cmSystemTools::ParseArguments(opts);
- for (std::string const& arg : args) {
- p4_sync.push_back(arg.c_str());
- }
+ cm::append(p4_sync, args);
std::string source = this->SourceDirectory + "/...";
@@ -515,11 +502,10 @@ bool cmCTestP4::UpdateImpl()
source.append("@\"").append(date).append("\"");
}
- p4_sync.push_back(source.c_str());
- p4_sync.push_back(nullptr);
+ p4_sync.push_back(source);
OutputLogger out(this->Log, "p4_sync-out> ");
OutputLogger err(this->Log, "p4_sync-err> ");
- return this->RunUpdateCommand(p4_sync.data(), &out, &err);
+ return this->RunUpdateCommand(p4_sync, &out, &err);
}
diff --git a/Source/CTest/cmCTestP4.h b/Source/CTest/cmCTestP4.h
index 1889520..827caa1 100644
--- a/Source/CTest/cmCTestP4.h
+++ b/Source/CTest/cmCTestP4.h
@@ -39,7 +39,7 @@ private:
std::vector<std::string> P4Options;
User GetUserData(const std::string& username);
- void SetP4Options(std::vector<char const*>& options);
+ void SetP4Options(std::vector<std::string>& options);
std::string GetWorkingRevision();
bool NoteOldRevision() override;
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 8ceb9db..483b3b4 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -25,13 +25,17 @@
#include "cmProcess.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmUVHandlePtr.h"
#include "cmWorkingDirectory.h"
-cmCTestRunTest::cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler)
+cmCTestRunTest::cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler,
+ int index)
: MultiTestHandler(multiHandler)
+ , Index(index)
+ , CTest(MultiTestHandler.CTest)
+ , TestHandler(MultiTestHandler.TestHandler)
+ , TestProperties(MultiTestHandler.Properties[Index])
{
- this->CTest = multiHandler.CTest;
- this->TestHandler = multiHandler.TestHandler;
}
void cmCTestRunTest::CheckOutput(std::string const& line)
@@ -161,7 +165,7 @@ cmCTestRunTest::EndTestResult cmCTestRunTest::EndTest(size_t completed,
reason = "Invalid resource spec file";
forceFail = true;
} else {
- this->MultiTestHandler.CheckResourcesAvailable();
+ this->MultiTestHandler.CheckResourceAvailability();
}
}
std::ostringstream outputStream;
@@ -526,7 +530,7 @@ std::string cmCTestRunTest::GetTestPrefix(size_t completed, size_t total) const
return outputStream.str();
}
-bool cmCTestRunTest::StartTest(std::unique_ptr<cmCTestRunTest> runner,
+void cmCTestRunTest::StartTest(std::unique_ptr<cmCTestRunTest> runner,
size_t completed, size_t total)
{
auto* testRun = runner.get();
@@ -535,10 +539,7 @@ bool cmCTestRunTest::StartTest(std::unique_ptr<cmCTestRunTest> runner,
if (!testRun->StartTest(completed, total)) {
testRun->FinalizeTest(false);
- return false;
}
-
- return true;
}
// Starts the execution of a test. Returns once it has started
@@ -887,7 +888,7 @@ bool cmCTestRunTest::ForkProcess()
this->TestResult.Environment.erase(this->TestResult.Environment.length() -
1);
- return this->TestProcess->StartProcess(this->MultiTestHandler.Loop,
+ return this->TestProcess->StartProcess(*this->MultiTestHandler.Loop,
&this->TestProperties->Affinity);
}
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 34f23c4..71d0865 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -24,7 +24,7 @@
class cmCTestRunTest
{
public:
- explicit cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler);
+ explicit cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler, int index);
void SetNumberOfRuns(int n)
{
@@ -33,18 +33,12 @@ public:
}
void SetRepeatMode(cmCTest::Repeat r) { this->RepeatMode = r; }
- void SetTestProperties(cmCTestTestHandler::cmCTestTestProperties* prop)
- {
- this->TestProperties = prop;
- }
cmCTestTestHandler::cmCTestTestProperties* GetTestProperties()
{
return this->TestProperties;
}
- void SetIndex(int i) { this->Index = i; }
-
int GetIndex() { return this->Index; }
void AddFailedDependency(const std::string& failedTest)
@@ -62,7 +56,7 @@ public:
// Read and store output. Returns true if it must be called again.
void CheckOutput(std::string const& line);
- static bool StartTest(std::unique_ptr<cmCTestRunTest> runner,
+ static void StartTest(std::unique_ptr<cmCTestRunTest> runner,
size_t completed, size_t total);
static bool StartAgain(std::unique_ptr<cmCTestRunTest> runner,
size_t completed);
@@ -124,16 +118,15 @@ private:
// Returns "completed/total Test #Index: "
std::string GetTestPrefix(size_t completed, size_t total) const;
- cmCTestTestHandler::cmCTestTestProperties* TestProperties;
- // Pointer back to the "parent"; the handler that invoked this test run
- cmCTestTestHandler* TestHandler;
+ cmCTestMultiProcessHandler& MultiTestHandler;
+ int Index;
cmCTest* CTest;
+ cmCTestTestHandler* TestHandler;
+ cmCTestTestHandler::cmCTestTestProperties* TestProperties;
+
std::unique_ptr<cmProcess> TestProcess;
std::string ProcessOutput;
- // The test results
cmCTestTestHandler::cmCTestTestResult TestResult;
- cmCTestMultiProcessHandler& MultiTestHandler;
- int Index;
std::set<std::string> FailedDependencies;
std::string StartTime;
std::string ActualCommand;
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 91a1177..fc7051c 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -33,8 +33,8 @@ cmCTestSVN::~cmCTestSVN() = default;
void cmCTestSVN::CleanupImpl()
{
- std::vector<const char*> svn_cleanup;
- svn_cleanup.push_back("cleanup");
+ std::vector<std::string> svn_cleanup;
+ svn_cleanup.emplace_back("cleanup");
OutputLogger out(this->Log, "cleanup-out> ");
OutputLogger err(this->Log, "cleanup-err> ");
this->RunSVNCommand(svn_cleanup, &out, &err);
@@ -88,9 +88,9 @@ static bool cmCTestSVNPathStarts(std::string const& p1, std::string const& p2)
std::string cmCTestSVN::LoadInfo(SVNInfo& svninfo)
{
// Run "svn info" to get the repository info from the work tree.
- std::vector<const char*> svn_info;
- svn_info.push_back("info");
- svn_info.push_back(svninfo.LocalPath.c_str());
+ std::vector<std::string> svn_info;
+ svn_info.emplace_back("info");
+ svn_info.push_back(svninfo.LocalPath);
std::string rev;
InfoParser out(this, "info-out> ", rev, svninfo);
OutputLogger err(this->Log, "info-err> ");
@@ -251,43 +251,37 @@ bool cmCTestSVN::UpdateImpl()
args.push_back("-r{" + this->GetNightlyTime() + " +0000}");
}
- std::vector<char const*> svn_update;
- svn_update.push_back("update");
- for (std::string const& arg : args) {
- svn_update.push_back(arg.c_str());
- }
+ std::vector<std::string> svn_update;
+ svn_update.emplace_back("update");
+ cm::append(svn_update, args);
UpdateParser out(this, "up-out> ");
OutputLogger err(this->Log, "up-err> ");
return this->RunSVNCommand(svn_update, &out, &err);
}
-bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
+bool cmCTestSVN::RunSVNCommand(std::vector<std::string> const& parameters,
OutputParser* out, OutputParser* err)
{
if (parameters.empty()) {
return false;
}
- std::vector<char const*> args;
- args.push_back(this->CommandLineTool.c_str());
+ std::vector<std::string> args;
+ args.push_back(this->CommandLineTool);
cm::append(args, parameters);
- args.push_back("--non-interactive");
+ args.emplace_back("--non-interactive");
std::string userOptions = this->CTest->GetCTestConfiguration("SVNOptions");
std::vector<std::string> parsedUserOptions =
cmSystemTools::ParseArguments(userOptions);
- for (std::string const& opt : parsedUserOptions) {
- args.push_back(opt.c_str());
- }
-
- args.push_back(nullptr);
+ cm::append(args, parsedUserOptions);
- if (strcmp(parameters[0], "update") == 0) {
- return this->RunUpdateCommand(args.data(), out, err);
+ if (parameters[0] == "update") {
+ return this->RunUpdateCommand(args, out, err);
}
- return this->RunChild(args.data(), out, err);
+ return this->RunChild(args, out, err);
}
class cmCTestSVN::LogParser
@@ -393,12 +387,12 @@ bool cmCTestSVN::LoadRevisions(SVNInfo& svninfo)
}
// Run "svn log" to get all global revisions of interest.
- std::vector<const char*> svn_log;
- svn_log.push_back("log");
- svn_log.push_back("--xml");
- svn_log.push_back("-v");
- svn_log.push_back(revs.c_str());
- svn_log.push_back(svninfo.LocalPath.c_str());
+ std::vector<std::string> svn_log;
+ svn_log.emplace_back("log");
+ svn_log.emplace_back("--xml");
+ svn_log.emplace_back("-v");
+ svn_log.emplace_back(revs);
+ svn_log.emplace_back(svninfo.LocalPath);
LogParser out(this, "log-out> ", svninfo);
OutputLogger err(this->Log, "log-err> ");
return this->RunSVNCommand(svn_log, &out, &err);
@@ -472,8 +466,8 @@ private:
bool cmCTestSVN::LoadModifications()
{
// Run "svn status" which reports local modifications.
- std::vector<const char*> svn_status;
- svn_status.push_back("status");
+ std::vector<std::string> svn_status;
+ svn_status.emplace_back("status");
StatusParser out(this, "status-out> ");
OutputLogger err(this->Log, "status-err> ");
this->RunSVNCommand(svn_status, &out, &err);
@@ -534,8 +528,8 @@ bool cmCTestSVN::LoadRepositories()
this->RootInfo = &(this->Repositories.back());
// Run "svn status" to get the list of external repositories
- std::vector<const char*> svn_status;
- svn_status.push_back("status");
+ std::vector<std::string> svn_status;
+ svn_status.emplace_back("status");
ExternalParser out(this, "external-out> ");
OutputLogger err(this->Log, "external-err> ");
return this->RunSVNCommand(svn_status, &out, &err);
diff --git a/Source/CTest/cmCTestSVN.h b/Source/CTest/cmCTestSVN.h
index 370d176..1485dc0 100644
--- a/Source/CTest/cmCTestSVN.h
+++ b/Source/CTest/cmCTestSVN.h
@@ -33,7 +33,7 @@ private:
bool NoteNewRevision() override;
bool UpdateImpl() override;
- bool RunSVNCommand(std::vector<char const*> const& parameters,
+ bool RunSVNCommand(std::vector<std::string> const& parameters,
OutputParser* out, OutputParser* err);
// Information about an SVN repository (root repository or external)
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 461ad1a..2003ce6 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -11,8 +11,9 @@
#include <cm/memory>
+#include <cm3p/uv.h>
+
#include "cmsys/Directory.hxx"
-#include "cmsys/Process.h"
#include "cmCTest.h"
#include "cmCTestBuildCommand.h"
@@ -40,6 +41,8 @@
#include "cmStateSnapshot.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVProcessChain.h"
#include "cmValue.h"
#include "cmake.h"
@@ -148,66 +151,65 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
// now pass through all the other arguments
std::vector<std::string>& initArgs =
this->CTest->GetInitialCommandLineArguments();
- //*** need to make sure this does not have the current script ***
- for (size_t i = 1; i < initArgs.size(); ++i) {
- argv.push_back(initArgs[i].c_str());
- }
- argv.push_back(nullptr);
// Now create process object
- cmsysProcess* cp = cmsysProcess_New();
- cmsysProcess_SetCommand(cp, argv.data());
- // cmsysProcess_SetWorkingDirectory(cp, dir);
- cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
- // cmsysProcess_SetTimeout(cp, timeout);
- cmsysProcess_Execute(cp);
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand(initArgs)
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR);
+ auto process = builder.Start();
+ cm::uv_pipe_ptr outPipe;
+ outPipe.init(process.GetLoop(), 0);
+ uv_pipe_open(outPipe, process.OutputStream());
+ cm::uv_pipe_ptr errPipe;
+ errPipe.init(process.GetLoop(), 0);
+ uv_pipe_open(errPipe, process.ErrorStream());
std::vector<char> out;
std::vector<char> err;
std::string line;
- int pipe =
- cmSystemTools::WaitForLine(cp, line, std::chrono::seconds(100), out, err);
- while (pipe != cmsysProcess_Pipe_None) {
+ auto pipe =
+ cmSystemTools::WaitForLine(&process.GetLoop(), outPipe, errPipe, line,
+ std::chrono::seconds(100), out, err);
+ while (pipe != cmSystemTools::WaitForLineResult::None) {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Output: " << line << "\n");
- if (pipe == cmsysProcess_Pipe_STDERR) {
+ if (pipe == cmSystemTools::WaitForLineResult::STDERR) {
cmCTestLog(this->CTest, ERROR_MESSAGE, line << "\n");
- } else if (pipe == cmsysProcess_Pipe_STDOUT) {
+ } else if (pipe == cmSystemTools::WaitForLineResult::STDOUT) {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, line << "\n");
}
- pipe = cmSystemTools::WaitForLine(cp, line, std::chrono::seconds(100), out,
- err);
+ pipe =
+ cmSystemTools::WaitForLine(&process.GetLoop(), outPipe, errPipe, line,
+ std::chrono::seconds(100), out, err);
}
// Properly handle output of the build command
- cmsysProcess_WaitForExit(cp, nullptr);
- int result = cmsysProcess_GetState(cp);
+ process.Wait();
+ auto const& status = process.GetStatus(0);
+ auto result = status.GetException();
int retVal = 0;
bool failed = false;
- if (result == cmsysProcess_State_Exited) {
- retVal = cmsysProcess_GetExitValue(cp);
- } else if (result == cmsysProcess_State_Exception) {
- retVal = cmsysProcess_GetExitException(cp);
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "\tThere was an exception: "
- << cmsysProcess_GetExceptionString(cp) << " " << retVal
- << std::endl);
- failed = true;
- } else if (result == cmsysProcess_State_Expired) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "\tThere was a timeout" << std::endl);
- failed = true;
- } else if (result == cmsysProcess_State_Error) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "\tError executing ctest: " << cmsysProcess_GetErrorString(cp)
- << std::endl);
- failed = true;
+ switch (result.first) {
+ case cmUVProcessChain::ExceptionCode::None:
+ retVal = static_cast<int>(status.ExitStatus);
+ break;
+ case cmUVProcessChain::ExceptionCode::Spawn:
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "\tError executing ctest: " << result.second << std::endl);
+ failed = true;
+ break;
+ default:
+ retVal = status.TermSignal;
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "\tThere was an exception: " << result.second << " " << retVal
+ << std::endl);
+ failed = true;
}
- cmsysProcess_Delete(cp);
if (failed) {
std::ostringstream message;
message << "Error running command: [";
- message << result << "] ";
+ message << static_cast<int>(result.first) << "] ";
for (const char* arg : argv) {
if (arg) {
message << arg << " ";
@@ -561,10 +563,8 @@ int cmCTestScriptHandler::RunCurrentScript()
int cmCTestScriptHandler::CheckOutSourceDir()
{
- std::string command;
std::string output;
int retVal;
- bool res;
if (!cmSystemTools::FileExists(this->SourceDir) &&
!this->CVSCheckOut.empty()) {
@@ -572,7 +572,7 @@ int cmCTestScriptHandler::CheckOutSourceDir()
output.clear();
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Run cvs: " << this->CVSCheckOut << std::endl);
- res = cmSystemTools::RunSingleCommand(
+ bool res = cmSystemTools::RunSingleCommand(
this->CVSCheckOut, &output, &output, &retVal, this->CTestRoot.c_str(),
this->HandlerVerbose, cmDuration::zero() /*this->TimeOut*/);
if (!res || retVal != 0) {
@@ -585,8 +585,6 @@ int cmCTestScriptHandler::CheckOutSourceDir()
int cmCTestScriptHandler::BackupDirectories()
{
- int retVal;
-
// compute the backup names
this->BackupSourceDir = cmStrCat(this->SourceDir, "_CMakeBackup");
this->BackupBinaryDir = cmStrCat(this->BinaryDir, "_CMakeBackup");
@@ -606,7 +604,7 @@ int cmCTestScriptHandler::BackupDirectories()
rename(this->BinaryDir.c_str(), this->BackupBinaryDir.c_str());
// we must now checkout the src dir
- retVal = this->CheckOutSourceDir();
+ int retVal = this->CheckOutSourceDir();
if (retVal) {
this->RestoreBackupDirectories();
return retVal;
@@ -670,9 +668,11 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
// clear the binary directory?
if (this->EmptyBinDir) {
- if (!cmCTestScriptHandler::EmptyBinaryDirectory(this->BinaryDir)) {
+ std::string err;
+ if (!cmCTestScriptHandler::EmptyBinaryDirectory(this->BinaryDir, err)) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Problem removing the binary directory" << std::endl);
+ "Problem removing the binary directory ("
+ << err << "): " << this->BinaryDir << std::endl);
}
}
@@ -858,10 +858,12 @@ bool cmCTestScriptHandler::RunScript(cmCTest* ctest, cmMakefile* mf,
return true;
}
-bool cmCTestScriptHandler::EmptyBinaryDirectory(const std::string& sname)
+bool cmCTestScriptHandler::EmptyBinaryDirectory(const std::string& sname,
+ std::string& err)
{
// try to avoid deleting root
if (sname.size() < 2) {
+ err = "path too short";
return false;
}
@@ -874,20 +876,24 @@ bool cmCTestScriptHandler::EmptyBinaryDirectory(const std::string& sname)
std::string check = cmStrCat(sname, "/CMakeCache.txt");
if (!cmSystemTools::FileExists(check)) {
+ err = "path does not contain an existing CMakeCache.txt file";
return false;
}
+ cmsys::Status status;
for (int i = 0; i < 5; ++i) {
- if (TryToRemoveBinaryDirectoryOnce(sname)) {
+ status = TryToRemoveBinaryDirectoryOnce(sname);
+ if (status) {
return true;
}
cmSystemTools::Delay(100);
}
+ err = status.GetString();
return false;
}
-bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce(
+cmsys::Status cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce(
const std::string& directoryPath)
{
cmsys::Directory directory;
@@ -905,18 +911,18 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce(
bool isDirectory = cmSystemTools::FileIsDirectory(fullPath) &&
!cmSystemTools::FileIsSymlink(fullPath);
+ cmsys::Status status;
if (isDirectory) {
- if (!cmSystemTools::RemoveADirectory(fullPath)) {
- return false;
- }
+ status = cmSystemTools::RemoveADirectory(fullPath);
} else {
- if (!cmSystemTools::RemoveFile(fullPath)) {
- return false;
- }
+ status = cmSystemTools::RemoveFile(fullPath);
+ }
+ if (!status) {
+ return status;
}
}
- return static_cast<bool>(cmSystemTools::RemoveADirectory(directoryPath));
+ return cmSystemTools::RemoveADirectory(directoryPath);
}
cmDuration cmCTestScriptHandler::GetRemainingTimeAllowed()
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h
index b7764b2..8aa07e7 100644
--- a/Source/CTest/cmCTestScriptHandler.h
+++ b/Source/CTest/cmCTestScriptHandler.h
@@ -9,6 +9,8 @@
#include <string>
#include <vector>
+#include "cmsys/Status.hxx"
+
#include "cmCTestGenericHandler.h"
#include "cmDuration.h"
@@ -80,7 +82,7 @@ public:
/*
* Empty Binary Directory
*/
- static bool EmptyBinaryDirectory(const std::string& dir);
+ static bool EmptyBinaryDirectory(const std::string& dir, std::string& err);
/*
* Write an initial CMakeCache.txt from the given contents.
@@ -139,7 +141,8 @@ private:
std::unique_ptr<cmCTestCommand> command);
// Try to remove the binary directory once
- static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath);
+ static cmsys::Status TryToRemoveBinaryDirectoryOnce(
+ const std::string& directoryPath);
std::vector<std::string> ConfigurationScripts;
std::vector<bool> ScriptProcessScope;
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index a92f9f2..029f81f 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -55,6 +55,50 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
this->Makefile, "DropLocation", "CTEST_DROP_LOCATION", this->Quiet);
}
+ if (!this->CTest->SetCTestConfigurationFromCMakeVariable(
+ this->Makefile, "TLSVersion", "CTEST_TLS_VERSION", this->Quiet)) {
+ if (cmValue tlsVersionVar =
+ this->Makefile->GetDefinition("CMAKE_TLS_VERSION")) {
+ cmCTestOptionalLog(
+ this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "SetCTestConfiguration from CMAKE_TLS_VERSION:TLSVersion:"
+ << *tlsVersionVar << std::endl,
+ this->Quiet);
+ this->CTest->SetCTestConfiguration("TLSVersion", *tlsVersionVar,
+ this->Quiet);
+ } else if (cm::optional<std::string> tlsVersionEnv =
+ cmSystemTools::GetEnvVar("CMAKE_TLS_VERSION")) {
+ cmCTestOptionalLog(
+ this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "SetCTestConfiguration from ENV{CMAKE_TLS_VERSION}:TLSVersion:"
+ << *tlsVersionEnv << std::endl,
+ this->Quiet);
+ this->CTest->SetCTestConfiguration("TLSVersion", *tlsVersionEnv,
+ this->Quiet);
+ }
+ }
+ if (!this->CTest->SetCTestConfigurationFromCMakeVariable(
+ this->Makefile, "TLSVerify", "CTEST_TLS_VERIFY", this->Quiet)) {
+ if (cmValue tlsVerifyVar =
+ this->Makefile->GetDefinition("CMAKE_TLS_VERIFY")) {
+ cmCTestOptionalLog(
+ this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "SetCTestConfiguration from CMAKE_TLS_VERIFY:TLSVerify:"
+ << *tlsVerifyVar << std::endl,
+ this->Quiet);
+ this->CTest->SetCTestConfiguration("TLSVerify", *tlsVerifyVar,
+ this->Quiet);
+ } else if (cm::optional<std::string> tlsVerifyEnv =
+ cmSystemTools::GetEnvVar("CMAKE_TLS_VERIFY")) {
+ cmCTestOptionalLog(
+ this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "SetCTestConfiguration from ENV{CMAKE_TLS_VERIFY}:TLSVerify:"
+ << *tlsVerifyEnv << std::endl,
+ this->Quiet);
+ this->CTest->SetCTestConfiguration("TLSVerify", *tlsVerifyEnv,
+ this->Quiet);
+ }
+ }
this->CTest->SetCTestConfigurationFromCMakeVariable(
this->Makefile, "CurlOptions", "CTEST_CURL_OPTIONS", this->Quiet);
this->CTest->SetCTestConfigurationFromCMakeVariable(
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 77af889..e69a7fe 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -8,6 +8,7 @@
#include <sstream>
#include <cm/iomanip>
+#include <cm/optional>
#include <cmext/algorithm>
#include <cm3p/curl/curl.h>
@@ -22,7 +23,6 @@
#include "cmCurl.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
-#include "cmList.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -138,6 +138,20 @@ void cmCTestSubmitHandler::Initialize()
this->Files.clear();
}
+int cmCTestSubmitHandler::ProcessCommandLineArguments(
+ const std::string& currentArg, size_t& idx,
+ const std::vector<std::string>& allArgs, bool& validArg)
+{
+ if (cmHasLiteralPrefix(currentArg, "--http-header") &&
+ idx < allArgs.size() - 1) {
+ ++idx;
+ this->HttpHeaders.push_back(allArgs[idx]);
+ this->CommandLineHttpHeaders.push_back(allArgs[idx]);
+ validArg = true;
+ }
+ return 1;
+}
+
bool cmCTestSubmitHandler::SubmitUsingHTTP(
const std::string& localprefix, const std::vector<std::string>& files,
const std::string& remoteprefix, const std::string& url)
@@ -159,30 +173,32 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
/* In windows, this will init the winsock stuff */
::curl_global_init(CURL_GLOBAL_ALL);
- std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
- cmList args{ curlopt };
- bool verifyPeerOff = false;
- bool verifyHostOff = false;
- for (std::string const& arg : args) {
- if (arg == "CURLOPT_SSL_VERIFYPEER_OFF") {
- verifyPeerOff = true;
- }
- if (arg == "CURLOPT_SSL_VERIFYHOST_OFF") {
- verifyHostOff = true;
- }
- }
+ cmCTestCurlOpts curlOpts(this->CTest);
for (std::string const& file : files) {
/* get a curl handle */
curl = curl_easy_init();
if (curl) {
cmCurlSetCAInfo(curl);
- if (verifyPeerOff) {
+ if (curlOpts.TLSVersionOpt) {
+ cm::optional<std::string> tlsVersionStr =
+ cmCurlPrintTLSVersion(*curlOpts.TLSVersionOpt);
+ cmCTestOptionalLog(
+ this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " Set CURLOPT_SSLVERSION to "
+ << (tlsVersionStr ? *tlsVersionStr : "unknown value") << "\n",
+ this->Quiet);
+ curl_easy_setopt(curl, CURLOPT_SSLVERSION, *curlOpts.TLSVersionOpt);
+ }
+ if (curlOpts.TLSVerifyOpt) {
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " Set CURLOPT_SSL_VERIFYPEER to off\n",
+ " Set CURLOPT_SSL_VERIFYPEER to "
+ << (*curlOpts.TLSVerifyOpt ? "on" : "off")
+ << "\n",
this->Quiet);
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER,
+ *curlOpts.TLSVerifyOpt ? 1 : 0);
}
- if (verifyHostOff) {
+ if (curlOpts.VerifyHostOff) {
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Set CURLOPT_SSL_VERIFYHOST to off\n",
this->Quiet);
@@ -282,7 +298,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
upload_as += "&MD5=";
- if (cmIsOn(this->GetOption("InternalTest"))) {
+ if (this->GetOption("InternalTest").IsOn()) {
upload_as += "ffffffffffffffffffffffffffffffff";
} else {
cmCryptoHash hasher(cmCryptoHash::AlgoMD5);
@@ -505,9 +521,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
}
cmCTestCurl curl(this->CTest);
curl.SetQuiet(this->Quiet);
- std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
- cmList args{ curlopt };
- curl.SetCurlOptions(args);
auto submitInactivityTimeout = this->GetSubmitInactivityTimeout();
if (submitInactivityTimeout != 0) {
curl.SetTimeOutSeconds(submitInactivityTimeout);
@@ -527,7 +540,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
fields = url.substr(pos + 1);
url.erase(pos);
}
- bool internalTest = cmIsOn(this->GetOption("InternalTest"));
+ bool internalTest = this->GetOption("InternalTest").IsOn();
// Get RETRY_COUNT and RETRY_DELAY values if they were set.
std::string retryDelayString = *this->GetOption("RetryDelay");
diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h
index 0c7253c..d152b71 100644
--- a/Source/CTest/cmCTestSubmitHandler.h
+++ b/Source/CTest/cmCTestSubmitHandler.h
@@ -4,6 +4,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <cstddef>
#include <iosfwd>
#include <set>
#include <string>
@@ -33,6 +34,11 @@ public:
void Initialize() override;
+ //! Set all the submit arguments
+ int ProcessCommandLineArguments(const std::string& currentArg, size_t& idx,
+ const std::vector<std::string>& allArgs,
+ bool& validArg) override;
+
/** Specify a set of parts (by name) to submit. */
void SelectParts(std::set<cmCTest::Part> const& parts);
@@ -44,7 +50,12 @@ public:
void SetHttpHeaders(std::vector<std::string> const& v)
{
- this->HttpHeaders = v;
+ if (this->CommandLineHttpHeaders.empty()) {
+ this->HttpHeaders = v;
+ } else {
+ this->HttpHeaders = this->CommandLineHttpHeaders;
+ this->HttpHeaders.insert(this->HttpHeaders.end(), v.begin(), v.end());
+ }
}
private:
@@ -75,5 +86,6 @@ private:
bool HasWarnings;
bool HasErrors;
std::set<std::string> Files;
+ std::vector<std::string> CommandLineHttpHeaders;
std::vector<std::string> HttpHeaders;
};
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index c717868..98ce862 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -26,6 +26,8 @@ void cmCTestTestCommand::BindArguments()
this->Bind("INCLUDE"_s, this->Include);
this->Bind("EXCLUDE_LABEL"_s, this->ExcludeLabel);
this->Bind("INCLUDE_LABEL"_s, this->IncludeLabel);
+ this->Bind("EXCLUDE_FROM_FILE"_s, this->ExcludeTestsFromFile);
+ this->Bind("INCLUDE_FROM_FILE"_s, this->IncludeTestsFromFile);
this->Bind("EXCLUDE_FIXTURE"_s, this->ExcludeFixture);
this->Bind("EXCLUDE_FIXTURE_SETUP"_s, this->ExcludeFixtureSetup);
this->Bind("EXCLUDE_FIXTURE_CLEANUP"_s, this->ExcludeFixtureCleanup);
@@ -80,6 +82,14 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
if (!this->IncludeLabel.empty()) {
handler->AddMultiOption("LabelRegularExpression", this->IncludeLabel);
}
+
+ if (!this->ExcludeTestsFromFile.empty()) {
+ handler->SetOption("ExcludeTestListFile", this->ExcludeTestsFromFile);
+ }
+ if (!this->IncludeTestsFromFile.empty()) {
+ handler->SetOption("TestListFile", this->IncludeTestsFromFile);
+ }
+
if (!this->ExcludeFixture.empty()) {
handler->SetOption("ExcludeFixtureRegularExpression",
this->ExcludeFixture);
@@ -95,8 +105,8 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
if (this->StopOnFailure) {
handler->SetOption("StopOnFailure", "ON");
}
- if (!this->ParallelLevel.empty()) {
- handler->SetOption("ParallelLevel", this->ParallelLevel);
+ if (this->ParallelLevel) {
+ handler->SetOption("ParallelLevel", *this->ParallelLevel);
}
if (!this->Repeat.empty()) {
handler->SetOption("Repeat", this->Repeat);
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index 24e74e2..23661c5 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -8,7 +8,9 @@
#include <utility>
#include <cm/memory>
+#include <cm/optional>
+#include "cmArgumentParserTypes.h"
#include "cmCTestHandlerCommand.h"
#include "cmCommand.h"
@@ -51,10 +53,12 @@ protected:
std::string Include;
std::string ExcludeLabel;
std::string IncludeLabel;
+ std::string IncludeTestsFromFile;
+ std::string ExcludeTestsFromFile;
std::string ExcludeFixture;
std::string ExcludeFixtureSetup;
std::string ExcludeFixtureCleanup;
- std::string ParallelLevel;
+ cm::optional<ArgumentParser::Maybe<std::string>> ParallelLevel;
std::string Repeat;
std::string ScheduleRandom;
std::string StopTime;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index eb3b4dd..2018b73 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -345,6 +345,10 @@ void cmCTestTestHandler::Initialize()
this->ExcludeFixtureRegExp.clear();
this->ExcludeFixtureSetupRegExp.clear();
this->ExcludeFixtureCleanupRegExp.clear();
+ this->TestListFile.clear();
+ this->ExcludeTestListFile.clear();
+ this->TestsToRunByName.reset();
+ this->TestsToExcludeByName.reset();
this->TestsToRunString.clear();
this->UseUnion = false;
@@ -518,8 +522,8 @@ bool cmCTestTestHandler::ProcessOptions()
{
// Update internal data structure from generic one
this->SetTestsToRunInformation(this->GetOption("TestsToRunInformation"));
- this->SetUseUnion(cmIsOn(this->GetOption("UseUnion")));
- if (cmIsOn(this->GetOption("ScheduleRandom"))) {
+ this->SetUseUnion(this->GetOption("UseUnion").IsOn());
+ if (this->GetOption("ScheduleRandom").IsOn()) {
this->CTest->SetScheduleType("Random");
}
if (cmValue repeat = this->GetOption("Repeat")) {
@@ -546,9 +550,21 @@ bool cmCTestTestHandler::ProcessOptions()
return false;
}
}
- if (this->GetOption("ParallelLevel")) {
- this->CTest->SetParallelLevel(
- std::stoi(*this->GetOption("ParallelLevel")));
+ if (cmValue parallelLevel = this->GetOption("ParallelLevel")) {
+ if (parallelLevel.IsEmpty()) {
+ // An empty value tells ctest to choose a default.
+ this->CTest->SetParallelLevel(cm::nullopt);
+ } else {
+ // A non-empty value must be a non-negative integer.
+ unsigned long plevel = 0;
+ if (!cmStrToULong(*parallelLevel, &plevel)) {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "ParallelLevel invalid value: " << *parallelLevel
+ << std::endl);
+ return false;
+ }
+ this->CTest->SetParallelLevel(plevel);
+ }
}
if (this->GetOption("StopOnFailure")) {
@@ -585,7 +601,15 @@ bool cmCTestTestHandler::ProcessOptions()
if (val) {
this->ResourceSpecFile = *val;
}
- this->SetRerunFailed(cmIsOn(this->GetOption("RerunFailed")));
+ val = this->GetOption("TestListFile");
+ if (val) {
+ this->TestListFile = val;
+ }
+ val = this->GetOption("ExcludeTestListFile");
+ if (val) {
+ this->ExcludeTestListFile = val;
+ }
+ this->SetRerunFailed(this->GetOption("RerunFailed").IsOn());
return true;
}
@@ -910,7 +934,6 @@ bool cmCTestTestHandler::ComputeTestList()
// Now create a final list of tests to run
int cnt = 0;
inREcnt = 0;
- std::string last_directory;
ListOfTests finalList;
for (cmCTestTestProperties& tp : this->TestList) {
cnt++;
@@ -933,6 +956,21 @@ bool cmCTestTestHandler::ComputeTestList()
continue;
}
}
+
+ if (this->TestsToRunByName) {
+ if (this->TestsToRunByName->find(tp.Name) ==
+ this->TestsToRunByName->end()) {
+ continue;
+ }
+ }
+
+ if (this->TestsToExcludeByName) {
+ if (this->TestsToExcludeByName->find(tp.Name) !=
+ this->TestsToExcludeByName->end()) {
+ continue;
+ }
+ }
+
tp.Index = cnt; // save the index into the test list for this test
finalList.push_back(tp);
}
@@ -1334,10 +1372,9 @@ bool cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed,
this->StartTestTime = std::chrono::system_clock::now();
auto elapsed_time_start = std::chrono::steady_clock::now();
- auto parallel = cm::make_unique<cmCTestMultiProcessHandler>();
- parallel->SetCTest(this->CTest);
+ auto parallel =
+ cm::make_unique<cmCTestMultiProcessHandler>(this->CTest, this);
parallel->SetParallelLevel(this->CTest->GetParallelLevel());
- parallel->SetTestHandler(this);
if (this->RepeatMode != cmCTest::Repeat::Never) {
parallel->SetRepeatMode(this->RepeatMode, this->RepeatCount);
} else {
@@ -1381,15 +1418,17 @@ bool cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed,
}
}
}
- tests[p.Index] = depends;
+ tests[p.Index].Depends = depends;
properties[p.Index] = &p;
}
parallel->SetResourceSpecFile(this->ResourceSpecFile);
- parallel->SetTests(tests, properties);
+ if (!parallel->SetTests(std::move(tests), std::move(properties))) {
+ return false;
+ }
parallel->SetPassFailVectors(&passed, &failed);
this->TestResults.clear();
parallel->SetTestResults(&this->TestResults);
- parallel->CheckResourcesAvailable();
+ parallel->CheckResourceAvailability();
if (this->CTest->ShouldPrintLabels()) {
parallel->PrintLabels();
@@ -1818,6 +1857,21 @@ bool cmCTestTestHandler::GetListOfTests()
if (this->ResourceSpecFile.empty() && specFile) {
this->ResourceSpecFile = *specFile;
}
+
+ if (!this->TestListFile.empty()) {
+ this->TestsToRunByName = this->ReadTestListFile(this->TestListFile);
+ if (!this->TestsToRunByName) {
+ return false;
+ }
+ }
+ if (!this->ExcludeTestListFile.empty()) {
+ this->TestsToExcludeByName =
+ this->ReadTestListFile(this->ExcludeTestListFile);
+ if (!this->TestsToExcludeByName) {
+ return false;
+ }
+ }
+
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Done constructing a list of tests" << std::endl,
this->Quiet);
@@ -1986,6 +2040,29 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed()
}
}
+cm::optional<std::set<std::string>> cmCTestTestHandler::ReadTestListFile(
+ std::string const& testListFileName) const
+{
+ cm::optional<std::set<std::string>> result;
+ cmsys::ifstream ifs(testListFileName.c_str());
+ if (ifs) {
+ std::set<std::string> testNames;
+ std::string line;
+ while (cmSystemTools::GetLineFromStream(ifs, line)) {
+ if (!line.empty()) {
+ testNames.insert(line);
+ }
+ }
+ result = std::move(testNames);
+ } else {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Problem reading test list file: "
+ << testListFileName
+ << " while generating list of tests to run." << std::endl);
+ }
+ return result;
+}
+
void cmCTestTestHandler::RecordCustomTestMeasurements(cmXMLWriter& xml,
std::string content)
{
@@ -2233,7 +2310,7 @@ bool cmCTestTestHandler::SetTestsProperties(
} else if (key == "RESOURCE_LOCK"_s) {
cmList lval{ val };
- rt.LockedResources.insert(lval.begin(), lval.end());
+ rt.ProjectResources.insert(lval.begin(), lval.end());
} else if (key == "FIXTURES_SETUP"_s) {
cmList lval{ val };
@@ -2372,6 +2449,8 @@ bool cmCTestTestHandler::SetTestsProperties(
rt.TimeoutRegularExpressions.emplace_back(cr, cr);
}
}
+ } else {
+ rt.CustomProperties[key] = val;
}
}
}
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 23f0a76..dd1bc59 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -145,6 +145,7 @@ public:
std::vector<std::pair<cmsys::RegularExpression, std::string>>
TimeoutRegularExpressions;
std::map<std::string, std::string> Measurements;
+ std::map<std::string, std::string> CustomProperties;
bool IsInBasedOnREOptions = true;
bool WillFail = false;
bool Disabled = false;
@@ -165,7 +166,7 @@ public:
std::vector<std::string> Environment;
std::vector<std::string> EnvironmentModification;
std::vector<std::string> Labels;
- std::set<std::string> LockedResources;
+ std::set<std::string> ProjectResources; // RESOURCE_LOCK
std::set<std::string> FixturesSetup;
std::set<std::string> FixturesCleanup;
std::set<std::string> FixturesRequired;
@@ -341,6 +342,8 @@ private:
std::string GetTestStatus(cmCTestTestResult const&);
void ExpandTestsToRunInformation(size_t numPossibleTests);
void ExpandTestsToRunInformationForRerunFailed();
+ cm::optional<std::set<std::string>> ReadTestListFile(
+ std::string const& testListFileName) const;
std::vector<std::string> CustomPreTest;
std::vector<std::string> CustomPostTest;
@@ -359,6 +362,10 @@ private:
std::vector<cmsys::RegularExpression> ExcludeLabelRegularExpressions;
cmsys::RegularExpression IncludeTestsRegularExpression;
cmsys::RegularExpression ExcludeTestsRegularExpression;
+ std::string TestListFile;
+ std::string ExcludeTestListFile;
+ cm::optional<std::set<std::string>> TestsToRunByName;
+ cm::optional<std::set<std::string>> TestsToExcludeByName;
std::string ResourceSpecFile;
diff --git a/Source/CTest/cmCTestUploadHandler.cxx b/Source/CTest/cmCTestUploadHandler.cxx
index 9d92aad..59e2b88 100644
--- a/Source/CTest/cmCTestUploadHandler.cxx
+++ b/Source/CTest/cmCTestUploadHandler.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestUploadHandler.h"
+#include <chrono>
#include <ostream>
#include <string>
@@ -54,6 +55,7 @@ int cmCTestUploadHandler::ProcessHandler()
std::string("ctest-") + cmVersion::GetCMakeVersion());
this->CTest->AddSiteProperties(xml);
xml.StartElement("Upload");
+ xml.Element("Time", std::chrono::system_clock::now());
for (std::string const& file : this->Files) {
cmCTestOptionalLog(this->CTest, OUTPUT,
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index 609ccba..cbbb5a5 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -7,10 +7,9 @@
#include <sstream>
#include <vector>
-#include "cmsys/Process.h"
-
#include "cmCTest.h"
#include "cmSystemTools.h"
+#include "cmUVProcessChain.h"
#include "cmValue.h"
#include "cmXMLWriter.h"
@@ -55,18 +54,12 @@ bool cmCTestVC::InitialCheckout(const std::string& command)
// Construct the initial checkout command line.
std::vector<std::string> args = cmSystemTools::ParseArguments(command);
- std::vector<char const*> vc_co;
- vc_co.reserve(args.size() + 1);
- for (std::string const& arg : args) {
- vc_co.push_back(arg.c_str());
- }
- vc_co.push_back(nullptr);
// Run the initial checkout command and log its output.
this->Log << "--- Begin Initial Checkout ---\n";
OutputLogger out(this->Log, "co-out> ");
OutputLogger err(this->Log, "co-err> ");
- bool result = this->RunChild(vc_co.data(), &out, &err, parent.c_str());
+ bool result = this->RunChild(args, &out, &err, parent);
this->Log << "--- End Initial Checkout ---\n";
if (!result) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
@@ -75,35 +68,35 @@ bool cmCTestVC::InitialCheckout(const std::string& command)
return result;
}
-bool cmCTestVC::RunChild(char const* const* cmd, OutputParser* out,
- OutputParser* err, const char* workDir,
- Encoding encoding)
+bool cmCTestVC::RunChild(const std::vector<std::string>& cmd,
+ OutputParser* out, OutputParser* err,
+ std::string workDir, Encoding encoding)
{
this->Log << cmCTestVC::ComputeCommandLine(cmd) << "\n";
- cmsysProcess* cp = cmsysProcess_New();
- cmsysProcess_SetCommand(cp, cmd);
- workDir = workDir ? workDir : this->SourceDirectory.c_str();
- cmsysProcess_SetWorkingDirectory(cp, workDir);
- cmCTestVC::RunProcess(cp, out, err, encoding);
- int result = cmsysProcess_GetExitValue(cp);
- cmsysProcess_Delete(cp);
- return result == 0;
+ cmUVProcessChainBuilder builder;
+ if (workDir.empty()) {
+ workDir = this->SourceDirectory;
+ }
+ builder.AddCommand(cmd).SetWorkingDirectory(workDir);
+ auto status = cmCTestVC::RunProcess(builder, out, err, encoding);
+ return status.front().SpawnResult == 0 && status.front().ExitStatus == 0;
}
-std::string cmCTestVC::ComputeCommandLine(char const* const* cmd)
+std::string cmCTestVC::ComputeCommandLine(const std::vector<std::string>& cmd)
{
std::ostringstream line;
const char* sep = "";
- for (const char* const* arg = cmd; *arg; ++arg) {
- line << sep << "\"" << *arg << "\"";
+ for (auto const& arg : cmd) {
+ line << sep << "\"" << arg << "\"";
sep = " ";
}
return line.str();
}
-bool cmCTestVC::RunUpdateCommand(char const* const* cmd, OutputParser* out,
- OutputParser* err, Encoding encoding)
+bool cmCTestVC::RunUpdateCommand(const std::vector<std::string>& cmd,
+ OutputParser* out, OutputParser* err,
+ Encoding encoding)
{
// Report the command line.
this->UpdateCommandLine = this->ComputeCommandLine(cmd);
@@ -113,7 +106,7 @@ bool cmCTestVC::RunUpdateCommand(char const* const* cmd, OutputParser* out,
}
// Run the command.
- return this->RunChild(cmd, out, err, nullptr, encoding);
+ return this->RunChild(cmd, out, err, "", encoding);
}
std::string cmCTestVC::GetNightlyTime()
diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h
index 7b03d10..dd5456d 100644
--- a/Source/CTest/cmCTestVC.h
+++ b/Source/CTest/cmCTestVC.h
@@ -6,6 +6,7 @@
#include <iosfwd>
#include <string>
+#include <vector>
#include "cmProcessOutput.h"
#include "cmProcessTools.h"
@@ -108,15 +109,15 @@ protected:
};
/** Convert a list of arguments to a human-readable command line. */
- static std::string ComputeCommandLine(char const* const* cmd);
+ static std::string ComputeCommandLine(const std::vector<std::string>& cmd);
/** Run a command line and send output to given parsers. */
- bool RunChild(char const* const* cmd, OutputParser* out, OutputParser* err,
- const char* workDir = nullptr,
+ bool RunChild(const std::vector<std::string>& cmd, OutputParser* out,
+ OutputParser* err, std::string workDir = {},
Encoding encoding = cmProcessOutput::Auto);
/** Run VC update command line and send output to given parsers. */
- bool RunUpdateCommand(char const* const* cmd, OutputParser* out,
+ bool RunUpdateCommand(const std::vector<std::string>& cmd, OutputParser* out,
OutputParser* err = nullptr,
Encoding encoding = cmProcessOutput::Auto);
diff --git a/Source/CTest/cmUVJobServerClient.cxx b/Source/CTest/cmUVJobServerClient.cxx
new file mode 100644
index 0000000..d7d76c9
--- /dev/null
+++ b/Source/CTest/cmUVJobServerClient.cxx
@@ -0,0 +1,518 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmUVJobServerClient.h"
+
+#include <cassert>
+#include <utility>
+
+#ifndef _WIN32
+# include <cstdio>
+# include <string>
+# include <vector>
+
+# include <fcntl.h>
+# include <unistd.h>
+#endif
+
+#include <cm/memory>
+#include <cm/optional>
+#include <cm/string_view>
+
+#include "cmRange.h"
+#include "cmStringAlgorithms.h"
+#include "cmSystemTools.h"
+#include "cmUVHandlePtr.h"
+
+class cmUVJobServerClient::Impl
+{
+public:
+ uv_loop_t& Loop;
+
+ cm::uv_idle_ptr ImplicitToken;
+ std::function<void()> OnToken;
+ std::function<void(int)> OnDisconnect;
+
+ // The number of tokens held by this client.
+ unsigned int HeldTokens = 0;
+
+ // The number of tokens we need to receive from the job server.
+ unsigned int NeedTokens = 0;
+
+ Impl(uv_loop_t& loop);
+ virtual ~Impl();
+
+ virtual void SendToken() = 0;
+ virtual void StartReceivingTokens() = 0;
+ virtual void StopReceivingTokens() = 0;
+
+ void RequestToken();
+ void ReleaseToken();
+ void RequestExplicitToken();
+ void DecrementNeedTokens();
+ void HoldToken();
+ void RequestImplicitToken();
+ void ReleaseImplicitToken();
+ void ReceivedToken();
+ void Disconnected(int status);
+};
+
+cmUVJobServerClient::Impl::Impl(uv_loop_t& loop)
+ : Loop(loop)
+{
+ this->ImplicitToken.init(this->Loop, this);
+}
+
+cmUVJobServerClient::Impl::~Impl() = default;
+
+void cmUVJobServerClient::Impl::RequestToken()
+{
+ if (this->HeldTokens == 0 && !uv_is_active(this->ImplicitToken)) {
+ this->RequestImplicitToken();
+ } else {
+ this->RequestExplicitToken();
+ }
+}
+
+void cmUVJobServerClient::Impl::ReleaseToken()
+{
+ assert(this->HeldTokens > 0);
+ --this->HeldTokens;
+ if (this->HeldTokens == 0) {
+ // This was the token implicitly owned by our process.
+ this->ReleaseImplicitToken();
+ } else {
+ // This was a token we received from the job server. Send it back.
+ this->SendToken();
+ }
+}
+
+void cmUVJobServerClient::Impl::RequestExplicitToken()
+{
+ ++this->NeedTokens;
+ this->StartReceivingTokens();
+}
+
+void cmUVJobServerClient::Impl::DecrementNeedTokens()
+{
+ assert(this->NeedTokens > 0);
+ --this->NeedTokens;
+ if (this->NeedTokens == 0) {
+ this->StopReceivingTokens();
+ }
+}
+
+void cmUVJobServerClient::Impl::HoldToken()
+{
+ ++this->HeldTokens;
+ if (this->OnToken) {
+ this->OnToken();
+ } else {
+ this->ReleaseToken();
+ }
+}
+
+void cmUVJobServerClient::Impl::RequestImplicitToken()
+{
+ assert(this->HeldTokens == 0);
+ this->ImplicitToken.start([](uv_idle_t* handle) {
+ uv_idle_stop(handle);
+ auto* self = static_cast<Impl*>(handle->data);
+ self->HoldToken();
+ });
+}
+
+void cmUVJobServerClient::Impl::ReleaseImplicitToken()
+{
+ assert(this->HeldTokens == 0);
+ // Use the implicit token in place of receiving one from the job server.
+ if (this->NeedTokens > 0) {
+ this->DecrementNeedTokens();
+ this->RequestImplicitToken();
+ }
+}
+
+void cmUVJobServerClient::Impl::ReceivedToken()
+{
+ this->DecrementNeedTokens();
+ this->HoldToken();
+}
+
+void cmUVJobServerClient::Impl::Disconnected(int status)
+{
+ if (this->OnDisconnect) {
+ this->OnDisconnect(status);
+ }
+}
+
+//---------------------------------------------------------------------------
+// Implementation on POSIX platforms.
+// https://www.gnu.org/software/make/manual/html_node/POSIX-Jobserver.html
+
+#ifndef _WIN32
+namespace {
+class ImplPosix : public cmUVJobServerClient::Impl
+{
+public:
+ enum class Connection
+ {
+ None,
+ FDs,
+ FIFO,
+ };
+ Connection Conn = Connection::None;
+
+ cm::uv_pipe_ptr ConnRead;
+ cm::uv_pipe_ptr ConnWrite;
+ cm::uv_pipe_ptr ConnFIFO;
+
+ std::shared_ptr<std::function<void(int)>> OnWrite;
+
+ void Connect();
+ void ConnectFDs(int rfd, int wfd);
+ void ConnectFIFO(const char* path);
+ void Disconnect(int status);
+
+ cm::uv_pipe_ptr OpenFD(int fd);
+
+ uv_stream_t* GetWriter() const;
+ uv_stream_t* GetReader() const;
+
+ static void OnAllocateCB(uv_handle_t* handle, size_t suggested_size,
+ uv_buf_t* buf);
+ static void OnReadCB(uv_stream_t* stream, ssize_t nread,
+ const uv_buf_t* buf);
+
+ void OnAllocate(size_t suggested_size, uv_buf_t* buf);
+ void OnRead(ssize_t nread, const uv_buf_t* buf);
+
+ char ReadBuf = '.';
+
+ bool ReceivingTokens = false;
+
+ bool IsConnected() const;
+
+ void SendToken() override;
+ void StartReceivingTokens() override;
+ void StopReceivingTokens() override;
+
+ ImplPosix(uv_loop_t& loop);
+ ~ImplPosix() override;
+};
+
+ImplPosix::ImplPosix(uv_loop_t& loop)
+ : Impl(loop)
+ , OnWrite(std::make_shared<std::function<void(int)>>([this](int status) {
+ if (status != 0) {
+ this->Disconnect(status);
+ }
+ }))
+{
+ this->Connect();
+}
+
+ImplPosix::~ImplPosix()
+{
+ this->Disconnect(0);
+}
+
+void ImplPosix::Connect()
+{
+ // --jobserver-auth= for gnu make versions >= 4.2
+ // --jobserver-fds= for gnu make versions < 4.2
+ // -J for bsd make
+ static const std::vector<cm::string_view> prefixes = {
+ "--jobserver-auth=", "--jobserver-fds=", "-J"
+ };
+
+ cm::optional<std::string> makeflags = cmSystemTools::GetEnvVar("MAKEFLAGS");
+ if (!makeflags) {
+ return;
+ }
+
+ // Look for the *last* occurrence of jobserver flags.
+ cm::optional<std::string> auth;
+ std::vector<std::string> args;
+ cmSystemTools::ParseUnixCommandLine(makeflags->c_str(), args);
+ for (cm::string_view arg : cmReverseRange(args)) {
+ for (cm::string_view prefix : prefixes) {
+ if (cmHasPrefix(arg, prefix)) {
+ auth = cmTrimWhitespace(arg.substr(prefix.length()));
+ break;
+ }
+ }
+ if (auth) {
+ break;
+ }
+ }
+
+ if (!auth) {
+ return;
+ }
+
+ // fifo:PATH
+ if (cmHasLiteralPrefix(*auth, "fifo:")) {
+ ConnectFIFO(auth->substr(cmStrLen("fifo:")).c_str());
+ return;
+ }
+
+ // reader,writer
+ int reader;
+ int writer;
+ if (std::sscanf(auth->c_str(), "%d,%d", &reader, &writer) == 2) {
+ ConnectFDs(reader, writer);
+ }
+}
+
+cm::uv_pipe_ptr ImplPosix::OpenFD(int fd)
+{
+ // Create a CLOEXEC duplicate so `uv_pipe_ptr` can close it
+ // without closing the original file descriptor, which our
+ // child processes might want to use too.
+ cm::uv_pipe_ptr p;
+ int fd_dup = dup(fd);
+ if (fd_dup < 0) {
+ return p;
+ }
+ if (fcntl(fd_dup, F_SETFD, FD_CLOEXEC) == -1) {
+ close(fd_dup);
+ return p;
+ }
+ p.init(this->Loop, 0, this);
+ if (uv_pipe_open(p, fd_dup) < 0) {
+ close(fd_dup);
+ }
+ return p;
+}
+
+void ImplPosix::ConnectFDs(int rfd, int wfd)
+{
+ cm::uv_pipe_ptr connRead = this->OpenFD(rfd);
+ cm::uv_pipe_ptr connWrite = this->OpenFD(wfd);
+
+ // Verify that the read end is readable and the write end is writable.
+ if (!connRead || !uv_is_readable(connRead) || //
+ !connWrite || !uv_is_writable(connWrite)) {
+ return;
+ }
+
+ this->ConnRead = std::move(connRead);
+ this->ConnWrite = std::move(connWrite);
+ this->Conn = Connection::FDs;
+}
+
+void ImplPosix::ConnectFIFO(const char* path)
+{
+ int fd = open(path, O_RDWR);
+ if (fd < 0) {
+ return;
+ }
+
+ cm::uv_pipe_ptr connFIFO;
+ connFIFO.init(this->Loop, 0, this);
+ if (uv_pipe_open(connFIFO, fd) != 0) {
+ close(fd);
+ return;
+ }
+
+ // Verify that the fifo is both readable and writable.
+ if (!connFIFO || !uv_is_readable(connFIFO) || !uv_is_writable(connFIFO)) {
+ return;
+ }
+
+ this->ConnFIFO = std::move(connFIFO);
+ this->Conn = Connection::FIFO;
+}
+
+void ImplPosix::Disconnect(int status)
+{
+ if (this->Conn == Connection::None) {
+ return;
+ }
+
+ this->StopReceivingTokens();
+
+ switch (this->Conn) {
+ case Connection::FDs:
+ this->ConnRead.reset();
+ this->ConnWrite.reset();
+ break;
+ case Connection::FIFO:
+ this->ConnFIFO.reset();
+ break;
+ default:
+ break;
+ }
+
+ this->Conn = Connection::None;
+ if (status != 0) {
+ this->Disconnected(status);
+ }
+}
+
+uv_stream_t* ImplPosix::GetWriter() const
+{
+ switch (this->Conn) {
+ case Connection::FDs:
+ return this->ConnWrite;
+ case Connection::FIFO:
+ return this->ConnFIFO;
+ default:
+ return nullptr;
+ }
+}
+
+uv_stream_t* ImplPosix::GetReader() const
+{
+ switch (this->Conn) {
+ case Connection::FDs:
+ return this->ConnRead;
+ case Connection::FIFO:
+ return this->ConnFIFO;
+ default:
+ return nullptr;
+ }
+}
+
+void ImplPosix::OnAllocateCB(uv_handle_t* handle, size_t suggested_size,
+ uv_buf_t* buf)
+{
+ auto* self = static_cast<ImplPosix*>(handle->data);
+ self->OnAllocate(suggested_size, buf);
+}
+
+void ImplPosix::OnReadCB(uv_stream_t* stream, ssize_t nread,
+ const uv_buf_t* buf)
+{
+ auto* self = static_cast<ImplPosix*>(stream->data);
+ self->OnRead(nread, buf);
+}
+
+void ImplPosix::OnAllocate(size_t /*suggested_size*/, uv_buf_t* buf)
+{
+ *buf = uv_buf_init(&this->ReadBuf, 1);
+}
+
+void ImplPosix::OnRead(ssize_t nread, const uv_buf_t* /*buf*/)
+{
+ if (nread == 0) {
+ return;
+ }
+
+ if (nread < 0) {
+ auto status = static_cast<int>(nread);
+ this->Disconnect(status);
+ return;
+ }
+
+ assert(nread == 1);
+ this->ReceivedToken();
+}
+
+bool ImplPosix::IsConnected() const
+{
+ return this->Conn != Connection::None;
+}
+
+void ImplPosix::SendToken()
+{
+ if (this->Conn == Connection::None) {
+ return;
+ }
+
+ static char token = '.';
+
+ uv_buf_t const buf = uv_buf_init(&token, sizeof(token));
+ int status = cm::uv_write(this->GetWriter(), &buf, 1, this->OnWrite);
+ if (status != 0) {
+ this->Disconnect(status);
+ }
+}
+
+void ImplPosix::StartReceivingTokens()
+{
+ if (this->Conn == Connection::None) {
+ return;
+ }
+ if (this->ReceivingTokens) {
+ return;
+ }
+
+ int status = uv_read_start(this->GetReader(), &ImplPosix::OnAllocateCB,
+ &ImplPosix::OnReadCB);
+ if (status != 0) {
+ this->Disconnect(status);
+ return;
+ }
+
+ this->ReceivingTokens = true;
+}
+
+void ImplPosix::StopReceivingTokens()
+{
+ if (this->Conn == Connection::None) {
+ return;
+ }
+ if (!this->ReceivingTokens) {
+ return;
+ }
+
+ this->ReceivingTokens = false;
+ uv_read_stop(this->GetReader());
+}
+}
+#endif
+
+//---------------------------------------------------------------------------
+// Implementation of public interface.
+
+cmUVJobServerClient::cmUVJobServerClient(std::unique_ptr<Impl> impl)
+ : Impl_(std::move(impl))
+{
+}
+
+cmUVJobServerClient::~cmUVJobServerClient() = default;
+
+cmUVJobServerClient::cmUVJobServerClient(cmUVJobServerClient&&) noexcept =
+ default;
+cmUVJobServerClient& cmUVJobServerClient::operator=(
+ cmUVJobServerClient&&) noexcept = default;
+
+void cmUVJobServerClient::RequestToken()
+{
+ this->Impl_->RequestToken();
+}
+
+void cmUVJobServerClient::ReleaseToken()
+{
+ this->Impl_->ReleaseToken();
+}
+
+int cmUVJobServerClient::GetHeldTokens() const
+{
+ return this->Impl_->HeldTokens;
+}
+
+int cmUVJobServerClient::GetNeedTokens() const
+{
+ return this->Impl_->NeedTokens;
+}
+
+cm::optional<cmUVJobServerClient> cmUVJobServerClient::Connect(
+ uv_loop_t& loop, std::function<void()> onToken,
+ std::function<void(int)> onDisconnect)
+{
+#if defined(_WIN32)
+ // FIXME: Windows job server client not yet implemented.
+ static_cast<void>(loop);
+ static_cast<void>(onToken);
+ static_cast<void>(onDisconnect);
+#else
+ auto impl = cm::make_unique<ImplPosix>(loop);
+ if (impl && impl->IsConnected()) {
+ impl->OnToken = std::move(onToken);
+ impl->OnDisconnect = std::move(onDisconnect);
+ return cmUVJobServerClient(std::move(impl));
+ }
+#endif
+ return cm::nullopt;
+}
diff --git a/Source/CTest/cmUVJobServerClient.h b/Source/CTest/cmUVJobServerClient.h
new file mode 100644
index 0000000..bbb5f08
--- /dev/null
+++ b/Source/CTest/cmUVJobServerClient.h
@@ -0,0 +1,96 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#pragma once
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <functional>
+#include <memory>
+
+#include <cm/optional>
+
+#include <cm3p/uv.h>
+
+/** \class cmUVJobServerClient
+ * \brief Job server client that can integrate with a libuv event loop.
+ *
+ * Use the \a Connect method to connect to an ambient job server as
+ * described by the MAKEFLAGS environment variable, if any. Request
+ * a token using the \a RequestToken method. The \a onToken callback
+ * will be invoked asynchronously when the token is received. Act
+ * on the token, and then use \a ReleaseToken to release it.
+ *
+ * The job server protocol states that a client process implicitly
+ * has one free token available, corresponding to the token its
+ * parent used to start it. \a cmUVJobServerClient will use the
+ * implicit token whenever it is available instead of requesting
+ * an explicit token from the job server. However, clients of
+ * this class must still request and receive the token before
+ * acting on it, and cannot assume that it is always held.
+ *
+ * If the job server connection breaks, \a onDisconnect will be
+ * called with the libuv error. No further tokens can be received
+ * from the job server, but progress can still be made serially
+ * using the implicit token.
+ */
+class cmUVJobServerClient
+{
+public:
+ class Impl;
+
+private:
+ std::unique_ptr<Impl> Impl_;
+
+ cmUVJobServerClient(std::unique_ptr<Impl> impl);
+
+public:
+ /**
+ * Disconnect from the job server.
+ */
+ ~cmUVJobServerClient();
+
+ cmUVJobServerClient(cmUVJobServerClient&&) noexcept;
+ cmUVJobServerClient(cmUVJobServerClient const&) = delete;
+ cmUVJobServerClient& operator=(cmUVJobServerClient&&) noexcept;
+ cmUVJobServerClient& operator=(cmUVJobServerClient const&) = delete;
+
+ /**
+ * Request a token from the job server.
+ * When the token is held, the \a onToken callback will be invoked.
+ */
+ void RequestToken();
+
+ /**
+ * Release a token to the job server.
+ * This may be called only after a corresponding \a onToken callback.
+ */
+ void ReleaseToken();
+
+ /**
+ * Get the number of implicit and explicit tokens currently held.
+ * This is the number of times \a onToken has been called but not
+ * yet followed by a call to \a ReleaseToken.
+ * This is meant for testing and debugging.
+ */
+ int GetHeldTokens() const;
+
+ /**
+ * Get the number of explicit tokens currently requested from the
+ * job server but not yet received. If the implicit token becomes
+ * available, it is used in place of a requested token, and this
+ * is decremented without receiving an explicit token.
+ * This is meant for testing and debugging.
+ */
+ int GetNeedTokens() const;
+
+ /**
+ * Connect to an ambient job server, if any.
+ * \param loop The libuv event loop on which to schedule events.
+ * \param onToken Function to call when a new token is held.
+ * \param onDisconnect Function to call on disconnect, with libuv error.
+ * \returns Connected instance, or cm::nullopt.
+ */
+ static cm::optional<cmUVJobServerClient> Connect(
+ uv_loop_t& loop, std::function<void()> onToken,
+ std::function<void(int)> onDisconnect);
+};
diff --git a/Source/Checks/Curses/CMakeLists.txt b/Source/Checks/Curses/CMakeLists.txt
index bc6b906..5d0e240 100644
--- a/Source/Checks/Curses/CMakeLists.txt
+++ b/Source/Checks/Curses/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.13...3.26 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.13...3.28 FATAL_ERROR)
project(CheckCurses C)
set(CURSES_NEED_NCURSES TRUE)
diff --git a/Source/Checks/Curses/CheckCurses.c b/Source/Checks/Curses/CheckCurses.c
index 7d827e6..3264fa0 100644
--- a/Source/Checks/Curses/CheckCurses.c
+++ b/Source/Checks/Curses/CheckCurses.c
@@ -8,7 +8,7 @@
# include <curses.h>
#endif
-int main()
+int main(void)
{
curses_version();
return 0;
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 0262746..02ebaa6 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -43,7 +43,7 @@ function(cm_check_cxx_feature name)
# Filter out MSVC output that looks like a command-line warning.
string(REGEX REPLACE "[^\n]*warning D[0-9][0-9][0-9][0-9][^\n]*" "" check_output "${check_output}")
# Filter out warnings caused by user flags.
- string(REGEX REPLACE "[^\n]*warning:[^\n]*-Winvalid-command-line-argument[^\n]*" "" check_output "${check_output}")
+ string(REGEX REPLACE "[^\n]*warning:[^\n]*-W(invalid|unused)-command-line-argument[^\n]*" "" check_output "${check_output}")
# Filter out warnings caused by local configuration.
string(REGEX REPLACE "[^\n]*warning:[^\n]*directory not found for option[^\n]*" "" check_output "${check_output}")
string(REGEX REPLACE "[^\n]*warning:[^\n]*object file compiled with -mlong-branch which is no longer needed[^\n]*" "" check_output "${check_output}")
diff --git a/Source/Checks/cm_cxx_filesystem.cxx b/Source/Checks/cm_cxx_filesystem.cxx
index c8df589..bdc7c6d 100644
--- a/Source/Checks/cm_cxx_filesystem.cxx
+++ b/Source/Checks/cm_cxx_filesystem.cxx
@@ -9,12 +9,13 @@ int main()
std::filesystem::path p0(L"/a/b/c");
std::filesystem::path p1("/a/b/c");
- std::filesystem::path p2("/a/b/c");
- if (p1 != p2) {
+ std::filesystem::path p2("/a/b//c");
+ if (p1 != p2.lexically_normal()) {
return 1;
}
#if defined(_WIN32)
+ // "//host/" is not preserved in some environments like GNU under MinGW.
std::filesystem::path p3("//host/a/b/../c");
if (p3.lexically_normal().generic_string() != "//host/a/c") {
return 1;
@@ -24,6 +25,12 @@ int main()
if (p4.lexically_normal().generic_string() != "c:/a/") {
return 1;
}
+
+ std::filesystem::path b1("C:\\path\\y\\..\\");
+ if (std::filesystem::weakly_canonical("\\\\?\\C:\\path\\x\\..") !=
+ b1.lexically_normal()) {
+ return 1;
+ }
#endif
// If std::string is copy-on-write, the std::filesystem::path
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index 0b104ea..3a47485 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -54,7 +54,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
switch (state->GetCacheEntryType(key)) {
case cmStateEnums::BOOL: {
auto bw = cm::make_unique<cmCursesBoolWidget>(this->EntryWidth, 1, 1, 1);
- bw->SetValueAsBool(cmIsOn(*value));
+ bw->SetValueAsBool(value.IsOn());
this->Entry = std::move(bw);
break;
}
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 77a0048..72460f3 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -962,6 +962,11 @@ int cmCursesMainForm::LoadCache(const char* /*unused*/)
if (r < 0) {
return r;
}
+
+ // Process presets before loading the cache
+ this->CMakeInstance->ProcessPresetVariables();
+ this->CMakeInstance->ProcessPresetEnvironment();
+
this->CMakeInstance->SetCacheArgs(this->Args);
this->CMakeInstance->PreLoadCMakeFiles();
return r;
diff --git a/Source/LexerParser/cmCTestResourceGroupsLexer.cxx b/Source/LexerParser/cmCTestResourceGroupsLexer.cxx
index 85b379b..f1d351a 100644
--- a/Source/LexerParser/cmCTestResourceGroupsLexer.cxx
+++ b/Source/LexerParser/cmCTestResourceGroupsLexer.cxx
@@ -667,6 +667,10 @@ Modify cmCTestResourceGroupsLexer.cxx:
#include <cstddef>
+#ifndef _WIN32
+# include <termios.h>
+#endif
+
/*--------------------------------------------------------------------------*/
#define INITIAL 0
diff --git a/Source/LexerParser/cmCTestResourceGroupsLexer.in.l b/Source/LexerParser/cmCTestResourceGroupsLexer.in.l
index 2befa85..ac9cbaf 100644
--- a/Source/LexerParser/cmCTestResourceGroupsLexer.in.l
+++ b/Source/LexerParser/cmCTestResourceGroupsLexer.in.l
@@ -26,6 +26,10 @@ Modify cmCTestResourceGroupsLexer.cxx:
#include <cstddef>
+#ifndef _WIN32
+# include <termios.h>
+#endif
+
/*--------------------------------------------------------------------------*/
%}
diff --git a/Source/LexerParser/cmGccDepfileLexer.cxx b/Source/LexerParser/cmGccDepfileLexer.cxx
index ca5577e..d926c8b 100644
--- a/Source/LexerParser/cmGccDepfileLexer.cxx
+++ b/Source/LexerParser/cmGccDepfileLexer.cxx
@@ -548,8 +548,8 @@ static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 12
-#define YY_END_OF_BUFFER 13
+#define YY_NUM_RULES 13
+#define YY_END_OF_BUFFER 14
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -557,11 +557,12 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static const flex_int16_t yy_accept[31] =
+static const flex_int16_t yy_accept[32] =
{ 0,
- 0, 0, 13, 11, 9, 6, 11, 10, 11, 11,
- 11, 9, 0, 6, 10, 1, 8, 7, 0, 0,
- 5, 0, 3, 2, 0, 8, 0, 4, 0, 0
+ 0, 0, 14, 12, 10, 7, 12, 11, 12, 12,
+ 12, 10, 0, 7, 11, 1, 9, 8, 0, 0,
+ 6, 0, 4, 2, 3, 0, 9, 0, 5, 0,
+ 0
} ;
static const YY_CHAR yy_ec[256] =
@@ -601,40 +602,40 @@ static const YY_CHAR yy_meta[11] =
1, 2, 1, 1, 2, 1, 1, 1, 1, 3
} ;
-static const flex_int16_t yy_base[33] =
+static const flex_int16_t yy_base[34] =
{ 0,
- 0, 0, 36, 46, 25, 46, 31, 27, 18, 9,
+ 0, 0, 39, 46, 26, 46, 32, 28, 25, 9,
17, 15, 25, 46, 17, 46, 0, 46, 15, 27,
- 46, 14, 46, 46, 27, 46, 13, 46, 33, 46,
- 42, 13
+ 46, 14, 46, 46, 46, 27, 46, 13, 46, 33,
+ 46, 42, 13
} ;
-static const flex_int16_t yy_def[33] =
+static const flex_int16_t yy_def[34] =
{ 0,
- 30, 1, 30, 30, 31, 30, 30, 30, 30, 30,
- 30, 31, 30, 30, 30, 30, 32, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30, 30, 0,
- 30, 30
+ 31, 1, 31, 31, 32, 31, 31, 31, 31, 31,
+ 31, 32, 31, 31, 31, 31, 33, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
+ 0, 31, 31
} ;
static const flex_int16_t yy_nxt[57] =
{ 0,
4, 5, 6, 7, 5, 8, 4, 9, 10, 11,
- 17, 18, 19, 17, 17, 26, 21, 18, 20, 21,
- 22, 23, 15, 24, 13, 16, 25, 21, 22, 26,
- 27, 28, 15, 14, 13, 30, 29, 23, 30, 30,
- 30, 30, 25, 12, 12, 3, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30
+ 17, 18, 19, 17, 17, 27, 21, 18, 20, 21,
+ 22, 23, 15, 24, 13, 25, 26, 21, 22, 27,
+ 28, 29, 16, 15, 14, 13, 30, 23, 31, 31,
+ 31, 31, 26, 12, 12, 3, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31
} ;
static const flex_int16_t yy_chk[57] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 10, 10, 10, 10, 32, 27, 22, 19, 10, 11,
- 11, 11, 15, 11, 12, 9, 11, 13, 13, 20,
- 20, 25, 8, 7, 5, 3, 25, 29, 0, 0,
- 0, 0, 29, 31, 31, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30
+ 10, 10, 10, 10, 33, 28, 22, 19, 10, 11,
+ 11, 11, 15, 11, 12, 11, 11, 13, 13, 20,
+ 20, 26, 9, 8, 7, 5, 26, 30, 3, 0,
+ 0, 0, 30, 32, 32, 31, 31, 31, 31, 31,
+ 31, 31, 31, 31, 31, 31
} ;
/* The intent behind this definition is that it'll catch
@@ -930,7 +931,7 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 31 )
+ if ( yy_current_state >= 32 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -977,6 +978,13 @@ YY_RULE_SETUP
case 3:
YY_RULE_SETUP
{
+ // Unescape the colon.
+ yyextra->addToCurrentPath(":");
+ }
+ YY_BREAK
+case 4:
+YY_RULE_SETUP
+{
// 2N+1 backslashes plus space -> N backslashes plus space.
size_t c = (strlen(yytext) - 1) / 2;
std::string s(c, '\\');
@@ -984,7 +992,7 @@ YY_RULE_SETUP
yyextra->addToCurrentPath(s.c_str());
}
YY_BREAK
-case 4:
+case 5:
YY_RULE_SETUP
{
// 2N backslashes plus space -> 2N backslashes, end of filename.
@@ -993,24 +1001,24 @@ YY_RULE_SETUP
yyextra->newDependency();
}
YY_BREAK
-case 5:
-/* rule 5 can match eol */
+case 6:
+/* rule 6 can match eol */
YY_RULE_SETUP
{
// A line continuation ends the current file name.
yyextra->newRuleOrDependency();
}
YY_BREAK
-case 6:
-/* rule 6 can match eol */
+case 7:
+/* rule 7 can match eol */
YY_RULE_SETUP
{
// A newline ends the current file name and the current rule.
yyextra->newEntry();
}
YY_BREAK
-case 7:
-/* rule 7 can match eol */
+case 8:
+/* rule 8 can match eol */
YY_RULE_SETUP
{
// A colon ends the rules
@@ -1019,8 +1027,8 @@ YY_RULE_SETUP
yyextra->newEntry();
}
YY_BREAK
-case 8:
-/* rule 8 can match eol */
+case 9:
+/* rule 9 can match eol */
YY_RULE_SETUP
{
// A colon followed by space or line continuation ends the rules
@@ -1028,28 +1036,28 @@ YY_RULE_SETUP
yyextra->newDependency();
}
YY_BREAK
-case 9:
+case 10:
YY_RULE_SETUP
{
// Rules and dependencies are separated by blocks of whitespace.
yyextra->newRuleOrDependency();
}
YY_BREAK
-case 10:
+case 11:
YY_RULE_SETUP
{
// Got a span of plain text.
yyextra->addToCurrentPath(yytext);
}
YY_BREAK
-case 11:
+case 12:
YY_RULE_SETUP
{
// Got an otherwise unmatched character.
yyextra->addToCurrentPath(yytext);
}
YY_BREAK
-case 12:
+case 13:
YY_RULE_SETUP
ECHO;
YY_BREAK
@@ -1351,7 +1359,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 31 )
+ if ( yy_current_state >= 32 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -1380,11 +1388,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 31 )
+ if ( yy_current_state >= 32 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
- yy_is_jam = (yy_current_state == 30);
+ yy_is_jam = (yy_current_state == 31);
(void)yyg;
return yy_is_jam ? 0 : yy_current_state;
diff --git a/Source/LexerParser/cmGccDepfileLexer.in.l b/Source/LexerParser/cmGccDepfileLexer.in.l
index 6336b5f..a0a0f22 100644
--- a/Source/LexerParser/cmGccDepfileLexer.in.l
+++ b/Source/LexerParser/cmGccDepfileLexer.in.l
@@ -27,6 +27,10 @@ NEWLINE \r?\n
// Unescape the hash.
yyextra->addToCurrentPath("#");
}
+\\: {
+ // Unescape the colon.
+ yyextra->addToCurrentPath(":");
+ }
(\\\\)*\\[ ] {
// 2N+1 backslashes plus space -> N backslashes plus space.
size_t c = (strlen(yytext) - 1) / 2;
diff --git a/Source/Modules/CMakeBuildUtilities.cmake b/Source/Modules/CMakeBuildUtilities.cmake
index 21f04e6..4e7f0fe 100644
--- a/Source/Modules/CMakeBuildUtilities.cmake
+++ b/Source/Modules/CMakeBuildUtilities.cmake
@@ -287,6 +287,8 @@ else()
set(ENABLE_CPIO_SHARED OFF)
set(ENABLE_CAT OFF)
set(ENABLE_CAT_SHARED OFF)
+ set(ENABLE_UNZIP OFF)
+ set(ENABLE_UNZIP_SHARED OFF)
set(ENABLE_XATTR OFF)
set(ENABLE_ACL OFF)
set(ENABLE_ICONV OFF)
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index ab77818..2a6a831 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -875,7 +875,7 @@ bool CMakeSetupDialog::setupFirstConfigure()
if (preset.setToolset) {
dialog.setToolset(preset.toolset);
}
- dialog.setCompilerOption(CompilerOption::DefaultNative);
+ dialog.setCompilerOption(CompilerOption::DefaultPreset);
}
if (dialog.exec() == QDialog::Accepted) {
diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx
index a454cb6..2986e1f 100644
--- a/Source/QtDialog/FirstConfigure.cxx
+++ b/Source/QtDialog/FirstConfigure.cxx
@@ -159,6 +159,10 @@ void StartCompilerSetup::setCompilerOption(CompilerOption option)
{
std::size_t index = 0;
switch (option) {
+ case CompilerOption::DefaultPreset:
+ this->CompilerSetupOptions[0]->setText(
+ tr("Use default preset compilers"));
+ CM_FALLTHROUGH;
case CompilerOption::DefaultNative:
index = 0;
break;
diff --git a/Source/QtDialog/FirstConfigure.h b/Source/QtDialog/FirstConfigure.h
index 5844f3a..ea6fae6 100644
--- a/Source/QtDialog/FirstConfigure.h
+++ b/Source/QtDialog/FirstConfigure.h
@@ -24,6 +24,7 @@ enum FirstConfigurePages
enum class CompilerOption
{
+ DefaultPreset,
DefaultNative,
SpecifyNative,
ToolchainFile,
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index f43f05f..8d63f6d 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -378,6 +378,54 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
this->CMakeInstance->SaveCache(this->BinaryDirectory.toStdString());
}
+namespace {
+template <typename T>
+QCMakeProperty cache_to_property(const T& v)
+{
+ QCMakeProperty prop;
+ prop.Key = QString::fromStdString(v.first);
+ prop.Value = QString::fromStdString(v.second->Value);
+ prop.Type = QCMakeProperty::STRING;
+ if (!v.second->Type.empty()) {
+ auto type = cmState::StringToCacheEntryType(v.second->Type);
+ switch (type) {
+ case cmStateEnums::BOOL:
+ prop.Type = QCMakeProperty::BOOL;
+ prop.Value = cmIsOn(v.second->Value);
+ break;
+ case cmStateEnums::PATH:
+ prop.Type = QCMakeProperty::PATH;
+ break;
+ case cmStateEnums::FILEPATH:
+ prop.Type = QCMakeProperty::FILEPATH;
+ break;
+ default:
+ prop.Type = QCMakeProperty::STRING;
+ break;
+ }
+ }
+ return prop;
+}
+
+void add_to_property_list(QCMakePropertyList& list, QCMakeProperty&& prop)
+{
+ // QCMakeCacheModel prefers variables earlier in the list rather than
+ // later, so overwrite them if they already exist rather than simply
+ // appending
+ bool found = false;
+ for (auto& orig : list) {
+ if (orig.Key == prop.Key) {
+ orig = prop;
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ list.append(prop);
+ }
+}
+}
+
QCMakePropertyList QCMake::properties() const
{
QCMakePropertyList ret;
@@ -423,47 +471,21 @@ QCMakePropertyList QCMake::properties() const
auto const& p =
this->CMakePresetsGraph.ConfigurePresets.at(presetName).Expanded;
if (p) {
+ if (!p->ToolchainFile.empty()) {
+ using CacheVariable = cmCMakePresetsGraph::CacheVariable;
+ CacheVariable var{ "FILEPATH", p->ToolchainFile };
+ std::pair<std::string, cm::optional<CacheVariable>> value = {
+ "CMAKE_TOOLCHAIN_FILE", var
+ };
+ auto prop = cache_to_property(value);
+ add_to_property_list(ret, std::move(prop));
+ }
for (auto const& v : p->CacheVariables) {
if (!v.second) {
continue;
}
- QCMakeProperty prop;
- prop.Key = QString::fromStdString(v.first);
- prop.Value = QString::fromStdString(v.second->Value);
- prop.Type = QCMakeProperty::STRING;
- if (!v.second->Type.empty()) {
- auto type = cmState::StringToCacheEntryType(v.second->Type);
- switch (type) {
- case cmStateEnums::BOOL:
- prop.Type = QCMakeProperty::BOOL;
- prop.Value = cmIsOn(v.second->Value);
- break;
- case cmStateEnums::PATH:
- prop.Type = QCMakeProperty::PATH;
- break;
- case cmStateEnums::FILEPATH:
- prop.Type = QCMakeProperty::FILEPATH;
- break;
- default:
- prop.Type = QCMakeProperty::STRING;
- break;
- }
- }
-
- // QCMakeCacheModel prefers variables earlier in the list rather than
- // later, so overwrite them if they already exist rather than simply
- // appending
- bool found = false;
- for (auto& orig : ret) {
- if (orig.Key == prop.Key) {
- orig = prop;
- found = true;
- break;
- }
- }
- if (!found) {
- ret.append(prop);
- }
+ auto prop = cache_to_property(v);
+ add_to_property_list(ret, std::move(prop));
}
}
}
diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h
index 89068ab..549cca2 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -91,10 +91,6 @@ public slots:
const QString& description, const QVariant& value,
bool advanced);
- // set the view type
- void setViewType(ViewType t);
- ViewType viewType() const;
-
public:
// get the properties
QCMakePropertyList properties() const;
@@ -112,6 +108,10 @@ public:
// get the data in the model for this property
void getPropertyData(const QModelIndex& idx1, QCMakeProperty& prop) const;
+ // set the view type
+ void setViewType(ViewType t);
+ ViewType viewType() const;
+
protected:
bool EditEnabled;
int NewPropertyCount;
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index b1589ff..ea97287 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -189,8 +189,8 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
} else if (copy == keyDEPFILE) {
doing = doing_depfile;
if (!mf.GetGlobalGenerator()->SupportsCustomCommandDepfile()) {
- status.SetError("Option DEPFILE not supported by " +
- mf.GetGlobalGenerator()->GetName());
+ status.SetError(cmStrCat("Option DEPFILE not supported by ",
+ mf.GetGlobalGenerator()->GetName()));
return false;
}
} else if (copy == keyJOB_POOL) {
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 29fc09b..9113dfd 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -11,6 +11,7 @@
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
+#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmValue.h"
@@ -26,7 +27,7 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
// Library type defaults to value of BUILD_SHARED_LIBS, if it exists,
// otherwise it defaults to static library.
cmStateEnums::TargetType type = cmStateEnums::SHARED_LIBRARY;
- if (cmIsOff(mf.GetDefinition("BUILD_SHARED_LIBS"))) {
+ if (mf.GetDefinition("BUILD_SHARED_LIBS").IsOff()) {
type = cmStateEnums::STATIC_LIBRARY;
}
bool excludeFromAll = false;
@@ -226,14 +227,35 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
if ((type == cmStateEnums::SHARED_LIBRARY ||
type == cmStateEnums::MODULE_LIBRARY) &&
!mf.GetState()->GetGlobalPropertyAsBool("TARGET_SUPPORTS_SHARED_LIBS")) {
- mf.IssueMessage(
- MessageType::AUTHOR_WARNING,
- cmStrCat(
- "ADD_LIBRARY called with ",
- (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE"),
- " option but the target platform does not support dynamic linking. ",
- "Building a STATIC library instead. This may lead to problems."));
- type = cmStateEnums::STATIC_LIBRARY;
+ switch (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0164)) {
+ case cmPolicies::WARN:
+ mf.IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat(
+ "ADD_LIBRARY called with ",
+ (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE"),
+ " option but the target platform does not support dynamic "
+ "linking. ",
+ "Building a STATIC library instead. This may lead to problems."));
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ type = cmStateEnums::STATIC_LIBRARY;
+ break;
+ case cmPolicies::NEW:
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ mf.IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(
+ "ADD_LIBRARY called with ",
+ (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE"),
+ " option but the target platform does not support dynamic "
+ "linking."));
+ cmSystemTools::SetFatalErrorOccurred();
+ return false;
+ default:
+ break;
+ }
}
// Handle imported target creation.
diff --git a/Source/cmArgumentParserTypes.h b/Source/cmArgumentParserTypes.h
index 7daae09..3e0fae4 100644
--- a/Source/cmArgumentParserTypes.h
+++ b/Source/cmArgumentParserTypes.h
@@ -4,7 +4,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#if defined(__SUNPRO_CC)
+#if defined(__SUNPRO_CC) || defined(__EDG__)
# include <string>
# include <vector>
diff --git a/Source/cmBinUtilsMacOSMachOLinker.cxx b/Source/cmBinUtilsMacOSMachOLinker.cxx
index 90e0891..7db7cb0 100644
--- a/Source/cmBinUtilsMacOSMachOLinker.cxx
+++ b/Source/cmBinUtilsMacOSMachOLinker.cxx
@@ -126,10 +126,16 @@ bool cmBinUtilsMacOSMachOLinker::GetFileDependencies(
this->Archive->AddResolvedPath(filename, path, unique,
dep_file_info->rpaths);
- if (unique &&
- !this->ScanDependencies(path, dep_file_info->libs,
- dep_file_info->rpaths, executablePath)) {
- return false;
+ if (unique) {
+ std::vector<std::string> combinedParentRpaths =
+ dep_file_info->rpaths;
+ combinedParentRpaths.insert(combinedParentRpaths.end(),
+ rpaths.begin(), rpaths.end());
+ if (!this->ScanDependencies(path, dep_file_info->libs,
+ combinedParentRpaths,
+ executablePath)) {
+ return false;
+ }
}
}
} else {
diff --git a/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx
index d95da95..d54aa7d 100644
--- a/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx
+++ b/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx
@@ -44,7 +44,7 @@ bool cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool::GetFileInfo(
std::string line;
static const cmsys::RegularExpression regex(
- "^\t*DLL Name: ([^\n]*\\.[Dd][Ll][Ll])$");
+ "^[\t ]*DLL Name: ([^\n]*\\.[Dd][Ll][Ll])$");
cmUVPipeIStream output(process.GetLoop(), process.OutputStream());
while (cmSystemTools::GetLineFromStream(output, line)) {
cmsys::RegularExpressionMatch match;
diff --git a/Source/cmBlockCommand.cxx b/Source/cmBlockCommand.cxx
index 42f1ad3..5bf7bed 100644
--- a/Source/cmBlockCommand.cxx
+++ b/Source/cmBlockCommand.cxx
@@ -127,6 +127,10 @@ bool cmBlockFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
inStatus.SetContinueInvoked();
return true;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ return true;
+ }
if (cmSystemTools::GetFatalErrorOccurred()) {
return true;
}
diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx
index 0efb9a4..e4160a1 100644
--- a/Source/cmCMakeHostSystemInformationCommand.cxx
+++ b/Source/cmCMakeHostSystemInformationCommand.cxx
@@ -178,7 +178,7 @@ cm::optional<std::pair<std::string, std::string>> ParseOSReleaseLine(
if (std::isalpha(ch) || ch == '_') {
key += ch;
state = PARSE_KEY;
- } else if (!std::isspace(ch)) {
+ } else if (!cmIsSpace(ch)) {
state = IGNORE_REST;
}
break;
@@ -238,7 +238,7 @@ cm::optional<std::pair<std::string, std::string>> ParseOSReleaseLine(
break;
case PARSE_VALUE:
- if (ch == '#' || std::isspace(ch)) {
+ if (ch == '#' || cmIsSpace(ch)) {
state = IGNORE_REST;
} else {
value += ch;
@@ -270,7 +270,7 @@ std::map<std::string, std::string> GetOSReleaseVariables(
std::map<std::string, std::string> data;
// Based on
- // https://www.freedesktop.org/software/systemd/man/os-release.html
+ // https://www.freedesktop.org/software/systemd/man/latest/os-release.html
for (auto name : { "/etc/os-release"_s, "/usr/lib/os-release"_s }) {
const auto& filename = cmStrCat(sysroot, name);
if (cmSystemTools::FileExists(filename)) {
diff --git a/Source/cmCMakeLanguageCommand.cxx b/Source/cmCMakeLanguageCommand.cxx
index 329427c..fe9257e 100644
--- a/Source/cmCMakeLanguageCommand.cxx
+++ b/Source/cmCMakeLanguageCommand.cxx
@@ -345,27 +345,18 @@ bool cmCMakeLanguageCommandGET_EXPERIMENTAL_FEATURE_ENABLED(
auto const& featureName = expandedArgs[1];
auto const& variableName = expandedArgs[2];
- auto feature = cmExperimental::Feature::Sentinel;
- for (std::size_t i = 0;
- i < static_cast<std::size_t>(cmExperimental::Feature::Sentinel); i++) {
- if (cmExperimental::DataForFeature(static_cast<cmExperimental::Feature>(i))
- .Name == featureName) {
- feature = static_cast<cmExperimental::Feature>(i);
- break;
+ if (auto feature = cmExperimental::FeatureByName(featureName)) {
+ if (cmExperimental::HasSupportEnabled(makefile, *feature)) {
+ makefile.AddDefinition(variableName, "TRUE");
+ } else {
+ makefile.AddDefinition(variableName, "FALSE");
}
- }
- if (feature == cmExperimental::Feature::Sentinel) {
+ } else {
return FatalError(status,
cmStrCat("Experimental feature name \"", featureName,
"\" does not exist."));
}
- if (cmExperimental::HasSupportEnabled(makefile, feature)) {
- makefile.AddDefinition(variableName, "TRUE");
- } else {
- makefile.AddDefinition(variableName, "FALSE");
- }
-
return true;
}
}
@@ -398,6 +389,32 @@ bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args,
if (!moreArgs()) {
return FatalError(status, "called with incorrect number of arguments");
}
+ if (expArgs[expArg] == "EXIT"_s) {
+ ++expArg; // consume "EXIT".
+
+ if (!moreArgs()) {
+ return FatalError(status, "EXIT requires one argument");
+ }
+
+ auto workingMode =
+ status.GetMakefile().GetCMakeInstance()->GetWorkingMode();
+ if (workingMode != cmake::SCRIPT_MODE) {
+ return FatalError(status, "EXIT can be used only in SCRIPT mode");
+ }
+
+ long retCode = 0;
+
+ if (!cmStrToLong(expArgs[expArg], &retCode)) {
+ return FatalError(status,
+ cmStrCat("EXIT requires one integral argument, got \"",
+ expArgs[expArg], '\"'));
+ }
+
+ if (workingMode == cmake::SCRIPT_MODE) {
+ status.SetExitCode(static_cast<int>(retCode));
+ }
+ return true;
+ }
if (expArgs[expArg] == "SET_DEPENDENCY_PROVIDER"_s) {
finishArgs();
diff --git a/Source/cmCMakePresetsGraph.cxx b/Source/cmCMakePresetsGraph.cxx
index d37c8a4..008f2dd 100644
--- a/Source/cmCMakePresetsGraph.cxx
+++ b/Source/cmCMakePresetsGraph.cxx
@@ -10,6 +10,7 @@
#include <iterator>
#include <utility>
+#include <cm/memory>
#include <cm/string_view>
#include "cmsys/RegularExpression.hxx"
@@ -49,6 +50,11 @@ template <typename T>
using PresetPair = cmCMakePresetsGraph::PresetPair<T>;
using ExpandMacroResult = cmCMakePresetsGraphInternal::ExpandMacroResult;
using MacroExpander = cmCMakePresetsGraphInternal::MacroExpander;
+using MacroExpanderVector = cmCMakePresetsGraphInternal::MacroExpanderVector;
+using BaseMacroExpander = cmCMakePresetsGraphInternal::BaseMacroExpander;
+template <typename T>
+using PresetMacroExpander =
+ cmCMakePresetsGraphInternal::PresetMacroExpander<T>;
using cmCMakePresetsGraphInternal::ExpandMacros;
void InheritString(std::string& child, const std::string& parent)
@@ -203,13 +209,61 @@ bool IsValidMacroNamespace(const std::string& str)
}
ExpandMacroResult VisitEnv(std::string& value, CycleStatus& status,
- const std::vector<MacroExpander>& macroExpanders,
+ MacroExpanderVector const& macroExpanders,
int version);
+template <class T>
+class EnvironmentMacroExpander : public MacroExpander
+{
+ std::map<std::string, CycleStatus>& EnvCycles;
+ cm::optional<T>& Out;
+ MacroExpanderVector& MacroExpanders;
+
+public:
+ EnvironmentMacroExpander(MacroExpanderVector& macroExpanders,
+ cm::optional<T>& out,
+ std::map<std::string, CycleStatus>& envCycles)
+ : EnvCycles(envCycles)
+ , Out(out)
+ , MacroExpanders(macroExpanders)
+ {
+ }
+ ExpandMacroResult operator()(const std::string& macroNamespace,
+ const std::string& macroName,
+ std::string& macroOut,
+ int version) const override
+ {
+ if (macroNamespace == "env" && !macroName.empty() && Out) {
+ auto v = Out->Environment.find(macroName);
+ if (v != Out->Environment.end() && v->second) {
+ auto e =
+ VisitEnv(*v->second, EnvCycles[macroName], MacroExpanders, version);
+ if (e != ExpandMacroResult::Ok) {
+ return e;
+ }
+ macroOut += *v->second;
+ return ExpandMacroResult::Ok;
+ }
+ }
+
+ if (macroNamespace == "env" || macroNamespace == "penv") {
+ if (macroName.empty()) {
+ return ExpandMacroResult::Error;
+ }
+ if (cm::optional<std::string> value =
+ cmSystemTools::GetEnvVar(macroName)) {
+ macroOut += *value;
+ }
+ return ExpandMacroResult::Ok;
+ }
+
+ return ExpandMacroResult::Ignore;
+ }
+};
bool ExpandMacros(const cmCMakePresetsGraph& graph,
const ConfigurePreset& preset,
cm::optional<ConfigurePreset>& out,
- const std::vector<MacroExpander>& macroExpanders)
+ MacroExpanderVector const& macroExpanders)
{
std::string binaryDir = preset.BinaryDir;
CHECK_EXPAND(out, binaryDir, macroExpanders, graph.GetVersion(preset));
@@ -251,7 +305,7 @@ bool ExpandMacros(const cmCMakePresetsGraph& graph,
bool ExpandMacros(const cmCMakePresetsGraph& graph, const BuildPreset& preset,
cm::optional<BuildPreset>& out,
- const std::vector<MacroExpander>& macroExpanders)
+ MacroExpanderVector const& macroExpanders)
{
for (auto& target : out->Targets) {
CHECK_EXPAND(out, target, macroExpanders, graph.GetVersion(preset));
@@ -267,7 +321,7 @@ bool ExpandMacros(const cmCMakePresetsGraph& graph, const BuildPreset& preset,
bool ExpandMacros(const cmCMakePresetsGraph& graph, const TestPreset& preset,
cm::optional<TestPreset>& out,
- const std::vector<MacroExpander>& macroExpanders)
+ MacroExpanderVector const& macroExpanders)
{
for (auto& overwrite : out->OverwriteConfigurationFile) {
CHECK_EXPAND(out, overwrite, macroExpanders, graph.GetVersion(preset));
@@ -321,7 +375,7 @@ bool ExpandMacros(const cmCMakePresetsGraph& graph, const TestPreset& preset,
bool ExpandMacros(const cmCMakePresetsGraph& graph,
const PackagePreset& preset,
cm::optional<PackagePreset>& out,
- const std::vector<MacroExpander>& macroExpanders)
+ MacroExpanderVector const& macroExpanders)
{
for (auto& variable : out->Variables) {
CHECK_EXPAND(out, variable.second, macroExpanders,
@@ -343,7 +397,7 @@ bool ExpandMacros(const cmCMakePresetsGraph& graph,
bool ExpandMacros(const cmCMakePresetsGraph& /*graph*/,
const WorkflowPreset& /*preset*/,
cm::optional<WorkflowPreset>& /*out*/,
- const std::vector<MacroExpander>& /*macroExpanders*/)
+ MacroExpanderVector const& /*macroExpanders*/)
{
return true;
}
@@ -359,100 +413,13 @@ bool ExpandMacros(cmCMakePresetsGraph& graph, const T& preset,
envCycles[v.first] = CycleStatus::Unvisited;
}
- std::vector<MacroExpander> macroExpanders;
+ MacroExpanderVector macroExpanders{};
- MacroExpander defaultMacroExpander =
- [&graph, &preset](const std::string& macroNamespace,
- const std::string& macroName, std::string& macroOut,
- int version) -> ExpandMacroResult {
- if (macroNamespace.empty()) {
- if (macroName == "sourceDir") {
- macroOut += graph.SourceDir;
- return ExpandMacroResult::Ok;
- }
- if (macroName == "sourceParentDir") {
- macroOut += cmSystemTools::GetParentDirectory(graph.SourceDir);
- return ExpandMacroResult::Ok;
- }
- if (macroName == "sourceDirName") {
- macroOut += cmSystemTools::GetFilenameName(graph.SourceDir);
- return ExpandMacroResult::Ok;
- }
- if (macroName == "presetName") {
- macroOut += preset.Name;
- return ExpandMacroResult::Ok;
- }
- if (macroName == "generator") {
- // Generator only makes sense if preset is not hidden.
- if (!preset.Hidden) {
- macroOut += graph.GetGeneratorForPreset(preset.Name);
- }
- return ExpandMacroResult::Ok;
- }
- if (macroName == "dollar") {
- macroOut += '$';
- return ExpandMacroResult::Ok;
- }
- if (macroName == "hostSystemName") {
- if (version < 3) {
- return ExpandMacroResult::Error;
- }
- macroOut += cmSystemTools::GetSystemName();
- return ExpandMacroResult::Ok;
- }
- if (macroName == "fileDir") {
- if (version < 4) {
- return ExpandMacroResult::Error;
- }
- macroOut +=
- cmSystemTools::GetParentDirectory(preset.OriginFile->Filename);
- return ExpandMacroResult::Ok;
- }
- if (macroName == "pathListSep") {
- if (version < 5) {
- return ExpandMacroResult::Error;
- }
- macroOut += cmSystemTools::GetSystemPathlistSeparator();
- return ExpandMacroResult::Ok;
- }
- }
-
- return ExpandMacroResult::Ignore;
- };
-
- MacroExpander environmentMacroExpander =
- [&macroExpanders, &out, &envCycles](
- const std::string& macroNamespace, const std::string& macroName,
- std::string& result, int version) -> ExpandMacroResult {
- if (macroNamespace == "env" && !macroName.empty() && out) {
- auto v = out->Environment.find(macroName);
- if (v != out->Environment.end() && v->second) {
- auto e =
- VisitEnv(*v->second, envCycles[macroName], macroExpanders, version);
- if (e != ExpandMacroResult::Ok) {
- return e;
- }
- result += *v->second;
- return ExpandMacroResult::Ok;
- }
- }
-
- if (macroNamespace == "env" || macroNamespace == "penv") {
- if (macroName.empty()) {
- return ExpandMacroResult::Error;
- }
- if (cm::optional<std::string> value =
- cmSystemTools::GetEnvVar(macroName)) {
- result += *value;
- }
- return ExpandMacroResult::Ok;
- }
-
- return ExpandMacroResult::Ignore;
- };
-
- macroExpanders.push_back(defaultMacroExpander);
- macroExpanders.push_back(environmentMacroExpander);
+ macroExpanders.push_back(cm::make_unique<BaseMacroExpander>(graph));
+ macroExpanders.push_back(
+ cm::make_unique<PresetMacroExpander<T>>(graph, preset));
+ macroExpanders.push_back(cm::make_unique<EnvironmentMacroExpander<T>>(
+ macroExpanders, out, envCycles));
for (auto& v : out->Environment) {
if (v.second) {
@@ -490,7 +457,7 @@ bool ExpandMacros(cmCMakePresetsGraph& graph, const T& preset,
}
ExpandMacroResult VisitEnv(std::string& value, CycleStatus& status,
- const std::vector<MacroExpander>& macroExpanders,
+ MacroExpanderVector const& macroExpanders,
int version)
{
if (status == CycleStatus::Verified) {
@@ -511,8 +478,7 @@ ExpandMacroResult VisitEnv(std::string& value, CycleStatus& status,
}
ExpandMacroResult cmCMakePresetsGraphInternal::ExpandMacros(
- std::string& out, const std::vector<MacroExpander>& macroExpanders,
- int version)
+ std::string& out, MacroExpanderVector const& macroExpanders, int version)
{
std::string result;
std::string macroNamespace;
@@ -591,11 +557,11 @@ ExpandMacroResult cmCMakePresetsGraphInternal::ExpandMacros(
ExpandMacroResult cmCMakePresetsGraphInternal::ExpandMacro(
std::string& out, const std::string& macroNamespace,
- const std::string& macroName,
- const std::vector<MacroExpander>& macroExpanders, int version)
+ const std::string& macroName, MacroExpanderVector const& macroExpanders,
+ int version)
{
for (auto const& macroExpander : macroExpanders) {
- auto result = macroExpander(macroNamespace, macroName, out, version);
+ auto result = (*macroExpander)(macroNamespace, macroName, out, version);
if (result != ExpandMacroResult::Ignore) {
return result;
}
@@ -651,8 +617,56 @@ bool TryReachPresetFromWorkflow(
}
}
+ExpandMacroResult BaseMacroExpander::operator()(
+ const std::string& macroNamespace, const std::string& macroName,
+ std::string& macroOut, int version) const
+{
+ if (macroNamespace.empty()) {
+ if (macroName == "sourceDir") {
+ macroOut += Graph.SourceDir;
+ return ExpandMacroResult::Ok;
+ }
+ if (macroName == "sourceParentDir") {
+ macroOut += cmSystemTools::GetParentDirectory(Graph.SourceDir);
+ return ExpandMacroResult::Ok;
+ }
+ if (macroName == "sourceDirName") {
+ macroOut += cmSystemTools::GetFilenameName(Graph.SourceDir);
+ return ExpandMacroResult::Ok;
+ }
+ if (macroName == "dollar") {
+ macroOut += '$';
+ return ExpandMacroResult::Ok;
+ }
+ if (macroName == "hostSystemName") {
+ if (version < 3) {
+ return ExpandMacroResult::Error;
+ }
+ macroOut += cmSystemTools::GetSystemName();
+ return ExpandMacroResult::Ok;
+ }
+ // Enable fileDir macro expansion for non-preset expanders
+ if (macroName == "fileDir" && File) {
+ if (version < 4) {
+ return ExpandMacroResult::Error;
+ }
+ macroOut += cmSystemTools::GetParentDirectory(File.value());
+ return ExpandMacroResult::Ok;
+ }
+ if (macroName == "pathListSep") {
+ if (version < 5) {
+ return ExpandMacroResult::Error;
+ }
+ macroOut += cmSystemTools::GetSystemPathlistSeparator();
+ return ExpandMacroResult::Ok;
+ }
+ }
+
+ return ExpandMacroResult::Ignore;
+}
+
bool cmCMakePresetsGraphInternal::EqualsCondition::Evaluate(
- const std::vector<MacroExpander>& expanders, int version,
+ MacroExpanderVector const& expanders, int version,
cm::optional<bool>& out) const
{
std::string lhs = this->Lhs;
@@ -666,7 +680,7 @@ bool cmCMakePresetsGraphInternal::EqualsCondition::Evaluate(
}
bool cmCMakePresetsGraphInternal::InListCondition::Evaluate(
- const std::vector<MacroExpander>& expanders, int version,
+ MacroExpanderVector const& expanders, int version,
cm::optional<bool>& out) const
{
std::string str = this->String;
@@ -685,7 +699,7 @@ bool cmCMakePresetsGraphInternal::InListCondition::Evaluate(
}
bool cmCMakePresetsGraphInternal::MatchesCondition::Evaluate(
- const std::vector<MacroExpander>& expanders, int version,
+ MacroExpanderVector const& expanders, int version,
cm::optional<bool>& out) const
{
std::string str = this->String;
@@ -703,7 +717,7 @@ bool cmCMakePresetsGraphInternal::MatchesCondition::Evaluate(
}
bool cmCMakePresetsGraphInternal::AnyAllOfCondition::Evaluate(
- const std::vector<MacroExpander>& expanders, int version,
+ MacroExpanderVector const& expanders, int version,
cm::optional<bool>& out) const
{
for (auto const& condition : this->Conditions) {
@@ -729,7 +743,7 @@ bool cmCMakePresetsGraphInternal::AnyAllOfCondition::Evaluate(
}
bool cmCMakePresetsGraphInternal::NotCondition::Evaluate(
- const std::vector<MacroExpander>& expanders, int version,
+ MacroExpanderVector const& expanders, int version,
cm::optional<bool>& out) const
{
out.reset();
diff --git a/Source/cmCMakePresetsGraphInternal.h b/Source/cmCMakePresetsGraphInternal.h
index 5c76e0e..a67be21 100644
--- a/Source/cmCMakePresetsGraphInternal.h
+++ b/Source/cmCMakePresetsGraphInternal.h
@@ -11,6 +11,7 @@
#include "cmCMakePresetsGraph.h"
#include "cmJSONHelpers.h"
+#include "cmSystemTools.h"
#define CHECK_OK(expr) \
do { \
@@ -27,17 +28,25 @@ enum class ExpandMacroResult
Error,
};
-using MacroExpander = std::function<ExpandMacroResult(
- const std::string&, const std::string&, std::string&, int version)>;
+class MacroExpander
+{
+public:
+ virtual ExpandMacroResult operator()(const std::string& macroNamespace,
+ const std::string& macroName,
+ std::string& macroOut,
+ int version) const = 0;
+ virtual ~MacroExpander() = default;
+};
+using MacroExpanderVector = std::vector<std::unique_ptr<MacroExpander>>;
-ExpandMacroResult ExpandMacros(
- std::string& out, const std::vector<MacroExpander>& macroExpanders,
- int version);
+ExpandMacroResult ExpandMacros(std::string& out,
+ MacroExpanderVector const& macroExpanders,
+ int version);
ExpandMacroResult ExpandMacro(std::string& out,
const std::string& macroNamespace,
const std::string& macroName,
- const std::vector<MacroExpander>& macroExpanders,
+ MacroExpanderVector const& macroExpanders,
int version);
}
@@ -47,17 +56,79 @@ public:
virtual ~Condition() = default;
virtual bool Evaluate(
- const std::vector<cmCMakePresetsGraphInternal::MacroExpander>& expanders,
+ const cmCMakePresetsGraphInternal::MacroExpanderVector& expanders,
int version, cm::optional<bool>& out) const = 0;
virtual bool IsNull() const { return false; }
};
namespace cmCMakePresetsGraphInternal {
+class BaseMacroExpander : public MacroExpander
+{
+ cmCMakePresetsGraph const& Graph;
+ cm::optional<std::string> File;
+
+public:
+ BaseMacroExpander(const cmCMakePresetsGraph& graph)
+ : Graph(graph)
+ {
+ }
+ BaseMacroExpander(const cmCMakePresetsGraph& graph, const std::string& file)
+ : Graph(graph)
+ , File(file)
+ {
+ }
+ ExpandMacroResult operator()(const std::string& macroNamespace,
+ const std::string& macroName,
+ std::string& macroOut,
+ int version) const override;
+};
+
+template <class T>
+class PresetMacroExpander : public MacroExpander
+{
+ cmCMakePresetsGraph const& Graph;
+ T const& Preset;
+
+public:
+ PresetMacroExpander(const cmCMakePresetsGraph& graph, const T& preset)
+ : Graph(graph)
+ , Preset(preset)
+ {
+ }
+ ExpandMacroResult operator()(const std::string& macroNamespace,
+ const std::string& macroName,
+ std::string& macroOut,
+ int version) const override
+ {
+ if (macroNamespace.empty()) {
+ if (macroName == "presetName") {
+ macroOut += Preset.Name;
+ return ExpandMacroResult::Ok;
+ }
+ if (macroName == "generator") {
+ // Generator only makes sense if preset is not hidden.
+ if (!Preset.Hidden) {
+ macroOut += Graph.GetGeneratorForPreset(Preset.Name);
+ }
+ return ExpandMacroResult::Ok;
+ }
+ if (macroName == "fileDir") {
+ if (version < 4) {
+ return ExpandMacroResult::Error;
+ }
+ macroOut +=
+ cmSystemTools::GetParentDirectory(Preset.OriginFile->Filename);
+ return ExpandMacroResult::Ok;
+ }
+ }
+ return ExpandMacroResult::Ignore;
+ }
+};
class NullCondition : public cmCMakePresetsGraph::Condition
{
- bool Evaluate(const std::vector<MacroExpander>& /*expanders*/,
- int /*version*/, cm::optional<bool>& out) const override
+ bool Evaluate(MacroExpanderVector const& /*expanders*/, int /*version*/,
+ cm::optional<bool>& out) const override
{
out = true;
return true;
@@ -69,8 +140,8 @@ class NullCondition : public cmCMakePresetsGraph::Condition
class ConstCondition : public cmCMakePresetsGraph::Condition
{
public:
- bool Evaluate(const std::vector<MacroExpander>& /*expanders*/,
- int /*version*/, cm::optional<bool>& out) const override
+ bool Evaluate(MacroExpanderVector const& /*expanders*/, int /*version*/,
+ cm::optional<bool>& out) const override
{
out = this->Value;
return true;
@@ -82,7 +153,7 @@ public:
class EqualsCondition : public cmCMakePresetsGraph::Condition
{
public:
- bool Evaluate(const std::vector<MacroExpander>& expanders, int version,
+ bool Evaluate(MacroExpanderVector const& expanders, int version,
cm::optional<bool>& out) const override;
std::string Lhs;
@@ -92,7 +163,7 @@ public:
class InListCondition : public cmCMakePresetsGraph::Condition
{
public:
- bool Evaluate(const std::vector<MacroExpander>& expanders, int version,
+ bool Evaluate(MacroExpanderVector const& expanders, int version,
cm::optional<bool>& out) const override;
std::string String;
@@ -102,7 +173,7 @@ public:
class MatchesCondition : public cmCMakePresetsGraph::Condition
{
public:
- bool Evaluate(const std::vector<MacroExpander>& expanders, int version,
+ bool Evaluate(MacroExpanderVector const& expanders, int version,
cm::optional<bool>& out) const override;
std::string String;
@@ -112,7 +183,7 @@ public:
class AnyAllOfCondition : public cmCMakePresetsGraph::Condition
{
public:
- bool Evaluate(const std::vector<MacroExpander>& expanders, int version,
+ bool Evaluate(MacroExpanderVector const& expanders, int version,
cm::optional<bool>& out) const override;
std::vector<std::unique_ptr<Condition>> Conditions;
@@ -122,7 +193,7 @@ public:
class NotCondition : public cmCMakePresetsGraph::Condition
{
public:
- bool Evaluate(const std::vector<MacroExpander>& expanders, int version,
+ bool Evaluate(MacroExpanderVector const& expanders, int version,
cm::optional<bool>& out) const override;
std::unique_ptr<Condition> SubCondition;
diff --git a/Source/cmCMakePresetsGraphReadJSON.cxx b/Source/cmCMakePresetsGraphReadJSON.cxx
index 0d8ec63..1cf9500 100644
--- a/Source/cmCMakePresetsGraphReadJSON.cxx
+++ b/Source/cmCMakePresetsGraphReadJSON.cxx
@@ -35,10 +35,12 @@ using ArchToolsetStrategy = cmCMakePresetsGraph::ArchToolsetStrategy;
using JSONHelperBuilder = cmJSONHelperBuilder;
using ExpandMacroResult = cmCMakePresetsGraphInternal::ExpandMacroResult;
using MacroExpander = cmCMakePresetsGraphInternal::MacroExpander;
+using MacroExpanderVector = cmCMakePresetsGraphInternal::MacroExpanderVector;
+using cmCMakePresetsGraphInternal::BaseMacroExpander;
using cmCMakePresetsGraphInternal::ExpandMacros;
constexpr int MIN_VERSION = 1;
-constexpr int MAX_VERSION = 8;
+constexpr int MAX_VERSION = 9;
struct CMakeVersion
{
@@ -297,6 +299,29 @@ auto const RootPresetsHelper =
false)
.Bind<std::nullptr_t>("$schema"_s, nullptr,
cmCMakePresetsGraphInternal::SchemaHelper(), false);
+
+class EnvironmentMacroExpander : public MacroExpander
+{
+public:
+ ExpandMacroResult operator()(const std::string& macroNamespace,
+ const std::string& macroName,
+ std::string& macroOut,
+ int /*version*/) const override
+ {
+ if (macroNamespace == "penv") {
+ if (macroName.empty()) {
+ return ExpandMacroResult::Error;
+ }
+ if (cm::optional<std::string> value =
+ cmSystemTools::GetEnvVar(macroName)) {
+ macroOut += *value;
+ }
+ return ExpandMacroResult::Ok;
+ }
+
+ return ExpandMacroResult::Ignore;
+ }
+};
}
namespace cmCMakePresetsGraphInternal {
@@ -706,26 +731,13 @@ bool cmCMakePresetsGraph::ReadJSONFile(const std::string& filename,
return true;
};
- std::vector<MacroExpander> macroExpanders;
+ MacroExpanderVector macroExpanders{};
- MacroExpander environmentMacroExpander =
- [](const std::string& macroNamespace, const std::string& macroName,
- std::string& expanded, int /*version*/) -> ExpandMacroResult {
- if (macroNamespace == "penv") {
- if (macroName.empty()) {
- return ExpandMacroResult::Error;
- }
- if (cm::optional<std::string> value =
- cmSystemTools::GetEnvVar(macroName)) {
- expanded += *value;
- }
- return ExpandMacroResult::Ok;
- }
-
- return ExpandMacroResult::Ignore;
- };
-
- macroExpanders.push_back(environmentMacroExpander);
+ if (v >= 9) {
+ macroExpanders.push_back(
+ cm::make_unique<BaseMacroExpander>(*this, filename));
+ }
+ macroExpanders.push_back(cm::make_unique<EnvironmentMacroExpander>());
for (Json::ArrayIndex i = 0; i < presets.Include.size(); ++i) {
auto include = presets.Include[i];
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 988a4eb..e1aefd9 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -5,6 +5,7 @@
#include <algorithm>
#include <cctype>
#include <chrono>
+#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
@@ -24,13 +25,13 @@
#include <cmext/string_view>
#include <cm3p/curl/curl.h>
+#include <cm3p/uv.h>
#include <cm3p/zlib.h>
#include "cmsys/Base64.h"
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
-#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
#include "cmsys/SystemInformation.hxx"
#if defined(_WIN32)
@@ -64,6 +65,9 @@
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVProcessChain.h"
+#include "cmUVStream.h"
#include "cmValue.h"
#include "cmVersion.h"
#include "cmVersionConfig.h"
@@ -175,7 +179,7 @@ struct cmCTest::Private
int MaxTestNameWidth = 30;
- int ParallelLevel = 1;
+ cm::optional<size_t> ParallelLevel = 1;
bool ParallelLevelSetInCli = false;
unsigned long TestLoad = 0;
@@ -376,14 +380,14 @@ cmCTest::cmCTest()
cmCTest::~cmCTest() = default;
-int cmCTest::GetParallelLevel() const
+cm::optional<size_t> cmCTest::GetParallelLevel() const
{
return this->Impl->ParallelLevel;
}
-void cmCTest::SetParallelLevel(int level)
+void cmCTest::SetParallelLevel(cm::optional<size_t> level)
{
- this->Impl->ParallelLevel = level < 1 ? 1 : level;
+ this->Impl->ParallelLevel = level;
}
unsigned long cmCTest::GetTestLoad() const
@@ -756,7 +760,9 @@ bool cmCTest::UpdateCTestConfiguration()
}
if (!this->GetCTestConfiguration("BuildDirectory").empty()) {
this->Impl->BinaryDir = this->GetCTestConfiguration("BuildDirectory");
- cmSystemTools::ChangeDirectory(this->Impl->BinaryDir);
+ if (this->Impl->TestDir.empty()) {
+ cmSystemTools::ChangeDirectory(this->Impl->BinaryDir);
+ }
}
this->Impl->TimeOut =
std::chrono::seconds(atoi(this->GetCTestConfiguration("TimeOut").c_str()));
@@ -1073,9 +1079,9 @@ int cmCTest::GetTestModelFromString(const std::string& str)
// ######################################################################
// ######################################################################
-int cmCTest::RunMakeCommand(const std::string& command, std::string& output,
- int* retVal, const char* dir, cmDuration timeout,
- std::ostream& ofs, Encoding encoding)
+bool cmCTest::RunMakeCommand(const std::string& command, std::string& output,
+ int* retVal, const char* dir, cmDuration timeout,
+ std::ostream& ofs, Encoding encoding)
{
// First generate the command and arguments
std::vector<std::string> args = cmSystemTools::ParseArguments(command);
@@ -1084,107 +1090,107 @@ int cmCTest::RunMakeCommand(const std::string& command, std::string& output,
return false;
}
- std::vector<const char*> argv;
- argv.reserve(args.size() + 1);
- for (std::string const& a : args) {
- argv.push_back(a.c_str());
- }
- argv.push_back(nullptr);
-
output.clear();
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Run command:");
- for (char const* arg : argv) {
- if (!arg) {
- break;
- }
+ for (auto const& arg : args) {
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, " \"" << arg << "\"");
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, std::endl);
// Now create process object
- cmsysProcess* cp = cmsysProcess_New();
- cmsysProcess_SetCommand(cp, argv.data());
- cmsysProcess_SetWorkingDirectory(cp, dir);
- cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
- cmsysProcess_SetTimeout(cp, timeout.count());
- cmsysProcess_Execute(cp);
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand(args).SetMergedBuiltinStreams();
+ if (dir) {
+ builder.SetWorkingDirectory(dir);
+ }
+ auto chain = builder.Start();
+ cm::uv_pipe_ptr outputStream;
+ outputStream.init(chain.GetLoop(), 0);
+ uv_pipe_open(outputStream, chain.OutputStream());
// Initialize tick's
std::string::size_type tick = 0;
std::string::size_type tick_len = 1024;
std::string::size_type tick_line_len = 50;
- char* data;
- int length;
cmProcessOutput processOutput(encoding);
- std::string strdata;
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
" Each . represents " << tick_len
<< " bytes of output\n"
" "
<< std::flush);
- while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
- processOutput.DecodeText(data, length, strdata);
- for (char& cc : strdata) {
- if (cc == 0) {
- cc = '\n';
+ auto outputHandle = cmUVStreamRead(
+ outputStream,
+ [this, &processOutput, &output, &tick, &tick_len, &tick_line_len,
+ &ofs](std::vector<char> data) {
+ std::string strdata;
+ processOutput.DecodeText(data.data(), data.size(), strdata);
+ for (char& cc : strdata) {
+ if (cc == 0) {
+ cc = '\n';
+ }
}
- }
- output.append(strdata);
- while (output.size() > (tick * tick_len)) {
- tick++;
- cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, "." << std::flush);
- if (tick % tick_line_len == 0 && tick > 0) {
- cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
- " Size: " << int((double(output.size()) / 1024.0) + 1)
- << "K\n " << std::flush);
+ output.append(strdata);
+ while (output.size() > (tick * tick_len)) {
+ tick++;
+ cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, "." << std::flush);
+ if (tick % tick_line_len == 0 && tick > 0) {
+ cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
+ " Size: " << int((double(output.size()) / 1024.0) + 1)
+ << "K\n " << std::flush);
+ }
}
- }
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
- cmCTestLogWrite(strdata.c_str(), strdata.size()));
- if (ofs) {
- ofs << cmCTestLogWrite(strdata.c_str(), strdata.size());
- }
- }
- processOutput.DecodeText(std::string(), strdata);
- if (!strdata.empty()) {
- output.append(strdata);
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
- cmCTestLogWrite(strdata.c_str(), strdata.size()));
- if (ofs) {
- ofs << cmCTestLogWrite(strdata.c_str(), strdata.size());
- }
- }
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
+ cmCTestLogWrite(strdata.c_str(), strdata.size()));
+ if (ofs) {
+ ofs << cmCTestLogWrite(strdata.c_str(), strdata.size());
+ }
+ },
+ [this, &processOutput, &output, &ofs]() {
+ std::string strdata;
+ processOutput.DecodeText(std::string(), strdata);
+ if (!strdata.empty()) {
+ output.append(strdata);
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
+ cmCTestLogWrite(strdata.c_str(), strdata.size()));
+ if (ofs) {
+ ofs << cmCTestLogWrite(strdata.c_str(), strdata.size());
+ }
+ }
+ });
+
+ bool finished = chain.Wait(static_cast<uint64_t>(timeout.count() * 1000.0));
cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
" Size of output: " << int(double(output.size()) / 1024.0) << "K"
<< std::endl);
- cmsysProcess_WaitForExit(cp, nullptr);
-
- int result = cmsysProcess_GetState(cp);
-
- if (result == cmsysProcess_State_Exited) {
- *retVal = cmsysProcess_GetExitValue(cp);
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
- "Command exited with the value: " << *retVal << std::endl);
- } else if (result == cmsysProcess_State_Exception) {
- *retVal = cmsysProcess_GetExitException(cp);
- cmCTestLog(this, WARNING,
- "There was an exception: " << *retVal << std::endl);
- } else if (result == cmsysProcess_State_Expired) {
+ if (finished) {
+ auto const& status = chain.GetStatus(0);
+ auto exception = status.GetException();
+ switch (exception.first) {
+ case cmUVProcessChain::ExceptionCode::None:
+ *retVal = static_cast<int>(status.ExitStatus);
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
+ "Command exited with the value: " << *retVal << std::endl);
+ break;
+ case cmUVProcessChain::ExceptionCode::Spawn:
+ output += "\n*** ERROR executing: ";
+ output += exception.second;
+ output += "\n***The build process failed.";
+ cmCTestLog(this, ERROR_MESSAGE,
+ "There was an error: " << exception.second << std::endl);
+ break;
+ default:
+ *retVal = static_cast<int>(exception.first);
+ cmCTestLog(this, WARNING,
+ "There was an exception: " << *retVal << std::endl);
+ break;
+ }
+ } else {
cmCTestLog(this, WARNING, "There was a timeout" << std::endl);
- } else if (result == cmsysProcess_State_Error) {
- output += "\n*** ERROR executing: ";
- output += cmsysProcess_GetErrorString(cp);
- output += "\n***The build process failed.";
- cmCTestLog(this, ERROR_MESSAGE,
- "There was an error: " << cmsysProcess_GetErrorString(cp)
- << std::endl);
}
- cmsysProcess_Delete(cp);
-
- return result;
+ return true;
}
// ######################################################################
@@ -1192,9 +1198,10 @@ int cmCTest::RunMakeCommand(const std::string& command, std::string& output,
// ######################################################################
// ######################################################################
-int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
- int* retVal, std::ostream* log, cmDuration testTimeOut,
- std::vector<std::string>* environment, Encoding encoding)
+bool cmCTest::RunTest(const std::vector<std::string>& argv,
+ std::string* output, int* retVal, std::ostream* log,
+ cmDuration testTimeOut,
+ std::vector<std::string>* environment, Encoding encoding)
{
bool modifyEnv = (environment && !environment->empty());
@@ -1233,19 +1240,16 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
inst.SetStreams(&oss, &oss);
std::vector<std::string> args;
- for (char const* i : argv) {
- if (i) {
- // make sure we pass the timeout in for any build and test
- // invocations. Since --build-generator is required this is a
- // good place to check for it, and to add the arguments in
- if (strcmp(i, "--build-generator") == 0 &&
- timeout != cmCTest::MaxDuration() &&
- timeout > cmDuration::zero()) {
- args.emplace_back("--test-timeout");
- args.push_back(std::to_string(cmDurationTo<unsigned int>(timeout)));
- }
- args.emplace_back(i);
+ for (auto const& i : argv) {
+ // make sure we pass the timeout in for any build and test
+ // invocations. Since --build-generator is required this is a
+ // good place to check for it, and to add the arguments in
+ if (i == "--build-generator" && timeout != cmCTest::MaxDuration() &&
+ timeout > cmDuration::zero()) {
+ args.emplace_back("--test-timeout");
+ args.push_back(std::to_string(cmDurationTo<unsigned int>(timeout)));
}
+ args.emplace_back(i);
}
if (log) {
*log << "* Run internal CTest" << std::endl;
@@ -1271,7 +1275,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
<< std::endl);
}
- return cmsysProcess_State_Exited;
+ return true;
}
std::vector<char> tempOutput;
if (output) {
@@ -1284,41 +1288,43 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
cmSystemTools::AppendEnv(*environment);
}
- cmsysProcess* cp = cmsysProcess_New();
- cmsysProcess_SetCommand(cp, argv.data());
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand(argv).SetMergedBuiltinStreams();
cmCTestLog(this, DEBUG, "Command is: " << argv[0] << std::endl);
- if (cmSystemTools::GetRunCommandHideConsole()) {
- cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
- }
-
- cmsysProcess_SetTimeout(cp, timeout.count());
- cmsysProcess_Execute(cp);
+ auto chain = builder.Start();
- char* data;
- int length;
cmProcessOutput processOutput(encoding);
- std::string strdata;
- while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
- processOutput.DecodeText(data, length, strdata);
- if (output) {
- cm::append(tempOutput, data, data + length);
- }
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
- cmCTestLogWrite(strdata.c_str(), strdata.size()));
- if (log) {
- log->write(strdata.c_str(), strdata.size());
- }
- }
- processOutput.DecodeText(std::string(), strdata);
- if (!strdata.empty()) {
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
- cmCTestLogWrite(strdata.c_str(), strdata.size()));
- if (log) {
- log->write(strdata.c_str(), strdata.size());
- }
- }
+ cm::uv_pipe_ptr outputStream;
+ outputStream.init(chain.GetLoop(), 0);
+ uv_pipe_open(outputStream, chain.OutputStream());
+ auto outputHandle = cmUVStreamRead(
+ outputStream,
+ [this, &processOutput, &output, &tempOutput,
+ &log](std::vector<char> data) {
+ std::string strdata;
+ processOutput.DecodeText(data.data(), data.size(), strdata);
+ if (output) {
+ cm::append(tempOutput, data.data(), data.data() + data.size());
+ }
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
+ cmCTestLogWrite(strdata.c_str(), strdata.size()));
+ if (log) {
+ log->write(strdata.c_str(), strdata.size());
+ }
+ },
+ [this, &processOutput, &log]() {
+ std::string strdata;
+ processOutput.DecodeText(std::string(), strdata);
+ if (!strdata.empty()) {
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
+ cmCTestLogWrite(strdata.c_str(), strdata.size()));
+ if (log) {
+ log->write(strdata.c_str(), strdata.size());
+ }
+ }
+ });
- cmsysProcess_WaitForExit(cp, nullptr);
+ bool complete = chain.Wait(static_cast<uint64_t>(timeout.count() * 1000.0));
processOutput.DecodeText(tempOutput, tempOutput);
if (output && tempOutput.begin() != tempOutput.end()) {
output->append(tempOutput.data(), tempOutput.size());
@@ -1326,33 +1332,41 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
"-- Process completed" << std::endl);
- int result = cmsysProcess_GetState(cp);
+ bool result = false;
- if (result == cmsysProcess_State_Exited) {
- *retVal = cmsysProcess_GetExitValue(cp);
- if (*retVal != 0 && this->Impl->OutputTestOutputOnTestFailure) {
- this->OutputTestErrors(tempOutput);
- }
- } else if (result == cmsysProcess_State_Exception) {
- if (this->Impl->OutputTestOutputOnTestFailure) {
- this->OutputTestErrors(tempOutput);
- }
- *retVal = cmsysProcess_GetExitException(cp);
- std::string outerr = cmStrCat("\n*** Exception executing: ",
- cmsysProcess_GetExceptionString(cp));
- if (output) {
- *output += outerr;
- }
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl);
- } else if (result == cmsysProcess_State_Error) {
- std::string outerr =
- cmStrCat("\n*** ERROR executing: ", cmsysProcess_GetErrorString(cp));
- if (output) {
- *output += outerr;
+ if (complete) {
+ auto const& status = chain.GetStatus(0);
+ auto exception = status.GetException();
+ switch (exception.first) {
+ case cmUVProcessChain::ExceptionCode::None:
+ *retVal = static_cast<int>(status.ExitStatus);
+ if (*retVal != 0 && this->Impl->OutputTestOutputOnTestFailure) {
+ this->OutputTestErrors(tempOutput);
+ }
+ result = true;
+ break;
+ case cmUVProcessChain::ExceptionCode::Spawn: {
+ std::string outerr =
+ cmStrCat("\n*** ERROR executing: ", exception.second);
+ if (output) {
+ *output += outerr;
+ }
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl);
+ } break;
+ default: {
+ if (this->Impl->OutputTestOutputOnTestFailure) {
+ this->OutputTestErrors(tempOutput);
+ }
+ *retVal = status.TermSignal;
+ std::string outerr =
+ cmStrCat("\n*** Exception executing: ", exception.second);
+ if (output) {
+ *output += outerr;
+ }
+ cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl);
+ } break;
}
- cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl);
}
- cmsysProcess_Delete(cp);
return result;
}
@@ -1878,16 +1892,34 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
std::string& errormsg)
{
std::string arg = args[i];
+ cm::string_view noTestsPrefix = "--no-tests=";
if (this->CheckArgument(arg, "-F"_s)) {
this->Impl->Failover = true;
- } else if (this->CheckArgument(arg, "-j"_s, "--parallel") &&
- i < args.size() - 1) {
- i++;
- int plevel = atoi(args[i].c_str());
- this->SetParallelLevel(plevel);
+ } else if (this->CheckArgument(arg, "-j"_s, "--parallel")) {
+ cm::optional<size_t> parallelLevel;
+ // No value or an empty value tells ctest to choose a default.
+ if (i + 1 < args.size() && !cmHasLiteralPrefix(args[i + 1], "-")) {
+ ++i;
+ if (!args[i].empty()) {
+ // A non-empty value must be a non-negative integer.
+ unsigned long plevel = 0;
+ if (!cmStrToULong(args[i], &plevel)) {
+ errormsg =
+ cmStrCat("'", arg, "' given invalid value '", args[i], "'");
+ return false;
+ }
+ parallelLevel = plevel;
+ }
+ }
+ this->SetParallelLevel(parallelLevel);
this->Impl->ParallelLevelSetInCli = true;
} else if (cmHasPrefix(arg, "-j")) {
- int plevel = atoi(arg.substr(2).c_str());
+ // The value must be a non-negative integer.
+ unsigned long plevel = 0;
+ if (!cmStrToULong(arg.substr(2), &plevel)) {
+ errormsg = cmStrCat("'", arg, "' given invalid value '", args[i], "'");
+ return false;
+ }
this->SetParallelLevel(plevel);
this->Impl->ParallelLevelSetInCli = true;
}
@@ -2122,8 +2154,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
this->SetOutputJUnitFileName(std::string(args[i]));
}
- cm::string_view noTestsPrefix = "--no-tests=";
- if (cmHasPrefix(arg, noTestsPrefix)) {
+ else if (cmHasPrefix(arg, noTestsPrefix)) {
cm::string_view noTestsMode =
cm::string_view(arg).substr(noTestsPrefix.length());
if (noTestsMode == "error") {
@@ -2212,9 +2243,27 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
args[i]);
}
+ else if (this->CheckArgument(arg, "--tests-from-file"_s) &&
+ i < args.size() - 1) {
+ i++;
+ this->GetTestHandler()->SetPersistentOption("TestListFile", args[i]);
+ this->GetMemCheckHandler()->SetPersistentOption("TestListFile", args[i]);
+ }
+
+ else if (this->CheckArgument(arg, "--exclude-from-file"_s) &&
+ i < args.size() - 1) {
+ i++;
+ this->GetTestHandler()->SetPersistentOption("ExcludeTestListFile",
+ args[i]);
+ this->GetMemCheckHandler()->SetPersistentOption("ExcludeTestListFile",
+ args[i]);
+ }
+
else if (this->CheckArgument(arg, "--rerun-failed"_s)) {
this->GetTestHandler()->SetPersistentOption("RerunFailed", "true");
this->GetMemCheckHandler()->SetPersistentOption("RerunFailed", "true");
+ } else {
+ return false;
}
return true;
}
@@ -2264,7 +2313,7 @@ bool cmCTest::ColoredOutputSupportedByConsole()
}
// handle the -S -SR and -SP arguments
-void cmCTest::HandleScriptArguments(size_t& i, std::vector<std::string>& args,
+bool cmCTest::HandleScriptArguments(size_t& i, std::vector<std::string>& args,
bool& SRArgumentSpecified)
{
std::string arg = args[i];
@@ -2279,8 +2328,8 @@ void cmCTest::HandleScriptArguments(size_t& i, std::vector<std::string>& args,
}
}
- if (this->CheckArgument(arg, "-SR"_s, "--script-run") &&
- i < args.size() - 1) {
+ else if (this->CheckArgument(arg, "-SR"_s, "--script-run") &&
+ i < args.size() - 1) {
SRArgumentSpecified = true;
this->Impl->RunConfigurationScript = true;
i++;
@@ -2288,7 +2337,8 @@ void cmCTest::HandleScriptArguments(size_t& i, std::vector<std::string>& args,
ch->AddConfigurationScript(args[i], true);
}
- if (this->CheckArgument(arg, "-S"_s, "--script") && i < args.size() - 1) {
+ else if (this->CheckArgument(arg, "-S"_s, "--script") &&
+ i < args.size() - 1) {
this->Impl->RunConfigurationScript = true;
i++;
cmCTestScriptHandler* ch = this->GetScriptHandler();
@@ -2296,7 +2346,10 @@ void cmCTest::HandleScriptArguments(size_t& i, std::vector<std::string>& args,
if (!SRArgumentSpecified) {
ch->AddConfigurationScript(args[i], true);
}
+ } else {
+ return false;
}
+ return true;
}
bool cmCTest::AddVariableDefinition(const std::string& arg)
@@ -2689,16 +2742,18 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
for (size_t i = 1; i < args.size(); ++i) {
// handle the simple commandline arguments
std::string errormsg;
- if (!this->HandleCommandLineArguments(i, args, errormsg)) {
+ bool validArg = this->HandleCommandLineArguments(i, args, errormsg);
+ if (!validArg && !errormsg.empty()) {
cmSystemTools::Error(errormsg);
return 1;
}
+ std::string arg = args[i];
// handle the script arguments -S -SR -SP
- this->HandleScriptArguments(i, args, SRArgumentSpecified);
+ validArg =
+ validArg || this->HandleScriptArguments(i, args, SRArgumentSpecified);
// --dashboard: handle a request for a dashboard
- std::string arg = args[i];
if (this->CheckArgument(arg, "-D"_s, "--dashboard") &&
i < args.size() - 1) {
this->Impl->ProduceXML = true;
@@ -2712,6 +2767,7 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
executeTests = false;
}
}
+ validArg = true;
}
// If it's not exactly -D, but it starts with -D, then try to parse out
@@ -2722,16 +2778,17 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
if (arg != "-D" && cmHasLiteralPrefix(arg, "-D")) {
std::string input = arg.substr(2);
this->AddVariableDefinition(input);
+ validArg = true;
}
// --test-action: calls SetTest(<stage>, /*report=*/ false) to enable
// the corresponding stage
- if (!this->HandleTestActionArgument(ctestExec, i, args)) {
+ if (!this->HandleTestActionArgument(ctestExec, i, args, validArg)) {
executeTests = false;
}
// --test-model: what type of test model
- if (!this->HandleTestModelArgument(ctestExec, i, args)) {
+ if (!this->HandleTestModelArgument(ctestExec, i, args, validArg)) {
executeTests = false;
}
@@ -2743,38 +2800,58 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
if (!this->SubmitExtraFiles(args[i])) {
return 0;
}
+ validArg = true;
}
// --build-and-test options
if (this->CheckArgument(arg, "--build-and-test"_s) &&
i < args.size() - 1) {
cmakeAndTest = true;
+ validArg = true;
}
// --schedule-random
if (this->CheckArgument(arg, "--schedule-random"_s)) {
this->Impl->ScheduleType = "Random";
+ validArg = true;
}
// pass the argument to all the handlers as well, but it may no longer be
// set to what it was originally so I'm not sure this is working as
// intended
for (auto& handler : this->Impl->GetTestingHandlers()) {
- if (!handler->ProcessCommandLineArguments(arg, i, args)) {
+ if (!handler->ProcessCommandLineArguments(arg, i, args, validArg)) {
cmCTestLog(
this, ERROR_MESSAGE,
"Problem parsing command line arguments within a handler\n");
return 0;
}
}
+
+ if (!validArg && cmHasLiteralPrefix(arg, "-") &&
+ !cmHasLiteralPrefix(arg, "--preset")) {
+ cmSystemTools::Error(cmStrCat("Unknown argument: ", arg));
+ cmSystemTools::Error("Run 'ctest --help' for all supported options.");
+ return 1;
+ }
} // the close of the for argument loop
// handle CTEST_PARALLEL_LEVEL environment variable
if (!this->Impl->ParallelLevelSetInCli) {
- std::string parallel;
- if (cmSystemTools::GetEnv("CTEST_PARALLEL_LEVEL", parallel)) {
- int plevel = atoi(parallel.c_str());
- this->SetParallelLevel(plevel);
+ if (cm::optional<std::string> parallelEnv =
+ cmSystemTools::GetEnvVar("CTEST_PARALLEL_LEVEL")) {
+ if (parallelEnv->empty() ||
+ parallelEnv->find_first_not_of(" \t") == std::string::npos) {
+ // An empty value tells ctest to choose a default.
+ this->SetParallelLevel(cm::nullopt);
+ } else {
+ // A non-empty value must be a non-negative integer.
+ // Otherwise, ignore it.
+ unsigned long plevel = 0;
+ if (cmStrToULong(*parallelEnv, &plevel)) {
+ this->SetParallelLevel(plevel);
+ }
+ }
}
}
@@ -2822,12 +2899,14 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
}
bool cmCTest::HandleTestActionArgument(const char* ctestExec, size_t& i,
- const std::vector<std::string>& args)
+ const std::vector<std::string>& args,
+ bool& validArg)
{
bool success = true;
std::string const& arg = args[i];
if (this->CheckArgument(arg, "-T"_s, "--test-action") &&
(i < args.size() - 1)) {
+ validArg = true;
this->Impl->ProduceXML = true;
i++;
if (!this->SetTest(args[i], false)) {
@@ -2854,12 +2933,14 @@ bool cmCTest::HandleTestActionArgument(const char* ctestExec, size_t& i,
}
bool cmCTest::HandleTestModelArgument(const char* ctestExec, size_t& i,
- const std::vector<std::string>& args)
+ const std::vector<std::string>& args,
+ bool& validArg)
{
bool success = true;
std::string const& arg = args[i];
if (this->CheckArgument(arg, "-M"_s, "--test-model") &&
(i < args.size() - 1)) {
+ validArg = true;
i++;
std::string const& str = args[i];
if (cmSystemTools::LowerCase(str) == "nightly"_s) {
@@ -3470,49 +3551,70 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args,
stdOut->clear();
stdErr->clear();
- cmsysProcess* cp = cmsysProcess_New();
- cmsysProcess_SetCommand(cp, argv.data());
- cmsysProcess_SetWorkingDirectory(cp, dir);
- if (cmSystemTools::GetRunCommandHideConsole()) {
- cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand(args)
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR);
+ if (dir) {
+ builder.SetWorkingDirectory(dir);
+ }
+ auto chain = builder.Start();
+
+ cm::uv_timer_ptr timer;
+ bool timedOut = false;
+ if (timeout.count()) {
+ timer.init(chain.GetLoop(), &timedOut);
+ timer.start(
+ [](uv_timer_t* t) {
+ auto* timedOutPtr = static_cast<bool*>(t->data);
+ *timedOutPtr = true;
+ },
+ static_cast<uint64_t>(timeout.count() * 1000.0), 0);
}
- cmsysProcess_SetTimeout(cp, timeout.count());
- cmsysProcess_Execute(cp);
std::vector<char> tempOutput;
+ bool outFinished = false;
+ cm::uv_pipe_ptr outStream;
std::vector<char> tempError;
- char* data;
- int length;
+ bool errFinished = false;
+ cm::uv_pipe_ptr errStream;
cmProcessOutput processOutput(encoding);
- std::string strdata;
- int res;
- bool done = false;
- while (!done) {
- res = cmsysProcess_WaitForData(cp, &data, &length, nullptr);
- switch (res) {
- case cmsysProcess_Pipe_STDOUT:
- cm::append(tempOutput, data, data + length);
- break;
- case cmsysProcess_Pipe_STDERR:
- cm::append(tempError, data, data + length);
- break;
- default:
- done = true;
- }
- if ((res == cmsysProcess_Pipe_STDOUT || res == cmsysProcess_Pipe_STDERR) &&
- this->Impl->ExtraVerbose) {
- processOutput.DecodeText(data, length, strdata);
- cmSystemTools::Stdout(strdata);
- }
+ auto startRead = [this, &chain, &processOutput](
+ cm::uv_pipe_ptr& pipe, int stream,
+ std::vector<char>& temp,
+ bool& finished) -> std::unique_ptr<cmUVStreamReadHandle> {
+ pipe.init(chain.GetLoop(), 0);
+ uv_pipe_open(pipe, stream);
+ return cmUVStreamRead(
+ pipe,
+ [this, &temp, &processOutput](std::vector<char> data) {
+ cm::append(temp, data);
+ if (this->Impl->ExtraVerbose) {
+ std::string strdata;
+ processOutput.DecodeText(data.data(), data.size(), strdata);
+ cmSystemTools::Stdout(strdata);
+ }
+ },
+ [&finished]() { finished = true; });
+ };
+ auto outputHandle =
+ startRead(outStream, chain.OutputStream(), tempOutput, outFinished);
+ auto errorHandle =
+ startRead(errStream, chain.ErrorStream(), tempError, errFinished);
+ while (!timedOut && !(outFinished && errFinished)) {
+ uv_run(&chain.GetLoop(), UV_RUN_ONCE);
}
if (this->Impl->ExtraVerbose) {
+ std::string strdata;
processOutput.DecodeText(std::string(), strdata);
if (!strdata.empty()) {
cmSystemTools::Stdout(strdata);
}
}
- cmsysProcess_WaitForExit(cp, nullptr);
+ while (!timedOut && !chain.Finished()) {
+ uv_run(&chain.GetLoop(), UV_RUN_ONCE);
+ }
if (!tempOutput.empty()) {
processOutput.DecodeText(tempOutput, tempOutput);
stdOut->append(tempOutput.data(), tempOutput.size());
@@ -3523,32 +3625,32 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args,
}
bool result = true;
- if (cmsysProcess_GetState(cp) == cmsysProcess_State_Exited) {
- if (retVal) {
- *retVal = cmsysProcess_GetExitValue(cp);
- } else {
- if (cmsysProcess_GetExitValue(cp) != 0) {
- result = false;
- }
- }
- } else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Exception) {
- const char* exception_str = cmsysProcess_GetExceptionString(cp);
- cmCTestLog(this, ERROR_MESSAGE, exception_str << std::endl);
- stdErr->append(exception_str, strlen(exception_str));
- result = false;
- } else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Error) {
- const char* error_str = cmsysProcess_GetErrorString(cp);
- cmCTestLog(this, ERROR_MESSAGE, error_str << std::endl);
- stdErr->append(error_str, strlen(error_str));
- result = false;
- } else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Expired) {
+ if (timedOut) {
const char* error_str = "Process terminated due to timeout\n";
cmCTestLog(this, ERROR_MESSAGE, error_str << std::endl);
stdErr->append(error_str, strlen(error_str));
result = false;
+ } else {
+ auto const& status = chain.GetStatus(0);
+ auto exception = status.GetException();
+ switch (exception.first) {
+ case cmUVProcessChain::ExceptionCode::None:
+ if (retVal) {
+ *retVal = static_cast<int>(status.ExitStatus);
+ } else {
+ if (status.ExitStatus != 0) {
+ result = false;
+ }
+ }
+ break;
+ default: {
+ cmCTestLog(this, ERROR_MESSAGE, exception.second << std::endl);
+ stdErr->append(exception.second);
+ result = false;
+ } break;
+ }
}
- cmsysProcess_Delete(cp);
return result;
}
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 9a8d5a6..ae2431c 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -12,6 +12,7 @@
#include <string>
#include <vector>
+#include <cm/optional>
#include <cm/string_view>
#include "cmDuration.h"
@@ -116,8 +117,8 @@ public:
cmDuration GetGlobalTimeout() const;
/** how many test to run at the same time */
- int GetParallelLevel() const;
- void SetParallelLevel(int);
+ cm::optional<size_t> GetParallelLevel() const;
+ void SetParallelLevel(cm::optional<size_t> level);
unsigned long GetTestLoad() const;
void SetTestLoad(unsigned long);
@@ -254,10 +255,10 @@ public:
* Run command specialized for make and configure. Returns process status
* and retVal is return value or exception.
*/
- int RunMakeCommand(const std::string& command, std::string& output,
- int* retVal, const char* dir, cmDuration timeout,
- std::ostream& ofs,
- Encoding encoding = cmProcessOutput::Auto);
+ bool RunMakeCommand(const std::string& command, std::string& output,
+ int* retVal, const char* dir, cmDuration timeout,
+ std::ostream& ofs,
+ Encoding encoding = cmProcessOutput::Auto);
/** Return the current tag */
std::string GetCurrentTag();
@@ -303,10 +304,10 @@ public:
* environment variables prior to running the test. After running the test,
* environment variables are restored to their previous values.
*/
- int RunTest(std::vector<const char*> args, std::string* output, int* retVal,
- std::ostream* logfile, cmDuration testTimeOut,
- std::vector<std::string>* environment,
- Encoding encoding = cmProcessOutput::Auto);
+ bool RunTest(const std::vector<std::string>& args, std::string* output,
+ int* retVal, std::ostream* logfile, cmDuration testTimeOut,
+ std::vector<std::string>* environment,
+ Encoding encoding = cmProcessOutput::Auto);
/**
* Get the handler object
@@ -511,7 +512,7 @@ private:
static bool ColoredOutputSupportedByConsole();
/** handle the -S -SP and -SR arguments */
- void HandleScriptArguments(size_t& i, std::vector<std::string>& args,
+ bool HandleScriptArguments(size_t& i, std::vector<std::string>& args,
bool& SRArgumentSpecified);
/** Reread the configuration file */
@@ -530,11 +531,13 @@ private:
/** Handle the --test-action command line argument */
bool HandleTestActionArgument(const char* ctestExec, size_t& i,
- const std::vector<std::string>& args);
+ const std::vector<std::string>& args,
+ bool& validArg);
/** Handle the --test-model command line argument */
bool HandleTestModelArgument(const char* ctestExec, size_t& i,
- const std::vector<std::string>& args);
+ const std::vector<std::string>& args,
+ bool& validArg);
int RunCMakeAndTest(std::string* output);
int ExecuteTests();
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 5c25cb9..51b2300 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -577,7 +577,7 @@ cmValue cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const
bool cmCacheManager::CacheEntry::GetPropertyAsBool(
const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
void cmCacheManager::CacheEntry::SetProperty(const std::string& prop,
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 90f0d55..fbf39e2 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -295,7 +295,7 @@ std::string cmCommonTargetGenerator::GetAIXExports(std::string const&)
if (this->GeneratorTarget->IsAIX()) {
if (cmValue exportAll =
this->GeneratorTarget->GetProperty("AIX_EXPORT_ALL_SYMBOLS")) {
- if (cmIsOff(*exportAll)) {
+ if (exportAll.IsOff()) {
aixExports = "-n";
}
}
@@ -501,7 +501,8 @@ std::string cmCommonTargetGenerator::GetLinkerLauncher(
cmValue launcherProp = this->GeneratorTarget->GetProperty(propName);
if (cmNonempty(launcherProp)) {
cmGeneratorExpressionDAGChecker dagChecker(this->GeneratorTarget, propName,
- nullptr, nullptr);
+ nullptr, nullptr,
+ this->LocalCommonGenerator);
std::string evaluatedLinklauncher = cmGeneratorExpression::Evaluate(
*launcherProp, this->LocalCommonGenerator, config, this->GeneratorTarget,
&dagChecker, this->GeneratorTarget, lang);
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 320c57c..f6ff71a 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -16,6 +16,8 @@
#include <cm/string_view>
#include <cmext/string_view>
+#include "cmsys/RegularExpression.hxx"
+
#include "cmComputeComponentGraph.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorExpressionDAGChecker.h"
@@ -26,6 +28,7 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmPolicies.h"
#include "cmRange.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
@@ -184,15 +187,6 @@ items that we know the linker will reuse automatically (shared libs).
namespace {
// LINK_LIBRARY helpers
-const auto LL_BEGIN = "<LINK_LIBRARY:"_s;
-const auto LL_END = "</LINK_LIBRARY:"_s;
-
-inline std::string ExtractFeature(std::string const& item)
-{
- return item.substr(LL_BEGIN.length(),
- item.find('>', LL_BEGIN.length()) - LL_BEGIN.length());
-}
-
bool IsFeatureSupported(cmMakefile* makefile, std::string const& linkLanguage,
std::string const& feature)
{
@@ -231,9 +225,208 @@ bool IsGroupFeatureSupported(cmMakefile* makefile,
cmStrCat("CMAKE_LINK_GROUP_USING_", feature, "_SUPPORTED");
return makefile->GetDefinition(featureSupported).IsOn();
}
+
+class EntriesProcessing
+{
+public:
+ using LinkEntry = cmComputeLinkDepends::LinkEntry;
+ using EntryVector = cmComputeLinkDepends::EntryVector;
+
+ EntriesProcessing(const cmGeneratorTarget* target,
+ const std::string& linkLanguage, EntryVector& entries,
+ EntryVector& finalEntries)
+ : Entries(entries)
+ , FinalEntries(finalEntries)
+ {
+ const auto* makefile = target->Makefile;
+
+ switch (target->GetPolicyStatusCMP0156()) {
+ case cmPolicies::WARN:
+ if (!makefile->GetCMakeInstance()->GetIsInTryCompile() &&
+ makefile->PolicyOptionalWarningEnabled(
+ "CMAKE_POLICY_WARNING_CMP0156")) {
+ makefile->GetCMakeInstance()->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0156),
+ "\nSince the policy is not set, legacy libraries "
+ "de-duplication strategy will be applied."),
+ target->GetBacktrace());
+ }
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ // rely on default initialization of the class
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ makefile->GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0156),
+ target->GetBacktrace());
+ CM_FALLTHROUGH;
+ case cmPolicies::NEW: {
+ if (auto libProcessing = makefile->GetDefinition(cmStrCat(
+ "CMAKE_", linkLanguage, "_LINK_LIBRARIES_PROCESSING"))) {
+ cmsys::RegularExpression processingOption{
+ "^(ORDER|UNICITY)=(FORWARD|REVERSE|ALL|NONE|SHARED)$"
+ };
+ std::string errorMessage;
+ for (auto const& option : cmList{ libProcessing }) {
+ if (processingOption.find(option)) {
+ if (processingOption.match(1) == "ORDER") {
+ if (processingOption.match(2) == "FORWARD") {
+ this->Order = Forward;
+ } else if (processingOption.match(2) == "REVERSE") {
+ this->Order = Reverse;
+ } else {
+ errorMessage += cmStrCat(" ", option, '\n');
+ }
+ } else if (processingOption.match(1) == "UNICITY") {
+ if (processingOption.match(2) == "ALL") {
+ this->Unicity = All;
+ } else if (processingOption.match(2) == "NONE") {
+ this->Unicity = None;
+ } else if (processingOption.match(2) == "SHARED") {
+ this->Unicity = Shared;
+ } else {
+ errorMessage += cmStrCat(" ", option, '\n');
+ }
+ }
+ } else {
+ errorMessage += cmStrCat(" ", option, '\n');
+ }
+ }
+ if (!errorMessage.empty()) {
+ makefile->GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("Erroneous option(s) for 'CMAKE_", linkLanguage,
+ "_LINK_LIBRARIES_PROCESSING':\n", errorMessage),
+ target->GetBacktrace());
+ }
+ }
+ }
+ }
+ }
+
+ void AddGroups(const std::map<size_t, std::vector<size_t>>& groups)
+ {
+ if (!groups.empty()) {
+ this->Groups = &groups;
+ // record all libraries as part of groups to ensure correct
+ // deduplication: libraries as part of groups are always kept.
+ for (const auto& group : groups) {
+ for (auto index : group.second) {
+ this->Emitted.insert(index);
+ }
+ }
+ }
+ }
+
+ void AddLibraries(const std::vector<size_t>& libEntries)
+ {
+ if (this->Order == Reverse) {
+ // Iterate in reverse order so we can keep only the last occurrence
+ // of a library.
+ this->AddLibraries(cmReverseRange(libEntries));
+ } else {
+ this->AddLibraries(cmMakeRange(libEntries));
+ }
+ }
+
+ void AddObjects(const std::vector<size_t>& objectEntries)
+ {
+ // Place explicitly linked object files in the front. The linker will
+ // always use them anyway, and they may depend on symbols from libraries.
+ if (this->Order == Reverse) {
+ // Append in reverse order at the end since we reverse the final order.
+ for (auto index : cmReverseRange(objectEntries)) {
+ this->FinalEntries.emplace_back(this->Entries[index]);
+ }
+ } else {
+ // Append in reverse order to ensure correct final order
+ for (auto index : cmReverseRange(objectEntries)) {
+ this->FinalEntries.emplace(this->FinalEntries.begin(),
+ this->Entries[index]);
+ }
+ }
+ }
+
+ void Finalize()
+ {
+ if (this->Order == Reverse) {
+ // Reverse the resulting order since we iterated in reverse.
+ std::reverse(this->FinalEntries.begin(), this->FinalEntries.end());
+ }
+
+ // expand groups
+ if (this->Groups != nullptr) {
+ for (const auto& group : *this->Groups) {
+ const LinkEntry& groupEntry = this->Entries[group.first];
+ auto it = this->FinalEntries.begin();
+ while (true) {
+ it = std::find_if(it, this->FinalEntries.end(),
+ [&groupEntry](const LinkEntry& entry) -> bool {
+ return groupEntry.Item == entry.Item;
+ });
+ if (it == this->FinalEntries.end()) {
+ break;
+ }
+ it->Item.Value = "</LINK_GROUP>";
+ for (auto index = group.second.rbegin();
+ index != group.second.rend(); ++index) {
+ it = this->FinalEntries.insert(it, this->Entries[*index]);
+ }
+ it = this->FinalEntries.insert(it, groupEntry);
+ it->Item.Value = "<LINK_GROUP>";
+ }
+ }
+ }
+ }
+
+private:
+ enum OrderKind
+ {
+ Forward,
+ Reverse
+ };
+
+ enum UnicityKind
+ {
+ None,
+ Shared,
+ All
+ };
+
+ bool IncludeEntry(LinkEntry const& entry) const
+ {
+ return this->Unicity == None ||
+ (this->Unicity == Shared &&
+ (entry.Target == nullptr ||
+ entry.Target->GetType() != cmStateEnums::SHARED_LIBRARY)) ||
+ (this->Unicity == All && entry.Kind != LinkEntry::Library);
+ }
+
+ template <typename Range>
+ void AddLibraries(const Range& libEntries)
+ {
+ for (auto index : libEntries) {
+ LinkEntry const& entry = this->Entries[index];
+ if (this->IncludeEntry(entry) || this->Emitted.insert(index).second) {
+ this->FinalEntries.emplace_back(entry);
+ }
+ }
+ }
+
+ OrderKind Order = Reverse;
+ UnicityKind Unicity = Shared;
+ EntryVector& Entries;
+ EntryVector& FinalEntries;
+ std::set<size_t> Emitted;
+ const std::map<size_t, std::vector<size_t>>* Groups = nullptr;
+};
}
-const std::string cmComputeLinkDepends::LinkEntry::DEFAULT = "DEFAULT";
+std::string const& cmComputeLinkDepends::LinkEntry::DEFAULT =
+ cmLinkItem::DEFAULT;
cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target,
const std::string& config,
@@ -258,10 +451,14 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target,
if (cmValue feature = this->Target->GetProperty(key)) {
if (!feature->empty() && key.length() > lloPrefix.length()) {
auto item = key.substr(lloPrefix.length());
- cmGeneratorExpressionDAGChecker dag{ this->Target->GetBacktrace(),
- this->Target,
- "LINK_LIBRARY_OVERRIDE",
- nullptr, nullptr };
+ cmGeneratorExpressionDAGChecker dag{
+ this->Target->GetBacktrace(),
+ this->Target,
+ "LINK_LIBRARY_OVERRIDE",
+ nullptr,
+ nullptr,
+ this->Target->GetLocalGenerator()
+ };
auto overrideFeature = cmGeneratorExpression::Evaluate(
*feature, this->Target->GetLocalGenerator(), config,
this->Target, &dag, this->Target, linkLanguage);
@@ -273,9 +470,12 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target,
// global override property
if (cmValue linkLibraryOverride =
this->Target->GetProperty("LINK_LIBRARY_OVERRIDE")) {
- cmGeneratorExpressionDAGChecker dag{ target->GetBacktrace(), target,
- "LINK_LIBRARY_OVERRIDE", nullptr,
- nullptr };
+ cmGeneratorExpressionDAGChecker dag{ target->GetBacktrace(),
+ target,
+ "LINK_LIBRARY_OVERRIDE",
+ nullptr,
+ nullptr,
+ target->GetLocalGenerator() };
auto overrideValue = cmGeneratorExpression::Evaluate(
*linkLibraryOverride, target->GetLocalGenerator(), config, target, &dag,
target, linkLanguage);
@@ -376,49 +576,14 @@ cmComputeLinkDepends::Compute()
this->OrderLinkEntries();
// Compute the final set of link entries.
- // Iterate in reverse order so we can keep only the last occurrence
- // of a shared library.
- std::set<size_t> emitted;
- for (size_t i : cmReverseRange(this->FinalLinkOrder)) {
- LinkEntry const& e = this->EntryList[i];
- cmGeneratorTarget const* t = e.Target;
- // Entries that we know the linker will reuse do not need to be repeated.
- bool uniquify = t && t->GetType() == cmStateEnums::SHARED_LIBRARY;
- if (!uniquify || emitted.insert(i).second) {
- this->FinalLinkEntries.push_back(e);
- }
- }
- // Place explicitly linked object files in the front. The linker will
- // always use them anyway, and they may depend on symbols from libraries.
- // Append in reverse order since we reverse the final order below.
- for (size_t i : cmReverseRange(this->ObjectEntries)) {
- this->FinalLinkEntries.emplace_back(this->EntryList[i]);
- }
- // Reverse the resulting order since we iterated in reverse.
- std::reverse(this->FinalLinkEntries.begin(), this->FinalLinkEntries.end());
-
- // Expand group items
- if (!this->GroupItems.empty()) {
- for (const auto& group : this->GroupItems) {
- const LinkEntry& groupEntry = this->EntryList[group.first];
- auto it = this->FinalLinkEntries.begin();
- while (true) {
- it = std::find_if(it, this->FinalLinkEntries.end(),
- [&groupEntry](const LinkEntry& entry) -> bool {
- return groupEntry.Item == entry.Item;
- });
- if (it == this->FinalLinkEntries.end()) {
- break;
- }
- it->Item.Value = "</LINK_GROUP>";
- for (auto i = group.second.rbegin(); i != group.second.rend(); ++i) {
- it = this->FinalLinkEntries.insert(it, this->EntryList[*i]);
- }
- it = this->FinalLinkEntries.insert(it, groupEntry);
- it->Item.Value = "<LINK_GROUP>";
- }
- }
- }
+ EntriesProcessing entriesProcessing{ this->Target, this->LinkLanguage,
+ this->EntryList,
+ this->FinalLinkEntries };
+ // Add groups first, to ensure that libraries of the groups are always kept.
+ entriesProcessing.AddGroups(this->GroupItems);
+ entriesProcessing.AddLibraries(this->FinalLinkOrder);
+ entriesProcessing.AddObjects(this->ObjectEntries);
+ entriesProcessing.Finalize();
// Display the final set.
if (this->DebugMode) {
@@ -466,10 +631,12 @@ std::pair<size_t, bool> cmComputeLinkDepends::AddLinkEntry(
LinkEntry& entry = this->EntryList[index];
entry.Item = BT<std::string>(item.AsStr(), item.Backtrace);
entry.Target = item.Target;
+ entry.Feature = item.Feature;
if (!entry.Target && entry.Item.Value[0] == '-' &&
entry.Item.Value[1] != 'l' &&
entry.Item.Value.substr(0, 10) != "-framework") {
entry.Kind = LinkEntry::Flag;
+ entry.Feature = LinkEntry::DEFAULT;
} else if (cmHasPrefix(entry.Item.Value, LG_BEGIN) &&
cmHasSuffix(entry.Item.Value, '>')) {
entry.Kind = LinkEntry::Group;
@@ -710,7 +877,6 @@ void cmComputeLinkDepends::AddLinkEntries(size_t depender_index,
{
// Track inferred dependency sets implied by this list.
std::map<size_t, DependSet> dependSets;
- std::string feature = LinkEntry::DEFAULT;
bool inGroup = false;
std::pair<size_t, bool> groupIndex{
@@ -727,34 +893,27 @@ void cmComputeLinkDepends::AddLinkEntries(size_t depender_index,
continue;
}
- if (cmHasPrefix(item.AsStr(), LL_BEGIN) &&
- cmHasSuffix(item.AsStr(), '>')) {
- feature = ExtractFeature(item.AsStr());
- // emit a warning if an undefined feature is used as part of
- // an imported target
- if (depender_index != cmComputeComponentGraph::INVALID_COMPONENT) {
- const auto& depender = this->EntryList[depender_index];
- if (depender.Target != nullptr && depender.Target->IsImported() &&
- !IsFeatureSupported(this->Makefile, this->LinkLanguage, feature)) {
- this->CMakeInstance->IssueMessage(
- MessageType::AUTHOR_ERROR,
- cmStrCat("The 'IMPORTED' target '", depender.Target->GetName(),
- "' uses the generator-expression '$<LINK_LIBRARY>' with "
- "the feature '",
- feature,
- "', which is undefined or unsupported.\nDid you miss to "
- "define it by setting variables \"CMAKE_",
- this->LinkLanguage, "_LINK_LIBRARY_USING_", feature,
- "\" and \"CMAKE_", this->LinkLanguage,
- "_LINK_LIBRARY_USING_", feature, "_SUPPORTED\"?"),
- this->Target->GetBacktrace());
- }
+ // emit a warning if an undefined feature is used as part of
+ // an imported target
+ if (item.Feature != LinkEntry::DEFAULT &&
+ depender_index != cmComputeComponentGraph::INVALID_COMPONENT) {
+ const auto& depender = this->EntryList[depender_index];
+ if (depender.Target != nullptr && depender.Target->IsImported() &&
+ !IsFeatureSupported(this->Makefile, this->LinkLanguage,
+ item.Feature)) {
+ this->CMakeInstance->IssueMessage(
+ MessageType::AUTHOR_ERROR,
+ cmStrCat("The 'IMPORTED' target '", depender.Target->GetName(),
+ "' uses the generator-expression '$<LINK_LIBRARY>' with "
+ "the feature '",
+ item.Feature,
+ "', which is undefined or unsupported.\nDid you miss to "
+ "define it by setting variables \"CMAKE_",
+ this->LinkLanguage, "_LINK_LIBRARY_USING_", item.Feature,
+ "\" and \"CMAKE_", this->LinkLanguage,
+ "_LINK_LIBRARY_USING_", item.Feature, "_SUPPORTED\"?"),
+ this->Target->GetBacktrace());
}
- continue;
- }
- if (cmHasPrefix(item.AsStr(), LL_END) && cmHasSuffix(item.AsStr(), '>')) {
- feature = LinkEntry::DEFAULT;
- continue;
}
if (cmHasPrefix(item.AsStr(), LG_BEGIN) &&
@@ -815,7 +974,7 @@ void cmComputeLinkDepends::AddLinkEntries(size_t depender_index,
dependee_index = ale.first;
LinkEntry& entry = this->EntryList[dependee_index];
auto const& itemFeature =
- this->GetCurrentFeature(entry.Item.Value, feature);
+ this->GetCurrentFeature(entry.Item.Value, item.Feature);
if (inGroup && ale.second && entry.Target != nullptr &&
(entry.Target->GetType() == cmStateEnums::TargetType::OBJECT_LIBRARY ||
entry.Target->GetType() ==
@@ -834,30 +993,27 @@ void cmComputeLinkDepends::AddLinkEntries(size_t depender_index,
" library '", entry.Item.Value, "'."),
this->Target->GetBacktrace());
}
- if (itemFeature != LinkEntry::DEFAULT) {
- if (ale.second) {
- // current item not yet defined
- if (entry.Target != nullptr &&
- (entry.Target->GetType() ==
- cmStateEnums::TargetType::OBJECT_LIBRARY ||
- entry.Target->GetType() ==
- cmStateEnums::TargetType::INTERFACE_LIBRARY)) {
- this->CMakeInstance->IssueMessage(
- MessageType::AUTHOR_WARNING,
- cmStrCat("The feature '", feature,
- "', specified as part of a generator-expression "
- "'$",
- LL_BEGIN, feature, ">', will not be applied to the ",
- (entry.Target->GetType() ==
- cmStateEnums::TargetType::OBJECT_LIBRARY
- ? "OBJECT"
- : "INTERFACE"),
- " library '", entry.Item.Value, "'."),
- this->Target->GetBacktrace());
- } else {
- entry.Feature = itemFeature;
- }
+ if (ale.second) {
+ // current item not yet defined
+ if (itemFeature != LinkEntry::DEFAULT && entry.Target != nullptr &&
+ (entry.Target->GetType() ==
+ cmStateEnums::TargetType::OBJECT_LIBRARY ||
+ entry.Target->GetType() ==
+ cmStateEnums::TargetType::INTERFACE_LIBRARY)) {
+ this->CMakeInstance->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat("The feature '", itemFeature,
+ "', specified as part of a generator-expression "
+ "'$<LINK_LIBRARY:",
+ itemFeature, ">', will not be applied to the ",
+ (entry.Target->GetType() ==
+ cmStateEnums::TargetType::OBJECT_LIBRARY
+ ? "OBJECT"
+ : "INTERFACE"),
+ " library '", entry.Item.Value, "'."),
+ this->Target->GetBacktrace());
}
+ entry.Feature = itemFeature;
}
bool supportedItem = entry.Target == nullptr ||
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 3233217..66daa07 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -49,7 +49,7 @@ public:
{
}
- static const std::string DEFAULT;
+ static std::string const& DEFAULT;
enum EntryKind
{
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 47717e3..b631610 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -646,7 +646,7 @@ bool cmComputeLinkInformation::Compute()
// Restore the target link type so the correct system runtime
// libraries are found.
cmValue lss = this->Target->GetProperty("LINK_SEARCH_END_STATIC");
- if (cmIsOn(lss)) {
+ if (lss.IsOn()) {
this->SetCurrentLinkType(LinkStatic);
} else {
this->SetCurrentLinkType(this->StartLinkType);
@@ -1332,7 +1332,17 @@ void cmComputeLinkInformation::AddSharedDepItem(LinkEntry const& entry)
}
// If in linking mode, just link to the shared library.
- if (this->SharedDependencyMode == SharedDepModeLink) {
+ if (this->SharedDependencyMode == SharedDepModeLink ||
+ // For an imported shared library without a known runtime artifact,
+ // such as a CUDA stub, a library file named with the real soname
+ // may not be available at all, so '-rpath-link' cannot help linkers
+ // find it to satisfy '--no-allow-shlib-undefined' recursively.
+ // Pass this dependency to the linker explicitly just in case.
+ // If the linker also uses '--as-needed' behavior, this will not
+ // add an unnecessary direct dependency.
+ (tgt && tgt->IsImported() &&
+ !tgt->HasKnownRuntimeArtifactLocation(this->Config) &&
+ this->Target->LinkerEnforcesNoAllowShLibUndefined(this->Config))) {
this->AddItem(entry);
return;
}
@@ -1441,7 +1451,7 @@ void cmComputeLinkInformation::ComputeLinkTypeInfo()
// Lookup the starting link type from the target (linked statically?).
cmValue lss = this->Target->GetProperty("LINK_SEARCH_START_STATIC");
- this->StartLinkType = cmIsOn(lss) ? LinkStatic : LinkShared;
+ this->StartLinkType = lss.IsOn() ? LinkStatic : LinkShared;
this->CurrentLinkType = this->StartLinkType;
}
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 6763225..0bcc7b9 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -473,7 +473,7 @@ void cmComputeTargetDepends::ComputeIntermediateGraph()
} else {
if (cmValue optimizeDependencies =
gt->GetProperty("OPTIMIZE_DEPENDENCIES")) {
- if (cmIsOn(optimizeDependencies)) {
+ if (optimizeDependencies.IsOn()) {
this->OptimizeLinkDependencies(gt, intermediateEdges, initialEdges);
} else {
intermediateEdges = initialEdges;
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 6f9f541..5a2b33a 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -33,6 +33,9 @@ auto const keyCOMMAND = "COMMAND"_s;
auto const keyDEFINED = "DEFINED"_s;
auto const keyEQUAL = "EQUAL"_s;
auto const keyEXISTS = "EXISTS"_s;
+auto const keyIS_READABLE = "IS_READABLE"_s;
+auto const keyIS_WRITABLE = "IS_WRITABLE"_s;
+auto const keyIS_EXECUTABLE = "IS_EXECUTABLE"_s;
auto const keyGREATER = "GREATER"_s;
auto const keyGREATER_EQUAL = "GREATER_EQUAL"_s;
auto const keyIN_LIST = "IN_LIST"_s;
@@ -396,7 +399,7 @@ bool cmConditionEvaluator::GetBooleanValue(
// Check definition.
cmValue def = this->GetDefinitionIfUnquoted(arg);
- return !cmIsOff(def);
+ return !def.IsOff();
}
//=========================================================================
@@ -413,14 +416,14 @@ bool cmConditionEvaluator::GetBooleanValueOld(
return true;
}
cmValue def = this->GetDefinitionIfUnquoted(arg);
- return !cmIsOff(def);
+ return !def.IsOff();
}
// Old GetVariableOrNumber behavior.
cmValue def = this->GetDefinitionIfUnquoted(arg);
if (!def && std::atoi(arg.GetValue().c_str())) {
def = cmValue(arg.GetValue());
}
- return !cmIsOff(def);
+ return !def.IsOff();
}
//=========================================================================
@@ -568,6 +571,24 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
newArgs.ReduceOneArg(cmSystemTools::FileExists(args.next->GetValue()),
args);
}
+ // check if a file is readable
+ else if (this->IsKeyword(keyIS_READABLE, *args.current)) {
+ newArgs.ReduceOneArg(cmSystemTools::TestFileAccess(
+ args.next->GetValue(), cmsys::TEST_FILE_READ),
+ args);
+ }
+ // check if a file is writable
+ else if (this->IsKeyword(keyIS_WRITABLE, *args.current)) {
+ newArgs.ReduceOneArg(cmSystemTools::TestFileAccess(
+ args.next->GetValue(), cmsys::TEST_FILE_WRITE),
+ args);
+ }
+ // check if a file is executable
+ else if (this->IsKeyword(keyIS_EXECUTABLE, *args.current)) {
+ newArgs.ReduceOneArg(cmSystemTools::TestFileAccess(
+ args.next->GetValue(), cmsys::TEST_FILE_EXECUTE),
+ args);
+ }
// does a directory with this name exist
else if (this->IsKeyword(keyIS_DIRECTORY, *args.current)) {
newArgs.ReduceOneArg(
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index de74716..23e4846 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -14,8 +14,13 @@
#pragma warning(disable : 1572) /* floating-point equality test */
#endif
-#if defined(__LCC__) && defined(__EDG__) && (__LCC__ == 123)
+#if defined(__LCC__) && defined(__EDG__)
+#if __LCC__ == 123
#pragma diag_suppress 2910 /* excess -Wunused-function in 1.23.x */
+#elif __LCC__ == 121
+#pragma diag_suppress 2727 /* excess -Wunused-function in 1.21.x */
+#include <limits.h> /* ..._MIN, ..._MAX constants */
+#endif
#endif
#cmakedefine HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 8c84ace..6d3e01c 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -14,6 +14,7 @@
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
+#include "cmsys/RegularExpression.hxx"
#include "cmArgumentParser.h"
#include "cmConfigureLog.h"
@@ -83,6 +84,7 @@ std::string const kCMAKE_HIP_PLATFORM = "CMAKE_HIP_PLATFORM";
std::string const kCMAKE_HIP_RUNTIME_LIBRARY = "CMAKE_HIP_RUNTIME_LIBRARY";
std::string const kCMAKE_ISPC_INSTRUCTION_SETS = "CMAKE_ISPC_INSTRUCTION_SETS";
std::string const kCMAKE_ISPC_HEADER_SUFFIX = "CMAKE_ISPC_HEADER_SUFFIX";
+std::string const kCMAKE_LINKER_TYPE = "CMAKE_LINKER_TYPE";
std::string const kCMAKE_LINK_SEARCH_END_STATIC =
"CMAKE_LINK_SEARCH_END_STATIC";
std::string const kCMAKE_LINK_SEARCH_START_STATIC =
@@ -176,6 +178,7 @@ auto const TryCompileBaseSourcesArgParser =
ArgumentParser::ExpectAtLeast{ 0 })
.Bind("LINK_LIBRARIES"_s, &Arguments::LinkLibraries)
.Bind("LINK_OPTIONS"_s, &Arguments::LinkOptions)
+ .Bind("LINKER_LANGUAGE"_s, &Arguments::LinkerLanguage)
.Bind("COPY_FILE"_s, &Arguments::CopyFileTo)
.Bind("COPY_FILE_ERROR"_s, &Arguments::CopyFileError)
.BIND_LANG_PROPS(C)
@@ -852,8 +855,30 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
fclose(fout);
return cm::nullopt;
}
- fprintf(fout, "\ninclude(\"${CMAKE_CURRENT_LIST_DIR}/%s\")\n\n",
+ fprintf(fout, "\ninclude(\"${CMAKE_CURRENT_LIST_DIR}/%s\")\n",
fname.c_str());
+ // Create all relevant alias targets
+ if (arguments.LinkLibraries) {
+ const auto& aliasTargets = this->Makefile->GetAliasTargets();
+ for (std::string const& i : *arguments.LinkLibraries) {
+ auto alias = aliasTargets.find(i);
+ if (alias != aliasTargets.end()) {
+ const auto& aliasTarget =
+ this->Makefile->FindTargetToUse(alias->second);
+ // Create equivalent library/executable alias
+ if (aliasTarget->GetType() == cmStateEnums::EXECUTABLE) {
+ fprintf(fout, "add_executable(\"%s\" ALIAS \"%s\")\n", i.c_str(),
+ alias->second.c_str());
+ } else {
+ // Other cases like UTILITY and GLOBAL_TARGET are excluded when
+ // arguments.LinkLibraries is initially parsed in this function.
+ fprintf(fout, "add_library(\"%s\" ALIAS \"%s\")\n", i.c_str(),
+ alias->second.c_str());
+ }
+ }
+ }
+ }
+ fprintf(fout, "\n");
}
/* Set the appropriate policy information for ENABLE_EXPORTS */
@@ -877,6 +902,14 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
? "NEW"
: "OLD");
+ /* Set the appropriate policy information for Swift compilation mode */
+ fprintf(
+ fout, "cmake_policy(SET CMP0157 %s)\n",
+ this->Makefile->GetDefinition("CMAKE_Swift_COMPILATION_MODE_DEFAULT")
+ .IsEmpty()
+ ? "OLD"
+ : "NEW");
+
// Workaround for -Wl,-headerpad_max_install_names issue until we can avoid
// adding that flag in the platform and compiler language files
fprintf(fout,
@@ -1041,6 +1074,19 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
}
}
+ if (arguments.LinkerLanguage) {
+ std::string LinkerLanguage = *arguments.LinkerLanguage;
+ if (testLangs.find(LinkerLanguage) == testLangs.end()) {
+ this->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ "Linker language '" + LinkerLanguage +
+ "' must be enabled in project(LANGUAGES).");
+ }
+
+ fprintf(fout, "set_property(TARGET %s PROPERTY LINKER_LANGUAGE %s)\n",
+ targetName.c_str(), LinkerLanguage.c_str());
+ }
+
if (arguments.LinkLibraries) {
std::string libsToLink = " ";
for (std::string const& i : *arguments.LinkLibraries) {
@@ -1105,6 +1151,7 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
vars.emplace("CMAKE_WATCOM_RUNTIME_LIBRARY"_s);
vars.emplace("CMAKE_MSVC_DEBUG_INFORMATION_FORMAT"_s);
vars.emplace("CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS"_s);
+ vars.emplace("CMAKE_VS_USE_DEBUG_LIBRARIES"_s);
if (cmValue varListStr = this->Makefile->GetDefinition(
kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES)) {
@@ -1112,6 +1159,20 @@ cm::optional<cmTryCompileResult> cmCoreTryCompile::TryCompileCode(
vars.insert(varList.begin(), varList.end());
}
+ if (this->Makefile->GetDefinition(kCMAKE_LINKER_TYPE)) {
+ // propagate various variables to support linker selection
+ vars.insert(kCMAKE_LINKER_TYPE);
+ auto defs = this->Makefile->GetDefinitions();
+ cmsys::RegularExpression linkerTypeDef{
+ "^CMAKE_[A-Za-z_-]+_USING_LINKER_"
+ };
+ for (auto const& def : defs) {
+ if (linkerTypeDef.find(def)) {
+ vars.insert(def);
+ }
+ }
+ }
+
if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0083) ==
cmPolicies::NEW) {
// To ensure full support of PIE, propagate cache variables
diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h
index 3217a1b..6a26e88 100644
--- a/Source/cmCoreTryCompile.h
+++ b/Source/cmCoreTryCompile.h
@@ -91,6 +91,7 @@ public:
cm::optional<ArgumentParser::MaybeEmpty<std::vector<std::string>>>
LinkLibraries;
ArgumentParser::MaybeEmpty<std::vector<std::string>> LinkOptions;
+ cm::optional<std::string> LinkerLanguage;
std::map<std::string, std::string> LangProps;
std::string CMakeInternal;
cm::optional<std::string> OutputVariable;
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx
index 75c25e3..9edbafe 100644
--- a/Source/cmCreateTestSourceList.cxx
+++ b/Source/cmCreateTestSourceList.cxx
@@ -81,8 +81,8 @@ bool cmCreateTestSourceList(std::vector<std::string> const& args,
}
std::string func_name;
if (!cmSystemTools::GetFilenamePath(*i).empty()) {
- func_name = cmSystemTools::GetFilenamePath(*i) + "/" +
- cmSystemTools::GetFilenameWithoutLastExtension(*i);
+ func_name = cmStrCat(cmSystemTools::GetFilenamePath(*i), '/',
+ cmSystemTools::GetFilenameWithoutLastExtension(*i));
} else {
func_name = cmSystemTools::GetFilenameWithoutLastExtension(*i);
}
@@ -93,9 +93,7 @@ bool cmCreateTestSourceList(std::vector<std::string> const& args,
tests_func_name.end();
tests_func_name.push_back(func_name);
if (!already_declared) {
- forwardDeclareCode += "int ";
- forwardDeclareCode += func_name;
- forwardDeclareCode += "(int, char*[]);\n";
+ forwardDeclareCode += cmStrCat("int ", func_name, "(int, char*[]);\n");
}
}
@@ -105,8 +103,8 @@ bool cmCreateTestSourceList(std::vector<std::string> const& args,
++i, ++j) {
std::string func_name;
if (!cmSystemTools::GetFilenamePath(*i).empty()) {
- func_name = cmSystemTools::GetFilenamePath(*i) + "/" +
- cmSystemTools::GetFilenameWithoutLastExtension(*i);
+ func_name = cmStrCat(cmSystemTools::GetFilenamePath(*i), '/',
+ cmSystemTools::GetFilenameWithoutLastExtension(*i));
} else {
func_name = cmSystemTools::GetFilenameWithoutLastExtension(*i);
}
@@ -137,12 +135,12 @@ bool cmCreateTestSourceList(std::vector<std::string> const& args,
{
cmSourceFile* sf = mf.GetOrCreateSource(driver);
sf->SetProperty("ABSTRACT", "0");
- sourceListValue = args[1];
+ sourceListValue = driver;
}
for (i = testsBegin; i != tests.end(); ++i) {
cmSourceFile* sf = mf.GetOrCreateSource(*i);
sf->SetProperty("ABSTRACT", "0");
- sourceListValue += ";";
+ sourceListValue += ';';
sourceListValue += *i;
}
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index ff9ab0f..55e3a5b 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCryptoHash.h"
+#include <cassert>
+
#include <cm/memory>
#include <cm3p/kwiml/int.h>
@@ -80,6 +82,37 @@ std::unique_ptr<cmCryptoHash> cmCryptoHash::New(cm::string_view algo)
return std::unique_ptr<cmCryptoHash>(nullptr);
}
+std::string cmCryptoHash::GetHashAlgoName() const
+{
+#ifndef CMAKE_USE_SYSTEM_LIBRHASH
+ static_assert(RHASH_HASH_COUNT == 10, "Update switch statement!");
+#endif
+ switch (this->Id) {
+ case RHASH_MD5:
+ return "MD5";
+ case RHASH_SHA1:
+ return "SHA1";
+ case RHASH_SHA224:
+ return "SHA224";
+ case RHASH_SHA256:
+ return "SHA256";
+ case RHASH_SHA384:
+ return "SHA384";
+ case RHASH_SHA512:
+ return "SHA512";
+ case RHASH_SHA3_224:
+ return "SHA3_224";
+ case RHASH_SHA3_256:
+ return "SHA3_256";
+ case RHASH_SHA3_384:
+ return "SHA3_384";
+ case RHASH_SHA3_512:
+ return "SHA3_512";
+ }
+ assert(false);
+ return "UNKNOWN";
+}
+
bool cmCryptoHash::IntFromHexDigit(char input, char& output)
{
if (input >= '0' && input <= '9') {
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index a2d45e7..bb026a2 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -74,6 +74,10 @@ public:
/// An empty string otherwise.
std::string HashFile(const std::string& file);
+ /// @brief Returns the name of the hash type.
+ /// @return The name of the hash type associated with this hash generator.
+ std::string GetHashAlgoName() const;
+
void Initialize();
void Append(void const*, size_t);
void Append(cm::string_view input);
diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx
index 24ba368..ddd5f69 100644
--- a/Source/cmCurl.cxx
+++ b/Source/cmCurl.cxx
@@ -2,6 +2,9 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCurl.h"
+#include <cm/string_view>
+#include <cmext/string_view>
+
#if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \
!defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH)
# define CMAKE_FIND_CAFILE
@@ -31,6 +34,54 @@
} \
} while (false)
+// curl versions before 7.52.0 did not provide TLS 1.3 support
+#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM < 0x073400
+# define CURL_SSLVERSION_TLSv1_3 CURL_SSLVERSION_LAST
+#endif
+
+// Make sure we keep up with new TLS versions supported by curl.
+// Do this only for our vendored curl to avoid breaking builds
+// against external future versions of curl.
+#if !defined(CMAKE_USE_SYSTEM_CURL)
+static_assert(CURL_SSLVERSION_LAST == 8,
+ "A new CURL_SSLVERSION_ may be available!");
+#endif
+
+cm::optional<int> cmCurlParseTLSVersion(cm::string_view tls_version)
+{
+ cm::optional<int> v;
+ if (tls_version == "1.0"_s) {
+ v = CURL_SSLVERSION_TLSv1_0;
+ } else if (tls_version == "1.1"_s) {
+ v = CURL_SSLVERSION_TLSv1_1;
+ } else if (tls_version == "1.2"_s) {
+ v = CURL_SSLVERSION_TLSv1_2;
+ } else if (tls_version == "1.3"_s) {
+ v = CURL_SSLVERSION_TLSv1_3;
+ }
+ return v;
+}
+
+cm::optional<std::string> cmCurlPrintTLSVersion(int curl_tls_version)
+{
+ cm::optional<std::string> s;
+ switch (curl_tls_version) {
+ case CURL_SSLVERSION_TLSv1_0:
+ s = "CURL_SSLVERSION_TLSv1_0"_s;
+ break;
+ case CURL_SSLVERSION_TLSv1_1:
+ s = "CURL_SSLVERSION_TLSv1_1"_s;
+ break;
+ case CURL_SSLVERSION_TLSv1_2:
+ s = "CURL_SSLVERSION_TLSv1_2"_s;
+ break;
+ case CURL_SSLVERSION_TLSv1_3:
+ s = "CURL_SSLVERSION_TLSv1_3"_s;
+ break;
+ }
+ return s;
+}
+
std::string cmCurlSetCAInfo(::CURL* curl, const std::string& cafile)
{
std::string e;
diff --git a/Source/cmCurl.h b/Source/cmCurl.h
index b5134f4..8b8c88b 100644
--- a/Source/cmCurl.h
+++ b/Source/cmCurl.h
@@ -6,8 +6,13 @@
#include <string>
+#include <cm/optional>
+#include <cm/string_view>
+
#include <cm3p/curl/curl.h>
+cm::optional<int> cmCurlParseTLSVersion(cm::string_view tls_version);
+cm::optional<std::string> cmCurlPrintTLSVersion(int curl_tls_version);
std::string cmCurlSetCAInfo(::CURL* curl, const std::string& cafile = {});
std::string cmCurlSetNETRCOption(::CURL* curl, const std::string& netrc_level,
const std::string& netrc_file);
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 634b63b..2dea338 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -284,8 +284,12 @@ void cmCustomCommandGenerator::FillEmulatorsWithArguments()
if (!this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")) {
return;
}
+ cmGeneratorExpression ge(*this->LG->GetCMakeInstance(),
+ this->CC->GetBacktrace());
for (unsigned int c = 0; c < this->GetNumberOfCommands(); ++c) {
+ // If the command is the plain name of an executable target,
+ // launch it with its emulator.
std::string const& argv0 = this->CommandLines[c][0];
cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0);
if (target && target->GetType() == cmStateEnums::EXECUTABLE &&
@@ -297,7 +301,12 @@ void cmCustomCommandGenerator::FillEmulatorsWithArguments()
continue;
}
- cmExpandList(*emulator_property, this->EmulatorsWithArguments[c]);
+ // Plain target names are replaced by GetArgv0Location with the
+ // path to the executable artifact in the command config, so
+ // evaluate the launcher's location in the command config too.
+ std::string const emulator =
+ ge.Parse(*emulator_property)->Evaluate(this->LG, this->CommandConfig);
+ cmExpandList(emulator, this->EmulatorsWithArguments[c]);
}
}
}
@@ -313,6 +322,8 @@ std::vector<std::string> cmCustomCommandGenerator::GetCrossCompilingEmulator(
const char* cmCustomCommandGenerator::GetArgv0Location(unsigned int c) const
{
+ // If the command is the plain name of an executable target, we replace it
+ // with the path to the executable artifact in the command config.
std::string const& argv0 = this->CommandLines[c][0];
cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0);
if (target && target->GetType() == cmStateEnums::EXECUTABLE &&
diff --git a/Source/cmDebugTools.h b/Source/cmDebugTools.h
index 99c0c6b..c3e05a6 100644
--- a/Source/cmDebugTools.h
+++ b/Source/cmDebugTools.h
@@ -4,6 +4,8 @@
#include <iostream>
+#include "cmSystemTools.h"
+
#define CM_DBG(expr) cm::dbg_impl(__FILE__, __LINE__, #expr, expr)
namespace cm {
@@ -13,8 +15,10 @@ namespace {
template <typename T>
T dbg_impl(const char* fname, int line, const char* expr, T value)
{
- std::cerr << fname << ':' << line << ": " << expr << " = " << value
- << std::endl;
+ if (!cmSystemTools::GetEnvVar("CMAKE_NO_DBG")) {
+ std::cerr << fname << ':' << line << ": " << expr << " = " << value
+ << std::endl;
+ }
return value;
}
diff --git a/Source/cmDebuggerExceptionManager.cxx b/Source/cmDebuggerExceptionManager.cxx
index a27426c..470e44c 100644
--- a/Source/cmDebuggerExceptionManager.cxx
+++ b/Source/cmDebuggerExceptionManager.cxx
@@ -78,7 +78,7 @@ cmDebuggerExceptionManager::HandleExceptionInfoRequest()
response.exceptionId = TheException->Id;
response.breakMode = "always";
response.description = TheException->Description;
- TheException = {};
+ TheException = cm::nullopt;
}
return response;
}
diff --git a/Source/cmDebuggerStackFrame.h b/Source/cmDebuggerStackFrame.h
index dc3b2ab..f4e6612 100644
--- a/Source/cmDebuggerStackFrame.h
+++ b/Source/cmDebuggerStackFrame.h
@@ -28,6 +28,10 @@ public:
std::string const& GetFileName() const noexcept { return this->FileName; }
int64_t GetLine() const noexcept;
cmMakefile* GetMakefile() const noexcept { return this->Makefile; }
+ cmListFileFunction const& GetFunction() const noexcept
+ {
+ return this->Function;
+ }
};
} // namespace cmDebugger
diff --git a/Source/cmDebuggerThread.cxx b/Source/cmDebuggerThread.cxx
index fd52f5a..f7a1778 100644
--- a/Source/cmDebuggerThread.cxx
+++ b/Source/cmDebuggerThread.cxx
@@ -13,6 +13,7 @@
#include "cmDebuggerVariables.h"
#include "cmDebuggerVariablesHelper.h"
#include "cmDebuggerVariablesManager.h"
+#include "cmListFileCache.h"
namespace cmDebugger {
@@ -135,8 +136,7 @@ dap::StackTraceResponse GetStackTraceResponse(
#endif
stackFrame.line = thread->Frames[i]->GetLine();
stackFrame.column = 1;
- stackFrame.name = thread->Frames[i]->GetFileName() + " Line " +
- std::to_string(stackFrame.line);
+ stackFrame.name = thread->Frames[i]->GetFunction().OriginalName();
stackFrame.id = thread->Frames[i]->GetId();
stackFrame.source = source;
diff --git a/Source/cmDyndepCollation.cxx b/Source/cmDyndepCollation.cxx
index 619aff0..bfe3a75 100644
--- a/Source/cmDyndepCollation.cxx
+++ b/Source/cmDyndepCollation.cxx
@@ -247,14 +247,16 @@ Json::Value CollationInformationExports(cmGeneratorTarget const* gt)
gt->GetGlobalGenerator()->GetBuildExportSets();
for (auto const& exp_entry : all_build_exports) {
auto const* exp = exp_entry.second;
- std::vector<std::string> targets;
+ std::vector<cmExportBuildFileGenerator::TargetExport> targets;
exp->GetTargets(targets);
// Ignore exports sets which are not for this target.
auto const& name = gt->GetName();
bool has_current_target =
std::any_of(targets.begin(), targets.end(),
- [name](std::string const& tname) { return tname == name; });
+ [name](cmExportBuildFileGenerator::TargetExport const& te) {
+ return te.Name == name;
+ });
if (!has_current_target) {
continue;
}
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 8aea753..a71e5f1 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -212,7 +212,8 @@ public:
// Return the number of sections as specified by the ELF header.
unsigned int GetNumberOfSections() const override
{
- return static_cast<unsigned int>(this->ELFHeader.e_shnum);
+ return static_cast<unsigned int>(this->ELFHeader.e_shnum +
+ this->SectionHeaders[0].sh_size);
}
// Get the file position of a dynamic section entry.
@@ -367,7 +368,7 @@ private:
return !this->Stream->fail();
}
- bool LoadSectionHeader(ELF_Half i)
+ bool LoadSectionHeader(unsigned int i)
{
// Read the section header from the file.
this->Stream->seekg(this->ELFHeader.e_shoff +
@@ -378,7 +379,7 @@ private:
// Identify some important sections.
if (this->SectionHeaders[i].sh_type == SHT_DYNAMIC) {
- this->DynamicSectionIndex = i;
+ this->DynamicSectionIndex = static_cast<int>(i);
}
return true;
}
@@ -444,8 +445,11 @@ cmELFInternalImpl<Types>::cmELFInternalImpl(cmELF* external,
this->Machine = this->ELFHeader.e_machine;
// Load the section headers.
- this->SectionHeaders.resize(this->ELFHeader.e_shnum);
- for (ELF_Half i = 0; i < this->ELFHeader.e_shnum; ++i) {
+ this->SectionHeaders.resize(
+ this->ELFHeader.e_shnum == 0 ? 1 : this->ELFHeader.e_shnum);
+ this->LoadSectionHeader(0);
+ this->SectionHeaders.resize(this->GetNumberOfSections());
+ for (unsigned int i = 1; i < this->GetNumberOfSections(); ++i) {
if (!this->LoadSectionHeader(i)) {
this->SetErrorMessage("Failed to load section headers.");
return;
@@ -617,7 +621,19 @@ cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString(
// Make sure the whole value was read.
if (!(*this->Stream)) {
- this->SetErrorMessage("Dynamic section specifies unreadable RPATH.");
+ if (tag == cmELF::TagRPath) {
+ this->SetErrorMessage(
+ "Dynamic section specifies unreadable DT_RPATH");
+ } else if (tag == cmELF::TagRunPath) {
+ this->SetErrorMessage(
+ "Dynamic section specifies unreadable DT_RUNPATH");
+ } else if (tag == cmELF::TagMipsRldMapRel) {
+ this->SetErrorMessage(
+ "Dynamic section specifies unreadable DT_MIPS_RLD_MAP_REL");
+ } else {
+ this->SetErrorMessage("Dynamic section specifies unreadable value"
+ " for unexpected attribute");
+ }
se.Value = "";
return nullptr;
}
diff --git a/Source/cmEnableLanguageCommand.cxx b/Source/cmEnableLanguageCommand.cxx
index 59522c0..87fb077 100644
--- a/Source/cmEnableLanguageCommand.cxx
+++ b/Source/cmEnableLanguageCommand.cxx
@@ -4,6 +4,9 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
+#include "cmPolicies.h"
+#include "cmSystemTools.h"
bool cmEnableLanguageCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
@@ -13,6 +16,27 @@ bool cmEnableLanguageCommand(std::vector<std::string> const& args,
return false;
}
+ cmMakefile& mf = status.GetMakefile();
+ if (!mf.IsNormalDefinitionSet("PROJECT_NAME")) {
+ switch (mf.GetPolicyStatus(cmPolicies::CMP0165)) {
+ case cmPolicies::WARN:
+ mf.IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ "project() should be called prior to this enable_language() call.");
+ break;
+ case cmPolicies::OLD:
+ break;
+ case cmPolicies::NEW:
+ mf.IssueMessage(
+ MessageType::FATAL_ERROR,
+ "project() must be called prior to this enable_language() call.");
+ cmSystemTools::SetFatalErrorOccurred();
+ return false;
+ default:
+ break;
+ }
+ }
+
bool optional = false;
std::vector<std::string> languages;
for (std::string const& it : args) {
@@ -23,6 +47,6 @@ bool cmEnableLanguageCommand(std::vector<std::string> const& args,
}
}
- status.GetMakefile().EnableLanguage(languages, optional);
+ mf.EnableLanguage(languages, optional);
return true;
}
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index 3efd3bd..2b923df 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -2,8 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExecuteProcessCommand.h"
-#include <algorithm>
-#include <cctype> /* isspace */
+#include <cstdint>
#include <cstdio>
#include <iostream>
#include <map>
@@ -16,7 +15,7 @@
#include <cmext/algorithm>
#include <cmext/string_view>
-#include "cmsys/Process.h"
+#include <cm3p/uv.h>
#include "cmArgumentParser.h"
#include "cmExecutionStatus.h"
@@ -26,17 +25,20 @@
#include "cmProcessOutput.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVProcessChain.h"
+#include "cmUVStream.h"
namespace {
bool cmExecuteProcessCommandIsWhitespace(char c)
{
- return (isspace(static_cast<int>(c)) || c == '\n' || c == '\r');
+ return (cmIsSpace(c) || c == '\n' || c == '\r');
}
void cmExecuteProcessCommandFixText(std::vector<char>& output,
bool strip_trailing_whitespace);
void cmExecuteProcessCommandAppend(std::vector<char>& output, const char* data,
- int length);
+ std::size_t length);
}
// cmExecuteProcessCommand
@@ -161,57 +163,68 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
}
}
// Create a process instance.
- std::unique_ptr<cmsysProcess, void (*)(cmsysProcess*)> cp_ptr(
- cmsysProcess_New(), cmsysProcess_Delete);
- cmsysProcess* cp = cp_ptr.get();
+ cmUVProcessChainBuilder builder;
// Set the command sequence.
for (std::vector<std::string> const& cmd : arguments.Commands) {
- std::vector<const char*> argv(cmd.size() + 1);
- std::transform(cmd.begin(), cmd.end(), argv.begin(),
- [](std::string const& s) { return s.c_str(); });
- argv.back() = nullptr;
- cmsysProcess_AddCommand(cp, argv.data());
+ builder.AddCommand(cmd);
}
// Set the process working directory.
if (!arguments.WorkingDirectory.empty()) {
- cmsysProcess_SetWorkingDirectory(cp, arguments.WorkingDirectory.c_str());
+ builder.SetWorkingDirectory(arguments.WorkingDirectory);
}
- // Always hide the process window.
- cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
-
// Check the output variables.
- bool merge_output = false;
- if (!arguments.InputFile.empty()) {
- cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDIN,
- arguments.InputFile.c_str());
- }
- if (!arguments.OutputFile.empty()) {
- cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDOUT,
- arguments.OutputFile.c_str());
- }
- if (!arguments.ErrorFile.empty()) {
- if (arguments.ErrorFile == arguments.OutputFile) {
- merge_output = true;
- } else {
- cmsysProcess_SetPipeFile(cp, cmsysProcess_Pipe_STDERR,
- arguments.ErrorFile.c_str());
+ std::unique_ptr<FILE, int (*)(FILE*)> inputFile(nullptr, fclose);
+ if (!inputFilename.empty()) {
+ inputFile.reset(cmsys::SystemTools::Fopen(inputFilename, "rb"));
+ if (inputFile) {
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT,
+ inputFile.get());
}
+ } else {
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, stdin);
}
- if (!arguments.OutputVariable.empty() &&
- arguments.OutputVariable == arguments.ErrorVariable) {
- merge_output = true;
+
+ std::unique_ptr<FILE, int (*)(FILE*)> outputFile(nullptr, fclose);
+ if (!outputFilename.empty()) {
+ outputFile.reset(cmsys::SystemTools::Fopen(outputFilename, "wb"));
+ if (outputFile) {
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT,
+ outputFile.get());
+ }
+ } else {
+ if (arguments.OutputVariable == arguments.ErrorVariable &&
+ !arguments.ErrorVariable.empty()) {
+ builder.SetMergedBuiltinStreams();
+ } else {
+ builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT);
+ }
}
- if (merge_output) {
- cmsysProcess_SetOption(cp, cmsysProcess_Option_MergeOutput, 1);
+
+ std::unique_ptr<FILE, int (*)(FILE*)> errorFile(nullptr, fclose);
+ if (!errorFilename.empty()) {
+ if (errorFilename == outputFilename) {
+ if (outputFile) {
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
+ outputFile.get());
+ }
+ } else {
+ errorFile.reset(cmsys::SystemTools::Fopen(errorFilename, "wb"));
+ if (errorFile) {
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
+ errorFile.get());
+ }
+ }
+ } else if (arguments.ErrorVariable.empty() ||
+ (!arguments.ErrorVariable.empty() &&
+ arguments.OutputVariable != arguments.ErrorVariable)) {
+ builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR);
}
// Set the timeout if any.
- if (timeout >= 0) {
- cmsysProcess_SetTimeout(cp, timeout);
- }
+ int64_t timeoutMillis = static_cast<int64_t>(timeout * 1000.0);
bool echo_stdout = false;
bool echo_stderr = false;
@@ -259,36 +272,86 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
}
}
// Start the process.
- cmsysProcess_Execute(cp);
+ auto chain = builder.Start();
+
+ bool timedOut = false;
+ cm::uv_timer_ptr timer;
+
+ if (timeoutMillis >= 0) {
+ timer.init(chain.GetLoop(), &timedOut);
+ timer.start(
+ [](uv_timer_t* handle) {
+ auto* timeoutPtr = static_cast<bool*>(handle->data);
+ *timeoutPtr = true;
+ },
+ timeoutMillis, 0);
+ }
// Read the process output.
- std::vector<char> tempOutput;
- std::vector<char> tempError;
- int length;
- char* data;
- int p;
+ struct ReadData
+ {
+ bool Finished = false;
+ std::vector<char> Output;
+ cm::uv_pipe_ptr Stream;
+ };
+ ReadData outputData;
+ ReadData errorData;
cmProcessOutput processOutput(
cmProcessOutput::FindEncoding(arguments.Encoding));
std::string strdata;
- while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr))) {
- // Put the output in the right place.
- if (p == cmsysProcess_Pipe_STDOUT && !arguments.OutputQuiet) {
- if (arguments.OutputVariable.empty() || arguments.EchoOutputVariable) {
- processOutput.DecodeText(data, length, strdata, 1);
- cmSystemTools::Stdout(strdata);
- }
- if (!arguments.OutputVariable.empty()) {
- cmExecuteProcessCommandAppend(tempOutput, data, length);
- }
- } else if (p == cmsysProcess_Pipe_STDERR && !arguments.ErrorQuiet) {
- if (arguments.ErrorVariable.empty() || arguments.EchoErrorVariable) {
- processOutput.DecodeText(data, length, strdata, 2);
- cmSystemTools::Stderr(strdata);
- }
- if (!arguments.ErrorVariable.empty()) {
- cmExecuteProcessCommandAppend(tempError, data, length);
- }
- }
+
+ std::unique_ptr<cmUVStreamReadHandle> outputHandle;
+ if (chain.OutputStream() >= 0) {
+ outputData.Stream.init(chain.GetLoop(), 0);
+ uv_pipe_open(outputData.Stream, chain.OutputStream());
+ outputHandle = cmUVStreamRead(
+ outputData.Stream,
+ [&arguments, &processOutput, &outputData,
+ &strdata](std::vector<char> data) {
+ if (!arguments.OutputQuiet) {
+ if (arguments.OutputVariable.empty() ||
+ arguments.EchoOutputVariable) {
+ processOutput.DecodeText(data.data(), data.size(), strdata, 1);
+ cmSystemTools::Stdout(strdata);
+ }
+ if (!arguments.OutputVariable.empty()) {
+ cmExecuteProcessCommandAppend(outputData.Output, data.data(),
+ data.size());
+ }
+ }
+ },
+ [&outputData]() { outputData.Finished = true; });
+ } else {
+ outputData.Finished = true;
+ }
+ std::unique_ptr<cmUVStreamReadHandle> errorHandle;
+ if (chain.ErrorStream() >= 0 &&
+ chain.ErrorStream() != chain.OutputStream()) {
+ errorData.Stream.init(chain.GetLoop(), 0);
+ uv_pipe_open(errorData.Stream, chain.ErrorStream());
+ errorHandle = cmUVStreamRead(
+ errorData.Stream,
+ [&arguments, &processOutput, &errorData,
+ &strdata](std::vector<char> data) {
+ if (!arguments.ErrorQuiet) {
+ if (arguments.ErrorVariable.empty() || arguments.EchoErrorVariable) {
+ processOutput.DecodeText(data.data(), data.size(), strdata, 2);
+ cmSystemTools::Stderr(strdata);
+ }
+ if (!arguments.ErrorVariable.empty()) {
+ cmExecuteProcessCommandAppend(errorData.Output, data.data(),
+ data.size());
+ }
+ }
+ },
+ [&errorData]() { errorData.Finished = true; });
+ } else {
+ errorData.Finished = true;
+ }
+
+ while (chain.Valid() && !timedOut &&
+ !(chain.Finished() && outputData.Finished && errorData.Finished)) {
+ uv_run(&chain.GetLoop(), UV_RUN_ONCE);
}
if (!arguments.OutputQuiet &&
(arguments.OutputVariable.empty() || arguments.EchoOutputVariable)) {
@@ -305,151 +368,102 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
}
}
- // All output has been read. Wait for the process to exit.
- cmsysProcess_WaitForExit(cp, nullptr);
- processOutput.DecodeText(tempOutput, tempOutput);
- processOutput.DecodeText(tempError, tempError);
+ // All output has been read.
+ processOutput.DecodeText(outputData.Output, outputData.Output);
+ processOutput.DecodeText(errorData.Output, errorData.Output);
// Fix the text in the output strings.
- cmExecuteProcessCommandFixText(tempOutput,
+ cmExecuteProcessCommandFixText(outputData.Output,
arguments.OutputStripTrailingWhitespace);
- cmExecuteProcessCommandFixText(tempError,
+ cmExecuteProcessCommandFixText(errorData.Output,
arguments.ErrorStripTrailingWhitespace);
// Store the output obtained.
- if (!arguments.OutputVariable.empty() && !tempOutput.empty()) {
+ if (!arguments.OutputVariable.empty() && !outputData.Output.empty()) {
status.GetMakefile().AddDefinition(arguments.OutputVariable,
- tempOutput.data());
+ outputData.Output.data());
}
- if (!merge_output && !arguments.ErrorVariable.empty() &&
- !tempError.empty()) {
+ if (arguments.ErrorVariable != arguments.OutputVariable &&
+ !arguments.ErrorVariable.empty() && !errorData.Output.empty()) {
status.GetMakefile().AddDefinition(arguments.ErrorVariable,
- tempError.data());
+ errorData.Output.data());
}
// Store the result of running the process.
if (!arguments.ResultVariable.empty()) {
- switch (cmsysProcess_GetState(cp)) {
- case cmsysProcess_State_Exited: {
- int v = cmsysProcess_GetExitValue(cp);
- char buf[16];
- snprintf(buf, sizeof(buf), "%d", v);
- status.GetMakefile().AddDefinition(arguments.ResultVariable, buf);
- } break;
- case cmsysProcess_State_Exception:
+ if (timedOut) {
+ status.GetMakefile().AddDefinition(arguments.ResultVariable,
+ "Process terminated due to timeout");
+ } else {
+ auto const* lastStatus = chain.GetStatus().back();
+ auto exception = lastStatus->GetException();
+ if (exception.first == cmUVProcessChain::ExceptionCode::None) {
status.GetMakefile().AddDefinition(
- arguments.ResultVariable, cmsysProcess_GetExceptionString(cp));
- break;
- case cmsysProcess_State_Error:
+ arguments.ResultVariable,
+ std::to_string(static_cast<int>(lastStatus->ExitStatus)));
+ } else {
status.GetMakefile().AddDefinition(arguments.ResultVariable,
- cmsysProcess_GetErrorString(cp));
- break;
- case cmsysProcess_State_Expired:
- status.GetMakefile().AddDefinition(
- arguments.ResultVariable, "Process terminated due to timeout");
- break;
+ exception.second);
+ }
}
}
// Store the result of running the processes.
if (!arguments.ResultsVariable.empty()) {
- switch (cmsysProcess_GetState(cp)) {
- case cmsysProcess_State_Exited: {
- std::vector<std::string> res;
- for (size_t i = 0; i < arguments.Commands.size(); ++i) {
- switch (cmsysProcess_GetStateByIndex(cp, static_cast<int>(i))) {
- case kwsysProcess_StateByIndex_Exited: {
- int exitCode =
- cmsysProcess_GetExitValueByIndex(cp, static_cast<int>(i));
- char buf[16];
- snprintf(buf, sizeof(buf), "%d", exitCode);
- res.emplace_back(buf);
- } break;
- case kwsysProcess_StateByIndex_Exception:
- res.emplace_back(cmsysProcess_GetExceptionStringByIndex(
- cp, static_cast<int>(i)));
- break;
- case kwsysProcess_StateByIndex_Error:
- default:
- res.emplace_back("Error getting the child return code");
- break;
- }
+ if (timedOut) {
+ status.GetMakefile().AddDefinition(arguments.ResultsVariable,
+ "Process terminated due to timeout");
+ } else {
+ std::vector<std::string> res;
+ for (auto const* processStatus : chain.GetStatus()) {
+ auto exception = processStatus->GetException();
+ if (exception.first == cmUVProcessChain::ExceptionCode::None) {
+ res.emplace_back(
+ std::to_string(static_cast<int>(processStatus->ExitStatus)));
+ } else {
+ res.emplace_back(exception.second);
}
- status.GetMakefile().AddDefinition(arguments.ResultsVariable,
- cmList::to_string(res));
- } break;
- case cmsysProcess_State_Exception:
- status.GetMakefile().AddDefinition(
- arguments.ResultsVariable, cmsysProcess_GetExceptionString(cp));
- break;
- case cmsysProcess_State_Error:
- status.GetMakefile().AddDefinition(arguments.ResultsVariable,
- cmsysProcess_GetErrorString(cp));
- break;
- case cmsysProcess_State_Expired:
- status.GetMakefile().AddDefinition(
- arguments.ResultsVariable, "Process terminated due to timeout");
- break;
+ }
+ status.GetMakefile().AddDefinition(arguments.ResultsVariable,
+ cmList::to_string(res));
}
}
- auto queryProcessStatusByIndex = [&cp](int index) -> std::string {
- std::string processStatus;
- switch (cmsysProcess_GetStateByIndex(cp, static_cast<int>(index))) {
- case kwsysProcess_StateByIndex_Exited: {
- int exitCode = cmsysProcess_GetExitValueByIndex(cp, index);
- if (exitCode) {
- processStatus = "Child return code: " + std::to_string(exitCode);
- }
- } break;
- case kwsysProcess_StateByIndex_Exception: {
- processStatus = cmStrCat(
- "Abnormal exit with child return code: ",
- cmsysProcess_GetExceptionStringByIndex(cp, static_cast<int>(index)));
- break;
+ auto queryProcessStatusByIndex = [&chain](std::size_t index) -> std::string {
+ auto const& processStatus = chain.GetStatus(index);
+ auto exception = processStatus.GetException();
+ if (exception.first == cmUVProcessChain::ExceptionCode::None) {
+ if (processStatus.ExitStatus) {
+ return cmStrCat("Child return code: ", processStatus.ExitStatus);
}
- case kwsysProcess_StateByIndex_Error:
- default:
- processStatus = "Error getting the child return code";
- break;
+ return "";
}
- return processStatus;
+ return cmStrCat("Abnormal exit with child return code: ",
+ exception.second);
};
if (arguments.CommandErrorIsFatal == "ANY"_s) {
bool ret = true;
- switch (cmsysProcess_GetState(cp)) {
- case cmsysProcess_State_Exited: {
- std::map<int, std::string> failureIndices;
- for (int i = 0; i < static_cast<int>(arguments.Commands.size()); ++i) {
- std::string processStatus = queryProcessStatusByIndex(i);
- if (!processStatus.empty()) {
- failureIndices[i] = processStatus;
- }
- if (!failureIndices.empty()) {
- std::ostringstream oss;
- oss << "failed command indexes:\n";
- for (auto const& e : failureIndices) {
- oss << " " << e.first + 1 << ": \"" << e.second << "\"\n";
- }
- status.SetError(oss.str());
- ret = false;
- }
+ if (timedOut) {
+ status.SetError("Process terminated due to timeout");
+ ret = false;
+ } else {
+ std::map<std::size_t, std::string> failureIndices;
+ auto statuses = chain.GetStatus();
+ for (std::size_t i = 0; i < statuses.size(); ++i) {
+ std::string processStatus = queryProcessStatusByIndex(i);
+ if (!processStatus.empty()) {
+ failureIndices[i] = processStatus;
}
- } break;
- case cmsysProcess_State_Exception:
- status.SetError(
- cmStrCat("abnormal exit: ", cmsysProcess_GetExceptionString(cp)));
- ret = false;
- break;
- case cmsysProcess_State_Error:
- status.SetError(cmStrCat("error getting child return code: ",
- cmsysProcess_GetErrorString(cp)));
- ret = false;
- break;
- case cmsysProcess_State_Expired:
- status.SetError("Process terminated due to timeout");
+ }
+ if (!failureIndices.empty()) {
+ std::ostringstream oss;
+ oss << "failed command indexes:\n";
+ for (auto const& e : failureIndices) {
+ oss << " " << e.first + 1 << ": \"" << e.second << "\"\n";
+ }
+ status.SetError(oss.str());
ret = false;
- break;
+ }
}
if (!ret) {
@@ -460,29 +474,23 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
if (arguments.CommandErrorIsFatal == "LAST"_s) {
bool ret = true;
- switch (cmsysProcess_GetState(cp)) {
- case cmsysProcess_State_Exited: {
+ if (timedOut) {
+ status.SetError("Process terminated due to timeout");
+ ret = false;
+ } else {
+ auto const& lastStatus = chain.GetStatus(arguments.Commands.size() - 1);
+ auto exception = lastStatus.GetException();
+ if (exception.first != cmUVProcessChain::ExceptionCode::None) {
+ status.SetError(cmStrCat("Abnormal exit: ", exception.second));
+ ret = false;
+ } else {
int lastIndex = static_cast<int>(arguments.Commands.size() - 1);
const std::string processStatus = queryProcessStatusByIndex(lastIndex);
if (!processStatus.empty()) {
status.SetError("last command failed");
ret = false;
}
- } break;
- case cmsysProcess_State_Exception:
- status.SetError(
- cmStrCat("Abnormal exit: ", cmsysProcess_GetExceptionString(cp)));
- ret = false;
- break;
- case cmsysProcess_State_Error:
- status.SetError(cmStrCat("Error getting child return code: ",
- cmsysProcess_GetErrorString(cp)));
- ret = false;
- break;
- case cmsysProcess_State_Expired:
- status.SetError("Process terminated due to timeout");
- ret = false;
- break;
+ }
}
if (!ret) {
cmSystemTools::SetFatalErrorOccurred();
@@ -525,7 +533,7 @@ void cmExecuteProcessCommandFixText(std::vector<char>& output,
}
void cmExecuteProcessCommandAppend(std::vector<char>& output, const char* data,
- int length)
+ std::size_t length)
{
#if defined(__APPLE__)
// HACK on Apple to work around bug with inserting at the
diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h
index ced3548..e023971 100644
--- a/Source/cmExecutionStatus.h
+++ b/Source/cmExecutionStatus.h
@@ -7,6 +7,8 @@
#include <string>
#include <vector>
+#include <cm/optional>
+
class cmMakefile;
/** \class cmExecutionStatus
@@ -53,6 +55,11 @@ public:
void SetNestedError() { this->NestedError = true; }
bool GetNestedError() const { return this->NestedError; }
+ void SetExitCode(int code) noexcept { this->ExitCode = code; }
+ bool HasExitCode() const noexcept { return this->ExitCode.has_value(); }
+ void CleanExitCode() noexcept { this->ExitCode.reset(); }
+ int GetExitCode() const noexcept { return this->ExitCode.value_or(-1); }
+
private:
cmMakefile& Makefile;
std::string Error;
@@ -60,5 +67,6 @@ private:
bool BreakInvoked = false;
bool ContinueInvoked = false;
bool NestedError = false;
+ cm::optional<int> ExitCode;
std::vector<std::string> Variables;
};
diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx
index d75879f..a2e6e70 100644
--- a/Source/cmExperimental.cxx
+++ b/Source/cmExperimental.cxx
@@ -19,6 +19,15 @@ namespace {
* up-to-date.
*/
cmExperimental::FeatureData LookupTable[] = {
+ // ExportPackageDependencies
+ { "ExportPackageDependencies",
+ "1942b4fa-b2c5-4546-9385-83f254070067",
+ "CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES",
+ "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",
"5c2d848d-4efa-4529-a768-efd57171bf68",
@@ -28,6 +37,15 @@ cmExperimental::FeatureData LookupTable[] = {
{},
cmExperimental::TryCompileCondition::Always,
false },
+ // CxxImportStd
+ { "CxxImportStd",
+ "0e5b6991-d74f-4b3d-a41c-cf096e0b2508",
+ "CMAKE_EXPERIMENTAL_CXX_IMPORT_STD",
+ "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 },
};
static_assert(sizeof(LookupTable) / sizeof(LookupTable[0]) ==
static_cast<size_t>(cmExperimental::Feature::Sentinel),
@@ -45,6 +63,20 @@ const cmExperimental::FeatureData& cmExperimental::DataForFeature(Feature f)
return ::DataForFeature(f);
}
+cm::optional<cmExperimental::Feature> cmExperimental::FeatureByName(
+ std::string const& name)
+{
+ size_t idx = 0;
+ for (auto const& feature : LookupTable) {
+ if (feature.Name == name) {
+ return static_cast<Feature>(idx);
+ }
+ ++idx;
+ }
+
+ return {};
+}
+
bool cmExperimental::HasSupportEnabled(cmMakefile const& mf, Feature f)
{
bool enabled = false;
diff --git a/Source/cmExperimental.h b/Source/cmExperimental.h
index e4c1448..05764f9 100644
--- a/Source/cmExperimental.h
+++ b/Source/cmExperimental.h
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include <cm/optional>
+
class cmMakefile;
class cmExperimental
@@ -15,7 +17,9 @@ class cmExperimental
public:
enum class Feature
{
+ ExportPackageDependencies,
WindowsKernelModeDriver,
+ CxxImportStd,
Sentinel,
};
@@ -39,5 +43,6 @@ public:
};
static const FeatureData& DataForFeature(Feature f);
+ static cm::optional<Feature> FeatureByName(std::string const& name);
static bool HasSupportEnabled(cmMakefile const& mf, Feature f);
};
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index c54e6ac..34bda1b 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -57,8 +57,8 @@ void cmExportBuildAndroidMKGenerator::GenerateImportTargetCode(
}
void cmExportBuildAndroidMKGenerator::GenerateImportPropertyCode(
- std::ostream&, const std::string&, cmGeneratorTarget const*,
- ImportPropertyMap const&)
+ std::ostream&, const std::string&, const std::string&,
+ cmGeneratorTarget const*, ImportPropertyMap const&, const std::string&)
{
}
diff --git a/Source/cmExportBuildAndroidMKGenerator.h b/Source/cmExportBuildAndroidMKGenerator.h
index 7067488..9562cee 100644
--- a/Source/cmExportBuildAndroidMKGenerator.h
+++ b/Source/cmExportBuildAndroidMKGenerator.h
@@ -51,10 +51,11 @@ protected:
void GenerateExpectedTargetsCode(
std::ostream& os, const std::string& expectedTargets) override;
void GenerateImportPropertyCode(
- std::ostream& os, const std::string& config,
- cmGeneratorTarget const* target,
- ImportPropertyMap const& properties) override;
+ std::ostream& os, const std::string& config, const std::string& suffix,
+ cmGeneratorTarget const* target, ImportPropertyMap const& properties,
+ const std::string& importedXcFrameworkLocation) override;
void GenerateMissingTargetsCheckCode(std::ostream& os) override;
+ void GenerateFindDependencyCalls(std::ostream&) override {}
void GenerateInterfaceProperties(
cmGeneratorTarget const* target, std::ostream& os,
const ImportPropertyMap& properties) override;
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 081e01d..2345d64 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -11,7 +11,6 @@
#include <utility>
#include <cm/string_view>
-#include <cmext/algorithm>
#include <cmext/string_view>
#include "cmCryptoHash.h"
@@ -56,15 +55,15 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
{
std::string expectedTargets;
std::string sep;
- std::vector<std::string> targets;
+ std::vector<TargetExport> targets;
bool generatedInterfaceRequired = false;
this->GetTargets(targets);
- for (std::string const& tei : targets) {
- cmGeneratorTarget* te = this->LG->FindGeneratorTargetToUse(tei);
+ for (auto const& tei : targets) {
+ cmGeneratorTarget* te = this->LG->FindGeneratorTargetToUse(tei.Name);
expectedTargets += sep + this->Namespace + te->GetExportName();
sep = " ";
if (this->ExportedTargets.insert(te).second) {
- this->Exports.push_back(te);
+ this->Exports.emplace_back(te, tei.XcFrameworkLocation);
} else {
std::ostringstream e;
e << "given target \"" << te->GetName() << "\" more than once.";
@@ -78,13 +77,14 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
}
if (generatedInterfaceRequired) {
- this->GenerateRequiredCMakeVersion(os, "3.0.0");
+ this->SetRequiredCMakeVersion(3, 0, 0);
}
this->GenerateExpectedTargetsCode(os, expectedTargets);
}
// Create all the imported targets.
- for (cmGeneratorTarget* gte : this->Exports) {
+ for (auto const& exp : this->Exports) {
+ cmGeneratorTarget* gte = exp.Target;
this->GenerateImportTargetCode(os, gte, this->GetExportTargetType(gte));
gte->Target->AppendBuildInterfaceIncludes();
@@ -165,7 +165,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
cmCryptoHash hasher(cmCryptoHash::AlgoSHA3_512);
constexpr std::size_t HASH_TRUNCATION = 12;
for (auto const& target : this->Targets) {
- hasher.Append(target);
+ hasher.Append(target.Name);
}
cxx_modules_name = hasher.FinalizeHex().substr(0, HASH_TRUNCATION);
}
@@ -190,7 +190,9 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
void cmExportBuildFileGenerator::GenerateImportTargetsConfig(
std::ostream& os, const std::string& config, std::string const& suffix)
{
- for (cmGeneratorTarget* target : this->Exports) {
+ for (auto const& exp : this->Exports) {
+ cmGeneratorTarget* target = exp.Target;
+
// Collect import properties for this target.
ImportPropertyMap properties;
@@ -214,7 +216,23 @@ void cmExportBuildFileGenerator::GenerateImportTargetsConfig(
// properties);
// Generate code in the export file.
- this->GenerateImportPropertyCode(os, config, target, properties);
+ std::string importedXcFrameworkLocation = exp.XcFrameworkLocation;
+ if (!importedXcFrameworkLocation.empty()) {
+ importedXcFrameworkLocation = cmGeneratorExpression::Preprocess(
+ importedXcFrameworkLocation,
+ cmGeneratorExpression::PreprocessContext::BuildInterface);
+ importedXcFrameworkLocation = cmGeneratorExpression::Evaluate(
+ importedXcFrameworkLocation, exp.Target->GetLocalGenerator(), config,
+ exp.Target, nullptr, exp.Target);
+ if (!importedXcFrameworkLocation.empty() &&
+ !cmSystemTools::FileIsFullPath(importedXcFrameworkLocation)) {
+ importedXcFrameworkLocation =
+ cmStrCat(this->LG->GetCurrentBinaryDirectory(), '/',
+ importedXcFrameworkLocation);
+ }
+ }
+ this->GenerateImportPropertyCode(os, config, suffix, target, properties,
+ importedXcFrameworkLocation);
}
}
}
@@ -322,7 +340,7 @@ void cmExportBuildFileGenerator::HandleMissingTarget(
}
void cmExportBuildFileGenerator::GetTargets(
- std::vector<std::string>& targets) const
+ std::vector<TargetExport>& targets) const
{
if (this->ExportSet) {
for (std::unique_ptr<cmTargetExport> const& te :
@@ -330,7 +348,7 @@ void cmExportBuildFileGenerator::GetTargets(
if (te->NamelinkOnly) {
continue;
}
- targets.push_back(te->TargetName);
+ targets.emplace_back(te->TargetName, te->XcFrameworkLocation);
}
return;
}
@@ -348,9 +366,11 @@ cmExportBuildFileGenerator::FindBuildExportInfo(cmGlobalGenerator* gg,
for (auto const& exp : exportSets) {
const auto& exportSet = exp.second;
- std::vector<std::string> targets;
+ std::vector<TargetExport> targets;
exportSet->GetTargets(targets);
- if (cm::contains(targets, name)) {
+ if (std::any_of(
+ targets.begin(), targets.end(),
+ [&name](const TargetExport& te) { return te.Name == name; })) {
exportFiles.push_back(exp.first);
ns = exportSet->GetNamespace();
}
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index ea51437..ee4779f 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -33,15 +33,27 @@ class cmTargetExport;
class cmExportBuildFileGenerator : public cmExportFileGenerator
{
public:
+ struct TargetExport
+ {
+ TargetExport(std::string name, std::string xcFrameworkLocation)
+ : Name(std::move(name))
+ , XcFrameworkLocation(std::move(xcFrameworkLocation))
+ {
+ }
+
+ std::string Name;
+ std::string XcFrameworkLocation;
+ };
+
cmExportBuildFileGenerator();
/** Set the list of targets to export. */
- void SetTargets(std::vector<std::string> const& targets)
+ void SetTargets(std::vector<TargetExport> const& targets)
{
this->Targets = targets;
}
- void GetTargets(std::vector<std::string>& targets) const;
- void AppendTargets(std::vector<std::string> const& targets)
+ void GetTargets(std::vector<TargetExport>& targets) const;
+ void AppendTargets(std::vector<TargetExport> const& targets)
{
cm::append(this->Targets, targets);
}
@@ -90,6 +102,7 @@ protected:
cmTargetExport* te) override;
std::string GetFileSetFiles(cmGeneratorTarget* gte, cmFileSet* fileSet,
cmTargetExport* te) override;
+ cmExportSet* GetExportSet() const override { return this->ExportSet; }
std::string GetCxxModulesDirectory() const override;
void GenerateCxxModuleConfigInformation(std::string const&,
@@ -100,9 +113,22 @@ protected:
std::pair<std::vector<std::string>, std::string> FindBuildExportInfo(
cmGlobalGenerator* gg, const std::string& name);
- std::vector<std::string> Targets;
+ struct TargetExportPrivate
+ {
+ TargetExportPrivate(cmGeneratorTarget* target,
+ std::string xcFrameworkLocation)
+ : Target(target)
+ , XcFrameworkLocation(std::move(xcFrameworkLocation))
+ {
+ }
+
+ cmGeneratorTarget* Target;
+ std::string XcFrameworkLocation;
+ };
+
+ std::vector<TargetExport> Targets;
cmExportSet* ExportSet;
- std::vector<cmGeneratorTarget*> Exports;
+ std::vector<TargetExportPrivate> Exports;
cmLocalGenerator* LG;
// The directory for C++ module information.
std::string CxxModulesDirectory;
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 7e44210..0cb0011 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -8,6 +8,7 @@
#include <cm/memory>
#include <cm/optional>
+#include <cmext/algorithm>
#include <cmext/string_view>
#include "cmsys/RegularExpression.hxx"
@@ -16,6 +17,7 @@
#include "cmArgumentParserTypes.h"
#include "cmCryptoHash.h"
#include "cmExecutionStatus.h"
+#include "cmExperimental.h"
#include "cmExportBuildAndroidMKGenerator.h"
#include "cmExportBuildFileGenerator.h"
#include "cmExportSet.h"
@@ -24,10 +26,12 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
+#include "cmRange.h"
#include "cmStateTypes.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
+#include "cmValue.h"
#if defined(__HAIKU__)
# include <FindDirectory.h>
@@ -66,6 +70,11 @@ bool cmExportCommand(std::vector<std::string> const& args,
std::string CxxModulesDirectory;
bool Append = false;
bool ExportOld = false;
+
+ std::vector<std::vector<std::string>> PackageDependencyArgs;
+ bool ExportPackageDependencies = false;
+
+ std::vector<std::vector<std::string>> TargetArgs;
};
auto parser =
@@ -76,6 +85,20 @@ bool cmExportCommand(std::vector<std::string> const& args,
if (args[0] == "EXPORT") {
parser.Bind("EXPORT"_s, &Arguments::ExportSetName);
+ if (cmExperimental::HasSupportEnabled(
+ status.GetMakefile(),
+ cmExperimental::Feature::ExportPackageDependencies)) {
+ parser.Bind("EXPORT_PACKAGE_DEPENDENCIES"_s,
+ &Arguments::ExportPackageDependencies);
+ }
+ } else if (args[0] == "SETUP") {
+ parser.Bind("SETUP"_s, &Arguments::ExportSetName);
+ if (cmExperimental::HasSupportEnabled(
+ status.GetMakefile(),
+ cmExperimental::Feature::ExportPackageDependencies)) {
+ parser.Bind("PACKAGE_DEPENDENCY"_s, &Arguments::PackageDependencyArgs);
+ }
+ parser.Bind("TARGET"_s, &Arguments::TargetArgs);
} else {
parser.Bind("TARGETS"_s, &Arguments::Targets);
parser.Bind("ANDROID_MK"_s, &Arguments::AndroidMKFile);
@@ -91,6 +114,91 @@ bool cmExportCommand(std::vector<std::string> const& args,
return false;
}
+ if (args[0] == "SETUP") {
+ cmMakefile& mf = status.GetMakefile();
+ cmGlobalGenerator* gg = mf.GetGlobalGenerator();
+
+ cmExportSetMap& setMap = gg->GetExportSets();
+ auto& exportSet = setMap[arguments.ExportSetName];
+
+ struct PackageDependencyArguments
+ {
+ std::string Enabled;
+ ArgumentParser::MaybeEmpty<std::vector<std::string>> ExtraArgs;
+ };
+
+ auto packageDependencyParser =
+ cmArgumentParser<PackageDependencyArguments>{}
+ .Bind("ENABLED"_s, &PackageDependencyArguments::Enabled)
+ .Bind("EXTRA_ARGS"_s, &PackageDependencyArguments::ExtraArgs);
+
+ for (auto const& packageDependencyArgs : arguments.PackageDependencyArgs) {
+ if (packageDependencyArgs.empty()) {
+ continue;
+ }
+
+ PackageDependencyArguments const packageDependencyArguments =
+ packageDependencyParser.Parse(
+ cmMakeRange(packageDependencyArgs).advance(1), &unknownArgs);
+
+ if (!unknownArgs.empty()) {
+ status.SetError("Unknown argument: \"" + unknownArgs.front() + "\".");
+ return false;
+ }
+
+ auto& packageDependency =
+ exportSet.GetPackageDependencyForSetup(packageDependencyArgs.front());
+
+ if (!packageDependencyArguments.Enabled.empty()) {
+ if (packageDependencyArguments.Enabled == "AUTO") {
+ packageDependency.Enabled =
+ cmExportSet::PackageDependencyExportEnabled::Auto;
+ } else if (cmIsOff(packageDependencyArguments.Enabled)) {
+ packageDependency.Enabled =
+ cmExportSet::PackageDependencyExportEnabled::Off;
+ } else if (cmIsOn(packageDependencyArguments.Enabled)) {
+ packageDependency.Enabled =
+ cmExportSet::PackageDependencyExportEnabled::On;
+ } else {
+ status.SetError(
+ cmStrCat("Invalid enable setting for package dependency: \"",
+ packageDependencyArguments.Enabled, "\""));
+ return false;
+ }
+ }
+
+ cm::append(packageDependency.ExtraArguments,
+ packageDependencyArguments.ExtraArgs);
+ }
+
+ struct TargetArguments
+ {
+ std::string XcFrameworkLocation;
+ };
+
+ auto targetParser = cmArgumentParser<TargetArguments>{}.Bind(
+ "XCFRAMEWORK_LOCATION"_s, &TargetArguments::XcFrameworkLocation);
+
+ for (auto const& targetArgs : arguments.TargetArgs) {
+ if (targetArgs.empty()) {
+ continue;
+ }
+
+ TargetArguments const targetArguments =
+ targetParser.Parse(cmMakeRange(targetArgs).advance(1), &unknownArgs);
+
+ if (!unknownArgs.empty()) {
+ status.SetError("Unknown argument: \"" + unknownArgs.front() + "\".");
+ return false;
+ }
+
+ exportSet.SetXcFrameworkLocation(targetArgs.front(),
+ targetArguments.XcFrameworkLocation);
+ }
+
+ return true;
+ }
+
std::string fname;
bool android = false;
if (!arguments.AndroidMKFile.empty()) {
@@ -133,7 +241,7 @@ bool cmExportCommand(std::vector<std::string> const& args,
fname = dir + "/" + fname;
}
- std::vector<std::string> targets;
+ std::vector<cmExportBuildFileGenerator::TargetExport> targets;
cmGlobalGenerator* gg = mf.GetGlobalGenerator();
@@ -171,7 +279,7 @@ bool cmExportCommand(std::vector<std::string> const& args,
status.SetError(e.str());
return false;
}
- targets.push_back(currentTarget);
+ targets.emplace_back(currentTarget, std::string{});
}
if (arguments.Append) {
if (cmExportBuildFileGenerator* ebfg =
@@ -224,6 +332,7 @@ bool cmExportCommand(std::vector<std::string> const& args,
ebfg->SetTargets(targets);
}
ebfg->SetExportOld(arguments.ExportOld);
+ ebfg->SetExportPackageDependencies(arguments.ExportPackageDependencies);
// Compute the set of configurations exported.
std::vector<std::string> configurationTypes =
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 944e703..9bd7f49 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExportFileGenerator.h"
+#include <algorithm>
#include <array>
#include <cassert>
#include <cstring>
@@ -9,13 +10,16 @@
#include <utility>
#include <cm/memory>
+#include <cm/optional>
#include <cm/string_view>
#include <cmext/string_view>
#include "cmsys/FStream.hxx"
#include "cmComputeLinkInformation.h"
+#include "cmExportSet.h"
#include "cmFileSet.h"
+#include "cmFindPackageStack.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
#include "cmLinkItem.h"
@@ -31,6 +35,7 @@
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmValue.h"
+#include "cmVersion.h"
static std::string cmExportFileGeneratorEscape(std::string const& str)
{
@@ -94,17 +99,35 @@ bool cmExportFileGenerator::GenerateImportFile()
return false;
}
std::ostream& os = *foutPtr;
+ std::stringstream mainFileWithHeadersAndFootersBuffer;
// Start with the import file header.
- this->GeneratePolicyHeaderCode(os);
- this->GenerateImportHeaderCode(os);
+ this->GenerateImportHeaderCode(mainFileWithHeadersAndFootersBuffer);
// Create all the imported targets.
- bool result = this->GenerateMainFile(os);
+ std::stringstream mainFileBuffer;
+ bool result = this->GenerateMainFile(mainFileBuffer);
+
+ // Export find_dependency() calls. Must be done after GenerateMainFile(),
+ // because that's when target dependencies are gathered, which we need for
+ // the find_dependency() calls.
+ if (!this->AppendMode && this->GetExportSet() &&
+ this->ExportPackageDependencies) {
+ this->SetRequiredCMakeVersion(3, 9, 0);
+ this->GenerateFindDependencyCalls(mainFileWithHeadersAndFootersBuffer);
+ }
+
+ // Write cached import code.
+ mainFileWithHeadersAndFootersBuffer << mainFileBuffer.rdbuf();
// End with the import file footer.
- this->GenerateImportFooterCode(os);
- this->GeneratePolicyFooterCode(os);
+ this->GenerateImportFooterCode(mainFileWithHeadersAndFootersBuffer);
+ this->GeneratePolicyFooterCode(mainFileWithHeadersAndFootersBuffer);
+
+ // This has to be done last, after the minimum CMake version has been
+ // determined.
+ this->GeneratePolicyHeaderCode(os);
+ os << mainFileWithHeadersAndFootersBuffer.rdbuf();
return result;
}
@@ -157,17 +180,6 @@ void cmExportFileGenerator::PopulateInterfaceProperty(
}
}
-void cmExportFileGenerator::GenerateRequiredCMakeVersion(
- std::ostream& os, const char* versionString)
-{
- /* clang-format off */
- os << "if(CMAKE_VERSION VERSION_LESS " << versionString << ")\n"
- " message(FATAL_ERROR \"This file relies on consumers using "
- "CMake " << versionString << " or greater.\")\n"
- "endif()\n\n";
- /* clang-format on */
-}
-
bool cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty(
cmGeneratorTarget const* target,
cmGeneratorExpression::PreprocessContext preprocessRule,
@@ -621,6 +633,12 @@ bool cmExportFileGenerator::AddTargetNamespace(std::string& input,
return false;
}
+ cmFindPackageStack const& pkgStack = tgt->Target->GetFindPackageStack();
+ if (!pkgStack.Empty() ||
+ tgt->Target->GetProperty("EXPORT_FIND_PACKAGE_NAME")) {
+ this->ExternalTargets.emplace(tgt);
+ }
+
if (tgt->IsImported()) {
input = tgt->GetName();
return true;
@@ -868,12 +886,14 @@ void cmExportFileGenerator::SetImportDetailProperties(
// Export IMPORTED_LINK_DEPENDENT_LIBRARIES to help consuming linkers
// find private dependencies of shared libraries.
std::size_t oldMissingTargetsSize = this->MissingTargets.size();
+ auto oldExternalTargets = this->ExternalTargets;
this->SetImportLinkProperty(
suffix, target, "IMPORTED_LINK_DEPENDENT_LIBRARIES", iface->SharedDeps,
properties, ImportLinkPropertyTargetNames::Yes);
// Avoid enforcing shared library private dependencies as public package
// dependencies by ignoring missing targets added for them.
this->MissingTargets.resize(oldMissingTargetsSize);
+ this->ExternalTargets = std::move(oldExternalTargets);
if (iface->Multiplicity > 0) {
std::string prop =
@@ -954,20 +974,30 @@ void cmExportFileGenerator::GeneratePolicyHeaderCode(std::ostream& os)
os << "if(\"${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}\" LESS 2.8)\n"
<< " message(FATAL_ERROR \"CMake >= 2.8.0 required\")\n"
<< "endif()\n"
- << "if(CMAKE_VERSION VERSION_LESS \"2.8.3\")\n"
- << " message(FATAL_ERROR \"CMake >= 2.8.3 required\")\n"
+ << "if(CMAKE_VERSION VERSION_LESS \""
+ << this->RequiredCMakeVersionMajor << '.'
+ << this->RequiredCMakeVersionMinor << '.'
+ << this->RequiredCMakeVersionPatch << "\")\n"
+ << " message(FATAL_ERROR \"CMake >= "
+ << this->RequiredCMakeVersionMajor << '.'
+ << this->RequiredCMakeVersionMinor << '.'
+ << this->RequiredCMakeVersionPatch << " required\")\n"
<< "endif()\n";
/* clang-format on */
// Isolate the file policy level.
- // Support CMake versions as far back as 2.6 but also support using NEW
- // policy settings for up to CMake 3.26 (this upper limit may be reviewed
+ // Support CMake versions as far back as the
+ // RequiredCMakeVersion{Major,Minor,Patch}, but also support using NEW
+ // policy settings for up to CMake 3.28 (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.
/* clang-format off */
os << "cmake_policy(PUSH)\n"
- << "cmake_policy(VERSION 2.8.3...3.26)\n";
+ << "cmake_policy(VERSION "
+ << this->RequiredCMakeVersionMajor << '.'
+ << this->RequiredCMakeVersionMinor << '.'
+ << this->RequiredCMakeVersionPatch << "...3.28)\n";
/* clang-format on */
}
@@ -1126,8 +1156,9 @@ void cmExportFileGenerator::GenerateImportTargetCode(
}
void cmExportFileGenerator::GenerateImportPropertyCode(
- std::ostream& os, const std::string& config, cmGeneratorTarget const* target,
- ImportPropertyMap const& properties)
+ std::ostream& os, const std::string& config, const std::string& suffix,
+ cmGeneratorTarget const* target, ImportPropertyMap const& properties,
+ const std::string& importedXcFrameworkLocation)
{
// Construct the imported target name.
std::string targetName = this->Namespace;
@@ -1146,12 +1177,98 @@ void cmExportFileGenerator::GenerateImportPropertyCode(
}
os << ")\n";
os << "set_target_properties(" << targetName << " PROPERTIES\n";
+ std::string importedLocationProp = cmStrCat("IMPORTED_LOCATION", suffix);
for (auto const& property : properties) {
- os << " " << property.first << " "
- << cmExportFileGeneratorEscape(property.second) << "\n";
+ if (importedXcFrameworkLocation.empty() ||
+ property.first != importedLocationProp) {
+ os << " " << property.first << " "
+ << cmExportFileGeneratorEscape(property.second) << "\n";
+ }
}
- os << " )\n"
- << "\n";
+ os << " )\n";
+ if (!importedXcFrameworkLocation.empty()) {
+ auto importedLocationIt = properties.find(importedLocationProp);
+ if (importedLocationIt != properties.end()) {
+ os << "if(NOT CMAKE_VERSION VERSION_LESS \"3.28\" AND IS_DIRECTORY "
+ << cmExportFileGeneratorEscape(importedXcFrameworkLocation)
+ << ")\n"
+ " set_property(TARGET "
+ << targetName << " PROPERTY " << importedLocationProp << " "
+ << cmExportFileGeneratorEscape(importedXcFrameworkLocation)
+ << ")\nelse()\n set_property(TARGET " << targetName << " PROPERTY "
+ << importedLocationProp << " "
+ << cmExportFileGeneratorEscape(importedLocationIt->second)
+ << ")\nendif()\n";
+ }
+ }
+ os << "\n";
+}
+
+void cmExportFileGenerator::GenerateFindDependencyCalls(std::ostream& os)
+{
+ os << "include(CMakeFindDependencyMacro)\n";
+ std::map<std::string, cmExportSet::PackageDependency> packageDependencies;
+ auto* exportSet = this->GetExportSet();
+ if (exportSet) {
+ packageDependencies = exportSet->GetPackageDependencies();
+ }
+
+ for (cmGeneratorTarget const* gt : this->ExternalTargets) {
+ std::string findPackageName;
+ auto exportFindPackageName = gt->GetProperty("EXPORT_FIND_PACKAGE_NAME");
+ cmFindPackageStack pkgStack = gt->Target->GetFindPackageStack();
+ if (!exportFindPackageName.IsEmpty()) {
+ findPackageName = *exportFindPackageName;
+ } else {
+ if (!pkgStack.Empty()) {
+ cmFindPackageCall const& fpc = pkgStack.Top();
+ findPackageName = fpc.Name;
+ }
+ }
+ if (!findPackageName.empty()) {
+ auto& dep = packageDependencies[findPackageName];
+ if (!pkgStack.Empty()) {
+ dep.FindPackageIndex = pkgStack.Top().Index;
+ }
+ if (dep.Enabled == cmExportSet::PackageDependencyExportEnabled::Auto) {
+ dep.Enabled = cmExportSet::PackageDependencyExportEnabled::On;
+ }
+ }
+ }
+
+ std::vector<std::pair<std::string, cmExportSet::PackageDependency>>
+ packageDependenciesSorted(packageDependencies.begin(),
+ packageDependencies.end());
+ std::sort(
+ packageDependenciesSorted.begin(), packageDependenciesSorted.end(),
+ [](const std::pair<std::string, cmExportSet::PackageDependency>& lhs,
+ const std::pair<std::string, cmExportSet::PackageDependency>& rhs)
+ -> bool {
+ if (lhs.second.SpecifiedIndex) {
+ if (rhs.second.SpecifiedIndex) {
+ return lhs.second.SpecifiedIndex < rhs.second.SpecifiedIndex;
+ }
+ assert(rhs.second.FindPackageIndex);
+ return true;
+ }
+ assert(lhs.second.FindPackageIndex);
+ if (rhs.second.SpecifiedIndex) {
+ return false;
+ }
+ assert(rhs.second.FindPackageIndex);
+ return lhs.second.FindPackageIndex < rhs.second.FindPackageIndex;
+ });
+
+ for (auto const& it : packageDependenciesSorted) {
+ if (it.second.Enabled == cmExportSet::PackageDependencyExportEnabled::On) {
+ os << "find_dependency(" << it.first;
+ for (auto const& arg : it.second.ExtraArguments) {
+ os << " " << cmOutputConverter::EscapeForCMake(arg);
+ }
+ os << ")\n";
+ }
+ }
+ os << "\n\n";
}
void cmExportFileGenerator::GenerateMissingTargetsCheckCode(std::ostream& os)
@@ -1215,10 +1332,16 @@ void cmExportFileGenerator::GenerateImportedFileCheckLoop(std::ostream& os)
/* clang-format off */
os << "# Loop over all imported files and verify that they actually exist\n"
"foreach(_cmake_target IN LISTS _cmake_import_check_targets)\n"
- " foreach(_cmake_file IN LISTS \"_cmake_import_check_files_for_${_cmake_target}\")\n"
- " if(NOT EXISTS \"${_cmake_file}\")\n"
- " message(FATAL_ERROR \"The imported target \\\"${_cmake_target}\\\""
- " references the file\n"
+ " if(CMAKE_VERSION VERSION_LESS \"3.28\"\n"
+ " OR NOT DEFINED "
+ "_cmake_import_check_xcframework_for_${_cmake_target}\n"
+ " OR NOT IS_DIRECTORY "
+ "\"${_cmake_import_check_xcframework_for_${_cmake_target}}\")\n"
+ " foreach(_cmake_file IN LISTS "
+ "\"_cmake_import_check_files_for_${_cmake_target}\")\n"
+ " if(NOT EXISTS \"${_cmake_file}\")\n"
+ " message(FATAL_ERROR \"The imported target "
+ "\\\"${_cmake_target}\\\" references the file\n"
" \\\"${_cmake_file}\\\"\n"
"but this file does not exist. Possible reasons include:\n"
"* The file was deleted, renamed, or moved to another location.\n"
@@ -1227,8 +1350,9 @@ void cmExportFileGenerator::GenerateImportedFileCheckLoop(std::ostream& os)
" \\\"${CMAKE_CURRENT_LIST_FILE}\\\"\n"
"but not all the files it references.\n"
"\")\n"
- " endif()\n"
- " endforeach()\n"
+ " endif()\n"
+ " endforeach()\n"
+ " endif()\n"
" unset(_cmake_file)\n"
" unset(\"_cmake_import_check_files_for_${_cmake_target}\")\n"
"endforeach()\n"
@@ -1241,15 +1365,18 @@ void cmExportFileGenerator::GenerateImportedFileCheckLoop(std::ostream& os)
void cmExportFileGenerator::GenerateImportedFileChecksCode(
std::ostream& os, cmGeneratorTarget* target,
ImportPropertyMap const& properties,
- const std::set<std::string>& importedLocations)
+ const std::set<std::string>& importedLocations,
+ const std::string& importedXcFrameworkLocation)
{
// Construct the imported target name.
std::string targetName = cmStrCat(this->Namespace, target->GetExportName());
- os << "list(APPEND _cmake_import_check_targets " << targetName
- << " )\n"
- "list(APPEND _cmake_import_check_files_for_"
- << targetName << " ";
+ os << "list(APPEND _cmake_import_check_targets " << targetName << " )\n";
+ if (!importedXcFrameworkLocation.empty()) {
+ os << "set(_cmake_import_check_xcframework_for_" << targetName << ' '
+ << cmExportFileGeneratorEscape(importedXcFrameworkLocation) << ")\n";
+ }
+ os << "list(APPEND _cmake_import_check_files_for_" << targetName << " ";
for (std::string const& li : importedLocations) {
auto pi = properties.find(li);
@@ -1261,6 +1388,12 @@ void cmExportFileGenerator::GenerateImportedFileChecksCode(
os << ")\n\n";
}
+enum class ExportWhen
+{
+ Defined,
+ Always,
+};
+
enum class PropertyType
{
Strings,
@@ -1282,6 +1415,12 @@ bool PropertyTypeIsForPaths(PropertyType pt)
}
}
+struct ModuleTargetPropertyTable
+{
+ cm::static_string_view Name;
+ ExportWhen Cond;
+};
+
struct ModulePropertyTable
{
cm::static_string_view Name;
@@ -1297,18 +1436,29 @@ bool cmExportFileGenerator::PopulateCxxModuleExportProperties(
return true;
}
- const cm::static_string_view exportedDirectModuleProperties[] = {
- "CXX_EXTENSIONS"_s,
+ const ModuleTargetPropertyTable exportedDirectModuleProperties[] = {
+ { "CXX_EXTENSIONS"_s, ExportWhen::Defined },
+ // Always define this property as it is an intrinsic property of the target
+ // and should not be inherited from the in-scope `CMAKE_CXX_MODULE_STD`
+ // variable.
+ //
+ // TODO(cxxmodules): A future policy may make this "ON" based on the target
+ // policies if unset. Add a new `ExportWhen` condition to handle it when
+ // this happens.
+ { "CXX_MODULE_STD"_s, ExportWhen::Always },
};
- for (auto const& propName : exportedDirectModuleProperties) {
- auto const propNameStr = std::string(propName);
- cmValue prop = gte->Target->GetComputedProperty(
+ for (auto const& prop : exportedDirectModuleProperties) {
+ auto const propNameStr = std::string(prop.Name);
+ cmValue propValue = gte->Target->GetComputedProperty(
propNameStr, *gte->Target->GetMakefile());
- if (!prop) {
- prop = gte->Target->GetProperty(propNameStr);
+ if (!propValue) {
+ propValue = gte->Target->GetProperty(propNameStr);
}
- if (prop) {
- properties[propNameStr] = cmGeneratorExpression::Preprocess(*prop, ctx);
+ if (propValue) {
+ properties[propNameStr] =
+ cmGeneratorExpression::Preprocess(*propValue, ctx);
+ } else if (prop.Cond == ExportWhen::Always) {
+ properties[propNameStr] = "";
}
}
@@ -1485,3 +1635,17 @@ void cmExportFileGenerator::GenerateCxxModuleInformation(
this->GenerateCxxModuleConfigInformation(name, ap);
}
+
+void cmExportFileGenerator::SetRequiredCMakeVersion(unsigned int major,
+ unsigned int minor,
+ unsigned int patch)
+{
+ if (CMake_VERSION_ENCODE(major, minor, patch) >
+ CMake_VERSION_ENCODE(this->RequiredCMakeVersionMajor,
+ this->RequiredCMakeVersionMinor,
+ this->RequiredCMakeVersionPatch)) {
+ this->RequiredCMakeVersionMajor = major;
+ this->RequiredCMakeVersionMinor = minor;
+ this->RequiredCMakeVersionPatch = patch;
+ }
+}
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 30333d3..f619576 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -15,6 +15,7 @@
#include "cmVersion.h"
#include "cmVersionConfig.h"
+class cmExportSet;
class cmFileSet;
class cmGeneratorTarget;
class cmLocalGenerator;
@@ -61,6 +62,11 @@ public:
error. */
bool GenerateImportFile();
+ void SetExportPackageDependencies(bool exportPackageDependencies)
+ {
+ this->ExportPackageDependencies = exportPackageDependencies;
+ }
+
protected:
using ImportPropertyMap = std::map<std::string, std::string>;
@@ -78,16 +84,18 @@ protected:
virtual void GenerateImportTargetCode(std::ostream& os,
cmGeneratorTarget const* target,
cmStateEnums::TargetType targetType);
- virtual void GenerateImportPropertyCode(std::ostream& os,
- const std::string& config,
- cmGeneratorTarget const* target,
- ImportPropertyMap const& properties);
+ virtual void GenerateImportPropertyCode(
+ std::ostream& os, const std::string& config, const std::string& suffix,
+ cmGeneratorTarget const* target, ImportPropertyMap const& properties,
+ const std::string& importedXcFrameworkLocation);
virtual void GenerateImportedFileChecksCode(
std::ostream& os, cmGeneratorTarget* target,
ImportPropertyMap const& properties,
- const std::set<std::string>& importedLocations);
+ const std::set<std::string>& importedLocations,
+ const std::string& importedXcFrameworkLocation);
virtual void GenerateImportedFileCheckLoop(std::ostream& os);
virtual void GenerateMissingTargetsCheckCode(std::ostream& os);
+ virtual void GenerateFindDependencyCalls(std::ostream& os);
virtual void GenerateExpectedTargetsCode(std::ostream& os,
const std::string& expectedTargets);
@@ -173,9 +181,6 @@ protected:
std::string& input, cmGeneratorTarget const* target,
FreeTargetsReplace replace = NoReplaceFreeTargets);
- virtual void GenerateRequiredCMakeVersion(std::ostream& os,
- const char* versionString);
-
bool PopulateCxxModuleExportProperties(
cmGeneratorTarget const* gte, ImportPropertyMap& properties,
cmGeneratorExpression::PreprocessContext ctx,
@@ -196,6 +201,11 @@ protected:
cmFileSet* fileSet,
cmTargetExport* te) = 0;
+ virtual cmExportSet* GetExportSet() const { return nullptr; }
+
+ void SetRequiredCMakeVersion(unsigned int major, unsigned int minor,
+ unsigned int patch);
+
// The namespace in which the exports are placed in the generated file.
std::string Namespace;
@@ -216,6 +226,14 @@ protected:
std::vector<std::string> MissingTargets;
+ std::set<cmGeneratorTarget const*> ExternalTargets;
+
+ unsigned int RequiredCMakeVersionMajor = 2;
+ unsigned int RequiredCMakeVersionMinor = 8;
+ unsigned int RequiredCMakeVersionPatch = 3;
+
+ bool ExportPackageDependencies = false;
+
private:
void PopulateInterfaceProperty(const std::string&, const std::string&,
cmGeneratorTarget const* target,
diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx
index d53254d..eaa85f3 100644
--- a/Source/cmExportInstallAndroidMKGenerator.cxx
+++ b/Source/cmExportInstallAndroidMKGenerator.cxx
@@ -80,8 +80,8 @@ void cmExportInstallAndroidMKGenerator::GenerateExpectedTargetsCode(
}
void cmExportInstallAndroidMKGenerator::GenerateImportPropertyCode(
- std::ostream&, const std::string&, cmGeneratorTarget const*,
- ImportPropertyMap const&)
+ std::ostream&, const std::string&, const std::string&,
+ cmGeneratorTarget const*, ImportPropertyMap const&, const std::string&)
{
}
@@ -110,11 +110,6 @@ void cmExportInstallAndroidMKGenerator::GenerateImportPrefix(std::ostream&)
{
}
-void cmExportInstallAndroidMKGenerator::GenerateRequiredCMakeVersion(
- std::ostream&, const char*)
-{
-}
-
void cmExportInstallAndroidMKGenerator::CleanupTemporaryVariables(
std::ostream&)
{
@@ -127,7 +122,7 @@ void cmExportInstallAndroidMKGenerator::GenerateImportedFileCheckLoop(
void cmExportInstallAndroidMKGenerator::GenerateImportedFileChecksCode(
std::ostream&, cmGeneratorTarget*, ImportPropertyMap const&,
- const std::set<std::string>&)
+ const std::set<std::string>&, const std::string&)
{
}
diff --git a/Source/cmExportInstallAndroidMKGenerator.h b/Source/cmExportInstallAndroidMKGenerator.h
index 061358d..b1778ef 100644
--- a/Source/cmExportInstallAndroidMKGenerator.h
+++ b/Source/cmExportInstallAndroidMKGenerator.h
@@ -45,22 +45,22 @@ protected:
void GenerateExpectedTargetsCode(
std::ostream& os, const std::string& expectedTargets) override;
void GenerateImportPropertyCode(
- std::ostream& os, const std::string& config,
- cmGeneratorTarget const* target,
- ImportPropertyMap const& properties) override;
+ std::ostream& os, const std::string& config, const std::string& suffix,
+ cmGeneratorTarget const* target, ImportPropertyMap const& properties,
+ const std::string& importedXcFrameworkLocation) override;
void GenerateMissingTargetsCheckCode(std::ostream& os) override;
+ void GenerateFindDependencyCalls(std::ostream&) override {}
void GenerateInterfaceProperties(
cmGeneratorTarget const* target, std::ostream& os,
const ImportPropertyMap& properties) override;
void GenerateImportPrefix(std::ostream& os) override;
void LoadConfigFiles(std::ostream&) override;
- void GenerateRequiredCMakeVersion(std::ostream& os,
- const char* versionString) override;
void CleanupTemporaryVariables(std::ostream&) override;
void GenerateImportedFileCheckLoop(std::ostream& os) override;
void GenerateImportedFileChecksCode(
std::ostream& os, cmGeneratorTarget* target,
ImportPropertyMap const& properties,
- const std::set<std::string>& importedLocations) override;
+ const std::set<std::string>& importedLocations,
+ const std::string& importedXcFrameworkLocation) override;
bool GenerateImportFileConfig(const std::string& config) override;
};
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 173dc18..5c95ecd 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -76,9 +76,6 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
// Compute the relative import prefix for the file
this->GenerateImportPrefix(os);
- bool require2_8_12 = false;
- bool require3_0_0 = false;
- bool require3_1_0 = false;
bool requiresConfigFiles = false;
// Create all the imported targets.
for (cmTargetExport* te : allTargets) {
@@ -147,16 +144,16 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
if (this->PopulateInterfaceLinkLibrariesProperty(
gt, cmGeneratorExpression::InstallInterface, properties) &&
!this->ExportOld) {
- require2_8_12 = true;
+ this->SetRequiredCMakeVersion(2, 8, 12);
}
}
if (targetType == cmStateEnums::INTERFACE_LIBRARY) {
- require3_0_0 = true;
+ this->SetRequiredCMakeVersion(3, 0, 0);
}
if (gt->GetProperty("INTERFACE_SOURCES")) {
// We can only generate INTERFACE_SOURCES in CMake 3.3, but CMake 3.1
// can consume them.
- require3_1_0 = true;
+ this->SetRequiredCMakeVersion(3, 1, 0);
}
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE", gt,
@@ -169,14 +166,6 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
this->GenerateTargetFileSets(gt, os, te);
}
- if (require3_1_0) {
- this->GenerateRequiredCMakeVersion(os, "3.1.0");
- } else if (require3_0_0) {
- this->GenerateRequiredCMakeVersion(os, "3.0.0");
- } else if (require2_8_12) {
- this->GenerateRequiredCMakeVersion(os, "2.8.12");
- }
-
this->LoadConfigFiles(os);
bool result = true;
@@ -388,9 +377,26 @@ void cmExportInstallFileGenerator::GenerateImportTargetsConfig(
// properties);
// Generate code in the export file.
- this->GenerateImportPropertyCode(os, config, gtgt, properties);
- this->GenerateImportedFileChecksCode(os, gtgt, properties,
- importedLocations);
+ std::string importedXcFrameworkLocation = te->XcFrameworkLocation;
+ if (!importedXcFrameworkLocation.empty()) {
+ importedXcFrameworkLocation = cmGeneratorExpression::Preprocess(
+ importedXcFrameworkLocation,
+ cmGeneratorExpression::PreprocessContext::InstallInterface, true);
+ importedXcFrameworkLocation = cmGeneratorExpression::Evaluate(
+ importedXcFrameworkLocation, te->Target->GetLocalGenerator(), config,
+ te->Target, nullptr, te->Target);
+ if (!importedXcFrameworkLocation.empty() &&
+ !cmSystemTools::FileIsFullPath(importedXcFrameworkLocation) &&
+ !cmHasLiteralPrefix(importedXcFrameworkLocation,
+ "${_IMPORT_PREFIX}/")) {
+ importedXcFrameworkLocation =
+ cmStrCat("${_IMPORT_PREFIX}/", importedXcFrameworkLocation);
+ }
+ }
+ this->GenerateImportPropertyCode(os, config, suffix, gtgt, properties,
+ importedXcFrameworkLocation);
+ this->GenerateImportedFileChecksCode(
+ os, gtgt, properties, importedLocations, importedXcFrameworkLocation);
}
}
}
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index 253a65e..7a72584 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -12,12 +12,13 @@
#include <vector>
#include "cmExportFileGenerator.h"
+#include "cmInstallExportGenerator.h"
#include "cmStateTypes.h"
+class cmExportSet;
class cmFileSet;
class cmGeneratorTarget;
class cmGlobalGenerator;
-class cmInstallExportGenerator;
class cmInstallTargetGenerator;
class cmTargetExport;
@@ -123,6 +124,11 @@ protected:
bool GenerateImportCxxModuleConfigTargetInclusion(std::string const&,
std::string const&);
+ cmExportSet* GetExportSet() const override
+ {
+ return this->IEGen->GetExportSet();
+ }
+
cmInstallExportGenerator* IEGen;
// The import file generated for each configuration.
diff --git a/Source/cmExportSet.cxx b/Source/cmExportSet.cxx
index 3d4ef0a..b32bb8d 100644
--- a/Source/cmExportSet.cxx
+++ b/Source/cmExportSet.cxx
@@ -1,6 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmExportSet.h"
+#include "cmExportSet.h" // IWYU pragma: associated
#include <algorithm>
#include <tuple>
@@ -11,7 +11,7 @@
#include "cmMessageType.h"
#include "cmStringAlgorithms.h"
#include "cmTarget.h"
-#include "cmTargetExport.h"
+#include "cmTargetExport.h" // IWYU pragma: associated
cmExportSet::cmExportSet(std::string name)
: Name(std::move(name))
@@ -20,6 +20,17 @@ cmExportSet::cmExportSet(std::string name)
cmExportSet::~cmExportSet() = default;
+cmExportSet::PackageDependency& cmExportSet::GetPackageDependencyForSetup(
+ const std::string& name)
+{
+ auto& dep = this->PackageDependencies[name];
+ if (!dep.SpecifiedIndex) {
+ dep.SpecifiedIndex = this->NextPackageDependencyIndex;
+ this->NextPackageDependencyIndex++;
+ }
+ return dep;
+}
+
bool cmExportSet::Compute(cmLocalGenerator* lg)
{
for (std::unique_ptr<cmTargetExport>& tgtExport : this->TargetExports) {
@@ -61,6 +72,16 @@ void cmExportSet::AddInstallation(cmInstallExportGenerator const* installation)
this->Installations.push_back(installation);
}
+void cmExportSet::SetXcFrameworkLocation(const std::string& name,
+ const std::string& location)
+{
+ for (auto& te : this->TargetExports) {
+ if (name == te->TargetName) {
+ te->XcFrameworkLocation = location;
+ }
+ }
+}
+
cmExportSet& cmExportSetMap::operator[](const std::string& name)
{
auto it = this->find(name);
diff --git a/Source/cmExportSet.h b/Source/cmExportSet.h
index b75a26d..f2fc4a7 100644
--- a/Source/cmExportSet.h
+++ b/Source/cmExportSet.h
@@ -9,6 +9,8 @@
#include <string>
#include <vector>
+#include <cm/optional>
+
class cmInstallExportGenerator;
class cmLocalGenerator;
class cmTargetExport;
@@ -31,6 +33,9 @@ public:
void AddInstallation(cmInstallExportGenerator const* installation);
+ void SetXcFrameworkLocation(const std::string& name,
+ const std::string& location);
+
std::string const& GetName() const { return this->Name; }
std::vector<std::unique_ptr<cmTargetExport>> const& GetTargetExports() const
@@ -43,10 +48,36 @@ public:
return &this->Installations;
}
+ enum class PackageDependencyExportEnabled
+ {
+ Auto,
+ Off,
+ On,
+ };
+
+ struct PackageDependency
+ {
+ PackageDependencyExportEnabled Enabled =
+ PackageDependencyExportEnabled::Auto;
+ std::vector<std::string> ExtraArguments;
+ cm::optional<unsigned int> SpecifiedIndex;
+ cm::optional<unsigned int> FindPackageIndex;
+ };
+
+ PackageDependency& GetPackageDependencyForSetup(const std::string& name);
+
+ const std::map<std::string, PackageDependency>& GetPackageDependencies()
+ const
+ {
+ return this->PackageDependencies;
+ }
+
private:
std::vector<std::unique_ptr<cmTargetExport>> TargetExports;
std::string Name;
std::vector<cmInstallExportGenerator const*> Installations;
+ std::map<std::string, PackageDependency> PackageDependencies;
+ unsigned int NextPackageDependencyIndex = 0;
};
/// A name -> cmExportSet map with overloaded operator[].
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 00c9173..4c41ff5 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -2,9 +2,11 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExportTryCompileFileGenerator.h"
+#include <map>
#include <utility>
#include <cm/memory>
+#include <cm/string_view>
#include "cmFileSet.h"
#include "cmGeneratorExpression.h"
@@ -44,12 +46,10 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
ImportPropertyMap properties;
for (std::string const& lang : this->Languages) {
-#define FIND_TARGETS(PROPERTY) \
- this->FindTargets("INTERFACE_" #PROPERTY, te, lang, emittedDeps);
-
- CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)
-
-#undef FIND_TARGETS
+ for (auto i : cmGeneratorTarget::BuiltinTransitiveProperties) {
+ this->FindTargets(std::string(i.second.InterfaceName), te, lang,
+ emittedDeps);
+ }
}
this->PopulateProperties(te, properties, emittedDeps);
@@ -76,10 +76,10 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
// 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, "LINK_OPTIONS", nullptr, nullptr, tgt->GetLocalGenerator());
}
- cmGeneratorExpressionDAGChecker dagChecker(tgt, propName, nullptr,
- parentDagChecker.get());
+ cmGeneratorExpressionDAGChecker dagChecker(
+ tgt, propName, nullptr, parentDagChecker.get(), tgt->GetLocalGenerator());
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*prop);
diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx
index 8b0f309..d4a7175 100644
--- a/Source/cmFileAPI.cxx
+++ b/Source/cmFileAPI.cxx
@@ -727,7 +727,7 @@ std::string cmFileAPI::NoSupportedVersion(
// The "codemodel" object kind.
// Update Help/manual/cmake-file-api.7.rst when updating this constant.
-static unsigned int const CodeModelV2Minor = 6;
+static unsigned int const CodeModelV2Minor = 7;
void cmFileAPI::BuildClientRequestCodeModel(
ClientRequest& r, std::vector<RequestVersion> const& versions)
@@ -830,7 +830,7 @@ Json::Value cmFileAPI::BuildCache(Object const& object)
// The "cmakeFiles" object kind.
-static unsigned int const CMakeFilesV1Minor = 0;
+static unsigned int const CMakeFilesV1Minor = 1;
void cmFileAPI::BuildClientRequestCMakeFiles(
ClientRequest& r, std::vector<RequestVersion> const& versions)
diff --git a/Source/cmFileAPICMakeFiles.cxx b/Source/cmFileAPICMakeFiles.cxx
index e208ca8..bc80319 100644
--- a/Source/cmFileAPICMakeFiles.cxx
+++ b/Source/cmFileAPICMakeFiles.cxx
@@ -4,11 +4,13 @@
#include <memory>
#include <string>
+#include <utility>
#include <vector>
#include <cm3p/json/value.h>
#include "cmFileAPI.h"
+#include "cmGlobCacheEntry.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
@@ -29,6 +31,8 @@ class CMakeFiles
Json::Value DumpPaths();
Json::Value DumpInputs();
Json::Value DumpInput(std::string const& file);
+ Json::Value DumpGlobsDependent();
+ Json::Value DumpGlobDependent(cmGlobCacheEntry const& entry);
public:
CMakeFiles(cmFileAPI& fileAPI, unsigned long version);
@@ -51,6 +55,10 @@ Json::Value CMakeFiles::Dump()
Json::Value cmakeFiles = Json::objectValue;
cmakeFiles["paths"] = this->DumpPaths();
cmakeFiles["inputs"] = this->DumpInputs();
+ Json::Value globsDependent = this->DumpGlobsDependent();
+ if (!globsDependent.empty()) {
+ cmakeFiles["globsDependent"] = std::move(globsDependent);
+ }
return cmakeFiles;
}
@@ -106,6 +114,40 @@ Json::Value CMakeFiles::DumpInput(std::string const& file)
return input;
}
+
+Json::Value CMakeFiles::DumpGlobsDependent()
+{
+ Json::Value globsDependent = Json::arrayValue;
+ for (cmGlobCacheEntry const& entry :
+ this->FileAPI.GetCMakeInstance()->GetGlobCacheEntries()) {
+ globsDependent.append(this->DumpGlobDependent(entry));
+ }
+ return globsDependent;
+}
+
+Json::Value CMakeFiles::DumpGlobDependent(cmGlobCacheEntry const& entry)
+{
+ Json::Value globDependent = Json::objectValue;
+ globDependent["expression"] = entry.Expression;
+ if (entry.Recurse) {
+ globDependent["recurse"] = true;
+ }
+ if (entry.ListDirectories) {
+ globDependent["listDirectories"] = true;
+ }
+ if (entry.FollowSymlinks) {
+ globDependent["followSymlinks"] = true;
+ }
+ if (!entry.Relative.empty()) {
+ globDependent["relative"] = entry.Relative;
+ }
+ Json::Value paths = Json::arrayValue;
+ for (std::string const& file : entry.Files) {
+ paths.append(file);
+ }
+ globDependent["paths"] = std::move(paths);
+ return globDependent;
+}
}
Json::Value cmFileAPICMakeFilesDump(cmFileAPI& fileAPI, unsigned long version)
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index d069186..b9daffb 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -41,10 +41,12 @@
#include "cmInstallSubdirectoryGenerator.h"
#include "cmInstallTargetGenerator.h"
#include "cmLinkLineComputer.h" // IWYU pragma: keep
+#include "cmList.h"
#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmRange.h"
#include "cmSourceFile.h"
#include "cmSourceGroup.h"
#include "cmState.h"
@@ -503,6 +505,8 @@ class Target
Json::Value DumpDependencies();
Json::Value DumpDependency(cmTargetDepend const& td);
Json::Value DumpFolder();
+ Json::Value DumpLauncher(const char* name, const char* type);
+ Json::Value DumpLaunchers();
public:
Target(cmGeneratorTarget* gt, std::string const& config);
@@ -681,6 +685,11 @@ Json::Value CodemodelConfig::DumpTargets()
continue;
}
+ // Ignore targets starting with `__cmake_` as they are internal.
+ if (cmHasLiteralPrefix(gt->GetName(), "__cmake_")) {
+ continue;
+ }
+
targets.append(this->DumpTarget(gt, targets.size()));
}
@@ -1223,6 +1232,13 @@ Json::Value Target::Dump()
target["archive"] = this->DumpArchive();
}
+ if (type == cmStateEnums::EXECUTABLE) {
+ Json::Value launchers = this->DumpLaunchers();
+ if (!launchers.empty()) {
+ target["launchers"] = std::move(launchers);
+ }
+ }
+
Json::Value dependencies = this->DumpDependencies();
if (!dependencies.empty()) {
target["dependencies"] = dependencies;
@@ -1368,14 +1384,11 @@ CompileData Target::BuildCompileData(cmSourceFile* sf)
}
// Add precompile headers compile options.
- std::vector<std::string> architectures =
- this->GT->GetAppleArchs(this->Config, fd.Language);
- if (architectures.empty()) {
- architectures.emplace_back();
- }
+ std::vector<std::string> pchArchs =
+ this->GT->GetPchArchs(this->Config, fd.Language);
std::unordered_map<std::string, std::string> pchSources;
- for (const std::string& arch : architectures) {
+ for (const std::string& arch : pchArchs) {
const std::string pchSource =
this->GT->GetPchSource(this->Config, fd.Language, arch);
if (!pchSource.empty()) {
@@ -2075,6 +2088,50 @@ Json::Value Target::DumpFolder()
}
return folder;
}
+
+Json::Value Target::DumpLauncher(const char* name, const char* type)
+{
+ cmValue property = this->GT->GetProperty(name);
+ Json::Value launcher;
+ if (property) {
+ cmLocalGenerator* lg = this->GT->GetLocalGenerator();
+ cmGeneratorExpression ge(*lg->GetCMakeInstance());
+ cmList commandWithArgs{ ge.Parse(*property)->Evaluate(lg, this->Config) };
+ if (!commandWithArgs.empty() && !commandWithArgs[0].empty()) {
+ std::string command(commandWithArgs[0]);
+ cmSystemTools::ConvertToUnixSlashes(command);
+ launcher = Json::objectValue;
+ launcher["command"] = RelativeIfUnder(this->TopSource, command);
+ launcher["type"] = type;
+ Json::Value args;
+ for (std::string const& arg : cmMakeRange(commandWithArgs).advance(1)) {
+ args.append(arg);
+ }
+ if (!args.empty()) {
+ launcher["arguments"] = std::move(args);
+ }
+ }
+ }
+ return launcher;
+}
+
+Json::Value Target::DumpLaunchers()
+{
+ Json::Value launchers;
+ {
+ Json::Value launcher = DumpLauncher("TEST_LAUNCHER", "test");
+ if (!launcher.empty()) {
+ launchers.append(std::move(launcher));
+ }
+ }
+ if (this->GT->Makefile->IsOn("CMAKE_CROSSCOMPILING")) {
+ Json::Value emulator = DumpLauncher("CROSSCOMPILING_EMULATOR", "emulator");
+ if (!emulator.empty()) {
+ launchers.append(std::move(emulator));
+ }
+ }
+ return launchers;
+}
}
Json::Value cmFileAPICodemodelDump(cmFileAPI& fileAPI, unsigned long version)
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index c65136c..0369051 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -41,6 +41,7 @@
#include "cmFileTimes.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpression.h"
+#include "cmGlobCacheEntry.h"
#include "cmGlobalGenerator.h"
#include "cmHexFileConverter.h"
#include "cmList.h"
@@ -315,6 +316,7 @@ bool HandleStringsCommand(std::vector<std::string> const& args,
unsigned int limit_count = 0;
cmsys::RegularExpression regex;
bool have_regex = false;
+ bool store_regex = true;
bool newline_consume = false;
bool hex_conversion_enabled = true;
enum
@@ -399,6 +401,26 @@ bool HandleStringsCommand(std::vector<std::string> const& args,
return false;
}
have_regex = true;
+ switch (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0159)) {
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ // store_regex = true
+ break;
+ case cmPolicies::WARN:
+ if (status.GetMakefile().PolicyOptionalWarningEnabled(
+ "CMAKE_POLICY_WARNING_CMP0159")) {
+ status.GetMakefile().IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0159), '\n',
+ "For compatibility, CMake is leaving CMAKE_MATCH_<n> "
+ "unchanged."));
+ }
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ store_regex = false;
+ break;
+ }
arg_mode = arg_none;
} else if (arg_mode == arg_encoding) {
if (args[i] == "UTF-8") {
@@ -539,6 +561,10 @@ bool HandleStringsCommand(std::vector<std::string> const& args,
// string matches the requirements. The length may now be as
// low as zero since blank lines are allowed.
if (s.length() >= minlen && (!have_regex || regex.find(s))) {
+ if (store_regex) {
+ status.GetMakefile().ClearMatches();
+ status.GetMakefile().StoreMatches(regex);
+ }
output_size += static_cast<int>(s.size()) + 1;
if (limit_output >= 0 && output_size >= limit_output) {
s.clear();
@@ -555,6 +581,10 @@ bool HandleStringsCommand(std::vector<std::string> const& args,
// be at least one no matter what the user specified.
if (s.length() >= minlen && !s.empty() &&
(!have_regex || regex.find(s))) {
+ if (store_regex) {
+ status.GetMakefile().ClearMatches();
+ status.GetMakefile().StoreMatches(regex);
+ }
output_size += static_cast<int>(s.size()) + 1;
if (limit_output >= 0 && output_size >= limit_output) {
s.clear();
@@ -572,6 +602,10 @@ bool HandleStringsCommand(std::vector<std::string> const& args,
if (maxlen > 0 && s.size() == maxlen) {
// Terminate a string if the maximum length is reached.
if (s.length() >= minlen && (!have_regex || regex.find(s))) {
+ if (store_regex) {
+ status.GetMakefile().ClearMatches();
+ status.GetMakefile().StoreMatches(regex);
+ }
output_size += static_cast<int>(s.size()) + 1;
if (limit_output >= 0 && output_size >= limit_output) {
s.clear();
@@ -588,6 +622,10 @@ bool HandleStringsCommand(std::vector<std::string> const& args,
// matches the requirements.
if ((!limit_count || strings.size() < limit_count) && !s.empty() &&
s.length() >= minlen && (!have_regex || regex.find(s))) {
+ if (store_regex) {
+ status.GetMakefile().ClearMatches();
+ status.GetMakefile().StoreMatches(regex);
+ }
output_size += static_cast<int>(s.size()) + 1;
if (limit_output < 0 || output_size < limit_output) {
strings.push_back(s);
@@ -773,11 +811,16 @@ bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse,
std::sort(foundFiles.begin(), foundFiles.end());
foundFiles.erase(std::unique(foundFiles.begin(), foundFiles.end()),
foundFiles.end());
- cm->AddGlobCacheEntry(
- recurse, (recurse ? g.GetRecurseListDirs() : g.GetListDirs()),
+ auto entry = cmGlobCacheEntry{
+ recurse,
+ (recurse ? g.GetRecurseListDirs() : g.GetListDirs()),
(recurse ? g.GetRecurseThroughSymlinks() : false),
- (g.GetRelative() ? g.GetRelative() : ""), expr, foundFiles, variable,
- status.GetMakefile().GetBacktrace());
+ (g.GetRelative() ? g.GetRelative() : ""),
+ expr,
+ foundFiles
+ };
+ cm->AddGlobCacheEntry(entry, variable,
+ status.GetMakefile().GetBacktrace());
} else {
warnConfigureLate = true;
}
@@ -1322,13 +1365,15 @@ bool HandleRealPathCommand(std::vector<std::string> const& args,
if (oldPolicyPath != realPath) {
status.GetMakefile().IssueMessage(
MessageType::AUTHOR_WARNING,
- cmStrCat(
- cmPolicies::GetPolicyWarning(cmPolicies::CMP0152), '\n',
- "From input path:\n ", input,
- "\nthe policy OLD behavior produces path:\n ", oldPolicyPath,
- "\nbut the policy NEW behavior produces path:\n ", realPath,
- "\nSince the policy is not set, CMake is using the OLD "
- "behavior for compatibility."));
+ cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0152),
+ "\n"
+ "From input path:\n ",
+ input, "\nthe policy OLD behavior produces path:\n ",
+ oldPolicyPath,
+ "\nbut the policy NEW behavior produces path:\n ",
+ realPath,
+ "\nSince the policy is not set, CMake is using the OLD "
+ "behavior for compatibility."));
}
}
realPath = oldPolicyPath;
@@ -1820,7 +1865,8 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
long inactivity_timeout = 0;
std::string logVar;
std::string statusVar;
- bool tls_verify = status.GetMakefile().IsOn("CMAKE_TLS_VERIFY");
+ cm::optional<std::string> tls_version;
+ cm::optional<bool> tls_verify;
cmValue cainfo = status.GetMakefile().GetDefinition("CMAKE_TLS_CAINFO");
std::string netrc_level =
status.GetMakefile().GetSafeDefinition("CMAKE_NETRC");
@@ -1866,6 +1912,14 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
return false;
}
statusVar = *i;
+ } else if (*i == "TLS_VERSION") {
+ ++i;
+ if (i != args.end()) {
+ tls_version = *i;
+ } else {
+ status.SetError("DOWNLOAD missing value for TLS_VERSION.");
+ return false;
+ }
} else if (*i == "TLS_VERIFY") {
++i;
if (i != args.end()) {
@@ -1977,6 +2031,30 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
++i;
}
+ if (!tls_verify) {
+ if (cmValue v = status.GetMakefile().GetDefinition("CMAKE_TLS_VERIFY")) {
+ tls_verify = v.IsOn();
+ }
+ }
+ if (!tls_verify) {
+ if (cm::optional<std::string> v =
+ cmSystemTools::GetEnvVar("CMAKE_TLS_VERIFY")) {
+ tls_verify = cmIsOn(*v);
+ }
+ }
+
+ if (!tls_version) {
+ if (cmValue v = status.GetMakefile().GetDefinition("CMAKE_TLS_VERSION")) {
+ tls_version = *v;
+ }
+ }
+ if (!tls_version) {
+ if (cm::optional<std::string> v =
+ cmSystemTools::GetEnvVar("CMAKE_TLS_VERSION")) {
+ tls_version = std::move(v);
+ }
+ }
+
// Can't calculate hash if we don't save the file.
// TODO Incrementally calculate hash in the write callback as the file is
// being downloaded so this check can be relaxed.
@@ -2053,8 +2131,21 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
cmFileCommandCurlDebugCallback);
check_curl_result(res, "DOWNLOAD cannot set debug function: ");
+ if (tls_version) {
+ if (cm::optional<int> v = cmCurlParseTLSVersion(*tls_version)) {
+ res = ::curl_easy_setopt(curl, CURLOPT_SSLVERSION, *v);
+ check_curl_result(
+ res,
+ cmStrCat("DOWNLOAD cannot set TLS/SSL version ", *tls_version, ": "));
+ } else {
+ status.SetError(
+ cmStrCat("DOWNLOAD given unknown TLS/SSL version ", *tls_version));
+ return false;
+ }
+ }
+
// check to see if TLS verification is requested
- if (tls_verify) {
+ if (tls_verify && *tls_verify) {
res = ::curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1);
check_curl_result(res, "DOWNLOAD cannot set TLS/SSL Verify on: ");
} else {
@@ -2242,7 +2333,8 @@ bool HandleUploadCommand(std::vector<std::string> const& args,
std::string logVar;
std::string statusVar;
bool showProgress = false;
- bool tls_verify = status.GetMakefile().IsOn("CMAKE_TLS_VERIFY");
+ cm::optional<std::string> tls_version;
+ cm::optional<bool> tls_verify;
cmValue cainfo = status.GetMakefile().GetDefinition("CMAKE_TLS_CAINFO");
std::string userpwd;
std::string netrc_level =
@@ -2285,6 +2377,14 @@ bool HandleUploadCommand(std::vector<std::string> const& args,
statusVar = *i;
} else if (*i == "SHOW_PROGRESS") {
showProgress = true;
+ } else if (*i == "TLS_VERSION") {
+ ++i;
+ if (i != args.end()) {
+ tls_version = *i;
+ } else {
+ status.SetError("UPLOAD missing value for TLS_VERSION.");
+ return false;
+ }
} else if (*i == "TLS_VERIFY") {
++i;
if (i != args.end()) {
@@ -2340,6 +2440,30 @@ bool HandleUploadCommand(std::vector<std::string> const& args,
++i;
}
+ if (!tls_verify) {
+ if (cmValue v = status.GetMakefile().GetDefinition("CMAKE_TLS_VERIFY")) {
+ tls_verify = v.IsOn();
+ }
+ }
+ if (!tls_verify) {
+ if (cm::optional<std::string> v =
+ cmSystemTools::GetEnvVar("CMAKE_TLS_VERIFY")) {
+ tls_verify = cmIsOn(*v);
+ }
+ }
+
+ if (!tls_version) {
+ if (cmValue v = status.GetMakefile().GetDefinition("CMAKE_TLS_VERSION")) {
+ tls_version = *v;
+ }
+ }
+ if (!tls_version) {
+ if (cm::optional<std::string> v =
+ cmSystemTools::GetEnvVar("CMAKE_TLS_VERSION")) {
+ tls_version = std::move(v);
+ }
+ }
+
// Open file for reading:
//
FILE* fin = cmsys::SystemTools::Fopen(filename, "rb");
@@ -2384,8 +2508,21 @@ bool HandleUploadCommand(std::vector<std::string> const& args,
cmFileCommandCurlDebugCallback);
check_curl_result(res, "UPLOAD cannot set debug function: ");
+ if (tls_version) {
+ if (cm::optional<int> v = cmCurlParseTLSVersion(*tls_version)) {
+ res = ::curl_easy_setopt(curl, CURLOPT_SSLVERSION, *v);
+ check_curl_result(
+ res,
+ cmStrCat("UPLOAD cannot set TLS/SSL version ", *tls_version, ": "));
+ } else {
+ status.SetError(
+ cmStrCat("UPLOAD given unknown TLS/SSL version ", *tls_version));
+ return false;
+ }
+ }
+
// check to see if TLS verification is requested
- if (tls_verify) {
+ if (tls_verify && *tls_verify) {
res = ::curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1);
check_curl_result(res, "UPLOAD cannot set TLS/SSL Verify on: ");
} else {
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index bec6369..31cc14b 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -26,7 +26,7 @@ cmFindCommon::PathLabel cmFindCommon::PathLabel::CMakeEnvironment(
"CMAKE_ENVIRONMENT");
cmFindCommon::PathLabel cmFindCommon::PathLabel::Hints("HINTS");
cmFindCommon::PathLabel cmFindCommon::PathLabel::SystemEnvironment(
- "SYSTM_ENVIRONMENT");
+ "SYSTEM_ENVIRONMENT");
cmFindCommon::PathLabel cmFindCommon::PathLabel::CMakeSystem("CMAKE_SYSTEM");
cmFindCommon::PathLabel cmFindCommon::PathLabel::Guess("GUESS");
@@ -207,7 +207,7 @@ void cmFindCommon::SelectDefaultSearchModes()
for (auto const& path : search_paths) {
cmValue def = this->Makefile->GetDefinition(path.second);
if (def) {
- path.first = !cmIsOn(*def);
+ path.first = !def.IsOn();
}
}
}
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 30458cd..6349302 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -628,7 +628,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
// priority over the deprecated CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
if (cmValue const def =
this->Makefile->GetDefinition("CMAKE_FIND_USE_PACKAGE_REGISTRY")) {
- this->NoUserRegistry = !cmIsOn(*def);
+ this->NoUserRegistry = !def.IsOn();
} else if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) {
this->NoUserRegistry = true;
}
@@ -638,7 +638,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
// priority over the deprecated CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
if (cmValue const def = this->Makefile->GetDefinition(
"CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY")) {
- this->NoSystemRegistry = !cmIsOn(*def);
+ this->NoSystemRegistry = !def.IsOn();
} else if (this->Makefile->IsOn(
"CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY")) {
this->NoSystemRegistry = true;
@@ -982,6 +982,36 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
return true;
}
+ // Restore PACKAGE_PREFIX_DIR to its pre-call value when we return. If our
+ // caller is a file generated by configure_package_config_file(), and if
+ // the package we are about to load also has a config file created by that
+ // command, it will overwrite PACKAGE_PREFIX_DIR. We need to restore it in
+ // case something still refers to it in our caller's scope after we return.
+ class RestoreVariableOnLeavingScope
+ {
+ cmMakefile* makefile_;
+ cm::optional<std::string> value_;
+
+ public:
+ RestoreVariableOnLeavingScope(cmMakefile* makefile)
+ : makefile_(makefile)
+ {
+ cmValue v = makefile->GetDefinition("PACKAGE_PREFIX_DIR");
+ if (v) {
+ value_ = *v;
+ }
+ }
+ ~RestoreVariableOnLeavingScope()
+ {
+ if (this->value_) {
+ makefile_->AddDefinition("PACKAGE_PREFIX_DIR", *value_);
+ } else {
+ makefile_->RemoveDefinition("PACKAGE_PREFIX_DIR");
+ }
+ }
+ };
+ RestoreVariableOnLeavingScope restorePackagePrefixDir(this->Makefile);
+
// Now choose what method(s) we will use to satisfy the request. Note that
// we still want all the above checking of arguments, etc. regardless of the
// method used. This will ensure ill-formed arguments are caught earlier,
@@ -1044,6 +1074,8 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
PushPopRootPathStack pushPopRootPathStack(*this);
SetRestoreFindDefinitions setRestoreFindDefinitions(*this, components,
componentVarDefs);
+ cmMakefile::FindPackageStackRAII findPackageStackRAII(this->Makefile,
+ this->Name);
// See if we have been told to delegate to FetchContent or some other
// redirected config package first. We have to check all names that
@@ -1418,7 +1450,7 @@ bool cmFindPackageCommand::HandlePackageMode(
// Try to load the config file if the directory is known
bool fileFound = false;
if (this->UseConfigFiles) {
- if (!cmIsOff(def)) {
+ if (!def.IsOff()) {
// Get the directory from the variable value.
std::string dir = *def;
cmSystemTools::ConvertToUnixSlashes(dir);
@@ -1438,7 +1470,7 @@ bool cmFindPackageCommand::HandlePackageMode(
}
// Search for the config file if it is not already found.
- if (cmIsOff(def) || !fileFound) {
+ if (def.IsOff() || !fileFound) {
fileFound = this->FindConfig();
}
diff --git a/Source/cmFindPackageStack.cxx b/Source/cmFindPackageStack.cxx
new file mode 100644
index 0000000..1aeb2a7
--- /dev/null
+++ b/Source/cmFindPackageStack.cxx
@@ -0,0 +1,7 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#define cmFindPackageStack_cxx
+#include "cmFindPackageStack.h"
+
+#include "cmConstStack.tcc" // IWYU pragma: keep
+template class cmConstStack<cmFindPackageCall, cmFindPackageStack>;
diff --git a/Source/cmFindPackageStack.h b/Source/cmFindPackageStack.h
new file mode 100644
index 0000000..2062fbc
--- /dev/null
+++ b/Source/cmFindPackageStack.h
@@ -0,0 +1,33 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#pragma once
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <memory>
+#include <string>
+
+#include "cmConstStack.h"
+
+/**
+ * Represents one call to find_package.
+ */
+class cmFindPackageCall
+{
+public:
+ std::string Name;
+ unsigned int Index;
+};
+
+/**
+ * Represents a stack of find_package calls with efficient value semantics.
+ */
+class cmFindPackageStack
+ : public cmConstStack<cmFindPackageCall, cmFindPackageStack>
+{
+ using cmConstStack::cmConstStack;
+ friend class cmConstStack<cmFindPackageCall, cmFindPackageStack>;
+};
+#ifndef cmFindPackageStack_cxx
+extern template class cmConstStack<cmFindPackageCall, cmFindPackageStack>;
+#endif
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 21a140d..33dae79 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -272,6 +272,11 @@ auto cmForEachFunctionBlocker::invoke(
if (status.GetContinueInvoked()) {
break;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ result.Break = true;
+ break;
+ }
if (cmSystemTools::GetFatalErrorOccurred()) {
result.Restore = false;
result.Break = true;
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 8d2d972..33721fc 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -124,6 +124,10 @@ bool cmFunctionHelperCommand::operator()(
makefile.RaiseScope(status.GetReturnVariables());
break;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ break;
+ }
}
// pop scope on the makefile
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 04decd2..0583fd5 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -70,13 +70,6 @@ const std::string& cmCompiledGeneratorExpression::Evaluate(
currentTarget ? currentTarget : headTarget, this->EvaluateForBuildsystem,
this->Backtrace, language);
- return this->EvaluateWithContext(context, dagChecker);
-}
-
-const std::string& cmCompiledGeneratorExpression::EvaluateWithContext(
- cmGeneratorExpressionContext& context,
- cmGeneratorExpressionDAGChecker* dagChecker) const
-{
if (!this->NeedsEvaluation) {
return this->Input;
}
@@ -432,7 +425,7 @@ const std::string& cmGeneratorExpressionInterpreter::Evaluate(
cmGeneratorExpressionDAGChecker dagChecker(
this->HeadTarget,
property == "COMPILE_FLAGS" ? "COMPILE_OPTIONS" : property, nullptr,
- nullptr);
+ nullptr, this->LocalGenerator);
return this->CompiledGeneratorExpression->Evaluate(
this->LocalGenerator, this->Config, this->HeadTarget, &dagChecker, nullptr,
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index e22b8ab..71855c9 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -17,7 +17,6 @@
class cmake;
class cmCompiledGeneratorExpression;
class cmGeneratorTarget;
-struct cmGeneratorExpressionContext;
struct cmGeneratorExpressionDAGChecker;
struct cmGeneratorExpressionEvaluator;
@@ -151,10 +150,6 @@ public:
std::map<std::string, std::string>& mapping);
private:
- const std::string& EvaluateWithContext(
- cmGeneratorExpressionContext& context,
- cmGeneratorExpressionDAGChecker* dagChecker) const;
-
cmCompiledGeneratorExpression(cmake& cmakeInstance,
cmListFileBacktrace backtrace,
std::string input);
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index d51dbd0..bb1f4b4 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -2,10 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGeneratorExpressionDAGChecker.h"
-#include <cstring>
#include <sstream>
#include <utility>
+#include <cm/optional>
#include <cm/string_view>
#include <cmext/string_view>
@@ -18,47 +18,38 @@
#include "cmake.h"
cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
- cmListFileBacktrace backtrace, cmGeneratorTarget const* target,
- std::string property, const GeneratorExpressionContent* content,
- cmGeneratorExpressionDAGChecker* parent)
- : Parent(parent)
- , Target(target)
- , Property(std::move(property))
- , Content(content)
- , Backtrace(std::move(backtrace))
- , TransitivePropertiesOnly(false)
- , CMP0131(false)
+ cmGeneratorTarget const* target, std::string property,
+ const GeneratorExpressionContent* content,
+ cmGeneratorExpressionDAGChecker* parent, cmLocalGenerator const* contextLG)
+ : cmGeneratorExpressionDAGChecker(cmListFileBacktrace(), target,
+ std::move(property), content, parent,
+ contextLG)
{
- this->Initialize();
}
cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
- cmGeneratorTarget const* target, std::string property,
- const GeneratorExpressionContent* content,
- cmGeneratorExpressionDAGChecker* parent)
+ cmListFileBacktrace backtrace, cmGeneratorTarget const* target,
+ std::string property, const GeneratorExpressionContent* content,
+ cmGeneratorExpressionDAGChecker* parent, cmLocalGenerator const* contextLG)
: Parent(parent)
+ , Top(parent ? parent->Top : this)
, Target(target)
, Property(std::move(property))
, Content(content)
- , Backtrace()
- , TransitivePropertiesOnly(false)
- , CMP0131(false)
+ , Backtrace(std::move(backtrace))
{
- this->Initialize();
-}
+ if (parent) {
+ this->TopIsTransitiveProperty = parent->TopIsTransitiveProperty;
+ } else {
+ this->TopIsTransitiveProperty =
+ this->Target->IsTransitiveProperty(this->Property, contextLG)
+ .has_value();
+ }
-void cmGeneratorExpressionDAGChecker::Initialize()
-{
- const auto* top = this->Top();
this->CheckResult = this->CheckGraph();
-#define TEST_TRANSITIVE_PROPERTY_METHOD(METHOD) top->METHOD() ||
-
- if (this->CheckResult == DAG &&
- (CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(
- TEST_TRANSITIVE_PROPERTY_METHOD) false)) // NOLINT(*)
-#undef TEST_TRANSITIVE_PROPERTY_METHOD
- {
+ if (this->CheckResult == DAG && this->EvaluatingTransitiveProperty()) {
+ const auto* top = this->Top;
auto it = top->Seen.find(this->Target);
if (it != top->Seen.end()) {
const std::set<std::string>& propSet = it->second;
@@ -142,52 +133,67 @@ cmGeneratorExpressionDAGChecker::CheckGraph() const
bool cmGeneratorExpressionDAGChecker::GetTransitivePropertiesOnly() const
{
- return this->Top()->TransitivePropertiesOnly;
+ return this->Top->TransitivePropertiesOnly;
}
bool cmGeneratorExpressionDAGChecker::GetTransitivePropertiesOnlyCMP0131()
const
{
- return this->Top()->CMP0131;
+ return this->Top->CMP0131;
+}
+
+bool cmGeneratorExpressionDAGChecker::EvaluatingTransitiveProperty() const
+{
+ return this->TopIsTransitiveProperty;
}
bool cmGeneratorExpressionDAGChecker::EvaluatingGenexExpression() const
{
+ // Corresponds to GenexEvaluator::EvaluateExpression.
return cmHasLiteralPrefix(this->Property, "TARGET_GENEX_EVAL:") ||
cmHasLiteralPrefix(this->Property, "GENEX_EVAL:");
}
bool cmGeneratorExpressionDAGChecker::EvaluatingPICExpression() const
{
- return this->Top()->Property == "INTERFACE_POSITION_INDEPENDENT_CODE";
+ // Corresponds to checkInterfacePropertyCompatibility's special case
+ // that evaluates the value of POSITION_INDEPENDENT_CODE as a genex.
+ return this->Top->Property == "INTERFACE_POSITION_INDEPENDENT_CODE";
}
bool cmGeneratorExpressionDAGChecker::EvaluatingCompileExpression() const
{
- cm::string_view property(this->Top()->Property);
+ cm::string_view property(this->Top->Property);
return property == "INCLUDE_DIRECTORIES"_s ||
property == "COMPILE_DEFINITIONS"_s || property == "COMPILE_OPTIONS"_s;
}
+bool cmGeneratorExpressionDAGChecker::EvaluatingSources() const
+{
+ return this->Property == "SOURCES"_s ||
+ this->Property == "INTERFACE_SOURCES"_s;
+}
+
bool cmGeneratorExpressionDAGChecker::EvaluatingLinkExpression() const
{
- cm::string_view property(this->Top()->Property);
+ cm::string_view property(this->Top->Property);
return property == "LINK_DIRECTORIES"_s || property == "LINK_OPTIONS"_s ||
- property == "LINK_DEPENDS"_s || property == "LINK_LIBRARY_OVERRIDE"_s;
+ property == "LINK_DEPENDS"_s || property == "LINK_LIBRARY_OVERRIDE"_s ||
+ property == "LINKER_TYPE"_s;
}
bool cmGeneratorExpressionDAGChecker::EvaluatingLinkOptionsExpression() const
{
- cm::string_view property(this->Top()->Property);
+ cm::string_view property(this->Top->Property);
- return property == "LINK_OPTIONS"_s;
+ return property == "LINK_OPTIONS"_s || property == "LINKER_TYPE"_s;
}
bool cmGeneratorExpressionDAGChecker::EvaluatingLinkerLauncher() const
{
- cm::string_view property(this->Top()->Property);
+ cm::string_view property(this->Top->Property);
return property.length() > cmStrLen("_LINKER_LAUNCHER") &&
property.substr(property.length() - cmStrLen("_LINKER_LAUNCHER")) ==
@@ -197,7 +203,7 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkerLauncher() const
bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(
cmGeneratorTarget const* tgt, ForGenex genex) const
{
- const auto* top = this->Top();
+ const auto* top = this->Top;
cm::string_view prop(top->Property);
@@ -218,54 +224,7 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(
: (result || prop == "INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE"_s);
}
-cmGeneratorExpressionDAGChecker const* cmGeneratorExpressionDAGChecker::Top()
- const
-{
- const cmGeneratorExpressionDAGChecker* top = this;
- const cmGeneratorExpressionDAGChecker* parent = this->Parent;
- while (parent) {
- top = parent;
- parent = parent->Parent;
- }
- return top;
-}
-
cmGeneratorTarget const* cmGeneratorExpressionDAGChecker::TopTarget() const
{
- return this->Top()->Target;
+ return this->Top->Target;
}
-
-enum TransitiveProperty
-{
-#define DEFINE_ENUM_ENTRY(NAME) NAME,
- CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(DEFINE_ENUM_ENTRY)
-#undef DEFINE_ENUM_ENTRY
- TransitivePropertyTerminal
-};
-
-template <TransitiveProperty>
-bool additionalTest(const char* const /*unused*/)
-{
- return false;
-}
-
-template <>
-bool additionalTest<COMPILE_DEFINITIONS>(const char* const prop)
-{
- return cmHasLiteralPrefix(prop, "COMPILE_DEFINITIONS_");
-}
-
-#define DEFINE_TRANSITIVE_PROPERTY_METHOD(METHOD, PROPERTY) \
- bool cmGeneratorExpressionDAGChecker::METHOD() const \
- { \
- const char* const prop = this->Property.c_str(); \
- if (strcmp(prop, #PROPERTY) == 0 || \
- strcmp(prop, "INTERFACE_" #PROPERTY) == 0) { \
- return true; \
- } \
- return additionalTest<PROPERTY>(prop); \
- }
-
-CM_FOR_EACH_TRANSITIVE_PROPERTY(DEFINE_TRANSITIVE_PROPERTY_METHOD)
-
-#undef DEFINE_TRANSITIVE_PROPERTY_METHOD
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 782d6c8..b230188 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -13,33 +13,7 @@
struct GeneratorExpressionContent;
struct cmGeneratorExpressionContext;
class cmGeneratorTarget;
-
-#define CM_SELECT_BOTH(F, A1, A2) F(A1, A2)
-#define CM_SELECT_FIRST(F, A1, A2) F(A1)
-#define CM_SELECT_SECOND(F, A1, A2) F(A2)
-
-#define CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, SELECT) \
- SELECT(F, EvaluatingIncludeDirectories, INCLUDE_DIRECTORIES) \
- SELECT(F, EvaluatingSystemIncludeDirectories, SYSTEM_INCLUDE_DIRECTORIES) \
- SELECT(F, EvaluatingCompileDefinitions, COMPILE_DEFINITIONS) \
- SELECT(F, EvaluatingCompileOptions, COMPILE_OPTIONS) \
- SELECT(F, EvaluatingAutoMocMacroNames, AUTOMOC_MACRO_NAMES) \
- SELECT(F, EvaluatingAutoUicOptions, AUTOUIC_OPTIONS) \
- SELECT(F, EvaluatingSources, SOURCES) \
- SELECT(F, EvaluatingCompileFeatures, COMPILE_FEATURES) \
- SELECT(F, EvaluatingLinkOptions, LINK_OPTIONS) \
- SELECT(F, EvaluatingLinkDirectories, LINK_DIRECTORIES) \
- SELECT(F, EvaluatingLinkDepends, LINK_DEPENDS) \
- SELECT(F, EvaluatingPrecompileHeaders, PRECOMPILE_HEADERS)
-
-#define CM_FOR_EACH_TRANSITIVE_PROPERTY(F) \
- CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_BOTH)
-
-#define CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(F) \
- CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_FIRST)
-
-#define CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(F) \
- CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_SECOND)
+class cmLocalGenerator;
struct cmGeneratorExpressionDAGChecker
{
@@ -47,11 +21,13 @@ struct cmGeneratorExpressionDAGChecker
cmGeneratorTarget const* target,
std::string property,
const GeneratorExpressionContent* content,
- cmGeneratorExpressionDAGChecker* parent);
+ cmGeneratorExpressionDAGChecker* parent,
+ cmLocalGenerator const* contextLG);
cmGeneratorExpressionDAGChecker(cmGeneratorTarget const* target,
std::string property,
const GeneratorExpressionContent* content,
- cmGeneratorExpressionDAGChecker* parent);
+ cmGeneratorExpressionDAGChecker* parent,
+ cmLocalGenerator const* contextLG);
enum Result
{
@@ -66,6 +42,7 @@ struct cmGeneratorExpressionDAGChecker
void ReportError(cmGeneratorExpressionContext* context,
const std::string& expr);
+ bool EvaluatingTransitiveProperty() const;
bool EvaluatingGenexExpression() const;
bool EvaluatingPICExpression() const;
bool EvaluatingCompileExpression() const;
@@ -82,11 +59,7 @@ struct cmGeneratorExpressionDAGChecker
bool EvaluatingLinkLibraries(cmGeneratorTarget const* tgt = nullptr,
ForGenex genex = ForGenex::ANY) const;
-#define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) bool METHOD() const;
-
- CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(DECLARE_TRANSITIVE_PROPERTY_METHOD)
-
-#undef DECLARE_TRANSITIVE_PROPERTY_METHOD
+ bool EvaluatingSources() const;
bool GetTransitivePropertiesOnly() const;
void SetTransitivePropertiesOnly() { this->TransitivePropertiesOnly = true; }
@@ -94,20 +67,20 @@ struct cmGeneratorExpressionDAGChecker
bool GetTransitivePropertiesOnlyCMP0131() const;
void SetTransitivePropertiesOnlyCMP0131() { this->CMP0131 = true; }
- cmGeneratorExpressionDAGChecker const* Top() const;
cmGeneratorTarget const* TopTarget() const;
private:
Result CheckGraph() const;
- void Initialize();
const cmGeneratorExpressionDAGChecker* const Parent;
+ const cmGeneratorExpressionDAGChecker* const Top;
cmGeneratorTarget const* Target;
const std::string Property;
mutable std::map<cmGeneratorTarget const*, std::set<std::string>> Seen;
const GeneratorExpressionContent* const Content;
const cmListFileBacktrace Backtrace;
Result CheckResult;
- bool TransitivePropertiesOnly;
- bool CMP0131;
+ bool TransitivePropertiesOnly = false;
+ bool CMP0131 = false;
+ bool TopIsTransitiveProperty = false;
};
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index c8147b2..b9feb87 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -487,7 +487,8 @@ protected:
if (context->HeadTarget) {
cmGeneratorExpressionDAGChecker dagChecker(
context->Backtrace, context->HeadTarget,
- genexOperator + ":" + expression, content, dagCheckerParent);
+ genexOperator + ":" + expression, content, dagCheckerParent,
+ context->LG);
switch (dagChecker.Check()) {
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE: {
@@ -547,6 +548,7 @@ static const struct TargetGenexEvalNode : public GenexEvaluator
return expression;
}
+ // Replace the surrounding context with the named target.
cmGeneratorExpressionContext targetContext(
context->LG, context->Config, context->Quiet, target, target,
context->EvaluateForBuildsystem, context->Backtrace, context->Language);
@@ -1859,6 +1861,7 @@ struct CharacterNode : public cmGeneratorExpressionNode
static const CharacterNode<'>'> angle_rNode;
static const CharacterNode<','> commaNode;
static const CharacterNode<';'> semicolonNode;
+static const CharacterNode<'"'> quoteNode;
struct CompilerIdNode : public cmGeneratorExpressionNode
{
@@ -2698,7 +2701,8 @@ static const struct DeviceLinkNode : public cmGeneratorExpressionNode
static std::string getLinkedTargetsContent(
cmGeneratorTarget const* target, std::string const& prop,
cmGeneratorExpressionContext* context,
- cmGeneratorExpressionDAGChecker* dagChecker)
+ cmGeneratorExpressionDAGChecker* dagChecker,
+ cmGeneratorTarget::LinkInterfaceFor interfaceFor)
{
std::string result;
if (cmLinkImplementationLibraries const* impl =
@@ -2713,8 +2717,8 @@ static std::string getLinkedTargetsContent(
target->GetLocalGenerator(), context->Config, context->Quiet, target,
target, context->EvaluateForBuildsystem, lib.Backtrace,
context->Language);
- std::string libResult =
- lib.Target->EvaluateInterfaceProperty(prop, &libContext, dagChecker);
+ std::string libResult = lib.Target->EvaluateInterfaceProperty(
+ prop, &libContext, dagChecker, interfaceFor);
if (!libResult.empty()) {
if (result.empty()) {
result = std::move(libResult);
@@ -2872,29 +2876,22 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
std::string interfacePropertyName;
bool isInterfaceProperty = false;
+ cmGeneratorTarget::LinkInterfaceFor interfaceFor =
+ cmGeneratorTarget::LinkInterfaceFor::Usage;
-#define POPULATE_INTERFACE_PROPERTY_NAME(prop) \
- if (propertyName == #prop) { \
- interfacePropertyName = "INTERFACE_" #prop; \
- } else if (propertyName == "INTERFACE_" #prop) { \
- interfacePropertyName = "INTERFACE_" #prop; \
- isInterfaceProperty = true; \
- } else
-
- CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(POPULATE_INTERFACE_PROPERTY_NAME)
- // Note that the above macro terminates with an else
- /* else */ if (cmHasLiteralPrefix(propertyName, "COMPILE_DEFINITIONS_")) {
- cmPolicies::PolicyStatus polSt =
- context->LG->GetPolicyStatus(cmPolicies::CMP0043);
- if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD) {
- interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
- }
+ if (cm::optional<cmGeneratorTarget::TransitiveProperty> transitiveProp =
+ target->IsTransitiveProperty(propertyName, context->LG)) {
+ interfacePropertyName = std::string(transitiveProp->InterfaceName);
+ isInterfaceProperty = transitiveProp->InterfaceName == propertyName;
+ interfaceFor = transitiveProp->InterfaceFor;
}
-#undef POPULATE_INTERFACE_PROPERTY_NAME
bool evaluatingLinkLibraries = false;
if (dagCheckerParent) {
+ // This $<TARGET_PROPERTY:...> node has been reached while evaluating
+ // another target property value. Check that the outermost evaluation
+ // expects such nested evaluations.
if (dagCheckerParent->EvaluatingGenexExpression() ||
dagCheckerParent->EvaluatingPICExpression() ||
dagCheckerParent->EvaluatingLinkerLauncher()) {
@@ -2910,21 +2907,19 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
return std::string();
}
} else {
-#define ASSERT_TRANSITIVE_PROPERTY_METHOD(METHOD) dagCheckerParent->METHOD() ||
- assert(CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(
- ASSERT_TRANSITIVE_PROPERTY_METHOD) false); // NOLINT(clang-tidy)
-#undef ASSERT_TRANSITIVE_PROPERTY_METHOD
+ assert(dagCheckerParent->EvaluatingTransitiveProperty());
}
}
if (isInterfaceProperty) {
return cmGeneratorExpression::StripEmptyListElements(
target->EvaluateInterfaceProperty(propertyName, context,
- dagCheckerParent));
+ dagCheckerParent, interfaceFor));
}
- cmGeneratorExpressionDAGChecker dagChecker(
- context->Backtrace, target, propertyName, content, dagCheckerParent);
+ cmGeneratorExpressionDAGChecker dagChecker(context->Backtrace, target,
+ propertyName, content,
+ dagCheckerParent, context->LG);
switch (dagChecker.Check()) {
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
@@ -2949,8 +2944,20 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
return std::string();
}
- if (!haveProp && !target->IsImported() &&
- target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
+ // Properties named by COMPATIBLE_INTERFACE_ properties combine over
+ // the transitive link closure as a single order-independent value.
+ // Imported targets do not themselves have a defined value for these
+ // properties, but they can contribute to the value of a non-imported
+ // dependent.
+ //
+ // For COMPATIBLE_INTERFACE_{BOOL,STRING}:
+ // * If set on this target, use the value directly. It is checked
+ // elsewhere for consistency over the transitive link closure.
+ // * If not set on this target, compute the value from the closure.
+ //
+ // For COMPATIBLE_INTERFACE_NUMBER_{MAX,MIN} we always compute the value
+ // 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;
@@ -2967,26 +2974,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
context->Config);
return propContent ? propContent : "";
}
- if (target->IsLinkInterfaceDependentNumberMinProperty(propertyName,
- context->Config)) {
- context->HadContextSensitiveCondition = true;
- const char* propContent =
- target->GetLinkInterfaceDependentNumberMinProperty(propertyName,
- context->Config);
- return propContent ? propContent : "";
- }
- if (target->IsLinkInterfaceDependentNumberMaxProperty(propertyName,
- context->Config)) {
- context->HadContextSensitiveCondition = true;
- const char* propContent =
- target->GetLinkInterfaceDependentNumberMaxProperty(propertyName,
- context->Config);
- return propContent ? propContent : "";
- }
}
-
- if (!target->IsImported() && dagCheckerParent &&
- !dagCheckerParent->EvaluatingLinkLibraries()) {
+ if (!evaluatingLinkLibraries && !target->IsImported()) {
if (target->IsLinkInterfaceDependentNumberMinProperty(propertyName,
context->Config)) {
context->HadContextSensitiveCondition = true;
@@ -3005,12 +2994,14 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
}
+ // Some properties, such as usage requirements, combine over the
+ // transitive link closure as an ordered list.
if (!interfacePropertyName.empty()) {
result = cmGeneratorExpression::StripEmptyListElements(
this->EvaluateDependentExpression(result, context->LG, context, target,
&dagChecker, target));
std::string linkedTargetsContent = getLinkedTargetsContent(
- target, interfacePropertyName, context, &dagChecker);
+ target, interfacePropertyName, context, &dagChecker, interfaceFor);
if (!linkedTargetsContent.empty()) {
result += (result.empty() ? "" : ";") + linkedTargetsContent;
}
@@ -4529,6 +4520,7 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode(
{ "ANGLE-R", &angle_rNode },
{ "COMMA", &commaNode },
{ "SEMICOLON", &semicolonNode },
+ { "QUOTE", &quoteNode },
{ "TARGET_PROPERTY", &targetPropertyNode },
{ "TARGET_NAME", &targetNameNode },
{ "TARGET_OBJECTS", &targetObjectsNode },
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 26ae2da..75f3b6d 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5,6 +5,7 @@
#include <algorithm>
#include <array>
#include <cassert>
+#include <cctype>
#include <cerrno>
#include <cstddef>
#include <cstdio>
@@ -31,6 +32,7 @@
#include "cmCustomCommandGenerator.h"
#include "cmCxxModuleUsageEffects.h"
#include "cmEvaluatedTargetProperty.h"
+#include "cmExperimental.h"
#include "cmFileSet.h"
#include "cmFileTimes.h"
#include "cmGeneratedFileStream.h"
@@ -63,6 +65,7 @@
namespace {
using LinkInterfaceFor = cmGeneratorTarget::LinkInterfaceFor;
+using TransitiveProperty = cmGeneratorTarget::TransitiveProperty;
const std::string kINTERFACE_LINK_LIBRARIES = "INTERFACE_LINK_LIBRARIES";
const std::string kINTERFACE_LINK_LIBRARIES_DIRECT =
@@ -71,6 +74,33 @@ const std::string kINTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE =
"INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE";
}
+const std::map<cm::string_view, TransitiveProperty>
+ cmGeneratorTarget::BuiltinTransitiveProperties = {
+ { "AUTOMOC_MACRO_NAMES"_s,
+ { "INTERFACE_AUTOMOC_MACRO_NAMES"_s, LinkInterfaceFor::Usage } },
+ { "AUTOUIC_OPTIONS"_s,
+ { "INTERFACE_AUTOUIC_OPTIONS"_s, LinkInterfaceFor::Usage } },
+ { "COMPILE_DEFINITIONS"_s,
+ { "INTERFACE_COMPILE_DEFINITIONS"_s, LinkInterfaceFor::Usage } },
+ { "COMPILE_FEATURES"_s,
+ { "INTERFACE_COMPILE_FEATURES"_s, LinkInterfaceFor::Usage } },
+ { "COMPILE_OPTIONS"_s,
+ { "INTERFACE_COMPILE_OPTIONS"_s, LinkInterfaceFor::Usage } },
+ { "INCLUDE_DIRECTORIES"_s,
+ { "INTERFACE_INCLUDE_DIRECTORIES"_s, LinkInterfaceFor::Usage } },
+ { "LINK_DEPENDS"_s,
+ { "INTERFACE_LINK_DEPENDS"_s, LinkInterfaceFor::Link } },
+ { "LINK_DIRECTORIES"_s,
+ { "INTERFACE_LINK_DIRECTORIES"_s, LinkInterfaceFor::Link } },
+ { "LINK_OPTIONS"_s,
+ { "INTERFACE_LINK_OPTIONS"_s, LinkInterfaceFor::Link } },
+ { "PRECOMPILE_HEADERS"_s,
+ { "INTERFACE_PRECOMPILE_HEADERS"_s, LinkInterfaceFor::Usage } },
+ { "SOURCES"_s, { "INTERFACE_SOURCES"_s, LinkInterfaceFor::Usage } },
+ { "SYSTEM_INCLUDE_DIRECTORIES"_s,
+ { "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES"_s, LinkInterfaceFor::Usage } },
+ };
+
template <>
cmValue cmTargetPropertyComputer::GetSources<cmGeneratorTarget>(
cmGeneratorTarget const* tgt, cmMakefile const& /* mf */)
@@ -878,6 +908,31 @@ cmValue cmGeneratorTarget::GetFeature(const std::string& feature,
return this->LocalGenerator->GetFeature(feature, config);
}
+std::string cmGeneratorTarget::GetLinkerTypeProperty(
+ std::string const& lang, std::string const& config) const
+{
+ std::string propName{ "LINKER_TYPE" };
+ auto linkerType = this->GetProperty(propName);
+ if (!linkerType.IsEmpty()) {
+ cmGeneratorExpressionDAGChecker dagChecker(this, propName, nullptr,
+ nullptr, this->LocalGenerator);
+ auto ltype =
+ cmGeneratorExpression::Evaluate(*linkerType, this->GetLocalGenerator(),
+ config, this, &dagChecker, this, lang);
+ if (this->IsDeviceLink()) {
+ cmList list{ ltype };
+ const auto DL_BEGIN = "<DEVICE_LINK>"_s;
+ const auto DL_END = "</DEVICE_LINK>"_s;
+ cm::erase_if(list, [&](const std::string& item) {
+ return item == DL_BEGIN || item == DL_END;
+ });
+ return list.to_string();
+ }
+ return ltype;
+ }
+ return std::string{};
+}
+
const char* cmGeneratorTarget::GetLinkPIEProperty(
const std::string& config) const
{
@@ -902,7 +957,7 @@ bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
{
cmValue feature = this->GetFeature("INTERPROCEDURAL_OPTIMIZATION", config);
- if (!cmIsOn(feature)) {
+ if (!feature.IsOn()) {
// 'INTERPROCEDURAL_OPTIMIZATION' is off, no need to check policies
return false;
}
@@ -1068,8 +1123,8 @@ cmValue cmGeneratorTarget::GetLanguageExtensions(std::string const& lang) const
bool cmGeneratorTarget::GetLanguageStandardRequired(
std::string const& lang) const
{
- return cmIsOn(
- this->GetPropertyWithPairedLanguageSupport(lang, "_STANDARD_REQUIRED"));
+ return this->GetPropertyWithPairedLanguageSupport(lang, "_STANDARD_REQUIRED")
+ .IsOn();
}
void cmGeneratorTarget::GetModuleDefinitionSources(
@@ -1325,7 +1380,8 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(
if (iter == this->SystemIncludesCache.end()) {
cmGeneratorExpressionDAGChecker dagChecker(
- this, "SYSTEM_INCLUDE_DIRECTORIES", nullptr, nullptr);
+ this, "SYSTEM_INCLUDE_DIRECTORIES", nullptr, nullptr,
+ this->LocalGenerator);
bool excludeImported = this->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED");
@@ -1433,7 +1489,8 @@ std::string cmGeneratorTarget::EvaluateInterfaceProperty(
// a subset of TargetPropertyNode::Evaluate without stringify/parse steps
// but sufficient for transitive interface properties.
cmGeneratorExpressionDAGChecker dagChecker(context->Backtrace, this, prop,
- nullptr, dagCheckerParent);
+ nullptr, dagCheckerParent,
+ this->LocalGenerator);
switch (dagChecker.Check()) {
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
dagChecker.ReportError(
@@ -1498,6 +1555,38 @@ std::string cmGeneratorTarget::EvaluateInterfaceProperty(
return result;
}
+cm::optional<cmGeneratorTarget::TransitiveProperty>
+cmGeneratorTarget::IsTransitiveProperty(cm::string_view prop,
+ cmLocalGenerator const* lg) const
+{
+ cm::optional<TransitiveProperty> result;
+ static const cm::string_view kINTERFACE_ = "INTERFACE_"_s;
+ if (cmHasPrefix(prop, kINTERFACE_)) {
+ prop = prop.substr(kINTERFACE_.length());
+ }
+ auto i = BuiltinTransitiveProperties.find(prop);
+ if (i != BuiltinTransitiveProperties.end()) {
+ result = i->second;
+ if (result->InterfaceFor != cmGeneratorTarget::LinkInterfaceFor::Usage) {
+ cmPolicies::PolicyStatus cmp0166 =
+ lg->GetPolicyStatus(cmPolicies::CMP0166);
+ if ((cmp0166 == cmPolicies::WARN || cmp0166 == cmPolicies::OLD) &&
+ (prop == "LINK_DIRECTORIES"_s || prop == "LINK_DEPENDS"_s ||
+ prop == "LINK_OPTIONS"_s)) {
+ result->InterfaceFor = cmGeneratorTarget::LinkInterfaceFor::Usage;
+ }
+ }
+ } else if (cmHasLiteralPrefix(prop, "COMPILE_DEFINITIONS_")) {
+ cmPolicies::PolicyStatus cmp0043 =
+ lg->GetPolicyStatus(cmPolicies::CMP0043);
+ if (cmp0043 == cmPolicies::WARN || cmp0043 == cmPolicies::OLD) {
+ result = TransitiveProperty{ "INTERFACE_COMPILE_DEFINITIONS"_s,
+ LinkInterfaceFor::Usage };
+ }
+ }
+ return result;
+}
+
namespace {
enum class IncludeDirectoryFallBack
@@ -1512,8 +1601,10 @@ std::string AddLangSpecificInterfaceIncludeDirectories(
const std::string& propertyName, IncludeDirectoryFallBack mode,
cmGeneratorExpressionDAGChecker* context)
{
- cmGeneratorExpressionDAGChecker dag{ target->GetBacktrace(), target,
- propertyName, nullptr, context };
+ cmGeneratorExpressionDAGChecker dag{
+ target->GetBacktrace(), target, propertyName, nullptr, context,
+ target->GetLocalGenerator()
+ };
switch (dag.Check()) {
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
dag.ReportError(
@@ -1563,8 +1654,10 @@ void AddLangSpecificImplicitIncludeDirectories(
{
if (const auto* libraries = target->GetLinkImplementationLibraries(
config, LinkInterfaceFor::Usage)) {
- cmGeneratorExpressionDAGChecker dag{ target->GetBacktrace(), target,
- propertyName, nullptr, nullptr };
+ cmGeneratorExpressionDAGChecker dag{
+ target->GetBacktrace(), target, propertyName, nullptr, nullptr,
+ target->GetLocalGenerator()
+ };
for (const cmLinkImplItem& library : libraries->Libraries) {
if (const cmGeneratorTarget* dependency = library.Target) {
@@ -1816,8 +1909,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetSourceFilePaths(
this->DebugSourcesDone = true;
}
- cmGeneratorExpressionDAGChecker dagChecker(this, "SOURCES", nullptr,
- nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, "SOURCES", nullptr, nullptr,
+ this->LocalGenerator);
EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
this, config, std::string(), &dagChecker, this->SourceEntries);
@@ -1831,32 +1924,31 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetSourceFilePaths(
AddInterfaceEntries(this, config, "INTERFACE_SOURCES", std::string(),
&dagChecker, linkInterfaceSourcesEntries,
IncludeRuntimeInterface::No, LinkInterfaceFor::Usage);
- std::vector<std::string>::size_type numFilesBefore = files.size();
bool contextDependentInterfaceSources = processSources(
this, linkInterfaceSourcesEntries, files, uniqueSrcs, debugSources);
// Collect TARGET_OBJECTS of direct object link-dependencies.
bool contextDependentObjects = false;
- std::vector<std::string>::size_type numFilesBefore2 = files.size();
if (this->GetType() != cmStateEnums::OBJECT_LIBRARY) {
EvaluatedTargetPropertyEntries linkObjectsEntries;
AddObjectEntries(this, config, &dagChecker, linkObjectsEntries);
contextDependentObjects = processSources(this, linkObjectsEntries, files,
uniqueSrcs, debugSources);
+ // Note that for imported targets or multi-config generators supporting
+ // cross-config builds the paths to the object files must be per-config,
+ // so contextDependentObjects will be true here even if object libraries
+ // are specified without per-config generator expressions.
}
// Collect this target's file sets.
- std::vector<std::string>::size_type numFilesBefore3 = files.size();
EvaluatedTargetPropertyEntries fileSetEntries;
AddFileSetEntries(this, config, &dagChecker, fileSetEntries);
bool contextDependentFileSets =
processSources(this, fileSetEntries, files, uniqueSrcs, debugSources);
// Determine if sources are context-dependent or not.
- if (!contextDependentDirectSources &&
- !(contextDependentInterfaceSources && numFilesBefore < files.size()) &&
- !(contextDependentObjects && numFilesBefore2 < files.size()) &&
- !(contextDependentFileSets && numFilesBefore3 < files.size())) {
+ if (!contextDependentDirectSources && !contextDependentInterfaceSources &&
+ !contextDependentObjects && !contextDependentFileSets) {
this->SourcesAreContextDependent = Tribool::False;
} else {
this->SourcesAreContextDependent = Tribool::True;
@@ -2407,7 +2499,7 @@ bool cmGeneratorTarget::MacOSXUseInstallNameDir() const
cmValue build_with_install_name =
this->GetProperty("BUILD_WITH_INSTALL_NAME_DIR");
if (build_with_install_name) {
- return cmIsOn(*build_with_install_name);
+ return build_with_install_name.IsOn();
}
cmPolicies::PolicyStatus cmp0068 = this->GetPolicyStatusCMP0068();
@@ -3032,7 +3124,7 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string>& result,
}
cmGeneratorExpressionDAGChecker dagChecker(this, "AUTOUIC_OPTIONS", nullptr,
- nullptr);
+ nullptr, this->LocalGenerator);
cmExpandList(cmGeneratorExpression::Evaluate(prop, this->LocalGenerator,
config, this, &dagChecker),
result);
@@ -3564,7 +3656,7 @@ void cmGeneratorTarget::AddCUDAArchitectureFlagsImpl(cmBuildStep compileOrLink,
flags += "]\"";
}
- } else if (compiler == "Clang") {
+ } else if (compiler == "Clang" && compileOrLink == cmBuildStep::Compile) {
for (CudaArchitecture& architecture : architectures) {
flags += " --cuda-gpu-arch=sm_" + architecture.name;
@@ -3832,8 +3924,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories(
std::vector<BT<std::string>> includes;
std::unordered_set<std::string> uniqueIncludes;
- cmGeneratorExpressionDAGChecker dagChecker(this, "INCLUDE_DIRECTORIES",
- nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this, "INCLUDE_DIRECTORIES", nullptr, nullptr, this->LocalGenerator);
cmList debugProperties{ this->Makefile->GetDefinition(
"CMAKE_DEBUG_TARGET_PROPERTIES") };
@@ -4097,7 +4189,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileOptions(
std::unordered_set<std::string> uniqueOptions;
cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_OPTIONS", nullptr,
- nullptr);
+ nullptr, this->LocalGenerator);
cmList debugProperties{ this->Makefile->GetDefinition(
"CMAKE_DEBUG_TARGET_PROPERTIES") };
@@ -4138,7 +4230,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileFeatures(
std::unordered_set<std::string> uniqueFeatures;
cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_FEATURES", nullptr,
- nullptr);
+ nullptr, this->LocalGenerator);
cmList debugProperties{ this->Makefile->GetDefinition(
"CMAKE_DEBUG_TARGET_PROPERTIES") };
@@ -4187,8 +4279,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileDefinitions(
std::vector<BT<std::string>> list;
std::unordered_set<std::string> uniqueOptions;
- cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_DEFINITIONS",
- nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this, "COMPILE_DEFINITIONS", nullptr, nullptr, this->LocalGenerator);
cmList debugProperties{ this->Makefile->GetDefinition(
"CMAKE_DEBUG_TARGET_PROPERTIES") };
@@ -4251,8 +4343,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetPrecompileHeaders(
}
std::unordered_set<std::string> uniqueOptions;
- cmGeneratorExpressionDAGChecker dagChecker(this, "PRECOMPILE_HEADERS",
- nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this, "PRECOMPILE_HEADERS", nullptr, nullptr, this->LocalGenerator);
cmList debugProperties{ this->Makefile->GetDefinition(
"CMAKE_DEBUG_TARGET_PROPERTIES") };
@@ -4278,6 +4370,20 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetPrecompileHeaders(
return list;
}
+std::vector<std::string> cmGeneratorTarget::GetPchArchs(
+ std::string const& config, std::string const& lang) const
+{
+ std::vector<std::string> pchArchs;
+ if (!this->GetGlobalGenerator()->IsXcode()) {
+ pchArchs = this->GetAppleArchs(config, lang);
+ }
+ if (pchArchs.size() < 2) {
+ // We do not need per-arch PCH files when building for one architecture.
+ pchArchs = { {} };
+ }
+ return pchArchs;
+}
+
std::string cmGeneratorTarget::GetPchHeader(const std::string& config,
const std::string& language,
const std::string& arch) const
@@ -4641,7 +4747,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkOptions(
std::unordered_set<std::string> uniqueOptions;
cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_OPTIONS", nullptr,
- nullptr);
+ nullptr, this->LocalGenerator);
cmList debugProperties{ this->Makefile->GetDefinition(
"CMAKE_DEBUG_TARGET_PROPERTIES") };
@@ -4809,8 +4915,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetStaticLibraryLinkOptions(
std::vector<BT<std::string>> result;
std::unordered_set<std::string> uniqueOptions;
- cmGeneratorExpressionDAGChecker dagChecker(this, "STATIC_LIBRARY_OPTIONS",
- nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(
+ this, "STATIC_LIBRARY_OPTIONS", nullptr, nullptr, this->LocalGenerator);
EvaluatedTargetPropertyEntries entries;
if (cmValue linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) {
@@ -4923,7 +5029,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDirectories(
std::unordered_set<std::string> uniqueDirectories;
cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_DIRECTORIES", nullptr,
- nullptr);
+ nullptr, this->LocalGenerator);
cmList debugProperties{ this->Makefile->GetDefinition(
"CMAKE_DEBUG_TARGET_PROPERTIES") };
@@ -4967,7 +5073,7 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDepends(
std::vector<BT<std::string>> result;
std::unordered_set<std::string> uniqueOptions;
cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_DEPENDS", nullptr,
- nullptr);
+ nullptr, this->LocalGenerator);
EvaluatedTargetPropertyEntries entries;
if (cmValue linkDepends = this->GetProperty("LINK_DEPENDS")) {
@@ -5538,6 +5644,75 @@ std::string cmGeneratorTarget::GetLinkerLanguage(
return this->GetLinkClosure(config)->LinkerLanguage;
}
+std::string cmGeneratorTarget::GetLinkerTool(const std::string& config) const
+{
+ return this->GetLinkerTool(this->GetLinkerLanguage(config), config);
+}
+
+std::string cmGeneratorTarget::GetLinkerTool(const std::string& lang,
+ const std::string& config) const
+{
+ auto usingLinker =
+ cmStrCat("CMAKE_", lang, "_USING_", this->IsDeviceLink() ? "DEVICE_" : "",
+ "LINKER_");
+ auto format = this->Makefile->GetDefinition(cmStrCat(usingLinker, "MODE"));
+ if (!format || format != "TOOL"_s) {
+ return this->Makefile->GetDefinition("CMAKE_LINKER");
+ }
+
+ auto linkerType = this->GetLinkerTypeProperty(lang, config);
+ if (linkerType.empty()) {
+ linkerType = "DEFAULT";
+ }
+ usingLinker = cmStrCat(usingLinker, linkerType);
+ auto linkerTool = this->Makefile->GetDefinition(usingLinker);
+
+ if (!linkerTool) {
+ if (this->GetGlobalGenerator()->IsVisualStudio() &&
+ linkerType == "DEFAULT"_s) {
+ return std::string{};
+ }
+
+ // fall-back to generic definition
+ linkerTool = this->Makefile->GetDefinition("CMAKE_LINKER");
+
+ if (linkerType != "DEFAULT"_s) {
+ auto isCMakeLinkerType = [](const std::string& type) -> bool {
+ return std::all_of(type.cbegin(), type.cend(),
+ [](char c) { return std::isupper(c); });
+ };
+ if (isCMakeLinkerType(linkerType)) {
+ this->LocalGenerator->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("LINKER_TYPE '", linkerType,
+ "' is unknown or not supported by this toolchain."));
+ } else {
+ this->LocalGenerator->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("LINKER_TYPE '", linkerType,
+ "' is unknown. Did you forget to define the '", usingLinker,
+ "' variable?"));
+ }
+ }
+ }
+
+ return linkerTool;
+}
+
+bool cmGeneratorTarget::LinkerEnforcesNoAllowShLibUndefined(
+ std::string const& config) const
+{
+ // FIXME(#25486): Account for the LINKER_TYPE target property.
+ // Also factor out the hard-coded list below into a platform
+ // information table based on the linker id.
+ std::string ll = this->GetLinkerLanguage(config);
+ std::string linkerIdVar = cmStrCat("CMAKE_", ll, "_COMPILER_LINKER_ID");
+ cmValue linkerId = this->Makefile->GetDefinition(linkerIdVar);
+ // The GNU bfd-based linker may enforce '--no-allow-shlib-undefined'
+ // recursively by default. The Solaris linker has similar behavior.
+ return linkerId && (*linkerId == "GNU" || *linkerId == "Solaris");
+}
+
std::string cmGeneratorTarget::GetPDBOutputName(
const std::string& config) const
{
@@ -6291,6 +6466,7 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
std::string interfaceProperty = "INTERFACE_" + p;
std::unique_ptr<cmGeneratorExpressionInterpreter> genexInterpreter;
if (p == "POSITION_INDEPENDENT_CODE") {
+ // Corresponds to EvaluatingPICExpression.
genexInterpreter = cm::make_unique<cmGeneratorExpressionInterpreter>(
tgt->GetLocalGenerator(), config, tgt);
}
@@ -6684,7 +6860,7 @@ bool cmGeneratorTarget::IsFortranBuildingInstrinsicModules() const
{
if (cmValue prop =
this->GetProperty("Fortran_BUILDING_INSTRINSIC_MODULES")) {
- return cmIsOn(*prop);
+ return prop.IsOn();
}
return false;
}
@@ -6856,7 +7032,8 @@ bool cmGeneratorTarget::IsLinkLookupScope(std::string const& n,
cm::optional<cmLinkItem> cmGeneratorTarget::LookupLinkItem(
std::string const& n, cmListFileBacktrace const& bt,
- LookupLinkItemScope* scope, LookupSelf lookupSelf) const
+ std::string const& linkFeature, LookupLinkItemScope* scope,
+ LookupSelf lookupSelf) const
{
cm::optional<cmLinkItem> maybeItem;
if (this->IsLinkLookupScope(n, scope->LG)) {
@@ -6868,7 +7045,8 @@ cm::optional<cmLinkItem> cmGeneratorTarget::LookupLinkItem(
(lookupSelf == LookupSelf::No && name == this->GetName())) {
return maybeItem;
}
- maybeItem = this->ResolveLinkItem(BT<std::string>(name, bt), scope->LG);
+ maybeItem =
+ this->ResolveLinkItem(BT<std::string>(name, bt), scope->LG, linkFeature);
return maybeItem;
}
@@ -6881,7 +7059,8 @@ void cmGeneratorTarget::ExpandLinkItems(
return;
}
// Keep this logic in sync with ComputeLinkImplementationLibraries.
- cmGeneratorExpressionDAGChecker dagChecker(this, prop, nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this, prop, nullptr, nullptr,
+ this->LocalGenerator);
// The $<LINK_ONLY> expression may be in a link interface to specify
// private link dependencies that are otherwise excluded from usage
// requirements.
@@ -6899,9 +7078,16 @@ void cmGeneratorTarget::ExpandLinkItems(
cmList libs{ cge->Evaluate(this->LocalGenerator, config, headTarget,
&dagChecker, this,
headTarget->LinkerLanguage) };
+
+ auto linkFeature = cmLinkItem::DEFAULT;
for (auto const& lib : libs) {
+ if (auto maybeLinkFeature = ParseLinkFeature(lib)) {
+ linkFeature = std::move(*maybeLinkFeature);
+ continue;
+ }
+
if (cm::optional<cmLinkItem> maybeItem = this->LookupLinkItem(
- lib, cge->GetBacktrace(), &scope,
+ lib, cge->GetBacktrace(), linkFeature, &scope,
field == LinkInterfaceField::Libraries ? LookupSelf::No
: LookupSelf::Yes)) {
cmLinkItem item = std::move(*maybeItem);
@@ -7647,9 +7833,16 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface(
LinkInterfaceField::Libraries, iface);
cmList deps{ info->SharedDeps };
LookupLinkItemScope scope{ this->LocalGenerator };
+
+ auto linkFeature = cmLinkItem::DEFAULT;
for (auto const& dep : deps) {
+ if (auto maybeLinkFeature = ParseLinkFeature(dep)) {
+ linkFeature = std::move(*maybeLinkFeature);
+ continue;
+ }
+
if (cm::optional<cmLinkItem> maybeItem = this->LookupLinkItem(
- dep, cmListFileBacktrace(), &scope, LookupSelf::No)) {
+ dep, cmListFileBacktrace(), linkFeature, &scope, LookupSelf::No)) {
iface.SharedDeps.emplace_back(std::move(*maybeItem));
}
}
@@ -7781,9 +7974,9 @@ void cmGeneratorTarget::ComputeImportInfo(std::string const& desired_config,
if (this->GetType() == cmStateEnums::SHARED_LIBRARY) {
std::string soProp = cmStrCat("IMPORTED_NO_SONAME", suffix);
if (cmValue config_no_soname = this->GetProperty(soProp)) {
- info.NoSOName = cmIsOn(*config_no_soname);
+ info.NoSOName = config_no_soname.IsOn();
} else if (cmValue no_soname = this->GetProperty("IMPORTED_NO_SONAME")) {
- info.NoSOName = cmIsOn(*no_soname);
+ info.NoSOName = no_soname.IsOn();
}
}
@@ -8311,9 +8504,119 @@ void ComputeLinkImplTransitive(cmGeneratorTarget const* self,
}
}
+bool cmGeneratorTarget::ApplyCXXStdTargets()
+{
+ cmStandardLevelResolver standardResolver(this->Makefile);
+ cmStandardLevel const cxxStd23 =
+ *standardResolver.LanguageStandardLevel("CXX", "23");
+ std::vector<std::string> const& configs =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
+ auto std_prop = this->GetProperty("CXX_MODULE_STD");
+ if (!std_prop) {
+ // TODO(cxxmodules): Add a target policy to flip the default here. Set
+ // `std_prop` based on it.
+ return true;
+ }
+
+ std::string std_prop_value;
+ if (std_prop) {
+ // Evaluate generator expressions.
+ cmGeneratorExpression ge(*this->LocalGenerator->GetCMakeInstance());
+ auto cge = ge.Parse(*std_prop);
+ if (!cge) {
+ this->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(R"(The "CXX_MODULE_STD" property on the target ")",
+ this->GetName(), "\" is not a valid generator expression."));
+ return false;
+ }
+ // But do not allow context-sensitive queries. Whether a target uses
+ // `import std` should not depend on configuration or properties of the
+ // consumer (head target). The link language also shouldn't matter, so ban
+ // it as well.
+ if (cge->GetHadHeadSensitiveCondition()) {
+ // Not reachable; all target-sensitive genexes actually fail to parse.
+ this->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(R"(The "CXX_MODULE_STD" property on the target ")",
+ this->GetName(),
+ "\" contains a condition that queries the "
+ "consuming target which is not supported."));
+ return false;
+ }
+ if (cge->GetHadLinkLanguageSensitiveCondition()) {
+ // Not reachable; all link language genexes actually fail to parse.
+ this->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(R"(The "CXX_MODULE_STD" property on the target ")",
+ this->GetName(),
+ "\" contains a condition that queries the "
+ "link language which is not supported."));
+ return false;
+ }
+ std_prop_value = cge->Evaluate(this->LocalGenerator, "");
+ if (cge->GetHadContextSensitiveCondition()) {
+ this->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(R"(The "CXX_MODULE_STD" property on the target ")",
+ this->GetName(),
+ "\" contains a context-sensitive condition "
+ "that is not supported."));
+ return false;
+ }
+ }
+ auto use_std = cmIsOn(std_prop_value);
+
+ // If we have a value and it is not true, there's nothing to do.
+ if (std_prop && !use_std) {
+ return true;
+ }
+
+ for (auto const& config : configs) {
+ if (this->HaveCxxModuleSupport(config) != Cxx20SupportLevel::Supported) {
+ continue;
+ }
+
+ cm::optional<cmStandardLevel> explicitLevel =
+ this->GetExplicitStandardLevel("CXX", config);
+ if (!explicitLevel || *explicitLevel < cxxStd23) {
+ continue;
+ }
+
+ auto const targetName = cmStrCat(
+ "__CMAKE::CXX", standardResolver.GetLevelString("CXX", *explicitLevel));
+ if (!this->Makefile->FindTargetToUse(targetName)) {
+ this->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(
+ R"(The "CXX_MODULE_STD" property on the target ")", this->GetName(),
+ "\" requires that the \"", targetName,
+ "\" target exist, but it was not provided by the toolchain."));
+ break;
+ }
+
+ // Check the experimental feature here as well. A toolchain may have
+ // provided the target and skipped the check in the toolchain preparation
+ // logic.
+ if (!cmExperimental::HasSupportEnabled(
+ *this->Makefile, cmExperimental::Feature::CxxImportStd)) {
+ break;
+ }
+
+ this->Target->AppendProperty(
+ "LINK_LIBRARIES",
+ cmStrCat("$<BUILD_LOCAL_INTERFACE:$<$<CONFIG:", config, ">:", targetName,
+ ">>"));
+ }
+
+ return true;
+}
+
bool cmGeneratorTarget::DiscoverSyntheticTargets(cmSyntheticTargetCache& cache,
std::string const& config)
{
+ std::vector<std::string> allConfigs =
+ this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
cmOptionalLinkImplementation impl;
this->ComputeLinkImplementationLibraries(config, impl, this,
LinkInterfaceFor::Link);
@@ -8392,9 +8695,22 @@ bool cmGeneratorTarget::DiscoverSyntheticTargets(cmSyntheticTargetCache& cache,
// Create the generator target and attach it to the local generator.
auto gtp = cm::make_unique<cmGeneratorTarget>(tgt, lg);
+
synthDep = gtp.get();
cache.CxxModuleTargets[targetName] = synthDep;
+
+ // See `localGen->ComputeTargetCompileFeatures()` call in
+ // `cmGlobalGenerator::Compute` for where non-synthetic targets resolve
+ // this.
+ for (auto const& innerConfig : allConfigs) {
+ gtp->ComputeCompileFeatures(innerConfig);
+ }
+ // See `cmGlobalGenerator::ApplyCXXStdTargets` in
+ // `cmGlobalGenerator::Compute` for non-synthetic target resolutions.
+ gtp->ApplyCXXStdTargets();
+
gtp->DiscoverSyntheticTargets(cache, config);
+
lg->AddGeneratorTarget(std::move(gtp));
} else {
synthDep = cached->second;
@@ -8419,7 +8735,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
for (auto const& entry : entryRange) {
// Keep this logic in sync with ExpandLinkItems.
cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_LIBRARIES", nullptr,
- nullptr);
+ nullptr, this->LocalGenerator);
// The $<LINK_ONLY> expression may be used to specify link dependencies
// that are otherwise excluded from usage requirements.
if (implFor == LinkInterfaceFor::Usage) {
@@ -8455,7 +8771,13 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
impl.HadLinkLanguageSensitiveCondition = true;
}
+ auto linkFeature = cmLinkItem::DEFAULT;
for (auto const& lib : llibs) {
+ if (auto maybeLinkFeature = ParseLinkFeature(lib)) {
+ linkFeature = std::move(*maybeLinkFeature);
+ continue;
+ }
+
if (this->IsLinkLookupScope(lib, lg)) {
continue;
}
@@ -8502,8 +8824,8 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
}
// The entry is meant for this configuration.
- cmLinkItem item =
- this->ResolveLinkItem(BT<std::string>(name, entry.Backtrace), lg);
+ cmLinkItem item = this->ResolveLinkItem(
+ BT<std::string>(name, entry.Backtrace), lg, linkFeature);
if (item.Target) {
auto depsForTarget = synthTargetsForConfig.find(item.Target);
if (depsForTarget != synthTargetsForConfig.end()) {
@@ -8551,7 +8873,14 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
CMP0003_ComputeLinkType(config, debugConfigs);
cmTarget::LinkLibraryVectorType const& oldllibs =
this->Target->GetOriginalLinkLibraries();
+
+ auto linkFeature = cmLinkItem::DEFAULT;
for (cmTarget::LibraryID const& oldllib : oldllibs) {
+ if (auto maybeLinkFeature = ParseLinkFeature(oldllib.first)) {
+ linkFeature = std::move(*maybeLinkFeature);
+ continue;
+ }
+
if (oldllib.second != GENERAL_LibraryType && oldllib.second != linkType) {
std::string name = this->CheckCMP0004(oldllib.first);
if (name == this->GetName() || name.empty()) {
@@ -8559,7 +8888,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
}
// Support OLD behavior for CMP0003.
impl.WrongConfigLibraries.push_back(
- this->ResolveLinkItem(BT<std::string>(name)));
+ this->ResolveLinkItem(BT<std::string>(name), linkFeature));
}
}
}
@@ -8585,19 +8914,20 @@ cmGeneratorTarget::TargetOrString cmGeneratorTarget::ResolveTargetReference(
}
cmLinkItem cmGeneratorTarget::ResolveLinkItem(
- BT<std::string> const& name) const
+ BT<std::string> const& name, std::string const& linkFeature) const
{
- return this->ResolveLinkItem(name, this->LocalGenerator);
+ return this->ResolveLinkItem(name, this->LocalGenerator, linkFeature);
}
-cmLinkItem cmGeneratorTarget::ResolveLinkItem(BT<std::string> const& name,
- cmLocalGenerator const* lg) const
+cmLinkItem cmGeneratorTarget::ResolveLinkItem(
+ BT<std::string> const& name, cmLocalGenerator const* lg,
+ std::string const& linkFeature) const
{
auto bt = name.Backtrace;
TargetOrString resolved = this->ResolveTargetReference(name.Value, lg);
if (!resolved.Target) {
- return cmLinkItem(resolved.String, false, bt);
+ return cmLinkItem(resolved.String, false, bt, linkFeature);
}
// Check deprecation, issue message with `bt` backtrace.
@@ -8618,10 +8948,10 @@ cmLinkItem cmGeneratorTarget::ResolveLinkItem(BT<std::string> const& name,
// within the project.
if (resolved.Target->GetType() == cmStateEnums::EXECUTABLE &&
!resolved.Target->IsExecutableWithExports()) {
- return cmLinkItem(resolved.Target->GetName(), false, bt);
+ return cmLinkItem(resolved.Target->GetName(), false, bt, linkFeature);
}
- return cmLinkItem(resolved.Target, false, bt);
+ return cmLinkItem(resolved.Target, false, bt, linkFeature);
}
bool cmGeneratorTarget::HasPackageReferences() const
@@ -9084,7 +9414,10 @@ std::string cmGeneratorTarget::GenerateHeaderSetVerificationFile(
// consider the headerFile as part of the entire language
// unit within include-what-you-use and as a result allows
// one to get IWYU advice for headers.
- fout << "#include <" << headerFilename << "> // IWYU pragma: associated\n";
+ // Also suppress clang-tidy include checks in generated code.
+ fout
+ << "/* NOLINTNEXTLINE(misc-header-include-cycle,misc-include-cleaner) */\n"
+ << "#include <" << headerFilename << "> /* IWYU pragma: associated */\n";
fout.close();
return filename;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index ed5a4be..5c7201d 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -15,6 +15,7 @@
#include <vector>
#include <cm/optional>
+#include <cm/string_view>
#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
@@ -207,6 +208,9 @@ public:
cmValue GetFeature(const std::string& feature,
const std::string& config) const;
+ std::string GetLinkerTypeProperty(std::string const& lang,
+ std::string const& config) const;
+
const char* GetLinkPIEProperty(const std::string& config) const;
bool IsIPOEnabled(std::string const& lang, std::string const& config) const;
@@ -448,9 +452,12 @@ public:
TargetOrString ResolveTargetReference(std::string const& name,
cmLocalGenerator const* lg) const;
- cmLinkItem ResolveLinkItem(BT<std::string> const& name) const;
- cmLinkItem ResolveLinkItem(BT<std::string> const& name,
- cmLocalGenerator const* lg) const;
+ cmLinkItem ResolveLinkItem(
+ BT<std::string> const& name,
+ std::string const& linkFeature = cmLinkItem::DEFAULT) const;
+ cmLinkItem ResolveLinkItem(
+ BT<std::string> const& name, cmLocalGenerator const* lg,
+ std::string const& linkFeature = cmLinkItem::DEFAULT) const;
bool HasPackageReferences() const;
std::vector<std::string> GetPackageReferences() const;
@@ -592,6 +599,8 @@ public:
std::vector<BT<std::string>> GetPrecompileHeaders(
const std::string& config, const std::string& language) const;
+ std::vector<std::string> GetPchArchs(std::string const& config,
+ std::string const& lang) const;
std::string GetPchHeader(const std::string& config,
const std::string& language,
const std::string& arch = std::string()) const;
@@ -798,6 +807,13 @@ public:
//! Return the preferred linker language for this target
std::string GetLinkerLanguage(const std::string& config) const;
+ //! Return the preferred linker tool for this target
+ std::string GetLinkerTool(const std::string& config) const;
+ std::string GetLinkerTool(const std::string& lang,
+ const std::string& config) const;
+
+ /** Is the linker known to enforce '--no-allow-shlib-undefined'? */
+ bool LinkerEnforcesNoAllowShLibUndefined(std::string const& config) const;
/** Does this target have a GNU implib to convert to MS format? */
bool HasImplibGNUtoMS(std::string const& config) const;
@@ -871,7 +887,19 @@ public:
std::string EvaluateInterfaceProperty(
std::string const& prop, cmGeneratorExpressionContext* context,
cmGeneratorExpressionDAGChecker* dagCheckerParent,
- LinkInterfaceFor interfaceFor = LinkInterfaceFor::Usage) const;
+ LinkInterfaceFor interfaceFor) const;
+
+ struct TransitiveProperty
+ {
+ cm::string_view InterfaceName;
+ LinkInterfaceFor InterfaceFor;
+ };
+
+ static const std::map<cm::string_view, TransitiveProperty>
+ BuiltinTransitiveProperties;
+
+ cm::optional<TransitiveProperty> IsTransitiveProperty(
+ cm::string_view prop, cmLocalGenerator const* lg) const;
bool HaveInstallTreeRPATH(const std::string& config) const;
@@ -949,6 +977,7 @@ public:
std::string GetImportedXcFrameworkPath(const std::string& config) const;
+ bool ApplyCXXStdTargets();
bool DiscoverSyntheticTargets(cmSyntheticTargetCache& cache,
std::string const& config);
@@ -1179,6 +1208,7 @@ private:
};
cm::optional<cmLinkItem> LookupLinkItem(std::string const& n,
cmListFileBacktrace const& bt,
+ std::string const& linkFeature,
LookupLinkItemScope* scope,
LookupSelf lookupSelf) const;
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 880756d..8e21da0 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -3,6 +3,10 @@
#include "cmGetPropertyCommand.h"
#include <cstddef>
+#include <functional>
+
+#include <cm/string_view>
+#include <cmext/string_view>
#include "cmExecutionStatus.h"
#include "cmGlobalGenerator.h"
@@ -267,6 +271,38 @@ bool cmGetPropertyCommand(std::vector<std::string> const& args,
return true;
}
+namespace GetPropertyCommand {
+bool GetSourceFilePropertyGENERATED(
+ const std::string& name, cmMakefile& mf,
+ const std::function<bool(bool)>& storeResult)
+{
+ // Globally set as generated?
+ // Note: If the given "name" only contains a filename or a relative path
+ // the file's location is ambiguous. In general, one would expect
+ // it in the source-directory, because that is where source files
+ // are located normally. However, generated files are normally
+ // generated in the build-directory. Therefore, we first check for
+ // a generated file in the build-directory before we check for a
+ // generated file in the source-directory.
+ {
+ auto file =
+ cmSystemTools::CollapseFullPath(name, mf.GetCurrentBinaryDirectory());
+ if (mf.GetGlobalGenerator()->IsGeneratedFile(file)) {
+ return storeResult(true);
+ }
+ }
+ {
+ auto file =
+ cmSystemTools::CollapseFullPath(name, mf.GetCurrentSourceDirectory());
+ if (mf.GetGlobalGenerator()->IsGeneratedFile(file)) {
+ return storeResult(true);
+ }
+ }
+ // Skip checking the traditional/local property.
+ return storeResult(false);
+}
+}
+
namespace {
// Implementation of result storage.
@@ -405,12 +441,32 @@ bool HandleSourceMode(cmExecutionStatus& status, const std::string& name,
return false;
}
+ // Special handling for GENERATED property.
+ // Note: Only, if CMP0163 is set to NEW!
+ if (propertyName == "GENERATED"_s) {
+ auto& mf = status.GetMakefile();
+ auto cmp0163 = directory_makefile.GetPolicyStatus(cmPolicies::CMP0163);
+ bool const cmp0163new =
+ cmp0163 != cmPolicies::OLD && cmp0163 != cmPolicies::WARN;
+ if (cmp0163new) {
+ return GetPropertyCommand::GetSourceFilePropertyGENERATED(
+ name, mf, [infoType, &variable, &mf](bool isGenerated) -> bool {
+ // Set the value on the original Makefile scope, not the scope of the
+ // requested directory.
+ return StoreResult(infoType, mf, variable,
+ (isGenerated) ? cmValue("1") : cmValue("0"));
+ });
+ }
+ }
+
// Get the source file.
const std::string source_file_absolute_path =
SetPropertyCommand::MakeSourceFilePathAbsoluteIfNeeded(
status, name, source_file_paths_should_be_absolute);
if (cmSourceFile* sf =
directory_makefile.GetOrCreateSource(source_file_absolute_path)) {
+ // Set the value on the original Makefile scope, not the scope of the
+ // requested directory.
return StoreResult(infoType, status.GetMakefile(), variable,
sf->GetPropertyForUser(propertyName));
}
diff --git a/Source/cmGetSourceFilePropertyCommand.cxx b/Source/cmGetSourceFilePropertyCommand.cxx
index 40ae112..209030a 100644
--- a/Source/cmGetSourceFilePropertyCommand.cxx
+++ b/Source/cmGetSourceFilePropertyCommand.cxx
@@ -2,12 +2,24 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGetSourceFilePropertyCommand.h"
+#include <functional>
+
+#include <cm/string_view>
+#include <cmext/string_view>
+
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
+#include "cmPolicies.h"
#include "cmSetPropertyCommand.h"
#include "cmSourceFile.h"
#include "cmValue.h"
+namespace GetPropertyCommand {
+bool GetSourceFilePropertyGENERATED(
+ const std::string& name, cmMakefile& mf,
+ const std::function<bool(bool)>& storeResult);
+}
+
bool cmGetSourceFilePropertyCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
@@ -23,11 +35,11 @@ bool cmGetSourceFilePropertyCommand(std::vector<std::string> const& args,
bool source_file_target_option_enabled = false;
int property_arg_index = 2;
- if (args[2] == "DIRECTORY" && args_size == 5) {
+ if (args[2] == "DIRECTORY"_s && args_size == 5) {
property_arg_index = 4;
source_file_directory_option_enabled = true;
source_file_directories.push_back(args[3]);
- } else if (args[2] == "TARGET_DIRECTORY" && args_size == 5) {
+ } else if (args[2] == "TARGET_DIRECTORY"_s && args_size == 5) {
property_arg_index = 4;
source_file_target_option_enabled = true;
source_file_target_directories.push_back(args[3]);
@@ -44,23 +56,44 @@ bool cmGetSourceFilePropertyCommand(std::vector<std::string> const& args,
}
std::string const& var = args[0];
+ std::string const& propName = args[property_arg_index];
bool source_file_paths_should_be_absolute =
source_file_directory_option_enabled || source_file_target_option_enabled;
+ cmMakefile& directory_makefile = *source_file_directory_makefiles[0];
+
+ // Special handling for GENERATED property.
+ // Note: Only, if CMP0163 is set to NEW!
+ if (propName == "GENERATED"_s) {
+ auto& mf = status.GetMakefile();
+ auto cmp0163 = directory_makefile.GetPolicyStatus(cmPolicies::CMP0163);
+ bool const cmp0163new =
+ cmp0163 != cmPolicies::OLD && cmp0163 != cmPolicies::WARN;
+ if (cmp0163new) {
+ return GetPropertyCommand::GetSourceFilePropertyGENERATED(
+ args[1], mf, [&var, &mf](bool isGenerated) -> bool {
+ // Set the value on the original Makefile scope, not the scope of the
+ // requested directory.
+ mf.AddDefinition(var, (isGenerated) ? cmValue("1") : cmValue("0"));
+ return true;
+ });
+ }
+ }
+
+ // Get the source file.
std::string const file =
SetPropertyCommand::MakeSourceFilePathAbsoluteIfNeeded(
status, args[1], source_file_paths_should_be_absolute);
- cmMakefile& mf = *source_file_directory_makefiles[0];
- cmSourceFile* sf = mf.GetSource(file);
+ cmSourceFile* sf = directory_makefile.GetSource(file);
// for the location we must create a source file first
- if (!sf && args[property_arg_index] == "LOCATION") {
- sf = mf.CreateSource(file);
+ if (!sf && propName == "LOCATION"_s) {
+ sf = directory_makefile.CreateSource(file);
}
if (sf) {
cmValue prop = nullptr;
- if (!args[property_arg_index].empty()) {
- prop = sf->GetPropertyForUser(args[property_arg_index]);
+ if (!propName.empty()) {
+ prop = sf->GetPropertyForUser(propName);
}
if (prop) {
// Set the value on the original Makefile scope, not the scope of the
@@ -70,6 +103,8 @@ bool cmGetSourceFilePropertyCommand(std::vector<std::string> const& args,
}
}
+ // Set the value on the original Makefile scope, not the scope of the
+ // requested directory.
status.GetMakefile().AddDefinition(var, "NOTFOUND");
return true;
}
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 95e2187..a92faef 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -116,6 +116,19 @@ void cmGhsMultiTargetGenerator::Generate()
void cmGhsMultiTargetGenerator::GenerateTarget()
{
+ if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE &&
+ !this->GeneratorTarget
+ ->GetLinkerTypeProperty(
+ this->GeneratorTarget->GetLinkerLanguage(this->ConfigName),
+ this->ConfigName)
+ .empty()) {
+ // Green Hill MULTI does not support this feature.
+ cmSystemTools::Message(
+ cmStrCat("'LINKER_TYPE' property, specified on target '",
+ this->GeneratorTarget->GetName(),
+ "', is not supported by this generator."));
+ }
+
// Open the target file in copy-if-different mode.
std::string fproj =
cmStrCat(this->LocalGenerator->GetCurrentBinaryDirectory(), '/',
@@ -580,7 +593,7 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
for (auto& sg : groupFilesList) {
std::ostream* fout;
bool useProjectFile =
- cmIsOn(this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE")) ||
+ this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE").IsOn() ||
this->Makefile->IsOn("CMAKE_GHS_NO_SOURCE_GROUP_FILE");
if (useProjectFile || sg.empty()) {
fout = &fout_proj;
@@ -751,7 +764,7 @@ std::string cmGhsMultiTargetGenerator::WriteObjectLangOverride(
bool cmGhsMultiTargetGenerator::DetermineIfIntegrityApp()
{
if (cmValue p = this->GeneratorTarget->GetProperty("ghs_integrity_app")) {
- return cmIsOn(*p);
+ return p.IsOn();
}
std::vector<cmSourceFile*> sources;
this->GeneratorTarget->GetSourceFiles(sources, this->ConfigName);
diff --git a/Source/cmGlobCacheEntry.h b/Source/cmGlobCacheEntry.h
new file mode 100644
index 0000000..acc410d
--- /dev/null
+++ b/Source/cmGlobCacheEntry.h
@@ -0,0 +1,30 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#pragma once
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <string>
+#include <vector>
+
+struct cmGlobCacheEntry
+{
+ const bool Recurse;
+ const bool ListDirectories;
+ const bool FollowSymlinks;
+ const std::string Relative;
+ const std::string Expression;
+ std::vector<std::string> Files;
+
+ cmGlobCacheEntry(bool recurse, bool listDirectories, bool followSymlinks,
+ std::string relative, std::string expression,
+ std::vector<std::string> files)
+ : Recurse(recurse)
+ , ListDirectories(listDirectories)
+ , FollowSymlinks(followSymlinks)
+ , Relative(std::move(relative))
+ , Expression(std::move(expression))
+ , Files(std::move(files))
+ {
+ }
+};
diff --git a/Source/cmGlobVerificationManager.cxx b/Source/cmGlobVerificationManager.cxx
index 89c5b01..73365d2 100644
--- a/Source/cmGlobVerificationManager.cxx
+++ b/Source/cmGlobVerificationManager.cxx
@@ -7,6 +7,7 @@
#include "cmsys/FStream.hxx"
#include "cmGeneratedFileStream.h"
+#include "cmGlobCacheEntry.h"
#include "cmListFileCache.h"
#include "cmMessageType.h"
#include "cmMessenger.h"
@@ -145,19 +146,18 @@ void cmGlobVerificationManager::CacheEntryKey::PrintGlobCommand(
}
void cmGlobVerificationManager::AddCacheEntry(
- const bool recurse, const bool listDirectories, const bool followSymlinks,
- const std::string& relative, const std::string& expression,
- const std::vector<std::string>& files, const std::string& variable,
+ const cmGlobCacheEntry& entry, const std::string& variable,
const cmListFileBacktrace& backtrace, cmMessenger* messenger)
{
- CacheEntryKey key = CacheEntryKey(recurse, listDirectories, followSymlinks,
- relative, expression);
+ CacheEntryKey key =
+ CacheEntryKey(entry.Recurse, entry.ListDirectories, entry.FollowSymlinks,
+ entry.Relative, entry.Expression);
CacheEntryValue& value = this->Cache[key];
if (!value.Initialized) {
- value.Files = files;
+ value.Files = entry.Files;
value.Initialized = true;
value.Backtraces.emplace_back(variable, backtrace);
- } else if (value.Initialized && value.Files != files) {
+ } else if (value.Initialized && value.Files != entry.Files) {
std::ostringstream message;
message << std::boolalpha;
message << "The glob expression\n ";
@@ -176,6 +176,21 @@ void cmGlobVerificationManager::AddCacheEntry(
}
}
+std::vector<cmGlobCacheEntry> cmGlobVerificationManager::GetCacheEntries()
+ const
+{
+ std::vector<cmGlobCacheEntry> entries;
+ for (auto const& i : this->Cache) {
+ CacheEntryKey k = std::get<0>(i);
+ CacheEntryValue v = std::get<1>(i);
+ if (v.Initialized) {
+ entries.emplace_back(k.Recurse, k.ListDirectories, k.FollowSymlinks,
+ k.Relative, k.Expression, v.Files);
+ }
+ }
+ return entries;
+}
+
void cmGlobVerificationManager::Reset()
{
this->Cache.clear();
diff --git a/Source/cmGlobVerificationManager.h b/Source/cmGlobVerificationManager.h
index 52d71aa..e9c519b 100644
--- a/Source/cmGlobVerificationManager.h
+++ b/Source/cmGlobVerificationManager.h
@@ -13,6 +13,7 @@
#include "cmListFileCache.h"
class cmMessenger;
+struct cmGlobCacheEntry;
/** \class cmGlobVerificationManager
* \brief Class for expressing build-time dependencies on glob expressions.
@@ -28,13 +29,13 @@ protected:
bool SaveVerificationScript(const std::string& path, cmMessenger* messenger);
//! Add an entry into the glob cache
- void AddCacheEntry(bool recurse, bool listDirectories, bool followSymlinks,
- const std::string& relative,
- const std::string& expression,
- const std::vector<std::string>& files,
+ void AddCacheEntry(const cmGlobCacheEntry& entry,
const std::string& variable,
const cmListFileBacktrace& bt, cmMessenger* messenger);
+ //! Get all cache entries
+ std::vector<cmGlobCacheEntry> GetCacheEntries() const;
+
//! Clear the glob cache for state reset.
void Reset();
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ba1938f..e397fa2 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -28,6 +28,7 @@
#include "cm_codecvt_Encoding.hxx"
#include "cmAlgorithms.h"
+#include "cmCMakePath.h"
#include "cmCPackPropertiesGenerator.h"
#include "cmComputeTargetDepends.h"
#include "cmCryptoHash.h"
@@ -223,7 +224,7 @@ std::string cmGlobalGenerator::SelectMakeProgram(
if (cmIsOff(makeProgram)) {
cmValue makeProgramCSTR =
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
- if (cmIsOff(makeProgramCSTR)) {
+ if (makeProgramCSTR.IsOff()) {
makeProgram = makeDefault;
} else {
makeProgram = *makeProgramCSTR;
@@ -270,17 +271,14 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string& lang,
std::string changeVars;
if (cname && !optional) {
- std::string cnameString;
+ cmCMakePath cachedPath;
if (!cmSystemTools::FileIsFullPath(*cname)) {
- cnameString = cmSystemTools::FindProgram(*cname);
+ cachedPath = cmSystemTools::FindProgram(*cname);
} else {
- cnameString = *cname;
+ cachedPath = *cname;
}
- std::string pathString = path;
- // get rid of potentially multiple slashes:
- cmSystemTools::ConvertToUnixSlashes(cnameString);
- cmSystemTools::ConvertToUnixSlashes(pathString);
- if (cnameString != pathString) {
+ cmCMakePath foundPath = path;
+ if (foundPath.Normal() != cachedPath.Normal()) {
cmValue cvars = this->GetCMakeInstance()->GetState()->GetGlobalProperty(
"__CMAKE_DELETE_CACHE_CHANGE_VARS_");
if (cvars) {
@@ -336,7 +334,7 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const
for (const auto& localGen : this->LocalGenerators) {
for (const auto& target : localGen->GetGeneratorTargets()) {
if (!target->CanCompileSources() ||
- cmIsOn(target->GetProperty("ghs_integrity_app"))) {
+ target->GetProperty("ghs_integrity_app").IsOn()) {
continue;
}
@@ -408,7 +406,7 @@ bool cmGlobalGenerator::CheckTargetsForPchCompilePdb() const
for (const auto& generator : this->LocalGenerators) {
for (const auto& target : generator->GetGeneratorTargets()) {
if (!target->CanCompileSources() ||
- cmIsOn(target->GetProperty("ghs_integrity_app"))) {
+ target->GetProperty("ghs_integrity_app").IsOn()) {
continue;
}
@@ -452,13 +450,13 @@ bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
"all generators must specify this->FindMakeProgramFile");
return false;
}
- if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (mf->GetDefinition("CMAKE_MAKE_PROGRAM").IsOff()) {
std::string setMakeProgram = mf->GetModulesFile(this->FindMakeProgramFile);
if (!setMakeProgram.empty()) {
mf->ReadListFile(setMakeProgram);
}
}
- if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (mf->GetDefinition("CMAKE_MAKE_PROGRAM").IsOff()) {
std::ostringstream err;
err << "CMake was unable to find a build program corresponding to \""
<< this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You "
@@ -694,7 +692,22 @@ void cmGlobalGenerator::EnableLanguage(
std::string includes =
mf->GetSafeDefinition("CMAKE_PROJECT_TOP_LEVEL_INCLUDES");
cmList includesList{ includes };
- for (std::string const& setupFile : includesList) {
+ for (std::string setupFile : includesList) {
+ // Any relative path without a .cmake extension is checked for valid
+ // cmake modules. This logic should be consistent with CMake's include()
+ // command. Otherwise default to checking relative path w.r.t. source
+ // directory
+ if (!cmSystemTools::FileIsFullPath(setupFile) &&
+ !cmHasLiteralSuffix(setupFile, ".cmake")) {
+ std::string mfile = mf->GetModulesFile(cmStrCat(setupFile, ".cmake"));
+ if (mfile.empty()) {
+ cmSystemTools::Error(cmStrCat(
+ "CMAKE_PROJECT_TOP_LEVEL_INCLUDES module:\n ", setupFile));
+ mf->GetState()->SetInTopLevelIncludes(false);
+ return;
+ }
+ setupFile = mfile;
+ }
std::string absSetupFile = cmSystemTools::CollapseFullPath(
setupFile, mf->GetCurrentSourceDirectory());
if (!cmSystemTools::FileExists(absSetupFile)) {
@@ -859,7 +872,11 @@ void cmGlobalGenerator::EnableLanguage(
noCompiler <<
"The " << compilerName << ":\n"
" " << *compilerFile << "\n"
- "is not a full path and was not found in the PATH.\n"
+ "is not a full path and was not found in the PATH."
+#ifdef _WIN32
+ " Perhaps the extension is missing?"
+#endif
+ "\n"
;
/* clang-format on */
} else if (!cmSystemTools::FileExists(*compilerFile)) {
@@ -1139,24 +1156,30 @@ std::string cmGlobalGenerator::GetLanguageOutputExtension(
{
const std::string& lang = source.GetLanguage();
if (!lang.empty()) {
- auto const it = this->LanguageToOutputExtension.find(lang);
- if (it != this->LanguageToOutputExtension.end()) {
- return it->second;
- }
- } else {
- // if no language is found then check to see if it is already an
- // output extension for some language. In that case it should be ignored
- // and in this map, so it will not be compiled but will just be used.
- std::string const& ext = source.GetExtension();
- if (!ext.empty()) {
- if (this->OutputExtensions.count(ext)) {
- return ext;
- }
+ return this->GetLanguageOutputExtension(lang);
+ }
+ // if no language is found then check to see if it is already an
+ // output extension for some language. In that case it should be ignored
+ // and in this map, so it will not be compiled but will just be used.
+ std::string const& ext = source.GetExtension();
+ if (!ext.empty()) {
+ if (this->OutputExtensions.count(ext)) {
+ return ext;
}
}
return "";
}
+std::string cmGlobalGenerator::GetLanguageOutputExtension(
+ std::string const& lang) const
+{
+ auto const it = this->LanguageToOutputExtension.find(lang);
+ if (it != this->LanguageToOutputExtension.end()) {
+ return it->second;
+ }
+ return "";
+}
+
std::string cmGlobalGenerator::GetLanguageFromExtension(const char* ext) const
{
// if there is an extension and it starts with . then move past the
@@ -1558,6 +1581,29 @@ bool cmGlobalGenerator::Compute()
}
#endif
+ // Perform up-front computation in order to handle errors (such as unknown
+ // features) at this point. While processing the compile features we also
+ // calculate and cache the language standard required by the compile
+ // features.
+ //
+ // Synthetic targets performed this inside of
+ // `cmLocalGenerator::DiscoverSyntheticTargets`
+ for (const auto& localGen : this->LocalGenerators) {
+ if (!localGen->ComputeTargetCompileFeatures()) {
+ return false;
+ }
+ }
+
+ // We now have all targets set up and std levels constructed. Add
+ // `__CMAKE::CXX*` targets as link dependencies to all targets which need
+ // them.
+ //
+ // Synthetic targets performed this inside of
+ // `cmLocalGenerator::DiscoverSyntheticTargets`
+ if (!this->ApplyCXXStdTargets()) {
+ return false;
+ }
+
// Iterate through all targets and set up C++20 module targets.
// Create target templates for each imported target with C++20 modules.
// INTERFACE library with BMI-generating rules and a collation step?
@@ -1565,6 +1611,9 @@ bool cmGlobalGenerator::Compute()
// Make `add_dependencies(imported_target
// $<$<TARGET_NAME_IF_EXISTS:uses_imported>:synth1>
// $<$<TARGET_NAME_IF_EXISTS:other_uses_imported>:synth2>)`
+ //
+ // Note that synthetic target creation performs the above marked
+ // steps on the created targets.
if (!this->DiscoverSyntheticTargets()) {
return false;
}
@@ -1574,16 +1623,6 @@ bool cmGlobalGenerator::Compute()
localGen->AddHelperCommands();
}
- // Perform up-front computation in order to handle errors (such as unknown
- // features) at this point. While processing the compile features we also
- // calculate and cache the language standard required by the compile
- // features.
- for (const auto& localGen : this->LocalGenerators) {
- if (!localGen->ComputeTargetCompileFeatures()) {
- return false;
- }
- }
-
// Add automatically generated sources (e.g. unity build).
// Add unity sources after computing compile features. Unity sources do
// not change the set of languages or features, but we need to know them
@@ -1801,6 +1840,19 @@ void cmGlobalGenerator::ComputeTargetOrder(cmGeneratorTarget const* gt,
entry->second = index++;
}
+bool cmGlobalGenerator::ApplyCXXStdTargets()
+{
+ for (auto const& gen : this->LocalGenerators) {
+ for (auto const& tgt : gen->GetGeneratorTargets()) {
+ if (!tgt->ApplyCXXStdTargets()) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
bool cmGlobalGenerator::DiscoverSyntheticTargets()
{
cmSyntheticTargetCache cache;
@@ -2798,7 +2850,7 @@ void cmGlobalGenerator::AddGlobalTarget_Package(
} else {
cmValue noPackageAll =
mf->GetDefinition("CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY");
- if (cmIsOff(noPackageAll)) {
+ if (noPackageAll.IsOff()) {
gti.Depends.emplace_back(this->GetAllTargetName());
}
}
@@ -2862,6 +2914,14 @@ void cmGlobalGenerator::AddGlobalTarget_Test(
gti.Name = this->GetTestTargetName();
gti.Message = "Running tests...";
gti.UsesTerminal = true;
+ // Unlike the 'install' target, the 'test' target does not depend on 'all'
+ // by default. Enable it only if CMAKE_SKIP_TEST_ALL_DEPENDENCY is
+ // explicitly set to OFF.
+ if (cmValue noall = mf->GetDefinition("CMAKE_SKIP_TEST_ALL_DEPENDENCY")) {
+ if (noall.IsOff()) {
+ gti.Depends.emplace_back(this->GetAllTargetName());
+ }
+ }
cmCustomCommandLine singleLine;
singleLine.push_back(cmSystemTools::GetCTestCommand());
singleLine.push_back("--force-new-ctest-process");
@@ -2982,7 +3042,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
gti.Depends.emplace_back(this->GetPreinstallTargetName());
} else {
cmValue noall = mf->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
- if (cmIsOff(noall)) {
+ if (noall.IsOff()) {
gti.Depends.emplace_back(this->GetAllTargetName());
}
}
@@ -3064,7 +3124,7 @@ bool cmGlobalGenerator::UseFolderProperty() const
// If this property is defined, let the setter turn this on or off.
if (prop) {
- return cmIsOn(*prop);
+ return prop.IsOn();
}
// If CMP0143 is NEW `treat` "USE_FOLDERS" as ON. Otherwise `treat` it as OFF
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index bc80547..1ca02d9 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -349,6 +349,8 @@ public:
int GetLinkerPreference(const std::string& lang) const;
//! What is the object file extension for a given source file?
std::string GetLanguageOutputExtension(cmSourceFile const&) const;
+ //! What is the object file extension for a given language?
+ std::string GetLanguageOutputExtension(std::string const& lang) const;
//! What is the configurations directory variable called?
virtual const char* GetCMakeCFGIntDir() const { return "."; }
@@ -672,6 +674,7 @@ protected:
virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const;
+ bool ApplyCXXStdTargets();
bool DiscoverSyntheticTargets();
bool AddHeaderSetVerification();
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 4ba53ec..37bcc2c 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -124,7 +124,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
{
/* set primary target */
cmValue t = mf->GetDefinition("GHS_PRIMARY_TARGET");
- if (cmIsOff(t)) {
+ if (t.IsOff()) {
/* Use the value from `-A` or use `arm` */
std::string arch = "arm";
if (!cmIsOff(p)) {
@@ -297,18 +297,18 @@ void cmGlobalGhsMultiGenerator::WriteTopLevelProject(std::ostream& fout,
// Specify BSP option if supplied by user
// -- not all platforms require this entry in the project file
cmValue bspName = root->GetMakefile()->GetDefinition("GHS_BSP_NAME");
- if (!cmIsOff(bspName)) {
+ if (!bspName.IsOff()) {
fout << " -bsp " << *bspName << '\n';
}
// Specify OS DIR if supplied by user
// -- not all platforms require this entry in the project file
cmValue osDir = root->GetMakefile()->GetDefinition("GHS_OS_DIR");
- if (!cmIsOff(osDir)) {
+ if (!osDir.IsOff()) {
cmValue osDirOption =
root->GetMakefile()->GetDefinition("GHS_OS_DIR_OPTION");
fout << " ";
- if (cmIsOff(osDirOption)) {
+ if (osDirOption.IsOff()) {
fout << "";
} else {
fout << *osDirOption;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index f350efa..612af4f 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -378,6 +378,15 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
}
{
+ std::string ninjaDepfilePath;
+ bool depfileIsOutput = false;
+ if (!depfile.empty()) {
+ ninjaDepfilePath = this->ConvertToNinjaPath(depfile);
+ depfileIsOutput =
+ std::find(outputs.ExplicitOuts.begin(), outputs.ExplicitOuts.end(),
+ ninjaDepfilePath) != outputs.ExplicitOuts.end();
+ }
+
cmNinjaBuild build("CUSTOM_COMMAND");
build.Comment = comment;
build.Outputs = std::move(outputs.ExplicitOuts);
@@ -405,7 +414,13 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
vars["pool"] = job_pool;
}
if (!depfile.empty()) {
- vars["depfile"] = depfile;
+ vars["depfile"] = ninjaDepfilePath;
+ // Add the depfile to the `.ninja_deps` database. Since this (generally)
+ // removes the file, it cannot be declared as an output or byproduct of
+ // the command.
+ if (!depfileIsOutput) {
+ vars["deps"] = "gcc";
+ }
}
if (config.empty()) {
this->WriteBuild(*this->GetCommonFileStream(), build);
@@ -813,6 +828,9 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
this->NinjaExpectedEncoding = codecvt_Encoding::ANSI;
}
#endif
+ this->NinjaSupportsCWDDepend =
+ !cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, this->NinjaVersion,
+ RequiredNinjaVersionForCWDDepend());
}
void cmGlobalNinjaGenerator::CheckNinjaCodePage()
@@ -1359,10 +1377,10 @@ void cmGlobalNinjaGenerator::AppendTargetDepends(
} else {
cmNinjaDeps outs;
- auto computeISPCOuputs = [](cmGlobalNinjaGenerator* gg,
- cmGeneratorTarget const* depTarget,
- cmNinjaDeps& outputDeps,
- const std::string& targetConfig) {
+ auto computeISPCOutputs = [](cmGlobalNinjaGenerator* gg,
+ cmGeneratorTarget const* depTarget,
+ cmNinjaDeps& outputDeps,
+ const std::string& targetConfig) {
if (depTarget->CanCompileSources()) {
auto headers = depTarget->GetGeneratedISPCHeaders(targetConfig);
if (!headers.empty()) {
@@ -1386,10 +1404,10 @@ void cmGlobalNinjaGenerator::AppendTargetDepends(
}
if (targetDep.IsCross()) {
this->AppendTargetOutputs(targetDep, outs, fileConfig, depends);
- computeISPCOuputs(this, targetDep, outs, fileConfig);
+ computeISPCOutputs(this, targetDep, outs, fileConfig);
} else {
this->AppendTargetOutputs(targetDep, outs, config, depends);
- computeISPCOuputs(this, targetDep, outs, config);
+ computeISPCOutputs(this, targetDep, outs, config);
}
}
std::sort(outs.begin(), outs.end());
@@ -1981,6 +1999,11 @@ bool cmGlobalNinjaGenerator::SupportsMultilineDepfile() const
return this->NinjaSupportsMultilineDepfile;
}
+bool cmGlobalNinjaGenerator::SupportsCWDDepend() const
+{
+ return this->NinjaSupportsCWDDepend;
+}
+
bool cmGlobalNinjaGenerator::WriteTargetCleanAdditional(std::ostream& os)
{
const auto& lgr = this->LocalGenerators.at(0);
@@ -3265,10 +3288,3 @@ std::string cmGlobalNinjaMultiGenerator::OrderDependsTargetForTarget(
return cmStrCat("cmake_object_order_depends_target_", target->GetName(), '_',
cmSystemTools::UpperCase(config));
}
-
-std::string cmGlobalNinjaMultiGenerator::OrderDependsTargetForTargetPrivate(
- cmGeneratorTarget const* target, const std::string& config) const
-{
- return cmStrCat(this->OrderDependsTargetForTarget(target, config),
- "_private");
-}
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 220d393..64eed4d 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -349,7 +349,7 @@ public:
virtual std::string OrderDependsTargetForTarget(
cmGeneratorTarget const* target, const std::string& config) const;
- virtual std::string OrderDependsTargetForTargetPrivate(
+ std::string OrderDependsTargetForTargetPrivate(
cmGeneratorTarget const* target, const std::string& config) const;
void AppendTargetOutputs(cmGeneratorTarget const* target,
@@ -415,10 +415,12 @@ public:
return "1.10.2";
}
static std::string RequiredNinjaVersionForCodePage() { return "1.11"; }
+ static std::string RequiredNinjaVersionForCWDDepend() { return "1.7"; }
bool SupportsDirectConsole() const override;
bool SupportsImplicitOuts() const;
bool SupportsManifestRestat() const;
bool SupportsMultilineDepfile() const;
+ bool SupportsCWDDepend() const;
std::string NinjaOutputPath(std::string const& path) const;
bool HasOutputPathPrefix() const { return !this->OutputPathPrefix.empty(); }
@@ -597,6 +599,7 @@ private:
bool NinjaSupportsMultipleOutputs = false;
bool NinjaSupportsMetadataOnRegeneration = false;
bool NinjaSupportsCodePage = false;
+ bool NinjaSupportsCWDDepend = false;
codecvt_Encoding NinjaExpectedEncoding = codecvt_Encoding::None;
@@ -742,9 +745,6 @@ public:
std::string OrderDependsTargetForTarget(
cmGeneratorTarget const* target, const std::string& config) const override;
- std::string OrderDependsTargetForTargetPrivate(
- cmGeneratorTarget const* target, const std::string& config) const override;
-
protected:
bool OpenBuildFileStreams() override;
void CloseBuildFileStreams() override;
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 30206b5..56748a5 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -698,7 +698,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
if (cmValue tgtMsg =
this->GetCMakeInstance()->GetState()->GetGlobalProperty(
"TARGET_MESSAGES")) {
- targetMessages = cmIsOn(*tgtMsg);
+ targetMessages = tgtMsg.IsOn();
}
if (targetMessages) {
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 541db63..91fbccc 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -191,6 +191,23 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
}
}
+ if (this->GeneratorToolsetFortran) {
+ if (*this->GeneratorToolsetFortran != "ifx" &&
+ *this->GeneratorToolsetFortran != "ifort") {
+ mf->IssueMessage(MessageType::FATAL_ERROR,
+ cmStrCat("Generator\n"
+ " ",
+ this->GetName(),
+ "\n"
+ "given toolset\n"
+ " fortran=",
+ *this->GeneratorToolsetFortran,
+ "\n"
+ "but the value is not \"ifx\" or \"ifort\"."));
+ this->GeneratorToolsetFortran = cm::nullopt;
+ }
+ }
+
if (!this->GeneratorToolsetVersion.empty() &&
this->GeneratorToolsetVersion != "Test Toolset Version"_s) {
// If a specific minor version of the MSVC toolset is requested, verify
@@ -201,15 +218,25 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
if (vcPlatformToolsetRegex.find(platformToolset) ||
platformToolset == "Test Toolset"_s) {
std::string versionToolset = this->GeneratorToolsetVersion;
- cmsys::RegularExpression versionToolsetRegex("^[0-9][0-9]\\.[0-9][0-9]");
+ cmsys::RegularExpression versionToolsetRegex(
+ "^([0-9][0-9])\\.([0-9])[0-9](\\.|$)");
if (versionToolsetRegex.find(versionToolset)) {
- versionToolset = cmStrCat('v', versionToolset.erase(2, 1));
+ versionToolset = cmStrCat('v', versionToolsetRegex.match(1),
+ versionToolsetRegex.match(2));
+ // Hard-code special cases for toolset versions whose first
+ // three digits do not match their toolset name.
+ if (platformToolset == "v143"_s && versionToolset == "v144"_s &&
+ // VS 17.10 toolset v143 version 14.40.
+ (this->GeneratorToolsetVersion == "14.40"_s ||
+ cmHasLiteralPrefix(this->GeneratorToolsetVersion, "14.40."))) {
+ versionToolset = "v143";
+ }
} else {
// Version not recognized. Clear it.
versionToolset.clear();
}
- if (!cmHasPrefix(versionToolset, platformToolset)) {
+ if (versionToolset != platformToolset) {
mf->IssueMessage(
MessageType::FATAL_ERROR,
cmStrCat("Generator\n"
@@ -300,6 +327,9 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
if (const char* cudaDir = this->GetPlatformToolsetCudaCustomDir()) {
mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR", cudaDir);
}
+ if (cm::optional<std::string> fortran = this->GetPlatformToolsetFortran()) {
+ mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_FORTRAN", *fortran);
+ }
if (const char* vcTargetsDir = this->GetCustomVCTargetsPath()) {
mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR",
vcTargetsDir);
@@ -410,6 +440,10 @@ bool cmGlobalVisualStudio10Generator::ProcessGeneratorToolsetField(
cmSystemTools::ConvertToUnixSlashes(this->CustomFlagTableDir);
return true;
}
+ if (key == "fortran"_s) {
+ this->GeneratorToolsetFortran = value;
+ return true;
+ }
if (key == "version"_s) {
this->GeneratorToolsetVersion = value;
return true;
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 40bdd71..a2b351c 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -93,6 +93,12 @@ public:
* directory */
std::string const& GetPlatformToolsetCudaVSIntegrationSubdirString() const;
+ /** The fortran toolset name. */
+ cm::optional<std::string> GetPlatformToolsetFortran() const override
+ {
+ return this->GeneratorToolsetFortran;
+ }
+
/** Return whether we need to use No/Debug instead of false/true
for GenerateDebugInformation. */
bool GetPlatformToolsetNeedsDebugEnum() const
@@ -221,6 +227,7 @@ protected:
std::string GeneratorToolsetCudaCustomDir;
std::string GeneratorToolsetCudaNvccSubdir;
std::string GeneratorToolsetCudaVSIntegrationSubdir;
+ cm::optional<std::string> GeneratorToolsetFortran;
std::string DefaultPlatformToolset;
std::string DefaultPlatformToolsetHostArchitecture;
std::string DefaultAndroidToolset;
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index 68b4d1a..35b69af 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -390,7 +390,7 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersion(
"CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM")) {
// If the value is some off/false value, then there is NO maximum set.
- if (cmIsOff(value)) {
+ if (value.IsOff()) {
return std::string();
}
// If the value is something else, trust that it is a valid SDK value.
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 1abdd0b..866ace2 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -94,8 +94,8 @@ const std::string& cmGlobalVisualStudio7Generator::GetIntelProjectVersion()
cmSystemTools::ReadRegistryValue(vskey, intelVersion,
cmSystemTools::KeyWOW64_32);
unsigned int intelVersionNumber = ~0u;
- sscanf(intelVersion.c_str(), "%u", &intelVersionNumber);
- if (intelVersionNumber >= 11) {
+ if (sscanf(intelVersion.c_str(), "%u", &intelVersionNumber) != 1 ||
+ intelVersionNumber >= 11) {
// Default to latest known project file version.
intelVersion = "11.0";
} else if (intelVersionNumber == 10) {
@@ -740,7 +740,7 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
}
// inspect EXCLUDE_FROM_DEFAULT_BUILD[_<CONFIG>] properties
for (std::string const& i : configs) {
- if (cmIsOff(target->GetFeature("EXCLUDE_FROM_DEFAULT_BUILD", i))) {
+ if (target->GetFeature("EXCLUDE_FROM_DEFAULT_BUILD", i).IsOff()) {
activeConfigs.insert(i);
}
}
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 6f6109e..2056b2f 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -10,6 +10,8 @@
#include <utility>
#include <vector>
+#include <cm/optional>
+
#include <cm3p/json/value.h>
#include "cmGlobalVisualStudioGenerator.h"
@@ -102,6 +104,10 @@ public:
}
const std::string& GetIntelProjectVersion();
+ virtual cm::optional<std::string> GetPlatformToolsetFortran() const
+ {
+ return cm::nullopt;
+ }
bool FindMakeProgram(cmMakefile* mf) override;
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 5305fec..6fdc32c 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -491,7 +491,7 @@ bool cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf)
// Visual Studio generators know how to lookup their build tool
// directly instead of needing a helper module to do it, so we
// do not actually need to put CMAKE_MAKE_PROGRAM into the cache.
- if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (mf->GetDefinition("CMAKE_MAKE_PROGRAM").IsOff()) {
mf->AddDefinition("CMAKE_MAKE_PROGRAM", this->GetVSMakeProgram());
}
return true;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 72dba42..8067694 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -269,7 +269,7 @@ bool cmGlobalXCodeGenerator::FindMakeProgram(cmMakefile* mf)
// The Xcode generator knows how to lookup its build tool
// directly instead of needing a helper module to do it, so we
// do not actually need to put CMAKE_MAKE_PROGRAM into the cache.
- if (cmIsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
+ if (mf->GetDefinition("CMAKE_MAKE_PROGRAM").IsOff()) {
mf->AddDefinition("CMAKE_MAKE_PROGRAM", this->GetXcodeBuildCommand());
}
return true;
@@ -1095,7 +1095,7 @@ std::string GetSourcecodeValueFromFileExtension(
bool& keepLastKnownFileType, const std::vector<std::string>& enabled_langs)
{
std::string ext = cmSystemTools::LowerCase(_ext);
- std::string sourcecode = "sourcecode";
+ std::string sourcecode = "default";
if (ext == "o"_s) {
keepLastKnownFileType = true;
@@ -1110,42 +1110,42 @@ std::string GetSourcecodeValueFromFileExtension(
sourcecode = "file.storyboard";
// NOLINTNEXTLINE(bugprone-branch-clone)
} else if (ext == "mm"_s && !cm::contains(enabled_langs, "OBJCXX")) {
- sourcecode += ".cpp.objcpp";
+ sourcecode = "sourcecode.cpp.objcpp";
// NOLINTNEXTLINE(bugprone-branch-clone)
} else if (ext == "m"_s && !cm::contains(enabled_langs, "OBJC")) {
- sourcecode += ".c.objc";
+ sourcecode = "sourcecode.c.objc";
} else if (ext == "swift"_s) {
- sourcecode += ".swift";
+ sourcecode = "sourcecode.swift";
} else if (ext == "plist"_s) {
- sourcecode += ".text.plist";
+ sourcecode = "sourcecode.text.plist";
} else if (ext == "h"_s) {
- sourcecode += ".c.h";
+ sourcecode = "sourcecode.c.h";
} else if (ext == "hxx"_s || ext == "hpp"_s || ext == "txx"_s ||
ext == "pch"_s || ext == "hh"_s || ext == "inl"_s) {
- sourcecode += ".cpp.h";
+ sourcecode = "sourcecode.cpp.h";
} else if (ext == "png"_s || ext == "gif"_s || ext == "jpg"_s) {
keepLastKnownFileType = true;
sourcecode = "image";
} else if (ext == "txt"_s) {
- sourcecode += ".text";
+ sourcecode = "sourcecode.text";
} else if (lang == "CXX"_s) {
- sourcecode += ".cpp.cpp";
+ sourcecode = "sourcecode.cpp.cpp";
} else if (lang == "C"_s) {
- sourcecode += ".c.c";
+ sourcecode = "sourcecode.c.c";
} else if (lang == "OBJCXX"_s) {
- sourcecode += ".cpp.objcpp";
+ sourcecode = "sourcecode.cpp.objcpp";
} else if (lang == "OBJC"_s) {
- sourcecode += ".c.objc";
+ sourcecode = "sourcecode.c.objc";
} else if (lang == "Fortran"_s) {
- sourcecode += ".fortran.f90";
+ sourcecode = "sourcecode.fortran.f90";
} else if (lang == "ASM"_s) {
- sourcecode += ".asm";
+ sourcecode = "sourcecode.asm";
} else if (ext == "metal"_s) {
- sourcecode += ".metal";
+ sourcecode = "sourcecode.metal";
} else if (ext == "mig"_s) {
- sourcecode += ".mig";
+ sourcecode = "sourcecode.mig";
} else if (ext == "tbd"_s) {
- sourcecode += ".text-based-dylib-definition";
+ sourcecode = "sourcecode.text-based-dylib-definition";
} else if (ext == "a"_s) {
keepLastKnownFileType = true;
sourcecode = "archive.ar";
@@ -2480,6 +2480,25 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
buildSettings->AddAttribute("SWIFT_ACTIVE_COMPILATION_CONDITIONS",
swiftDefs.CreateList());
}
+
+ if (cm::optional<cmSwiftCompileMode> swiftCompileMode =
+ this->CurrentLocalGenerator->GetSwiftCompileMode(gtgt, configName)) {
+ switch (*swiftCompileMode) {
+ case cmSwiftCompileMode::Wholemodule:
+ buildSettings->AddAttribute("SWIFT_COMPILATION_MODE",
+ this->CreateString("wholemodule"));
+ break;
+ case cmSwiftCompileMode::Incremental:
+ case cmSwiftCompileMode::Singlefile:
+ break;
+ case cmSwiftCompileMode::Unknown:
+ this->CurrentLocalGenerator->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat("Unknown Swift_COMPILATION_MODE on target '",
+ gtgt->GetName(), "'"));
+ break;
+ }
+ }
}
std::string extraLinkOptionsVar;
@@ -2501,6 +2520,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
this->CurrentLocalGenerator->GetStaticLibraryFlags(
extraLinkOptions, configName, llang, gtgt);
} else {
+ this->CurrentLocalGenerator->AppendLinkerTypeFlags(extraLinkOptions, gtgt,
+ configName, llang);
+
cmValue targetLinkFlags = gtgt->GetProperty("LINK_FLAGS");
if (targetLinkFlags) {
this->CurrentLocalGenerator->AppendFlags(extraLinkOptions,
@@ -3045,7 +3067,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
}
// Precompile Headers
- std::string pchHeader = gtgt->GetPchHeader(configName, llang);
+ std::string pchHeader =
+ gtgt->GetPchHeader(configName, langForPreprocessorDefinitions);
if (!pchHeader.empty()) {
buildSettings->AddAttribute("GCC_PREFIX_HEADER",
this->CreateString(pchHeader));
@@ -3092,8 +3115,12 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateUtilityTarget(
"shellScript", this->CreateString("# shell script goes here\nexit 0"));
shellBuildPhase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
- cmXCodeObject* target =
- this->CreateObject(cmXCodeObject::PBXAggregateTarget);
+ std::string targetBinaryPath = cmStrCat(
+ gtgt->Makefile->GetCurrentBinaryDirectory(), '/', gtgt->GetName());
+
+ cmXCodeObject* target = this->CreateObject(
+ cmXCodeObject::PBXAggregateTarget,
+ cmStrCat("PBXAggregateTarget:", gtgt->GetName(), ":", targetBinaryPath));
target->SetComment(gtgt->GetName());
cmXCodeObject* buildPhases = this->CreateObject(cmXCodeObject::OBJECT_LIST);
std::vector<cmXCodeObject*> emptyContentVector;
@@ -3317,7 +3344,14 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeTarget(
if (!gtgt->IsInBuildSystem()) {
return nullptr;
}
- cmXCodeObject* target = this->CreateObject(cmXCodeObject::PBXNativeTarget);
+
+ std::string targetBinaryPath = this->RelativeToRootBinary(cmStrCat(
+ gtgt->Makefile->GetCurrentBinaryDirectory(), '/', gtgt->GetName()));
+
+ cmXCodeObject* target = this->CreateObject(
+ cmXCodeObject::PBXNativeTarget,
+ cmStrCat("PBXNativeTarget:", gtgt->GetName(), ":", targetBinaryPath));
+
target->AddAttribute("buildPhases", buildPhases);
cmXCodeObject* buildRules = this->CreateObject(cmXCodeObject::OBJECT_LIST);
target->AddAttribute("buildRules", buildRules);
@@ -4200,18 +4234,18 @@ void cmGlobalXCodeGenerator::AddEmbeddedObjects(
cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
bool removeHeaders = actionsOnByDefault & RemoveHeadersOnCopyByDefault;
- if (auto prop = gt->GetProperty(
+ if (cmValue prop = gt->GetProperty(
cmStrCat(embedPropertyName, "_REMOVE_HEADERS_ON_COPY"))) {
- removeHeaders = cmIsOn(*prop);
+ removeHeaders = prop.IsOn();
}
if (removeHeaders) {
attrs->AddObject(this->CreateString("RemoveHeadersOnCopy"));
}
bool codeSign = actionsOnByDefault & CodeSignOnCopyByDefault;
- if (auto prop =
+ if (cmValue prop =
gt->GetProperty(cmStrCat(embedPropertyName, "_CODE_SIGN_ON_COPY"))) {
- codeSign = cmIsOn(*prop);
+ codeSign = prop.IsOn();
}
if (codeSign) {
attrs->AddObject(this->CreateString("CodeSignOnCopy"));
@@ -4278,6 +4312,15 @@ void cmGlobalXCodeGenerator::AddEmbeddedResources(cmXCodeObject* target)
dstSubfolderSpec, NoActionOnCopyByDefault);
}
+void cmGlobalXCodeGenerator::AddEmbeddedXPCServices(cmXCodeObject* target)
+{
+ static const auto dstSubfolderSpec = "16";
+
+ this->AddEmbeddedObjects(
+ target, "Embed XPC Services", "XCODE_EMBED_XPC_SERVICES", dstSubfolderSpec,
+ NoActionOnCopyByDefault, "$(CONTENTS_FOLDER_PATH)/XPCServices");
+}
+
bool cmGlobalXCodeGenerator::CreateGroups(
std::vector<cmLocalGenerator*>& generators)
{
@@ -4607,6 +4650,10 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
buildSettings->AddAttribute("CODE_SIGNING_ALLOWED",
this->CreateString("NO"));
}
+
+ // This code supports the OLD behavior of CMP0157. We should be able to
+ // remove computing the debug configuration set once the old behavior is
+ // removed.
auto debugConfigs = this->GetCMakeInstance()->GetDebugConfigs();
std::set<std::string> debugConfigSet(debugConfigs.begin(),
debugConfigs.end());
@@ -4616,9 +4663,16 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
cmXCodeObject* buildSettingsForCfg = this->CreateFlatClone(buildSettings);
- if (debugConfigSet.count(cmSystemTools::UpperCase(config.first)) == 0) {
- buildSettingsForCfg->AddAttribute("SWIFT_COMPILATION_MODE",
- this->CreateString("wholemodule"));
+ // Supports the OLD behavior of CMP0157. CMP0157 OLD behavior globally set
+ // wholemodule compilation for all non-debug configurations, for all
+ // targets.
+ if (this->CurrentMakefile
+ ->GetDefinition("CMAKE_Swift_COMPILATION_MODE_DEFAULT")
+ .IsEmpty()) {
+ if (debugConfigSet.count(cmSystemTools::UpperCase(config.first)) == 0) {
+ buildSettingsForCfg->AddAttribute("SWIFT_COMPILATION_MODE",
+ this->CreateString("wholemodule"));
+ }
}
// Put this last so it can override existing settings
@@ -4680,6 +4734,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
this->AddEmbeddedAppExtensions(t);
this->AddEmbeddedExtensionKitExtensions(t);
this->AddEmbeddedResources(t);
+ this->AddEmbeddedXPCServices(t);
// Inherit project-wide values for any target-specific search paths.
this->InheritBuildSettingAttribute(t, "HEADER_SEARCH_PATHS");
this->InheritBuildSettingAttribute(t, "SYSTEM_HEADER_SEARCH_PATHS");
@@ -5086,6 +5141,17 @@ std::string cmGlobalXCodeGenerator::RelativeToSource(const std::string& p)
return p;
}
+std::string cmGlobalXCodeGenerator::RelativeToRootBinary(const std::string& p)
+{
+ std::string binaryDirectory =
+ this->CurrentRootGenerator->GetCurrentBinaryDirectory();
+ if (cmSystemTools::IsSubDirectory(p, binaryDirectory)) {
+ binaryDirectory = cmSystemTools::ForceToRelativePath(binaryDirectory, p);
+ }
+
+ return binaryDirectory;
+}
+
std::string cmGlobalXCodeGenerator::RelativeToBinary(const std::string& p)
{
return this->CurrentRootGenerator->MaybeRelativeToCurBinDir(p);
@@ -5254,7 +5320,7 @@ bool cmGlobalXCodeGenerator::UseEffectivePlatformName(cmMakefile* mf) const
return mf->PlatformIsAppleEmbedded();
}
- return cmIsOn(*epnValue);
+ return epnValue.IsOn();
}
bool cmGlobalXCodeGenerator::ShouldStripResourcePath(cmMakefile*) const
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index da0a4ea..2375e95 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -161,6 +161,7 @@ private:
bool CreateGroups(std::vector<cmLocalGenerator*>& generators);
std::string XCodeEscapePath(const std::string& p);
std::string RelativeToSource(const std::string& p);
+ std::string RelativeToRootBinary(const std::string& p);
std::string RelativeToBinary(const std::string& p);
std::string ConvertToRelativeForMake(std::string const& p);
void CreateCustomCommands(
@@ -225,6 +226,7 @@ private:
void AddEmbeddedAppExtensions(cmXCodeObject* target);
void AddEmbeddedExtensionKitExtensions(cmXCodeObject* target);
void AddEmbeddedResources(cmXCodeObject* target);
+ void AddEmbeddedXPCServices(cmXCodeObject* target);
void AddPositionIndependentLinkAttribute(cmGeneratorTarget* target,
cmXCodeObject* buildSettings,
const std::string& configName);
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index a8a7abb..6c3afef 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -284,7 +284,8 @@ void cmGraphVizWriter::Write()
// Reserved targets have inconsistent names across platforms (e.g. 'all'
// vs. 'ALL_BUILD'), which can disrupt the traversal ordering.
// We don't need or want them anyway.
- if (!cmGlobalGenerator::IsReservedTarget(gt->GetName())) {
+ if (!cmGlobalGenerator::IsReservedTarget(gt->GetName()) &&
+ !cmHasLiteralPrefix(gt->GetName(), "__cmake_")) {
sortedGeneratorTargets.insert(gt.get());
}
}
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index c2a09c1..0b80aaa 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -161,6 +161,10 @@ bool cmIfFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
inStatus.SetContinueInvoked();
return true;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ return true;
+ }
}
}
return true;
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 0fc4011..1567629 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -21,6 +21,7 @@
#include "cmArgumentParser.h"
#include "cmArgumentParserTypes.h"
#include "cmExecutionStatus.h"
+#include "cmExperimental.h"
#include "cmExportSet.h"
#include "cmFileSet.h"
#include "cmGeneratorExpression.h"
@@ -2030,7 +2031,7 @@ bool HandleExportAndroidMKMode(std::vector<std::string> const& args,
cm::make_unique<cmInstallExportGenerator>(
&exportSet, ica.GetDestination(), ica.GetPermissions(),
ica.GetConfigurations(), ica.GetComponent(), message,
- ica.GetExcludeFromAll(), fname, name_space, "", exportOld, true,
+ ica.GetExcludeFromAll(), fname, name_space, "", exportOld, true, false,
helper.Makefile->GetBacktrace()));
return true;
@@ -2054,6 +2055,7 @@ bool HandleExportMode(std::vector<std::string> const& args,
bool exportOld = false;
std::string filename;
std::string cxx_modules_directory;
+ bool exportPackageDependencies = false;
ica.Bind("EXPORT"_s, exp);
ica.Bind("NAMESPACE"_s, name_space);
@@ -2061,6 +2063,12 @@ bool HandleExportMode(std::vector<std::string> const& args,
ica.Bind("FILE"_s, filename);
ica.Bind("CXX_MODULES_DIRECTORY"_s, cxx_modules_directory);
+ if (cmExperimental::HasSupportEnabled(
+ status.GetMakefile(),
+ cmExperimental::Feature::ExportPackageDependencies)) {
+ ica.Bind("EXPORT_PACKAGE_DEPENDENCIES"_s, exportPackageDependencies);
+ }
+
std::vector<std::string> unknownArgs;
ica.Parse(args, &unknownArgs);
@@ -2147,7 +2155,8 @@ bool HandleExportMode(std::vector<std::string> const& args,
&exportSet, ica.GetDestination(), ica.GetPermissions(),
ica.GetConfigurations(), ica.GetComponent(), message,
ica.GetExcludeFromAll(), fname, name_space, cxx_modules_directory,
- exportOld, false, helper.Makefile->GetBacktrace()));
+ exportOld, false, exportPackageDependencies,
+ helper.Makefile->GetBacktrace()));
return true;
}
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index ead9c0e..2f3da3e 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -27,7 +27,7 @@ cmInstallExportGenerator::cmInstallExportGenerator(
std::string const& component, MessageLevel message, bool exclude_from_all,
std::string filename, std::string name_space,
std::string cxx_modules_directory, bool exportOld, bool android,
- cmListFileBacktrace backtrace)
+ bool exportPackageDependencies, cmListFileBacktrace backtrace)
: cmInstallGenerator(destination, configurations, component, message,
exclude_from_all, false, std::move(backtrace))
, ExportSet(exportSet)
@@ -36,6 +36,7 @@ cmInstallExportGenerator::cmInstallExportGenerator(
, Namespace(std::move(name_space))
, CxxModulesDirectory(std::move(cxx_modules_directory))
, ExportOld(exportOld)
+ , ExportPackageDependencies(exportPackageDependencies)
{
if (android) {
#ifndef CMAKE_BOOTSTRAP
@@ -119,6 +120,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os)
this->EFGen->AddConfiguration(c);
}
}
+ this->EFGen->SetExportPackageDependencies(this->ExportPackageDependencies);
this->EFGen->GenerateImportFile();
// Perform the main install script generation.
diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h
index f2d4a05..5f92851 100644
--- a/Source/cmInstallExportGenerator.h
+++ b/Source/cmInstallExportGenerator.h
@@ -29,7 +29,8 @@ public:
bool exclude_from_all, std::string filename,
std::string name_space,
std::string cxx_modules_directory, bool exportOld,
- bool android, cmListFileBacktrace backtrace);
+ bool android, bool exportPackageDependencies,
+ cmListFileBacktrace backtrace);
cmInstallExportGenerator(const cmInstallExportGenerator&) = delete;
~cmInstallExportGenerator() override;
@@ -70,6 +71,7 @@ protected:
std::string const Namespace;
std::string const CxxModulesDirectory;
bool const ExportOld;
+ bool const ExportPackageDependencies;
cmLocalGenerator* LocalGenerator = nullptr;
std::string TempDir;
diff --git a/Source/cmJSONState.cxx b/Source/cmJSONState.cxx
index 1abdaa6..5c44fba 100644
--- a/Source/cmJSONState.cxx
+++ b/Source/cmJSONState.cxx
@@ -45,7 +45,7 @@ cmJSONState::cmJSONState(const std::string& filename, Json::Value* root)
void cmJSONState::AddError(std::string const& errMsg)
{
- this->errors.push_back(Error(errMsg));
+ this->errors.emplace_back(errMsg);
}
void cmJSONState::AddErrorAtValue(std::string const& errMsg,
@@ -65,7 +65,7 @@ void cmJSONState::AddErrorAtOffset(std::string const& errMsg,
this->AddError(errMsg);
} else {
Location loc = LocateInDocument(offset);
- this->errors.push_back(Error(loc, errMsg));
+ this->errors.emplace_back(loc, errMsg);
}
}
@@ -118,7 +118,7 @@ const Json::Value* cmJSONState::value_after(std::string const& k)
void cmJSONState::push_stack(std::string const& k, const Json::Value* value)
{
- this->parseStack.push_back(JsonPair(k, value));
+ this->parseStack.emplace_back(k, value);
}
void cmJSONState::pop_stack()
diff --git a/Source/cmLinkItem.cxx b/Source/cmLinkItem.cxx
index 2dc40ff..3654176 100644
--- a/Source/cmLinkItem.cxx
+++ b/Source/cmLinkItem.cxx
@@ -4,20 +4,30 @@
#include <utility> // IWYU pragma: keep
+#include <cm/optional>
+#include <cm/string_view>
+#include <cmext/string_view>
+
#include "cmGeneratorTarget.h"
+#include "cmStringAlgorithms.h"
+
+const std::string cmLinkItem::DEFAULT = "DEFAULT";
cmLinkItem::cmLinkItem() = default;
-cmLinkItem::cmLinkItem(std::string n, bool c, cmListFileBacktrace bt)
+cmLinkItem::cmLinkItem(std::string n, bool c, cmListFileBacktrace bt,
+ std::string feature)
: String(std::move(n))
+ , Feature(std::move(feature))
, Cross(c)
, Backtrace(std::move(bt))
{
}
cmLinkItem::cmLinkItem(cmGeneratorTarget const* t, bool c,
- cmListFileBacktrace bt)
+ cmListFileBacktrace bt, std::string feature)
: Target(t)
+ , Feature(std::move(feature))
, Cross(c)
, Backtrace(std::move(bt))
{
@@ -73,3 +83,19 @@ cmLinkImplItem::cmLinkImplItem(cmLinkItem item, bool checkCMP0027)
, CheckCMP0027(checkCMP0027)
{
}
+
+namespace {
+const cm::string_view LL_BEGIN = "<LINK_LIBRARY:"_s;
+const cm::string_view LL_END = "</LINK_LIBRARY:"_s;
+}
+cm::optional<std::string> ParseLinkFeature(std::string const& item)
+{
+ if (cmHasPrefix(item, LL_BEGIN) && cmHasSuffix(item, '>')) {
+ return item.substr(LL_BEGIN.length(),
+ item.find('>', LL_BEGIN.length()) - LL_BEGIN.length());
+ }
+ if (cmHasPrefix(item, LL_END) && cmHasSuffix(item, '>')) {
+ return cmLinkItem::DEFAULT;
+ }
+ return cm::nullopt;
+}
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index e4444d3..1946c9b 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -10,6 +10,7 @@
#include <unordered_map>
#include <vector>
+#include <cm/optional>
#include <cmext/algorithm>
#include "cmListFileCache.h"
@@ -25,14 +26,20 @@ class cmLinkItem
std::string String;
public:
+ // default feature: link library without decoration
+ static const std::string DEFAULT;
+
cmLinkItem();
- cmLinkItem(std::string s, bool c, cmListFileBacktrace bt);
- cmLinkItem(cmGeneratorTarget const* t, bool c, cmListFileBacktrace bt);
+ cmLinkItem(std::string s, bool c, cmListFileBacktrace bt,
+ std::string feature = DEFAULT);
+ cmLinkItem(cmGeneratorTarget const* t, bool c, cmListFileBacktrace bt,
+ std::string feature = DEFAULT);
std::string const& AsStr() const;
cmGeneratorTarget const* Target = nullptr;
// The source file representing the external object (used when linking
// `$<TARGET_OBJECTS>`)
cmSourceFile const* ObjectSource = nullptr;
+ std::string Feature;
bool Cross = false;
cmListFileBacktrace Backtrace;
friend bool operator<(cmLinkItem const& l, cmLinkItem const& r);
@@ -160,3 +167,6 @@ inline cmTargetLinkLibraryType CMP0003_ComputeLinkType(
// The current configuration is not a debug configuration.
return OPTIMIZED_LibraryType;
}
+
+// Parse LINK_LIBRARY genex markers.
+cm::optional<std::string> ParseLinkFeature(std::string const& item);
diff --git a/Source/cmLinkItemGraphVisitor.cxx b/Source/cmLinkItemGraphVisitor.cxx
index 0ad846b..a63b794 100644
--- a/Source/cmLinkItemGraphVisitor.cxx
+++ b/Source/cmLinkItemGraphVisitor.cxx
@@ -82,7 +82,7 @@ bool cmLinkItemGraphVisitor::ItemVisited(cmLinkItem const& item)
bool cmLinkItemGraphVisitor::LinkVisited(cmLinkItem const& depender,
cmLinkItem const& dependee)
{
- auto const link = std::make_pair<>(depender.AsStr(), dependee.AsStr());
+ auto const link = std::make_pair(depender.AsStr(), dependee.AsStr());
bool const linkVisited =
this->VisitedLinks.find(link) != this->VisitedLinks.cend();
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index 28aa5d9..f1bda8d 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -204,7 +204,7 @@ bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg,
target.GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
// If CUDA_RESOLVE_DEVICE_SYMBOLS has been explicitly set we need
// to honor the value no matter what it is.
- return cmIsOn(*resolveDeviceSymbols);
+ return resolveDeviceSymbols.IsOn();
}
// Determine if we have any dependencies that require
@@ -213,7 +213,7 @@ bool requireDeviceLinking(cmGeneratorTarget& target, cmLocalGenerator& lg,
target.GetLinkClosure(config);
if (cm::contains(closure->Languages, "CUDA")) {
- if (cmIsOn(target.GetProperty("CUDA_SEPARABLE_COMPILATION"))) {
+ if (target.GetProperty("CUDA_SEPARABLE_COMPILATION").IsOn()) {
bool doDeviceLinking = false;
switch (target.GetType()) {
case cmStateEnums::SHARED_LIBRARY:
diff --git a/Source/cmList.h b/Source/cmList.h
index c29aae7..e107096 100644
--- a/Source/cmList.h
+++ b/Source/cmList.h
@@ -6,7 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <algorithm>
-#include <cstdint>
+#include <cstddef>
#include <initializer_list>
#include <iterator>
#include <memory>
@@ -47,7 +47,7 @@ public:
using value_type = container_type::value_type;
using allocator_type = container_type::allocator_type;
- using index_type = std::intptr_t;
+ using index_type = std::ptrdiff_t;
using size_type = container_type::size_type;
using difference_type = container_type::difference_type;
using reference = container_type::reference;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2c3595b..ffd41d2 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -5,6 +5,7 @@
#include <algorithm>
#include <array>
#include <cassert>
+#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <initializer_list>
@@ -82,7 +83,6 @@ static auto ruleReplaceVars = { "CMAKE_${LANG}_COMPILER",
"CMAKE_CURRENT_SOURCE_DIR",
"CMAKE_CURRENT_BINARY_DIR",
"CMAKE_RANLIB",
- "CMAKE_LINKER",
"CMAKE_MT",
"CMAKE_TAPI",
"CMAKE_CUDA_HOST_COMPILER",
@@ -595,7 +595,7 @@ void cmLocalGenerator::GenerateInstallRules()
"CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM")) {
/* clang-format off */
fout <<
- "# Set default install directory permissions.\n"
+ "# Set OS and executable format for runtime-dependencies.\n"
"if(NOT DEFINED CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM)\n"
" set(CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM \""
<< *platform << "\")\n"
@@ -611,7 +611,7 @@ void cmLocalGenerator::GenerateInstallRules()
this->Makefile->GetDefinition("CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL")) {
/* clang-format off */
fout <<
- "# Set default install directory permissions.\n"
+ "# Set tool for dependency-resolution of runtime-dependencies.\n"
"if(NOT DEFINED CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL)\n"
" set(CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL \""
<< *command << "\")\n"
@@ -627,7 +627,7 @@ void cmLocalGenerator::GenerateInstallRules()
"CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND")) {
/* clang-format off */
fout <<
- "# Set default install directory permissions.\n"
+ "# Set path to tool for dependency-resolution of runtime-dependencies.\n"
"if(NOT DEFINED CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND)\n"
" set(CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND \""
<< *command << "\")\n"
@@ -644,7 +644,7 @@ void cmLocalGenerator::GenerateInstallRules()
if (cmValue command = this->Makefile->GetDefinition("CMAKE_OBJDUMP")) {
/* clang-format off */
fout <<
- "# Set default install directory permissions.\n"
+ "# Set path to fallback-tool for dependency-resolution.\n"
"if(NOT DEFINED CMAKE_OBJDUMP)\n"
" set(CMAKE_OBJDUMP \""
<< *command << "\")\n"
@@ -910,8 +910,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
for (std::string const& i : includes) {
if (cmNonempty(fwSearchFlag) && this->Makefile->IsOn("APPLE") &&
cmSystemTools::IsPathToFramework(i)) {
- std::string const frameworkDir =
- cmSystemTools::CollapseFullPath(cmStrCat(i, "/../"));
+ std::string const frameworkDir = cmSystemTools::GetFilenamePath(i);
if (emitted.insert(frameworkDir).second) {
if (sysFwSearchFlag && target &&
target->IsSystemIncludeDirectory(frameworkDir, config, lang)) {
@@ -1367,7 +1366,7 @@ std::vector<BT<std::string>> cmLocalGenerator::GetStaticLibraryFlags(
{
const std::string configUpper = cmSystemTools::UpperCase(config);
std::vector<BT<std::string>> flags;
- if (linkLanguage != "Swift") {
+ if (linkLanguage != "Swift" && !this->IsSplitSwiftBuild()) {
std::string staticLibFlags;
this->AppendFlags(
staticLibFlags,
@@ -1479,7 +1478,7 @@ void cmLocalGenerator::GetTargetFlags(
CM_FALLTHROUGH;
case cmStateEnums::SHARED_LIBRARY: {
std::string sharedLibFlags;
- if (linkLanguage != "Swift") {
+ if (this->IsSplitSwiftBuild() || linkLanguage != "Swift") {
sharedLibFlags = cmStrCat(
this->Makefile->GetSafeDefinition(libraryLinkVariable), ' ');
if (!configUpper.empty()) {
@@ -1522,6 +1521,13 @@ void cmLocalGenerator::GetTargetFlags(
} break;
case cmStateEnums::EXECUTABLE: {
std::string exeFlags;
+ if (linkLanguage.empty()) {
+ cmSystemTools::Error(
+ "CMake can not determine linker language for target: " +
+ target->GetName());
+ return;
+ }
+
if (linkLanguage != "Swift") {
exeFlags = this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS");
exeFlags += " ";
@@ -1530,28 +1536,22 @@ void cmLocalGenerator::GetTargetFlags(
cmStrCat("CMAKE_EXE_LINKER_FLAGS_", configUpper));
exeFlags += " ";
}
- if (linkLanguage.empty()) {
- cmSystemTools::Error(
- "CMake can not determine linker language for target: " +
- target->GetName());
- return;
- }
+ }
- if (target->IsWin32Executable(config)) {
- exeFlags += this->Makefile->GetSafeDefinition(
- cmStrCat("CMAKE_", linkLanguage, "_CREATE_WIN32_EXE"));
- exeFlags += " ";
- } else {
- exeFlags += this->Makefile->GetSafeDefinition(
- cmStrCat("CMAKE_", linkLanguage, "_CREATE_CONSOLE_EXE"));
- exeFlags += " ";
- }
+ if (target->IsWin32Executable(config)) {
+ exeFlags += this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", linkLanguage, "_CREATE_WIN32_EXE"));
+ exeFlags += " ";
+ } else {
+ exeFlags += this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", linkLanguage, "_CREATE_CONSOLE_EXE"));
+ exeFlags += " ";
+ }
- if (target->IsExecutableWithExports()) {
- exeFlags += this->Makefile->GetSafeDefinition(
- cmStrCat("CMAKE_EXE_EXPORTS_", linkLanguage, "_FLAG"));
- exeFlags += " ";
- }
+ if (target->IsExecutableWithExports()) {
+ exeFlags += this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_EXE_EXPORTS_", linkLanguage, "_FLAG"));
+ exeFlags += " ";
}
this->AddLanguageFlagsForLinking(flags, target, linkLanguage, config);
@@ -1604,6 +1604,7 @@ void cmLocalGenerator::GetTargetFlags(
}
std::string extraLinkFlags;
+ this->AppendLinkerTypeFlags(extraLinkFlags, target, config, linkLanguage);
this->AppendPositionIndependentLinkerFlags(extraLinkFlags, target, config,
linkLanguage);
this->AppendIPOLinkerFlags(extraLinkFlags, target, config, linkLanguage);
@@ -1651,6 +1652,39 @@ std::vector<BT<std::string>> cmLocalGenerator::GetTargetCompileFlags(
if (lang == "Fortran") {
this->AppendFlags(compileFlags,
this->GetTargetFortranFlags(target, config));
+ } else if (lang == "Swift") {
+ // Only set the compile mode if CMP0157 is set
+ if (cm::optional<cmSwiftCompileMode> swiftCompileMode =
+ this->GetSwiftCompileMode(target, config)) {
+ std::string swiftCompileModeFlag;
+ switch (*swiftCompileMode) {
+ case cmSwiftCompileMode::Incremental: {
+ swiftCompileModeFlag = "-incremental";
+ if (cmValue flag =
+ mf->GetDefinition("CMAKE_Swift_COMPILE_OPTIONS_INCREMENTAL")) {
+ swiftCompileModeFlag = *flag;
+ }
+ break;
+ }
+ case cmSwiftCompileMode::Wholemodule: {
+ swiftCompileModeFlag = "-wmo";
+ if (cmValue flag =
+ mf->GetDefinition("CMAKE_Swift_COMPILE_OPTIONS_WMO")) {
+ swiftCompileModeFlag = *flag;
+ }
+ break;
+ }
+ case cmSwiftCompileMode::Singlefile:
+ break;
+ case cmSwiftCompileMode::Unknown: {
+ this->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat("Unknown Swift_COMPILATION_MODE on target '",
+ target->GetName(), "'"));
+ }
+ }
+ this->AppendFlags(compileFlags, swiftCompileModeFlag);
+ }
}
this->AddCMP0018Flags(compileFlags, target, lang, config);
@@ -2687,15 +2721,10 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
continue;
}
- std::vector<std::string> architectures;
- if (!this->GetGlobalGenerator()->IsXcode()) {
- architectures = target->GetAppleArchs(config, lang);
- }
- if (architectures.empty()) {
- architectures.emplace_back();
- } else {
+ std::vector<std::string> pchArchs = target->GetPchArchs(config, lang);
+ if (pchArchs.size() > 1) {
std::string useMultiArchPch;
- for (const std::string& arch : architectures) {
+ for (const std::string& arch : pchArchs) {
const std::string pchHeader =
target->GetPchHeader(config, lang, arch);
if (!pchHeader.empty()) {
@@ -2712,7 +2741,7 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
}
}
- for (const std::string& arch : architectures) {
+ for (const std::string& arch : pchArchs) {
const std::string pchSource = target->GetPchSource(config, lang, arch);
const std::string pchHeader = target->GetPchHeader(config, lang, arch);
@@ -2989,6 +3018,40 @@ cm::optional<std::string> cmLocalGenerator::GetMSVCDebugFormatName(
return msvcDebugInformationFormat;
}
+cm::optional<cmSwiftCompileMode> cmLocalGenerator::GetSwiftCompileMode(
+ cmGeneratorTarget const* target, std::string const& config)
+{
+ cmMakefile const* mf = this->GetMakefile();
+ cmValue const swiftCompileModeDefault =
+ mf->GetDefinition("CMAKE_Swift_COMPILATION_MODE_DEFAULT");
+ if (!cmNonempty(swiftCompileModeDefault)) {
+ return {};
+ }
+ cmValue swiftCompileMode = target->GetProperty("Swift_COMPILATION_MODE");
+ if (!swiftCompileMode) {
+ swiftCompileMode = swiftCompileModeDefault;
+ }
+
+ std::string const expandedCompileMode =
+ cmGeneratorExpression::Evaluate(*swiftCompileMode, this, config, target);
+ if (expandedCompileMode == "wholemodule") {
+ return cmSwiftCompileMode::Wholemodule;
+ }
+ if (expandedCompileMode == "singlefile") {
+ return cmSwiftCompileMode::Singlefile;
+ }
+ if (expandedCompileMode == "incremental") {
+ return cmSwiftCompileMode::Incremental;
+ }
+ return cmSwiftCompileMode::Unknown;
+}
+
+bool cmLocalGenerator::IsSplitSwiftBuild() const
+{
+ return cmNonempty(this->GetMakefile()->GetDefinition(
+ "CMAKE_Swift_COMPILATION_MODE_DEFAULT"));
+}
+
namespace {
inline void RegisterUnitySources(cmGeneratorTarget* target, cmSourceFile* sf,
@@ -3067,7 +3130,10 @@ void cmLocalGenerator::WriteUnitySourceInclude(
unity_file << *beforeInclude << "\n";
}
- unity_file << "/* NOLINTNEXTLINE(bugprone-suspicious-include) */\n";
+ // clang-tidy-17 has new include checks that needs NOLINT too.
+ unity_file
+ << "/* NOLINTNEXTLINE(bugprone-suspicious-include,misc-include-cleaner) "
+ "*/\n";
unity_file << "#include \"" << sf_full_path << "\"\n";
if (afterInclude) {
@@ -3097,8 +3163,17 @@ cmLocalGenerator::AddUnityFilesModeAuto(
chunk = std::min(itemsLeft, batchSize);
- std::string filename = cmStrCat(filename_base, "unity_", batch,
- (lang == "C") ? "_c.c" : "_cxx.cxx");
+ std::string extension;
+ if (lang == "C") {
+ extension = "_c.c";
+ } else if (lang == "CXX") {
+ extension = "_cxx.cxx";
+ } else if (lang == "OBJC") {
+ extension = "_m.m";
+ } else if (lang == "OBJCXX") {
+ extension = "_mm.mm";
+ }
+ std::string filename = cmStrCat(filename_base, "unity_", batch, extension);
auto const begin = filtered_sources.begin() + batch * batchSize;
auto const end = begin + chunk;
unity_files.emplace_back(this->WriteUnitySource(
@@ -3199,7 +3274,7 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target)
cmValue afterInclude = target->GetProperty("UNITY_BUILD_CODE_AFTER_INCLUDE");
cmValue unityMode = target->GetProperty("UNITY_BUILD_MODE");
- for (std::string lang : { "C", "CXX" }) {
+ for (std::string lang : { "C", "CXX", "OBJC", "OBJCXX" }) {
std::vector<UnityBatchedSource> filtered_sources;
std::copy_if(unitySources.begin(), unitySources.end(),
std::back_inserter(filtered_sources),
@@ -3245,6 +3320,61 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target)
}
}
+void cmLocalGenerator::AppendLinkerTypeFlags(std::string& flags,
+ cmGeneratorTarget* target,
+ const std::string& config,
+ const std::string& linkLanguage)
+{
+ switch (target->GetType()) {
+ case cmStateEnums::EXECUTABLE:
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::MODULE_LIBRARY:
+ break;
+ default:
+ return;
+ }
+
+ auto usingLinker =
+ cmStrCat("CMAKE_", linkLanguage, "_USING_",
+ target->IsDeviceLink() ? "DEVICE_" : "", "LINKER_");
+
+ auto format = this->Makefile->GetDefinition(cmStrCat(usingLinker, "MODE"));
+ if (format && format != "FLAG"_s) {
+ return;
+ }
+
+ auto linkerType = target->GetLinkerTypeProperty(linkLanguage, config);
+ if (linkerType.empty()) {
+ linkerType = "DEFAULT";
+ }
+ usingLinker = cmStrCat(usingLinker, linkerType);
+ auto linkerTypeFlags = this->Makefile->GetDefinition(usingLinker);
+ if (linkerTypeFlags) {
+ if (!linkerTypeFlags.IsEmpty()) {
+ auto linkerFlags = cmExpandListWithBacktrace(linkerTypeFlags);
+ target->ResolveLinkerWrapper(linkerFlags, linkLanguage);
+ this->AppendFlags(flags, linkerFlags);
+ }
+ } else if (linkerType != "DEFAULT"_s) {
+ auto isCMakeLinkerType = [](const std::string& type) -> bool {
+ return std::all_of(type.cbegin(), type.cend(),
+ [](char c) { return std::isupper(c); });
+ };
+ if (isCMakeLinkerType(linkerType)) {
+ this->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("LINKER_TYPE '", linkerType,
+ "' is unknown or not supported by this toolchain."));
+ } else {
+ this->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("LINKER_TYPE '", linkerType,
+ "' is unknown. Did you forget to define the '", usingLinker,
+ "' variable?"));
+ }
+ }
+}
+
void cmLocalGenerator::AppendIPOLinkerFlags(std::string& flags,
cmGeneratorTarget* target,
const std::string& config,
@@ -3293,7 +3423,7 @@ void cmLocalGenerator::AppendPositionIndependentLinkerFlags(
const std::string mode = cmIsOn(PICValue) ? "PIE" : "NO_PIE";
std::string supported = "CMAKE_" + lang + "_LINK_" + mode + "_SUPPORTED";
- if (cmIsOff(this->Makefile->GetDefinition(supported))) {
+ if (this->Makefile->GetDefinition(supported).IsOff()) {
return;
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index a920cfe..3ec349b 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -67,6 +67,15 @@ enum class cmBuildStep
Link
};
+/** What compilation mode the swift files are in */
+enum class cmSwiftCompileMode
+{
+ Wholemodule,
+ Incremental,
+ Singlefile,
+ Unknown,
+};
+
/** Target and source file which have a specific output. */
struct cmSourcesWithOutput
{
@@ -177,6 +186,9 @@ public:
void AddPchDependencies(cmGeneratorTarget* target);
void AddUnityBuild(cmGeneratorTarget* target);
virtual void AddXCConfigSources(cmGeneratorTarget* /* target */) {}
+ void AppendLinkerTypeFlags(std::string& flags, cmGeneratorTarget* target,
+ const std::string& config,
+ const std::string& linkLanguage);
void AppendIPOLinkerFlags(std::string& flags, cmGeneratorTarget* target,
const std::string& config,
const std::string& lang);
@@ -546,6 +558,14 @@ public:
const std::string& prop,
const std::string& config);
+ // Return Swift_COMPILATION_MODE value if CMP0157 is NEW.
+ cm::optional<cmSwiftCompileMode> GetSwiftCompileMode(
+ cmGeneratorTarget const* target, std::string const& config);
+
+ // Can we build Swift with a separate object build and link step
+ // (If CMP0157 is NEW, we can do a split build)
+ bool IsSplitSwiftBuild() const;
+
protected:
// The default implementation converts to a Windows shortpath to
// help older toolchains handle spaces and such. A generator may
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 7bce1d2..7def1fe 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -898,7 +898,7 @@ void cmLocalUnixMakefileGenerator3::AppendRuleDepend(
// Add a dependency on the rule file itself unless an option to skip
// it is specifically enabled by the user or project.
cmValue nodep = this->Makefile->GetDefinition("CMAKE_SKIP_RULE_DEPENDENCY");
- if (cmIsOff(nodep)) {
+ if (nodep.IsOff()) {
depends.emplace_back(ruleFileName);
}
}
@@ -1532,7 +1532,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
if (haveDirectoryInfo) {
// Test whether we need to force Unix paths.
if (cmValue force = mf->GetDefinition("CMAKE_FORCE_UNIX_PATHS")) {
- if (!cmIsOff(force)) {
+ if (!force.IsOff()) {
cmSystemTools::SetForceUnixPaths(true);
}
}
@@ -1784,7 +1784,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
depends.clear();
cmValue noall =
this->Makefile->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
- if (cmIsOff(noall)) {
+ if (noall.IsOff()) {
// Drive the build before installing.
depends.emplace_back("all");
} else if (regenerate) {
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7b02c56..12ca528 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -32,6 +32,7 @@
#include "cmList.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
@@ -794,6 +795,9 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
target->GetType() == cmStateEnums::OBJECT_LIBRARY
? ".lib"
: cmSystemTools::GetFilenameLastExtension(targetNameFull);
+ if (cm::optional<std::string> fortran = gg->GetPlatformToolsetFortran()) {
+ fout << "\t\t\tUseCompiler=\"" << *fortran << "Compiler\"\n";
+ }
/* clang-format off */
fout <<
"\t\t\tTargetName=\"" << this->EscapeForXML(targetName) << "\"\n"
@@ -1085,6 +1089,16 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
cmComputeLinkInformation& cli = *pcli;
std::string linkLanguage = cli.GetLinkLanguage();
+ if (!target->GetLinkerTypeProperty(linkLanguage, configName).empty()) {
+ // Visual Studio 10 or upper is required for this feature
+ this->GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("'LINKER_TYPE' property, specified on target '",
+ target->GetName(),
+ "', is not supported by this generator."),
+ target->GetBacktrace());
+ }
+
// Compute the variable name to lookup standard libraries for this
// language.
std::string standardLibsVar =
@@ -1121,7 +1135,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
cmStrCat(target->GetPDBDirectory(configName), '/', targetNames.PDB);
fout << "\t\t\t\tProgramDatabaseFile=\""
<< this->ConvertToXMLOutputPathSingle(temp) << "\"\n";
- if (targetOptions.IsDebug()) {
+ if (targetOptions.UsingDebugInfo()) {
fout << "\t\t\t\tGenerateDebugInformation=\"true\"\n";
}
if (this->WindowsCEProject) {
@@ -1161,6 +1175,16 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
cmComputeLinkInformation& cli = *pcli;
std::string linkLanguage = cli.GetLinkLanguage();
+ if (!target->GetLinkerTypeProperty(linkLanguage, configName).empty()) {
+ // Visual Studio 10 or upper is required for this feature
+ this->GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("'LINKER_TYPE' property, specified on target '",
+ target->GetName(),
+ "', is not supported by this generator."),
+ target->GetBacktrace());
+ }
+
bool isWin32Executable = target->IsWin32Executable(configName);
// Compute the variable name to lookup standard libraries for this
@@ -1199,7 +1223,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
target->GetPDBDirectory(configName));
fout << "\t\t\t\tProgramDatabaseFile=\"" << path << "/"
<< targetNames.PDB << "\"\n";
- if (targetOptions.IsDebug()) {
+ if (targetOptions.UsingDebugInfo()) {
fout << "\t\t\t\tGenerateDebugInformation=\"true\"\n";
}
if (this->WindowsCEProject) {
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 3d7cd8b..b57c3dd 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -135,6 +135,10 @@ bool cmMacroHelperCommand::operator()(
inStatus.SetBreakInvoked();
return true;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ return true;
+ }
}
return true;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 93fb8b4..ba9fab5 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -302,6 +302,11 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const
return this->Backtrace;
}
+cmFindPackageStack cmMakefile::GetFindPackageStack() const
+{
+ return this->FindPackageStack;
+}
+
void cmMakefile::PrintCommandTrace(cmListFileFunction const& lff,
cmListFileBacktrace const& bt,
CommandMissingFromStack missing) const
@@ -524,6 +529,12 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
cmSystemTools::SetFatalErrorOccurred();
}
}
+ if (this->GetCMakeInstance()->HasScriptModeExitCode() &&
+ this->GetCMakeInstance()->GetWorkingMode() == cmake::SCRIPT_MODE) {
+ // pass-through the exit code from inner cmake_language(EXIT) ,
+ // possibly from include() or similar command...
+ status.SetExitCode(this->GetCMakeInstance()->GetScriptModeExitCode());
+ }
}
} else {
if (!cmSystemTools::GetFatalErrorOccurred()) {
@@ -893,6 +904,11 @@ void cmMakefile::RunListFile(cmListFile const& listFile,
if (cmSystemTools::GetFatalErrorOccurred()) {
break;
}
+ if (status.HasExitCode()) {
+ // cmake_language EXIT was requested, early break.
+ this->GetCMakeInstance()->SetScriptModeExitCode(status.GetExitCode());
+ break;
+ }
if (status.GetReturnInvoked()) {
this->RaiseScope(status.GetReturnVariables());
// Exit early due to return command.
@@ -1128,9 +1144,15 @@ cmTarget* cmMakefile::GetCustomCommandTarget(
const std::string& target, cmObjectLibraryCommands objLibCommands,
const cmListFileBacktrace& lfbt) const
{
- // Find the target to which to add the custom command.
- auto ti = this->Targets.find(target);
+ auto realTarget = target;
+
+ auto ai = this->AliasTargets.find(target);
+ if (ai != this->AliasTargets.end()) {
+ realTarget = ai->second;
+ }
+ // Find the target to which to add the custom command.
+ auto ti = this->Targets.find(realTarget);
if (ti == this->Targets.end()) {
MessageType messageType = MessageType::AUTHOR_WARNING;
bool issueMessage = false;
@@ -1215,8 +1237,8 @@ cmTarget* cmMakefile::AddCustomCommandToTarget(
// Dispatch command creation to allow generator expressions in outputs.
this->AddGeneratorAction(
std::move(cc),
- [=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
- std::unique_ptr<cmCustomCommand> tcc) {
+ [this, t, type](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
+ std::unique_ptr<cmCustomCommand> tcc) {
BacktraceGuard guard(this->Backtrace, lfbt);
tcc->SetBacktrace(lfbt);
detail::AddCustomCommandToTarget(lg, cmCommandOrigin::Project, t, type,
@@ -1254,8 +1276,9 @@ void cmMakefile::AddCustomCommandToOutput(
// Dispatch command creation to allow generator expressions in outputs.
this->AddGeneratorAction(
std::move(cc),
- [=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
- std::unique_ptr<cmCustomCommand> tcc) {
+ [this, replace, callback](cmLocalGenerator& lg,
+ const cmListFileBacktrace& lfbt,
+ std::unique_ptr<cmCustomCommand> tcc) {
BacktraceGuard guard(this->Backtrace, lfbt);
tcc->SetBacktrace(lfbt);
cmSourceFile* sf = detail::AddCustomCommandToOutput(
@@ -1341,7 +1364,8 @@ void cmMakefile::AppendCustomCommandToOutput(
if (this->ValidateCustomCommand(commandLines)) {
// Dispatch command creation to allow generator expressions in outputs.
this->AddGeneratorAction(
- [=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt) {
+ [this, output, depends, implicit_depends,
+ commandLines](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt) {
BacktraceGuard guard(this->Backtrace, lfbt);
detail::AppendCustomCommandToOutput(lg, lfbt, output, depends,
implicit_depends, commandLines);
@@ -1372,8 +1396,8 @@ cmTarget* cmMakefile::AddUtilityCommand(const std::string& utilityName,
// Dispatch command creation to allow generator expressions in outputs.
this->AddGeneratorAction(
std::move(cc),
- [=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
- std::unique_ptr<cmCustomCommand> tcc) {
+ [this, target](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
+ std::unique_ptr<cmCustomCommand> tcc) {
BacktraceGuard guard(this->Backtrace, lfbt);
tcc->SetBacktrace(lfbt);
detail::AddUtilityCommand(lg, cmCommandOrigin::Project, target,
@@ -1420,8 +1444,8 @@ static void s_RemoveDefineFlag(std::string const& flag, std::string& dflags)
for (std::string::size_type lpos = dflags.find(flag, 0);
lpos != std::string::npos; lpos = dflags.find(flag, lpos)) {
std::string::size_type rpos = lpos + len;
- if ((lpos <= 0 || isspace(dflags[lpos - 1])) &&
- (rpos >= dflags.size() || isspace(dflags[rpos]))) {
+ if ((lpos <= 0 || cmIsSpace(dflags[lpos - 1])) &&
+ (rpos >= dflags.size() || cmIsSpace(dflags[rpos]))) {
dflags.erase(lpos, len);
} else {
++lpos;
@@ -2498,7 +2522,7 @@ void cmMakefile::ExpandVariablesCMP0019()
bool cmMakefile::IsOn(const std::string& name) const
{
- return cmIsOn(this->GetDefinition(name));
+ return this->GetDefinition(name).IsOn();
}
bool cmMakefile::IsSet(const std::string& name) const
@@ -3882,8 +3906,8 @@ void cmMakefile::DisplayStatus(const std::string& message, float s) const
#endif
}
-std::string cmMakefile::GetModulesFile(const std::string& filename,
- bool& system, bool debug,
+std::string cmMakefile::GetModulesFile(cm::string_view filename, bool& system,
+ bool debug,
std::string& debugBuffer) const
{
std::string result;
@@ -4001,7 +4025,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
// Replace #cmakedefine instances.
if (this->cmDefineRegex.find(line)) {
cmValue def = this->GetDefinition(this->cmDefineRegex.match(2));
- if (!cmIsOff(def)) {
+ if (!def.IsOff()) {
const std::string indentation = this->cmDefineRegex.match(1);
cmSystemTools::ReplaceString(line,
cmStrCat("#", indentation, "cmakedefine"),
@@ -4019,7 +4043,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
cmStrCat("#", indentation, "cmakedefine01"),
cmStrCat("#", indentation, "define"));
output += line;
- if (!cmIsOff(def)) {
+ if (!def.IsOff()) {
output += " 1";
} else {
output += " 0";
@@ -4194,7 +4218,7 @@ cmValue cmMakefile::GetProperty(const std::string& prop, bool chain) const
bool cmMakefile::GetPropertyAsBool(const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
std::vector<std::string> cmMakefile::GetPropertyKeys() const
@@ -4601,7 +4625,7 @@ bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var) const
{
// Check for an explicit CMAKE_POLICY_WARNING_CMP<NNNN> setting.
if (cmValue val = this->GetDefinition(var)) {
- return cmIsOn(val);
+ return val.IsOn();
}
// Enable optional policy warnings with --debug-output, --trace,
// or --trace-expand.
@@ -4633,12 +4657,14 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
}
// Deprecate old policies.
- if (status == cmPolicies::OLD && id <= cmPolicies::CMP0120 &&
+ if (status == cmPolicies::OLD && id <= cmPolicies::CMP0128 &&
!(this->GetCMakeInstance()->GetIsInTryCompile() &&
(
// Policies set by cmCoreTryCompile::TryCompileCode.
id == cmPolicies::CMP0065 || id == cmPolicies::CMP0083 ||
- id == cmPolicies::CMP0091 || id == cmPolicies::CMP0104)) &&
+ id == cmPolicies::CMP0091 || id == cmPolicies::CMP0104 ||
+ id == cmPolicies::CMP0123 || id == cmPolicies::CMP0126 ||
+ id == cmPolicies::CMP0128)) &&
(!this->IsSet("CMAKE_WARN_DEPRECATED") ||
this->IsOn("CMAKE_WARN_DEPRECATED"))) {
this->IssueMessage(MessageType::DEPRECATION_WARNING,
@@ -4771,6 +4797,36 @@ cmMakefile::MacroPushPop::~MacroPushPop()
this->Makefile->PopMacroScope(this->ReportError);
}
+cmMakefile::FindPackageStackRAII::FindPackageStackRAII(cmMakefile* mf,
+ std::string const& name)
+ : Makefile(mf)
+{
+ this->Makefile->FindPackageStack =
+ this->Makefile->FindPackageStack.Push(cmFindPackageCall{
+ name,
+ this->Makefile->FindPackageStackNextIndex,
+ });
+ this->Makefile->FindPackageStackNextIndex++;
+}
+
+cmMakefile::FindPackageStackRAII::~FindPackageStackRAII()
+{
+ this->Makefile->FindPackageStackNextIndex =
+ this->Makefile->FindPackageStack.Top().Index + 1;
+ this->Makefile->FindPackageStack = this->Makefile->FindPackageStack.Pop();
+
+ if (!this->Makefile->FindPackageStack.Empty()) {
+ auto top = this->Makefile->FindPackageStack.Top();
+ this->Makefile->FindPackageStack = this->Makefile->FindPackageStack.Pop();
+
+ top.Index = this->Makefile->FindPackageStackNextIndex;
+ this->Makefile->FindPackageStackNextIndex++;
+
+ this->Makefile->FindPackageStack =
+ this->Makefile->FindPackageStack.Push(top);
+ }
+}
+
cmMakefile::DebugFindPkgRAII::DebugFindPkgRAII(cmMakefile* mf,
std::string const& pkg)
: Makefile(mf)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 24daa72..ea0b4c6 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -25,6 +25,7 @@
#include "cmAlgorithms.h"
#include "cmCustomCommand.h"
+#include "cmFindPackageStack.h"
#include "cmFunctionBlocker.h"
#include "cmListFileCache.h"
#include "cmMessageType.h" // IWYU pragma: keep
@@ -660,6 +661,11 @@ public:
cmListFileBacktrace GetBacktrace() const;
/**
+ * Get the current stack of find_package calls.
+ */
+ cmFindPackageStack GetFindPackageStack() const;
+
+ /**
* Get the vector of files created by this makefile
*/
const std::vector<std::string>& GetOutputFiles() const
@@ -797,7 +803,7 @@ public:
/**
* Return a location of a file in cmake or custom modules directory
*/
- std::string GetModulesFile(const std::string& name) const
+ std::string GetModulesFile(cm::string_view name) const
{
bool system;
std::string debugBuffer;
@@ -807,13 +813,13 @@ public:
/**
* Return a location of a file in cmake or custom modules directory
*/
- std::string GetModulesFile(const std::string& name, bool& system) const
+ std::string GetModulesFile(cm::string_view name, bool& system) const
{
std::string debugBuffer;
return this->GetModulesFile(name, system, false, debugBuffer);
}
- std::string GetModulesFile(const std::string& name, bool& system, bool debug,
+ std::string GetModulesFile(cm::string_view name, bool& system, bool debug,
std::string& debugBuffer) const;
//! Set/Get a property of this directory
@@ -1020,6 +1026,15 @@ public:
// searches
std::deque<std::vector<std::string>> FindPackageRootPathStack;
+ class FindPackageStackRAII
+ {
+ cmMakefile* Makefile;
+
+ public:
+ FindPackageStackRAII(cmMakefile* mf, std::string const& pkg);
+ ~FindPackageStackRAII();
+ };
+
class DebugFindPkgRAII
{
cmMakefile* Makefile;
@@ -1210,6 +1225,9 @@ private:
std::vector<BT<GeneratorAction>> GeneratorActions;
bool GeneratorActionsInvoked = false;
+ cmFindPackageStack FindPackageStack;
+ unsigned int FindPackageStackNextIndex = 0;
+
bool DebugFindPkg = false;
bool CheckSystemVars;
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 4a2b9e8..96a0d5c 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -344,6 +344,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
return;
}
+ auto linker = this->GeneratorTarget->GetLinkerTool(this->GetConfigName());
+
// Build list of dependencies.
std::vector<std::string> depends;
this->AppendLinkDepends(depends, linkLanguage);
@@ -533,6 +535,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
vars.CMTargetType =
cmState::GetTargetTypeName(this->GeneratorTarget->GetType()).c_str();
vars.Language = linkLanguage.c_str();
+ vars.Linker = linker.c_str();
vars.AIXExports = aixExports.c_str();
vars.Objects = buildObjs.c_str();
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index fc3caa1..481c52d 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -218,6 +218,9 @@ void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
extraFlags, this->GeneratorTarget, linkLineComputer.get(),
this->GetConfigName());
+ this->UseLWYU = this->LocalGenerator->AppendLWYUFlags(
+ extraFlags, this->GeneratorTarget, linkLanguage);
+
this->WriteLibraryRules(linkRuleVar, extraFlags, relink);
}
@@ -441,6 +444,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
return;
}
+ auto linker = this->GeneratorTarget->GetLinkerTool(this->GetConfigName());
+
// Build list of dependencies.
std::vector<std::string> depends;
this->AppendLinkDepends(depends, linkLanguage);
@@ -766,6 +771,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
vars.CMTargetType =
cmState::GetTargetTypeName(this->GeneratorTarget->GetType()).c_str();
vars.Language = linkLanguage.c_str();
+ vars.Linker = linker.c_str();
vars.AIXExports = aixExports.c_str();
vars.Objects = buildObjs.c_str();
std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
@@ -972,6 +978,9 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
auto genStubsRule =
this->Makefile->GetDefinition("CMAKE_CREATE_TEXT_STUBS");
cmList genStubs_commands{ genStubsRule };
+ this->LocalGenerator->CreateCDCommand(
+ genStubs_commands, this->Makefile->GetCurrentBinaryDirectory(),
+ this->LocalGenerator->GetBinaryDirectory());
std::string TBDFullPath =
cmStrCat(outpathImp, this->TargetNames.ImportOutput);
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 90afb1b..d5c50bc 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -65,7 +65,7 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
this->NoRuleMessages = false;
if (cmValue ruleStatus =
cm->GetState()->GetGlobalProperty("RULE_MESSAGES")) {
- this->NoRuleMessages = cmIsOff(*ruleStatus);
+ this->NoRuleMessages = ruleStatus.IsOff();
}
switch (this->GeneratorTarget->GetPolicyStatusCMP0113()) {
case cmPolicies::WARN:
@@ -139,7 +139,7 @@ void cmMakefileTargetGenerator::GetTargetLinkFlags(
this->LocalGenerator->AppendFlags(
flags, this->GeneratorTarget->GetSafeProperty("LINK_FLAGS"));
- std::string linkFlagsConfig =
+ std::string const linkFlagsConfig =
cmStrCat("LINK_FLAGS_", cmSystemTools::UpperCase(this->GetConfigName()));
this->LocalGenerator->AppendFlags(
flags, this->GeneratorTarget->GetSafeProperty(linkFlagsConfig));
@@ -153,6 +153,8 @@ void cmMakefileTargetGenerator::GetTargetLinkFlags(
this->LocalGenerator->AppendCompileOptions(flags, opts);
this->LocalGenerator->SetLinkScriptShell(false);
+ this->LocalGenerator->AppendLinkerTypeFlags(
+ flags, this->GeneratorTarget, this->GetConfigName(), linkLanguage);
this->LocalGenerator->AppendPositionIndependentLinkerFlags(
flags, this->GeneratorTarget, this->GetConfigName(), linkLanguage);
this->LocalGenerator->AppendDependencyInfoLinkerFlags(
@@ -234,7 +236,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
}
// Look for ISPC extra object files generated by this target
- auto ispcAdditionalObjs =
+ auto const ispcAdditionalObjs =
this->GeneratorTarget->GetGeneratedISPCObjects(this->GetConfigName());
for (std::string const& ispcObj : ispcAdditionalObjs) {
this->CleanFiles.insert(
@@ -242,7 +244,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
}
// add custom commands to the clean rules?
- bool clean = cmIsOff(this->Makefile->GetProperty("CLEAN_NO_CUSTOM"));
+ bool const clean = this->Makefile->GetProperty("CLEAN_NO_CUSTOM").IsOff();
// First generate the object rule files. Save a list of all object
// files for this target.
@@ -611,8 +613,9 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
// Use compiler to generate dependencies, if supported.
bool const compilerGenerateDeps =
this->GlobalGenerator->SupportsCompilerDependencies() &&
- cmIsOn(this->Makefile->GetDefinition(
- cmStrCat("CMAKE_", lang, "_DEPENDS_USE_COMPILER")));
+ this->Makefile
+ ->GetDefinition(cmStrCat("CMAKE_", lang, "_DEPENDS_USE_COMPILER"))
+ .IsOn();
auto const scanner = compilerGenerateDeps ? cmDependencyScannerKind::Compiler
: cmDependencyScannerKind::CMake;
@@ -669,15 +672,12 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
std::string const configUpper = cmSystemTools::UpperCase(config);
// Add precompile headers dependencies
- std::vector<std::string> architectures =
- this->GeneratorTarget->GetAppleArchs(config, lang);
- if (architectures.empty()) {
- architectures.emplace_back();
- }
+ std::vector<std::string> pchArchs =
+ this->GeneratorTarget->GetPchArchs(config, lang);
std::string filterArch;
std::unordered_map<std::string, std::string> pchSources;
- for (const std::string& arch : architectures) {
+ for (const std::string& arch : pchArchs) {
const std::string pchSource =
this->GeneratorTarget->GetPchSource(config, lang, arch);
if (pchSource == source.GetFullPath()) {
@@ -689,7 +689,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
}
if (!pchSources.empty() && !source.GetProperty("SKIP_PRECOMPILE_HEADERS")) {
- for (const std::string& arch : architectures) {
+ for (const std::string& arch : pchArchs) {
std::string const& pchHeader =
this->GeneratorTarget->GetPchHeader(config, lang, arch);
depends.push_back(pchHeader);
@@ -1797,7 +1797,6 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
*this->BuildFileStream << "# Object files for target "
<< this->GeneratorTarget->GetName() << "\n"
<< variableName << " =";
- std::string object;
const auto& lineContinue = this->GlobalGenerator->LineContinueDirective;
cmValue pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION");
@@ -1825,7 +1824,6 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
<< variableNameExternal << " =";
/* clang-format on */
for (std::string const& obj : this->ExternalObjects) {
- object = this->LocalGenerator->MaybeRelativeToCurBinDir(obj);
*this->BuildFileStream << " " << lineContinue;
*this->BuildFileStream
<< cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(
@@ -1905,7 +1903,7 @@ void cmMakefileTargetGenerator::WriteObjectsStrings(
for (std::string const& obj : this->ExternalObjects) {
helper.Feed(obj);
}
- auto ispcAdditionalObjs =
+ auto const ispcAdditionalObjs =
this->GeneratorTarget->GetGeneratedISPCObjects(this->GetConfigName());
for (std::string const& obj : ispcAdditionalObjs) {
helper.Feed(obj);
@@ -1920,13 +1918,12 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
std::string dir =
this->LocalGenerator->GetRelativeTargetDirectory(this->GeneratorTarget);
std::string buildTargetRuleName =
- cmStrCat(dir, relink ? "/preinstall" : "/build");
+ cmStrCat(std::move(dir), relink ? "/preinstall" : "/build");
buildTargetRuleName =
this->LocalGenerator->MaybeRelativeToTopBinDir(buildTargetRuleName);
// Build the list of target outputs to drive.
- std::vector<std::string> depends;
- depends.push_back(main_output);
+ std::vector<std::string> depends{ main_output };
const char* comment = nullptr;
if (relink) {
@@ -1969,7 +1966,7 @@ void cmMakefileTargetGenerator::AppendTargetDepends(
}
// Loop over all library dependencies.
- if (cmComputeLinkInformation* cli =
+ if (cmComputeLinkInformation const* cli =
this->GeneratorTarget->GetLinkInformation(cfg)) {
cm::append(depends, cli->GetDepends());
}
@@ -2083,7 +2080,7 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
"CMAKE_" + l + "_USE_RESPONSE_FILE_FOR_OBJECTS";
if (cmValue val = this->Makefile->GetDefinition(responseVar)) {
if (!val->empty()) {
- return cmIsOn(val);
+ return val.IsOn();
}
}
@@ -2122,7 +2119,7 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForLibraries(
"CMAKE_" + l + "_USE_RESPONSE_FILE_FOR_LIBRARIES";
if (cmValue val = this->Makefile->GetDefinition(responseVar)) {
if (!val->empty()) {
- return cmIsOn(val);
+ return val.IsOn();
}
}
@@ -2194,16 +2191,17 @@ void cmMakefileTargetGenerator::CreateLinkLibs(
std::string responseFlag = this->GetResponseFlag(responseMode);
// Create this response file.
- std::string responseFileName =
+ std::string const responseFileName =
(responseMode == Link) ? "linkLibs.rsp" : "deviceLinkLibs.rsp";
- std::string responseLang = (responseMode == Link) ? linkLanguage : "CUDA";
+ std::string const responseLang =
+ (responseMode == Link) ? linkLanguage : "CUDA";
std::string link_rsp = this->CreateResponseFile(
responseFileName, linkLibs, makefile_depends, responseLang);
// Reference the response file.
- linkLibs = cmStrCat(responseFlag,
+ linkLibs = cmStrCat(std::move(responseFlag),
this->LocalGenerator->ConvertToOutputFormat(
- link_rsp, cmOutputConverter::SHELL));
+ std::move(link_rsp), cmOutputConverter::SHELL));
}
}
@@ -2227,7 +2225,7 @@ void cmMakefileTargetGenerator::CreateObjectLists(
responseFileLimit);
// Lookup the response file reference flag.
- std::string responseFlag = this->GetResponseFlag(responseMode);
+ std::string const responseFlag = this->GetResponseFlag(responseMode);
// Write a response file for each string.
const char* sep = "";
@@ -2267,15 +2265,15 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
const std::string& lang,
const std::string& /*config*/)
{
- std::string responseVar =
+ std::string const responseVar =
cmStrCat("CMAKE_", lang, "_USE_RESPONSE_FILE_FOR_INCLUDES");
- bool useResponseFile = this->Makefile->IsOn(responseVar);
+ bool const useResponseFile = this->Makefile->IsOn(responseVar);
std::vector<std::string> includes;
this->LocalGenerator->GetIncludeDirectories(includes, this->GeneratorTarget,
lang, this->GetConfigName());
- std::string includeFlags = this->LocalGenerator->GetIncludeFlags(
+ std::string const includeFlags = this->LocalGenerator->GetIncludeFlags(
includes, this->GeneratorTarget, lang, this->GetConfigName(),
useResponseFile);
if (includeFlags.empty()) {
@@ -2290,8 +2288,8 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
if (responseFlag.empty()) {
responseFlag = "@";
}
- std::string name = cmStrCat("includes_", lang, ".rsp");
- std::string arg = std::move(responseFlag) +
+ std::string const name = cmStrCat("includes_", lang, ".rsp");
+ std::string const arg = std::move(responseFlag) +
this->CreateResponseFile(name, includeFlags, this->FlagFileDepends[lang],
lang);
this->LocalGenerator->AppendFlags(flags, arg);
@@ -2320,7 +2318,7 @@ void cmMakefileTargetGenerator::GenDefFile(
cmd += this->LocalGenerator->ConvertToOutputFormat(
this->LocalGenerator->MaybeRelativeToCurBinDir(objlist_file),
cmOutputConverter::SHELL);
- cmValue nm_executable = this->Makefile->GetDefinition("CMAKE_NM");
+ cmValue const nm_executable = this->Makefile->GetDefinition("CMAKE_NM");
if (cmNonempty(nm_executable)) {
cmd += " --nm=";
cmd += this->LocalCommonGenerator->ConvertToOutputFormat(
@@ -2360,7 +2358,7 @@ std::string cmMakefileTargetGenerator::GetResponseFlag(
responseFlagVar = "CMAKE_CUDA_RESPONSE_FILE_DEVICE_LINK_FLAG";
}
- if (cmValue p = this->Makefile->GetDefinition(responseFlagVar)) {
+ if (cmValue const p = this->Makefile->GetDefinition(responseFlagVar)) {
responseFlag = *p;
}
return responseFlag;
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 48c30b6..d365ef6 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -294,6 +294,9 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkRule(
.c_str();
vars.Language = "CUDA";
+ std::string linker =
+ this->GetGeneratorTarget()->GetLinkerTool("CUDA", config);
+ vars.Linker = linker.c_str();
// build response file name
std::string responseFlag = this->GetMakefile()->GetSafeDefinition(
@@ -400,6 +403,9 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRules(
vars.Fatbinary = "$FATBIN";
vars.RegisterFile = "$REGISTER";
vars.LinkFlags = "$LINK_FLAGS";
+ std::string linker =
+ this->GetGeneratorTarget()->GetLinkerTool("CUDA", config);
+ vars.Linker = linker.c_str();
std::string flags = this->GetFlags("CUDA", config);
vars.Flags = flags.c_str();
@@ -441,11 +447,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
vars.CMTargetName = this->GetGeneratorTarget()->GetName().c_str();
vars.CMTargetType = cmState::GetTargetTypeName(targetType).c_str();
+ std::string linker = this->GetGeneratorTarget()->GetLinkerTool(config);
+ vars.Linker = linker.c_str();
std::string lang = this->TargetLinkLanguage(config);
vars.Language = lang.c_str();
vars.AIXExports = "$AIX_EXPORTS";
- if (this->TargetLinkLanguage(config) == "Swift") {
+ if (!this->GetLocalGenerator()->IsSplitSwiftBuild() &&
+ this->TargetLinkLanguage(config) == "Swift") {
vars.SwiftLibraryName = "$SWIFT_LIBRARY_NAME";
vars.SwiftModule = "$SWIFT_MODULE";
vars.SwiftModuleName = "$SWIFT_MODULE_NAME";
@@ -500,7 +509,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES";
}
- if (this->TargetLinkLanguage(config) == "Swift") {
+ if (!this->GetLocalGenerator()->IsSplitSwiftBuild() &&
+ this->TargetLinkLanguage(config) == "Swift") {
vars.SwiftSources = responseFlag.c_str();
} else {
vars.Objects = responseFlag.c_str();
@@ -1201,7 +1211,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
globalGen->GetByproductsForCleanTarget(config).push_back(targetOutputReal);
}
- if (this->TargetLinkLanguage(config) == "Swift") {
+ // If we can't split the Swift build model (CMP0157 is OLD or unset), fall
+ // back on the old one-step "build/link" logic.
+ if (!this->GetLocalGenerator()->IsSplitSwiftBuild() &&
+ this->TargetLinkLanguage(config) == "Swift") {
vars["SWIFT_LIBRARY_NAME"] = [this, config]() -> std::string {
cmGeneratorTarget::Names targetNames =
this->GetGeneratorTarget()->GetLibraryNames(config);
@@ -1214,12 +1227,12 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
cmOutputConverter::SHELL);
vars["SWIFT_SOURCES"] = [this, config]() -> std::string {
- std::vector<cmSourceFile const*> sources;
+ std::vector<cmSourceFile const*> sourceFiles;
std::stringstream oss;
- this->GetGeneratorTarget()->GetObjectSources(sources, config);
+ this->GetGeneratorTarget()->GetObjectSources(sourceFiles, config);
cmLocalGenerator const* LocalGen = this->GetLocalGenerator();
- for (const auto& source : sources) {
+ for (const auto& source : sourceFiles) {
const std::string sourcePath = source->GetLanguage() == "Swift"
? this->GetCompiledSourceNinjaPath(source)
: this->GetObjectFilePath(source, config);
@@ -1237,10 +1250,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
vars["FLAGS"] = this->GetFlags("Swift", config);
vars["INCLUDES"] = this->GetIncludes("Swift", config);
this->GenerateSwiftOutputFileMap(config, vars["FLAGS"]);
- }
- // Compute specific libraries to link with.
- if (this->TargetLinkLanguage(config) == "Swift") {
+ // Compute specific libraries to link with.
std::vector<cmSourceFile const*> sources;
gt->GetObjectSources(sources, config);
for (const auto& source : sources) {
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 22cd48b..c61f445 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -32,6 +32,7 @@
#include "cmGlobalCommonGenerator.h"
#include "cmGlobalNinjaGenerator.h"
#include "cmList.h"
+#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmLocalNinjaGenerator.h"
#include "cmMakefile.h"
@@ -48,6 +49,7 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
+#include "cmTargetDepend.h"
#include "cmValue.h"
#include "cmake.h"
@@ -146,7 +148,7 @@ std::string cmNinjaTargetGenerator::LanguageScanRule(
bool cmNinjaTargetGenerator::NeedExplicitPreprocessing(
std::string const& lang) const
{
- return lang == "Fortran";
+ return lang == "Fortran" || lang == "Swift";
}
bool cmNinjaTargetGenerator::CompileWithDefines(std::string const& lang) const
@@ -187,14 +189,11 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject(
const std::string& config, const std::string& objectFileName)
{
std::unordered_map<std::string, std::string> pchSources;
- std::vector<std::string> architectures =
- this->GeneratorTarget->GetAppleArchs(config, language);
- if (architectures.empty()) {
- architectures.emplace_back();
- }
+ std::vector<std::string> pchArchs =
+ this->GeneratorTarget->GetPchArchs(config, language);
std::string filterArch;
- for (const std::string& arch : architectures) {
+ for (const std::string& arch : pchArchs) {
const std::string pchSource =
this->GeneratorTarget->GetPchSource(config, language, arch);
if (pchSource == source->GetFullPath()) {
@@ -409,28 +408,29 @@ std::string cmNinjaTargetGenerator::GetCompiledSourceNinjaPath(
return this->ConvertToNinjaAbsPath(source->GetFullPath());
}
-std::string cmNinjaTargetGenerator::GetObjectFilePath(
- cmSourceFile const* source, const std::string& config) const
+std::string cmNinjaTargetGenerator::GetObjectFileDir(
+ const std::string& config) const
{
std::string path = this->LocalGenerator->GetHomeRelativeOutputPath();
if (!path.empty()) {
path += '/';
}
- std::string const& objectName = this->GeneratorTarget->GetObjectName(source);
- path += cmStrCat(
- this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget),
- this->GetGlobalGenerator()->ConfigDirectory(config), '/', objectName);
+ path +=
+ cmStrCat(this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget),
+ this->GetGlobalGenerator()->ConfigDirectory(config));
return path;
}
-std::string cmNinjaTargetGenerator::GetBmiFilePath(
+std::string cmNinjaTargetGenerator::GetObjectFilePath(
cmSourceFile const* source, const std::string& config) const
{
- std::string path = this->LocalGenerator->GetHomeRelativeOutputPath();
- if (!path.empty()) {
- path += '/';
- }
+ std::string const& objectName = this->GeneratorTarget->GetObjectName(source);
+ return cmStrCat(this->GetObjectFileDir(config), '/', objectName);
+}
+std::string cmNinjaTargetGenerator::GetBmiFilePath(
+ cmSourceFile const* source, const std::string& config) const
+{
auto& importedConfigInfo = this->Configs.at(config).ImportedCxxModules;
if (!importedConfigInfo.Initialized()) {
std::string configUpper = cmSystemTools::UpperCase(config);
@@ -442,10 +442,7 @@ std::string cmNinjaTargetGenerator::GetBmiFilePath(
std::string bmiName =
importedConfigInfo.BmiNameForSource(source->GetFullPath());
- path += cmStrCat(
- this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget),
- this->GetGlobalGenerator()->ConfigDirectory(config), '/', bmiName);
- return path;
+ return cmStrCat(this->GetObjectFileDir(config), '/', bmiName);
}
std::string cmNinjaTargetGenerator::GetClangTidyReplacementsFilePath(
@@ -855,6 +852,14 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
flags = cmStrCat(responseFlag, rule.RspFile);
vars.Defines = "";
vars.Includes = "";
+
+ // Swift consumes all source files in a module at once, which reaches
+ // command line length limits pretty quickly. Inject source files into the
+ // response file in this case as well.
+ if (lang == "Swift") {
+ rule.RspContent = cmStrCat(rule.RspContent, ' ', vars.Source);
+ vars.Source = "";
+ }
}
// Tell ninja dependency format so all deps can be loaded into a database
@@ -1030,6 +1035,15 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
}
}
+ if (!this->GetGlobalGenerator()->SupportsCWDDepend()) {
+ // Ensure that the object directory exists. If there are no objects in the
+ // target (e.g., an empty `OBJECT` library), the directory is still listed
+ // as an order-only depends in the build files. Alternate `ninja`
+ // implementations may not allow this (such as `samu`). See #25526.
+ auto const objectDir = this->GetObjectFileDir(config);
+ this->EnsureDirectoryExists(objectDir);
+ }
+
{
cmNinjaBuild build("phony");
build.Comment =
@@ -1104,11 +1118,15 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
// that "output ... of phony edge with no inputs doesn't exist" and
// consider the phony output "dirty".
if (orderOnlyDeps.empty()) {
- // Any path that always exists will work here. It would be nice to
- // use just "." but that is not supported by Ninja < 1.7.
- std::string tgtDir = cmStrCat(
- this->LocalGenerator->GetCurrentBinaryDirectory(), '/',
- this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget));
+ std::string tgtDir;
+ if (this->GetGlobalGenerator()->SupportsCWDDepend()) {
+ tgtDir = ".";
+ } else {
+ // Any path that always exists will work here.
+ tgtDir = cmStrCat(
+ this->LocalGenerator->GetCurrentBinaryDirectory(), '/',
+ this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget));
+ }
orderOnlyDeps.push_back(this->ConvertToNinjaPath(tgtDir));
}
@@ -1144,9 +1162,19 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
std::vector<cmSourceFile const*> objectSources;
this->GeneratorTarget->GetObjectSources(objectSources, config);
+ std::vector<cmSourceFile const*> swiftSources;
+
for (cmSourceFile const* sf : objectSources) {
- this->WriteObjectBuildStatement(sf, config, fileConfig, firstForConfig);
+ if (this->GetLocalGenerator()->IsSplitSwiftBuild() &&
+ sf->GetLanguage() == "Swift") {
+ swiftSources.push_back(sf);
+ } else {
+ this->WriteObjectBuildStatement(sf, config, fileConfig,
+ firstForConfig);
+ }
}
+ WriteSwiftObjectBuildStatement(swiftSources, config, fileConfig,
+ firstForConfig);
}
{
@@ -1246,9 +1274,11 @@ void cmNinjaTargetGenerator::GenerateSwiftOutputFileMap(
if (cmValue name = target->GetProperty("Swift_DEPENDENCIES_FILE")) {
return *name;
}
- return this->ConvertToNinjaPath(cmStrCat(target->GetSupportDirectory(),
- '/', config, '/',
- target->GetName(), ".swiftdeps"));
+ return this->GetLocalGenerator()->ConvertToOutputFormat(
+ this->ConvertToNinjaPath(cmStrCat(target->GetSupportDirectory(), '/',
+ config, '/', target->GetName(),
+ ".swiftdeps")),
+ cmOutputConverter::SHELL);
}();
std::string mapFilePath =
@@ -1266,8 +1296,10 @@ void cmNinjaTargetGenerator::GenerateSwiftOutputFileMap(
// Add flag
this->LocalGenerator->AppendFlags(flags, "-output-file-map");
- this->LocalGenerator->AppendFlagEscape(flags,
- ConvertToNinjaPath(mapFilePath));
+ this->LocalGenerator->AppendFlagEscape(
+ flags,
+ this->GetLocalGenerator()->ConvertToOutputFormat(
+ ConvertToNinjaPath(mapFilePath), cmOutputConverter::SHELL));
}
namespace {
@@ -1445,10 +1477,13 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
}
}
+ this->SetMsvcTargetPdbVariable(vars, config);
+
if (firstForConfig) {
this->ExportObjectCompileCommand(
language, sourceFilePath, objectDir, objectFileName, objectFileDir,
- vars["FLAGS"], vars["DEFINES"], vars["INCLUDES"], config, withScanning);
+ vars["FLAGS"], vars["DEFINES"], vars["INCLUDES"],
+ vars["TARGET_COMPILE_PDB"], vars["TARGET_PDB"], config, withScanning);
}
objBuild.Outputs.push_back(objectFileName);
@@ -1462,14 +1497,11 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
// Add precompile headers dependencies
std::vector<std::string> depList;
- std::vector<std::string> architectures =
- this->GeneratorTarget->GetAppleArchs(config, language);
- if (architectures.empty()) {
- architectures.emplace_back();
- }
+ std::vector<std::string> pchArchs =
+ this->GeneratorTarget->GetPchArchs(config, language);
std::unordered_set<std::string> pchSources;
- for (const std::string& arch : architectures) {
+ for (const std::string& arch : pchArchs) {
const std::string pchSource =
this->GeneratorTarget->GetPchSource(config, language, arch);
@@ -1479,7 +1511,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
}
if (!pchSources.empty() && !source->GetProperty("SKIP_PRECOMPILE_HEADERS")) {
- for (const std::string& arch : architectures) {
+ for (const std::string& arch : pchArchs) {
depList.push_back(
this->GeneratorTarget->GetPchHeader(config, language, arch));
if (pchSources.find(source->GetFullPath()) == pchSources.end()) {
@@ -1639,8 +1671,6 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
}
}
- this->SetMsvcTargetPdbVariable(vars, config);
-
objBuild.RspFile = cmStrCat(objectFileName, ".rsp");
if (language == "ISPC") {
@@ -1791,10 +1821,13 @@ void cmNinjaTargetGenerator::WriteCxxModuleBmiBuildStatement(
vars["CLANG_TIDY_EXPORT_FIXES"] = fixesFile;
}
+ this->SetMsvcTargetPdbVariable(vars, config);
+
if (firstForConfig) {
this->ExportObjectCompileCommand(
language, sourceFilePath, bmiDir, bmiFileName, bmiFileDir, vars["FLAGS"],
- vars["DEFINES"], vars["INCLUDES"], config, WithScanning::Yes);
+ vars["DEFINES"], vars["INCLUDES"], vars["TARGET_COMPILE_PDB"],
+ vars["TARGET_PDB"], config, WithScanning::Yes);
}
bmiBuild.Outputs.push_back(bmiFileName);
@@ -1802,12 +1835,6 @@ void cmNinjaTargetGenerator::WriteCxxModuleBmiBuildStatement(
std::vector<std::string> depList;
- std::vector<std::string> architectures =
- this->GeneratorTarget->GetAppleArchs(config, language);
- if (architectures.empty()) {
- architectures.emplace_back();
- }
-
bmiBuild.OrderOnlyDeps.push_back(this->OrderDependsTargetForTarget(config));
// For some cases we scan to dynamically discover dependencies.
@@ -1865,14 +1892,231 @@ void cmNinjaTargetGenerator::WriteCxxModuleBmiBuildStatement(
this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(),
vars);
- this->SetMsvcTargetPdbVariable(vars, config);
-
bmiBuild.RspFile = cmStrCat(bmiFileName, ".rsp");
this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig),
bmiBuild, commandLineLengthLimit);
}
+void cmNinjaTargetGenerator::WriteSwiftObjectBuildStatement(
+ std::vector<cmSourceFile const*> const& sources, std::string const& config,
+ std::string const& fileConfig, bool firstForConfig)
+{
+ // Swift sources are compiled as a module, not individually like with C/C++.
+ // Flags, header search paths, and definitions are passed to the entire
+ // module build, but we still need to emit compile-commands for each source
+ // file in order to support CMAKE_EXPORT_COMPILE_COMMANDS.
+ // In whole-module mode, with a single thread, the Swift compiler will
+ // only emit a single object file, but if more than one thread is specified,
+ // or building in other modes, the compiler will emit multiple object files.
+ // When building a single-output, we do not provide an output-file-map (OFM),
+ // and instead pass `-o` to tell the compiler where to write the object.
+ // When building multiple outputs, we provide an OFM to tell the compiler
+ // where to put each object.
+ //
+ //
+ // Per-Target (module):
+ // - Flags
+ // - Definitions
+ // - Include paths
+ // - (single-output) output object filename
+ // - Swiftmodule
+ //
+ // Per-File:
+ // - compile-command
+ // - (multi-output) OFM data
+ // - (multi-output) output object filename
+ //
+ // Note: Due to the differences in the build models, we are only able to
+ // build the object build-graph if we know what mode the target is built in.
+ // For that, we need the "NEW" behavior for CMP0157. Otherwise, we have to
+ // fall back on the old "linker" build. Otherwise, this should be
+ // indistinguishable from the old behavior.
+
+ if (sources.empty()) {
+ return;
+ }
+
+ cmSwiftCompileMode compileMode;
+ if (cm::optional<cmSwiftCompileMode> optionalCompileMode =
+ this->LocalGenerator->GetSwiftCompileMode(this->GeneratorTarget,
+ config)) {
+ compileMode = *optionalCompileMode;
+ } else {
+ // CMP0157 is not NEW, bailing early!
+ return;
+ }
+
+ auto getTargetPropertyOrDefault =
+ [](cmGeneratorTarget const& target, std::string const& property,
+ std::string defaultValue) -> std::string {
+ if (cmValue value = target.GetProperty(property)) {
+ return *value;
+ }
+ return defaultValue;
+ };
+
+ std::string const language = "Swift";
+ std::string const objectDir = this->ConvertToNinjaPath(
+ cmStrCat(this->GeneratorTarget->GetSupportDirectory(),
+ this->GetGlobalGenerator()->ConfigDirectory(config)));
+
+ cmGeneratorTarget const& target = *this->GeneratorTarget;
+ cmNinjaBuild objBuild(
+ this->LanguageCompilerRule(language, config, WithScanning::No));
+ cmNinjaVars& vars = objBuild.Variables;
+
+ // The swift toolchain leaves outputs untouched if there are no meaningful
+ // changes to input files (e.g. addition of a comment).
+ vars.emplace("restat", "1");
+
+ std::string const moduleName =
+ getTargetPropertyOrDefault(target, "Swift_MODULE_NAME", target.GetName());
+ std::string const moduleDirectory = getTargetPropertyOrDefault(
+ target, "Swift_MODULE_DIRECTORY",
+ target.LocalGenerator->GetCurrentBinaryDirectory());
+ std::string const moduleFilename = getTargetPropertyOrDefault(
+ target, "Swift_MODULE", cmStrCat(moduleName, ".swiftmodule"));
+ std::string const moduleFilepath =
+ this->ConvertToNinjaPath(cmStrCat(moduleDirectory, '/', moduleFilename));
+
+ vars.emplace("description",
+ cmStrCat("Building Swift Module '", moduleName, "' with ",
+ sources.size(),
+ sources.size() == 1 ? " source" : " sources"));
+
+ bool const isSingleOutput = [this, compileMode]() -> bool {
+ bool isMultiThread = false;
+ if (cmValue numThreadStr =
+ this->GetMakefile()->GetDefinition("CMAKE_Swift_NUM_THREADS")) {
+ unsigned long numThreads;
+ cmStrToULong(*numThreadStr, &numThreads);
+ // numThreads == 1 is multi-threaded according to swiftc
+ isMultiThread = numThreads > 0;
+ }
+ return !isMultiThread && compileMode == cmSwiftCompileMode::Wholemodule;
+ }();
+
+ // Without `-emit-library` or `-emit-executable`, targets with a single
+ // source file parse as a Swift script instead of like normal source. For
+ // non-executable targets, append this to ensure that they are parsed like a
+ // normal source.
+ if (target.GetType() != cmStateEnums::EXECUTABLE) {
+ this->LocalGenerator->AppendFlags(vars["FLAGS"], "-parse-as-library");
+ }
+
+ if (target.GetType() == cmStateEnums::STATIC_LIBRARY) {
+ this->LocalGenerator->AppendFlags(vars["FLAGS"], "-static");
+ }
+
+ // Does this swift target emit a module file for importing into other
+ // targets?
+ auto isImportableTarget = [](cmGeneratorTarget const& tgt) -> bool {
+ // Everything except for executables that don't export anything should emit
+ // some way to import them.
+ if (tgt.GetType() == cmStateEnums::EXECUTABLE) {
+ return tgt.IsExecutableWithExports();
+ }
+ return true;
+ };
+
+ // Swift modules only make sense to emit from things that can be imported.
+ // Executables that don't export symbols can't be imported, so don't try to
+ // emit a swiftmodule for them. It will break.
+ if (isImportableTarget(target)) {
+ std::string const emitModuleFlag = "-emit-module";
+ std::string const modulePathFlag = "-emit-module-path";
+ this->LocalGenerator->AppendFlags(
+ vars["FLAGS"], { emitModuleFlag, modulePathFlag, moduleFilepath });
+ objBuild.Outputs.push_back(moduleFilepath);
+ }
+ this->LocalGenerator->AppendFlags(vars["FLAGS"],
+ cmStrCat("-module-name ", moduleName));
+
+ if (target.GetType() != cmStateEnums::EXECUTABLE) {
+ std::string const libraryLinkNameFlag = "-module-link-name";
+ std::string const libraryLinkName =
+ this->GetGeneratorTarget()->GetLibraryNames(config).Base;
+ this->LocalGenerator->AppendFlags(
+ vars["FLAGS"], cmStrCat(libraryLinkNameFlag, ' ', libraryLinkName));
+ }
+
+ this->LocalGenerator->AppendFlags(vars["FLAGS"],
+ this->GetFlags(language, config));
+ vars["DEFINES"] = this->GetDefines(language, config);
+ vars["INCLUDES"] = this->GetIncludes(language, config);
+
+ // target-level object filename
+ std::string const targetObjectFilename = this->ConvertToNinjaPath(cmStrCat(
+ objectDir, '/', moduleName,
+ this->GetGlobalGenerator()->GetLanguageOutputExtension(language)));
+ objBuild.RspFile = cmStrCat(targetObjectFilename, ".swift.rsp");
+
+ if (isSingleOutput) {
+ this->LocalGenerator->AppendFlags(vars["FLAGS"],
+ cmStrCat("-o ", targetObjectFilename));
+ objBuild.Outputs.push_back(targetObjectFilename);
+ this->Configs[config].Objects.push_back(targetObjectFilename);
+ }
+
+ for (cmSourceFile const* sf : sources) {
+ // Add dependency to object build on each source file
+ std::string const sourceFilePath = this->GetCompiledSourceNinjaPath(sf);
+ objBuild.ExplicitDeps.push_back(sourceFilePath);
+
+ if (!isSingleOutput) {
+ // Object outputs
+ std::string const objectFilepath =
+ this->ConvertToNinjaPath(this->GetObjectFilePath(sf, config));
+ this->EnsureParentDirectoryExists(objectFilepath);
+ objBuild.Outputs.push_back(objectFilepath);
+ this->Configs[config].Objects.push_back(objectFilepath);
+
+ // Add OFM data
+ this->EmitSwiftDependencyInfo(sf, config);
+ }
+ }
+
+ if (!isSingleOutput) {
+ this->GenerateSwiftOutputFileMap(config, vars["FLAGS"]);
+ }
+
+ if (firstForConfig) {
+ this->ExportSwiftObjectCompileCommand(
+ sources, targetObjectFilename, vars["FLAGS"], vars["DEFINES"],
+ vars["INCLUDES"], config, isSingleOutput);
+ }
+
+ for (cmTargetDepend const& dep :
+ this->GetGlobalGenerator()->GetTargetDirectDepends(&target)) {
+ if (!dep->IsLanguageUsed("Swift", config)) {
+ continue;
+ }
+
+ // If the dependency emits a swiftmodule, add a dependency edge on that
+ // swiftmodule to the ninja build graph.
+ if (isImportableTarget(*dep)) {
+ std::string const depModuleName =
+ getTargetPropertyOrDefault(*dep, "Swift_MODULE_NAME", dep->GetName());
+ std::string const depModuleDir = getTargetPropertyOrDefault(
+ *dep, "Swift_MODULE_DIRECTORY",
+ dep->LocalGenerator->GetCurrentBinaryDirectory());
+ std::string const depModuleFilename = getTargetPropertyOrDefault(
+ *dep, "Swift_MODULE", cmStrCat(depModuleName, ".swiftmodule"));
+ std::string const depModuleFilepath = this->ConvertToNinjaPath(
+ cmStrCat(depModuleDir, '/', depModuleFilename));
+ objBuild.ImplicitDeps.push_back(depModuleFilepath);
+ }
+ }
+
+ objBuild.OrderOnlyDeps.push_back(this->OrderDependsTargetForTarget(config));
+
+ // Write object build
+ this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig),
+ objBuild,
+ this->ForceResponseFile() ? -1 : 0);
+}
+
void cmNinjaTargetGenerator::WriteTargetDependInfo(std::string const& lang,
const std::string& config)
{
@@ -2006,6 +2250,7 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
std::string const& objectDir, std::string const& objectFileName,
std::string const& objectFileDir, std::string const& flags,
std::string const& defines, std::string const& includes,
+ std::string const& targetCompilePdb, std::string const& targetPdb,
std::string const& outputConfig, WithScanning withScanning)
{
if (!this->GeneratorTarget->GetPropertyAsBool("EXPORT_COMPILE_COMMANDS")) {
@@ -2054,6 +2299,8 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
compileObjectVars.Flags = fullFlags.c_str();
compileObjectVars.Defines = defines.c_str();
compileObjectVars.Includes = includes.c_str();
+ compileObjectVars.TargetCompilePDB = targetCompilePdb.c_str();
+ compileObjectVars.TargetPDB = targetPdb.c_str();
// Rule for compiling object file.
std::string cudaCompileMode;
@@ -2108,6 +2355,80 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
objectFileName);
}
+void cmNinjaTargetGenerator::ExportSwiftObjectCompileCommand(
+ std::vector<cmSourceFile const*> const& moduleSourceFiles,
+ std::string const& moduleObjectFilename, std::string const& flags,
+ std::string const& defines, std::string const& includes,
+ std::string const& outputConfig, bool singleOutput)
+{
+ if (!this->GeneratorTarget->GetPropertyAsBool("EXPORT_COMPILE_COMMANDS")) {
+ return;
+ }
+
+ auto escapeSourceFileName = [this](std::string srcFilename) -> std::string {
+ if (!cmSystemTools::FileIsFullPath(srcFilename)) {
+ srcFilename =
+ cmSystemTools::CollapseFullPath(srcFilename,
+ this->GetGlobalGenerator()
+ ->GetCMakeInstance()
+ ->GetHomeOutputDirectory());
+ }
+
+ return this->LocalGenerator->ConvertToOutputFormat(
+ srcFilename, cmOutputConverter::SHELL);
+ };
+ auto escapedModuleObjectFilename =
+ this->ConvertToNinjaPath(moduleObjectFilename);
+
+ cmRulePlaceholderExpander::RuleVariables compileObjectVars;
+ compileObjectVars.Language = "Swift";
+ compileObjectVars.Flags = flags.c_str();
+ compileObjectVars.Defines = defines.c_str();
+ compileObjectVars.Includes = includes.c_str();
+
+ // Build up the list of source files in the module
+ std::vector<std::string> filenames;
+ filenames.reserve(moduleSourceFiles.size());
+ for (cmSourceFile const* sf : moduleSourceFiles) {
+ filenames.emplace_back(
+ escapeSourceFileName(this->GetCompiledSourceNinjaPath(sf)));
+ }
+ // Note that `escapedSourceFilenames` must remain alive until the
+ // compileObjectVars is consumed or Source will be a dangling pointer.
+ std::string const escapedSourceFilenames = cmJoin(filenames, " ");
+ compileObjectVars.Source = escapedSourceFilenames.c_str();
+
+ std::string const& compileCommand =
+ this->Makefile->GetRequiredDefinition("CMAKE_Swift_COMPILE_OBJECT");
+ cmList compileCmds(compileCommand);
+
+ auto rulePlaceholderExpander =
+ this->GetLocalGenerator()->CreateRulePlaceholderExpander();
+
+ for (cmSourceFile const* sf : moduleSourceFiles) {
+ std::string const sourceFilename = this->GetCompiledSourceNinjaPath(sf);
+ std::string objectFilename = escapedModuleObjectFilename;
+
+ if (!singleOutput) {
+ // If it's not single-output, each source file gets a separate object
+ objectFilename =
+ this->ConvertToNinjaPath(this->GetObjectFilePath(sf, outputConfig));
+ }
+ compileObjectVars.Objects = objectFilename.c_str();
+
+ for (std::string& cmd : compileCmds) {
+ rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(),
+ cmd, compileObjectVars);
+ }
+
+ std::string commandLine = this->GetLocalGenerator()->BuildCommandLine(
+ compileCmds, outputConfig, outputConfig);
+
+ this->GetGlobalGenerator()->AddCXXCompileCommand(
+ commandLine, sourceFilename, objectFilename);
+ }
+}
+
void cmNinjaTargetGenerator::AdditionalCleanFiles(const std::string& config)
{
if (cmValue prop_value =
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index a9bff1d..2bfed80 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -128,6 +128,7 @@ protected:
/// @return the source file path for the given @a source.
std::string GetCompiledSourceNinjaPath(cmSourceFile const* source) const;
+ std::string GetObjectFileDir(const std::string& config) const;
/// @return the object file path for the given @a source.
std::string GetObjectFilePath(cmSourceFile const* source,
const std::string& config) const;
@@ -171,6 +172,9 @@ protected:
const std::string& config,
const std::string& fileConfig,
bool firstForConfig);
+ void WriteSwiftObjectBuildStatement(
+ std::vector<cmSourceFile const*> const& sources, const std::string& config,
+ const std::string& fileConfig, bool firstForConfig);
void WriteObjectBuildStatement(cmSourceFile const* source,
const std::string& config,
const std::string& fileConfig,
@@ -189,8 +193,15 @@ protected:
std::string const& objectDir, std::string const& objectFileName,
std::string const& objectFileDir, std::string const& flags,
std::string const& defines, std::string const& includes,
+ std::string const& targetCompilePdb, std::string const& targetPdb,
std::string const& outputConfig, WithScanning withScanning);
+ void ExportSwiftObjectCompileCommand(
+ std::vector<cmSourceFile const*> const& moduleSourceFiles,
+ std::string const& moduleObjectFilename, std::string const& flags,
+ std::string const& defines, std::string const& includes,
+ std::string const& outputConfig, bool singleOutput);
+
void AdditionalCleanFiles(const std::string& config);
cmNinjaDeps GetObjects(const std::string& config) const;
diff --git a/Source/cmPlaceholderExpander.cxx b/Source/cmPlaceholderExpander.cxx
index 118017e..11c7485 100644
--- a/Source/cmPlaceholderExpander.cxx
+++ b/Source/cmPlaceholderExpander.cxx
@@ -48,6 +48,10 @@ std::string& cmPlaceholderExpander::ExpandVariables(std::string& s)
}
// add the rest of the input
expandedInput += s.substr(pos, s.size() - pos);
+ // remove trailing whitespace
+ if (!expandedInput.empty() && expandedInput.back() == ' ') {
+ expandedInput.pop_back();
+ }
s = expandedInput;
return s;
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 8838de4..eb9f031 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -294,8 +294,8 @@ class cmMakefile;
"FindFLEX runs flex in CMAKE_CURRENT_BINARY_DIR when executing.", 3, \
17, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0099, \
- "Link properties are transitive over private dependency on static " \
- "libraries.", \
+ "Link properties are transitive over private dependencies of " \
+ "static libraries.", \
3, 17, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0100, "Let AUTOMOC and AUTOUIC process .hh files.", 3, \
17, 0, cmPolicies::WARN) \
@@ -349,10 +349,10 @@ class cmMakefile;
SELECT(POLICY, CMP0117, \
"MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default.", 3, \
20, 0, cmPolicies::WARN) \
- SELECT( \
- POLICY, CMP0118, \
- "The GENERATED source file property is now visible in all directories.", \
- 3, 20, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0118, \
+ "GENERATED sources may be used across directories without manual " \
+ "marking.", \
+ 3, 20, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0119, \
"LANGUAGE source file property explicitly compiles as specified " \
"language.", \
@@ -406,8 +406,8 @@ class cmMakefile;
"is not usable.", \
3, 24, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0135, \
- "ExternalProject ignores timestamps in archives by default for the " \
- "URL download method", \
+ "ExternalProject and FetchContent ignore timestamps in archives by " \
+ "default for the URL download method", \
3, 24, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0136, \
"Watcom runtime library flags are selected by an abstraction.", 3, \
@@ -473,7 +473,46 @@ class cmMakefile;
SELECT(POLICY, CMP0155, \
"C++ sources in targets with at least C++20 are scanned for " \
"imports when supported.", \
- 3, 28, 0, cmPolicies::WARN)
+ 3, 28, 0, cmPolicies::WARN) \
+ SELECT( \
+ POLICY, CMP0156, \
+ "De-duplicate libraries on link lines based on linker capabilities.", 3, \
+ 29, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0157, \
+ "Swift compilation mode selected by an abstraction.", 3, 29, 0, \
+ cmPolicies::WARN) \
+ SELECT(POLICY, CMP0158, \
+ "add_test() honors CMAKE_CROSSCOMPILING_EMULATOR only when " \
+ "cross-compiling.", \
+ 3, 29, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0159, \
+ "file(STRINGS) with REGEX updates CMAKE_MATCH_<n>.", 3, 29, 0, \
+ cmPolicies::WARN) \
+ SELECT( \
+ POLICY, CMP0160, \
+ "More read-only target properties now error when trying to set them.", 3, \
+ 29, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0161, "CPACK_PRODUCTBUILD_DOMAINS defaults to true.", 3, \
+ 29, 0, cmPolicies::WARN) \
+ SELECT( \
+ POLICY, CMP0162, \
+ "Visual Studio generators add UseDebugLibraries indicators by default.", \
+ 3, 30, 0, cmPolicies::WARN) \
+ SELECT( \
+ POLICY, CMP0163, \
+ "The GENERATED source file property is now visible in all directories.", \
+ 3, 30, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0164, \
+ "add_library() rejects SHARED libraries when not supported by the " \
+ "platform.", \
+ 3, 30, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0165, \
+ "enable_language() must not be called before project().", 3, 30, 0, \
+ cmPolicies::WARN) \
+ SELECT(POLICY, CMP0166, \
+ "TARGET_PROPERTY evaluates link properties transitively over " \
+ "private dependencies of static libraries.", \
+ 3, 30, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
#define CM_FOR_EACH_POLICY_ID(POLICY) \
@@ -513,7 +552,11 @@ class cmMakefile;
F(CMP0131) \
F(CMP0142) \
F(CMP0154) \
- F(CMP0155)
+ F(CMP0155) \
+ F(CMP0156) \
+ F(CMP0157) \
+ F(CMP0160) \
+ F(CMP0162)
#define CM_FOR_EACH_CUSTOM_COMMAND_POLICY(F) \
F(CMP0116) \
diff --git a/Source/cmProcessTools.cxx b/Source/cmProcessTools.cxx
index 9e7854b..1dd1dce 100644
--- a/Source/cmProcessTools.cxx
+++ b/Source/cmProcessTools.cxx
@@ -2,48 +2,68 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmProcessTools.h"
+#include <algorithm>
+#include <iterator>
#include <ostream>
-#include "cmsys/Process.h"
+#include <cm3p/uv.h>
#include "cmProcessOutput.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVStream.h"
-void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out,
- OutputParser* err, Encoding encoding)
+std::vector<cmUVProcessChain::Status> cmProcessTools::RunProcess(
+ cmUVProcessChainBuilder& builder, OutputParser* out, OutputParser* err,
+ Encoding encoding)
{
- cmsysProcess_Execute(cp);
- char* data = nullptr;
- int length = 0;
- int p;
cmProcessOutput processOutput(encoding);
+
+ builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR);
+
+ auto chain = builder.Start();
+
std::string strdata;
- while ((out || err) &&
- (p = cmsysProcess_WaitForData(cp, &data, &length, nullptr))) {
- if (out && p == cmsysProcess_Pipe_STDOUT) {
- processOutput.DecodeText(data, length, strdata, 1);
- if (!out->Process(strdata.c_str(), static_cast<int>(strdata.size()))) {
- out = nullptr;
+ cm::uv_pipe_ptr outputPipe;
+ outputPipe.init(chain.GetLoop(), 0);
+ uv_pipe_open(outputPipe, chain.OutputStream());
+ auto outputHandle = cmUVStreamRead(
+ outputPipe,
+ [&out, &processOutput, &strdata](std::vector<char> data) {
+ if (out) {
+ processOutput.DecodeText(data.data(), data.size(), strdata, 1);
+ if (!out->Process(strdata.c_str(), static_cast<int>(strdata.size()))) {
+ out = nullptr;
+ }
}
- } else if (err && p == cmsysProcess_Pipe_STDERR) {
- processOutput.DecodeText(data, length, strdata, 2);
- if (!err->Process(strdata.c_str(), static_cast<int>(strdata.size()))) {
- err = nullptr;
+ },
+ [&out]() { out = nullptr; });
+ cm::uv_pipe_ptr errorPipe;
+ errorPipe.init(chain.GetLoop(), 0);
+ uv_pipe_open(errorPipe, chain.ErrorStream());
+ auto errorHandle = cmUVStreamRead(
+ errorPipe,
+ [&err, &processOutput, &strdata](std::vector<char> data) {
+ if (err) {
+ processOutput.DecodeText(data.data(), data.size(), strdata, 2);
+ if (!err->Process(strdata.c_str(), static_cast<int>(strdata.size()))) {
+ err = nullptr;
+ }
}
- }
+ },
+ [&err]() { err = nullptr; });
+ while (out || err || !chain.Finished()) {
+ uv_run(&chain.GetLoop(), UV_RUN_ONCE);
}
- if (out) {
- processOutput.DecodeText(std::string(), strdata, 1);
- if (!strdata.empty()) {
- out->Process(strdata.c_str(), static_cast<int>(strdata.size()));
- }
- }
- if (err) {
- processOutput.DecodeText(std::string(), strdata, 2);
- if (!strdata.empty()) {
- err->Process(strdata.c_str(), static_cast<int>(strdata.size()));
- }
- }
- cmsysProcess_WaitForExit(cp, nullptr);
+
+ std::vector<cmUVProcessChain::Status> result;
+ auto status = chain.GetStatus();
+ std::transform(
+ status.begin(), status.end(), std::back_inserter(result),
+ [](const cmUVProcessChain::Status* s) -> cmUVProcessChain::Status {
+ return *s;
+ });
+ return result;
}
cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR)
diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h
index 74ec5e0..2bdabea 100644
--- a/Source/cmProcessTools.h
+++ b/Source/cmProcessTools.h
@@ -7,8 +7,10 @@
#include <cstring>
#include <iosfwd>
#include <string>
+#include <vector>
#include "cmProcessOutput.h"
+#include "cmUVProcessChain.h"
/** \class cmProcessTools
* \brief Helper classes for process output parsing
@@ -81,7 +83,7 @@ public:
};
/** Run a process and send output to given parsers. */
- static void RunProcess(struct cmsysProcess_s* cp, OutputParser* out,
- OutputParser* err = nullptr,
- Encoding encoding = cmProcessOutput::Auto);
+ static std::vector<cmUVProcessChain::Status> RunProcess(
+ cmUVProcessChainBuilder& builder, OutputParser* out,
+ OutputParser* err = nullptr, Encoding encoding = cmProcessOutput::Auto);
};
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 3aef299..53166c1 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -11,6 +11,7 @@
#include "cmsys/RegularExpression.hxx"
#include "cmExecutionStatus.h"
+#include "cmList.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
@@ -371,29 +372,55 @@ static bool IncludeByVariable(cmExecutionStatus& status,
if (!include) {
return true;
}
+ cmList includeFiles{ *include };
+
+ bool failed = false;
+ for (auto filePath : includeFiles) {
+ // Any relative path without a .cmake extension is checked for valid cmake
+ // modules. This logic should be consistent with CMake's include() command.
+ // Otherwise default to checking relative path w.r.t. source directory
+ if (!cmSystemTools::FileIsFullPath(filePath) &&
+ !cmHasLiteralSuffix(filePath, ".cmake")) {
+ std::string mfile = mf.GetModulesFile(cmStrCat(filePath, ".cmake"));
+ if (mfile.empty()) {
+ status.SetError(
+ cmStrCat("could not find requested module:\n ", filePath));
+ failed = true;
+ continue;
+ }
+ filePath = mfile;
+ }
+ std::string includeFile = cmSystemTools::CollapseFullPath(
+ filePath, mf.GetCurrentSourceDirectory());
+ if (!cmSystemTools::FileExists(includeFile)) {
+ status.SetError(
+ cmStrCat("could not find requested file:\n ", filePath));
+ failed = true;
+ continue;
+ }
+ if (cmSystemTools::FileIsDirectory(includeFile)) {
+ status.SetError(
+ cmStrCat("requested file is a directory:\n ", filePath));
+ failed = true;
+ continue;
+ }
- std::string includeFile =
- cmSystemTools::CollapseFullPath(*include, mf.GetCurrentSourceDirectory());
- if (!cmSystemTools::FileExists(includeFile)) {
- status.SetError(cmStrCat("could not find requested file:\n ", *include));
- return false;
- }
- if (cmSystemTools::FileIsDirectory(includeFile)) {
- status.SetError(cmStrCat("requested file is a directory:\n ", *include));
- return false;
- }
+ const bool readit = mf.ReadDependentFile(filePath);
+ if (readit) {
+ // If the included file ran successfully, continue to the next file
+ continue;
+ }
- const bool readit = mf.ReadDependentFile(*include);
- if (readit) {
- return true;
- }
+ if (cmSystemTools::GetFatalErrorOccurred()) {
+ failed = true;
+ continue;
+ }
- if (cmSystemTools::GetFatalErrorOccurred()) {
- return true;
+ status.SetError(cmStrCat("could not load requested file:\n ", filePath));
+ failed = true;
}
-
- status.SetError(cmStrCat("could not load requested file:\n ", *include));
- return false;
+ // At this point all files were processed
+ return !failed;
}
static void TopLevelCMakeVarCondSet(cmMakefile& mf, std::string const& name,
diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx
index adbdba8..0a394b5 100644
--- a/Source/cmQtAutoGen.cxx
+++ b/Source/cmQtAutoGen.cxx
@@ -76,13 +76,6 @@ static void MergeOptions(std::vector<std::string>& baseOpts,
unsigned int const cmQtAutoGen::ParallelMax = 64;
-#ifdef _WIN32
-// Actually 32767 (see
-// https://devblogs.microsoft.com/oldnewthing/20031210-00/?p=41553) but we
-// allow for a small margin
-size_t const cmQtAutoGen::CommandLineLengthMax = 32000;
-#endif
-
cm::string_view cmQtAutoGen::GeneratorName(GenT genType)
{
switch (genType) {
diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h
index d111422..b302403 100644
--- a/Source/cmQtAutoGen.h
+++ b/Source/cmQtAutoGen.h
@@ -6,6 +6,7 @@
#include <memory>
#include <string>
+#include <unordered_map>
#include <vector>
#include <cm/string_view>
@@ -16,6 +17,22 @@
class cmQtAutoGen
{
public:
+ /** String value with per configuration variants. */
+ class ConfigString
+ {
+ public:
+ std::string Default;
+ std::unordered_map<std::string, std::string> Config;
+ };
+
+ /** String values with per configuration variants. */
+ template <typename C>
+ class ConfigStrings
+ {
+ public:
+ C Default;
+ std::unordered_map<std::string, C> Config;
+ };
/** Integer version. */
struct IntegerVersion
{
@@ -64,11 +81,6 @@ public:
/// @brief Maximum number of parallel threads/processes in a generator
static unsigned int const ParallelMax;
-#ifdef _WIN32
- /// @brief Maximum number of characters on command line
- static size_t const CommandLineLengthMax;
-#endif
-
/// @brief Returns the generator name
static cm::string_view GeneratorName(GenT genType);
/// @brief Returns the generator name in upper case
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index 1da8847..591c53e 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -49,7 +49,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
bool globalAutoGenTarget = false;
bool globalAutoRccTarget = false;
{
- cmMakefile* makefile = localGen->GetMakefile();
+ cmMakefile const* makefile = localGen->GetMakefile();
// Detect global autogen target name
if (makefile->IsOn("CMAKE_GLOBAL_AUTOGEN_TARGET")) {
std::string targetName =
@@ -118,7 +118,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
target->GetSafeProperty(this->kw().AUTORCC_EXECUTABLE);
// We support Qt4, Qt5 and Qt6
- auto qtVersion =
+ auto const qtVersion =
cmQtAutoGenInitializer::GetQtVersion(target.get(), mocExec);
bool const validQt = (qtVersion.first.Major == 4) ||
(qtVersion.first.Major == 5) || (qtVersion.first.Major == 6);
@@ -167,7 +167,7 @@ void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
{
// Test if the target already exists
if (localGen->FindGeneratorTargetToUse(name) == nullptr) {
- cmMakefile* makefile = localGen->GetMakefile();
+ cmMakefile const* makefile = localGen->GetMakefile();
// Create utility target
auto cc = cm::make_unique<cmCustomCommand>();
@@ -192,9 +192,10 @@ void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
cmLocalGenerator* localGen, std::string const& targetName)
{
- auto it = this->GlobalAutoGenTargets_.find(localGen);
+ auto const it = this->GlobalAutoGenTargets_.find(localGen);
if (it != this->GlobalAutoGenTargets_.end()) {
- cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
+ cmGeneratorTarget const* target =
+ localGen->FindGeneratorTargetToUse(it->second);
if (target != nullptr) {
target->Target->AddUtility(targetName, false, localGen->GetMakefile());
}
@@ -204,33 +205,91 @@ void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
cmLocalGenerator* localGen, std::string const& targetName)
{
- auto it = this->GlobalAutoRccTargets_.find(localGen);
+ auto const it = this->GlobalAutoRccTargets_.find(localGen);
if (it != this->GlobalAutoRccTargets_.end()) {
- cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
+ cmGeneratorTarget const* target =
+ localGen->FindGeneratorTargetToUse(it->second);
if (target != nullptr) {
target->Target->AddUtility(targetName, false, localGen->GetMakefile());
}
}
}
-cmQtAutoGen::CompilerFeaturesHandle
+cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>
cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
- std::string const& generator, std::string const& executable,
- std::string& error)
+ std::string const& generator, cmQtAutoGen::ConfigString const& executable,
+ std::string& error, bool const isMultiConfig, bool const UseBetterGraph)
{
+ cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle> res;
+ if (isMultiConfig && UseBetterGraph) {
+ for (auto const& config : executable.Config) {
+ auto const exe = config.second;
+ // Check if we have cached features
+ {
+ auto it = this->CompilerFeatures_.Config[config.first].find(exe);
+ if (it != this->CompilerFeatures_.Config[config.first].end()) {
+ res.Config[config.first] = it->second;
+ continue;
+ }
+ }
+
+ // Check if the executable exists
+ if (!cmSystemTools::FileExists(exe, true)) {
+ error = cmStrCat("The \"", generator, "\" executable ",
+ cmQtAutoGen::Quoted(exe), " does not exist.");
+ res.Config[config.first] = {};
+ continue;
+ }
+
+ // Test the executable
+ std::string stdOut;
+ {
+ std::string stdErr;
+ std::vector<std::string> command;
+ command.emplace_back(exe);
+ command.emplace_back("-h");
+ int retVal = 0;
+ const bool runResult = cmSystemTools::RunSingleCommand(
+ command, &stdOut, &stdErr, &retVal, nullptr,
+ cmSystemTools::OUTPUT_NONE, cmDuration::zero(),
+ cmProcessOutput::Auto);
+ if (!runResult) {
+ error = cmStrCat("Test run of \"", generator, "\" executable ",
+ cmQtAutoGen::Quoted(exe), " failed.\n",
+ cmQtAutoGen::QuotedCommand(command), '\n', stdOut,
+ '\n', stdErr);
+ res.Config[config.first] = {};
+ continue;
+ }
+ }
+
+ // Create valid handle
+ res.Config[config.first] =
+ std::make_shared<cmQtAutoGen::CompilerFeatures>();
+ res.Config[config.first]->HelpOutput = std::move(stdOut);
+
+ // Register compiler features
+ this->CompilerFeatures_.Config[config.first].emplace(
+ exe, res.Config[config.first]);
+ }
+ return res;
+ }
+
// Check if we have cached features
{
- auto it = this->CompilerFeatures_.find(executable);
- if (it != this->CompilerFeatures_.end()) {
- return it->second;
+ auto const it = this->CompilerFeatures_.Default.find(executable.Default);
+ if (it != this->CompilerFeatures_.Default.end()) {
+ res.Default = it->second;
+ return res;
}
}
// Check if the executable exists
- if (!cmSystemTools::FileExists(executable, true)) {
- error = cmStrCat("The \"", generator, "\" executable ",
- cmQtAutoGen::Quoted(executable), " does not exist.");
- return cmQtAutoGen::CompilerFeaturesHandle();
+ if (!cmSystemTools::FileExists(executable.Default, true)) {
+ error =
+ cmStrCat("The \"", generator, "\" executable ",
+ cmQtAutoGen::Quoted(executable.Default), " does not exist.");
+ return cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>();
}
// Test the executable
@@ -238,7 +297,7 @@ cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
{
std::string stdErr;
std::vector<std::string> command;
- command.emplace_back(executable);
+ command.emplace_back(executable.Default);
command.emplace_back("-h");
int retVal = 0;
const bool runResult = cmSystemTools::RunSingleCommand(
@@ -246,20 +305,18 @@ cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
cmDuration::zero(), cmProcessOutput::Auto);
if (!runResult) {
error = cmStrCat("Test run of \"", generator, "\" executable ",
- cmQtAutoGen::Quoted(executable), " failed.\n",
+ cmQtAutoGen::Quoted(executable.Default), " failed.\n",
cmQtAutoGen::QuotedCommand(command), '\n', stdOut, '\n',
stdErr);
- return cmQtAutoGen::CompilerFeaturesHandle();
+ return cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>();
}
}
- // Create valid handle
- cmQtAutoGen::CompilerFeaturesHandle res =
- std::make_shared<cmQtAutoGen::CompilerFeatures>();
- res->HelpOutput = std::move(stdOut);
+ res.Default = std::make_shared<cmQtAutoGen::CompilerFeatures>();
+ res.Default->HelpOutput = std::move(stdOut);
// Register compiler features
- this->CompilerFeatures_.emplace(executable, res);
+ this->CompilerFeatures_.Default.emplace(executable.Default, res.Default);
return res;
}
diff --git a/Source/cmQtAutoGenGlobalInitializer.h b/Source/cmQtAutoGenGlobalInitializer.h
index e8569a5..c1c4758 100644
--- a/Source/cmQtAutoGenGlobalInitializer.h
+++ b/Source/cmQtAutoGenGlobalInitializer.h
@@ -66,14 +66,17 @@ private:
void AddToGlobalAutoRcc(cmLocalGenerator* localGen,
std::string const& targetName);
- cmQtAutoGen::CompilerFeaturesHandle GetCompilerFeatures(
- std::string const& generator, std::string const& executable,
- std::string& error);
+ cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle>
+ GetCompilerFeatures(std::string const& generator,
+ cmQtAutoGen::ConfigString const& executable,
+ std::string& error, bool isMultiConfig,
+ bool UseBetterGraph);
std::vector<std::unique_ptr<cmQtAutoGenInitializer>> Initializers_;
std::map<cmLocalGenerator*, std::string> GlobalAutoGenTargets_;
std::map<cmLocalGenerator*, std::string> GlobalAutoRccTargets_;
- std::unordered_map<std::string, cmQtAutoGen::CompilerFeaturesHandle>
+ cmQtAutoGen::ConfigStrings<
+ std::unordered_map<std::string, cmQtAutoGen::CompilerFeaturesHandle>>
CompilerFeatures_;
Keywords const Keywords_;
};
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 891b58d..34a47cc 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmQtAutoGenInitializer.h"
+#include <array>
#include <cstddef>
#include <deque>
#include <initializer_list>
@@ -17,6 +18,7 @@
#include <cm/algorithm>
#include <cm/iterator>
#include <cm/memory>
+#include <cm/string_view>
#include <cmext/algorithm>
#include <cmext/string_view>
@@ -301,15 +303,22 @@ bool InfoWriter::Save(std::string const& filename)
return fileStream.Close();
}
-void AddAutogenExecutableToDependencies(
- cmQtAutoGenInitializer::GenVarsT const& genVars,
- std::vector<std::string>& dependencies)
+cmQtAutoGen::ConfigStrings<std::vector<std::string>> generateListOptions(
+ cmQtAutoGen::ConfigStrings<cmQtAutoGen::CompilerFeaturesHandle> const&
+ executableFeatures,
+ bool IsMultiConfig)
{
- if (genVars.ExecutableTarget != nullptr) {
- dependencies.push_back(genVars.ExecutableTarget->Target->GetName());
- } else if (!genVars.Executable.empty()) {
- dependencies.push_back(genVars.Executable);
+ cmQtAutoGen::ConfigStrings<std::vector<std::string>> tempListOptions;
+ if (IsMultiConfig) {
+ for (auto const& executableFeature : executableFeatures.Config) {
+ tempListOptions.Config[executableFeature.first] =
+ executableFeature.second->ListOptions;
+ }
+ } else {
+ tempListOptions.Default = executableFeatures.Default->ListOptions;
}
+
+ return tempListOptions;
}
} // End of unnamed namespace
@@ -334,6 +343,42 @@ cmQtAutoGenInitializer::cmQtAutoGenInitializer(
this->Rcc.GlobalTarget = globalAutoRccTarget;
this->CrossConfig =
!this->Makefile->GetSafeDefinition("CMAKE_CROSS_CONFIGS").empty();
+ this->UseBetterGraph =
+ this->GenTarget->GetProperty("AUTOGEN_BETTER_GRAPH_MULTI_CONFIG").IsSet()
+ ? this->GenTarget->GetProperty("AUTOGEN_BETTER_GRAPH_MULTI_CONFIG").IsOn()
+ : (this->QtVersion >= IntegerVersion(6, 8));
+ // AUTOGEN_BETTER_GRAPH_MULTI_CONFIG is set explicitly because it is read by
+ // the qt library
+ this->GenTarget->Target->SetProperty("AUTOGEN_BETTER_GRAPH_MULTI_CONFIG",
+ this->UseBetterGraph ? "ON" : "OFF");
+}
+
+void cmQtAutoGenInitializer::AddAutogenExecutableToDependencies(
+ cmQtAutoGenInitializer::GenVarsT const& genVars,
+ std::vector<std::string>& dependencies) const
+{
+ if (genVars.ExecutableTarget != nullptr) {
+ dependencies.push_back(genVars.ExecutableTarget->Target->GetName());
+ } else if (this->MultiConfig && this->UseBetterGraph) {
+ cm::string_view const& configGenexWithCommandConfig =
+ "$<COMMAND_CONFIG:$<$<CONFIG:";
+ cm::string_view const& configGenex = "$<$<CONFIG:";
+ cm::string_view const& configGenexEnd = ">";
+ cm::string_view const& configGenexEndWithCommandConfig = ">>";
+ auto genexBegin =
+ this->CrossConfig ? configGenexWithCommandConfig : configGenex;
+ auto genexEnd =
+ this->CrossConfig ? configGenexEndWithCommandConfig : configGenexEnd;
+ for (auto const& config : genVars.Executable.Config) {
+ auto executableWithConfig =
+ cmStrCat(genexBegin, config.first, ">:", config.second, genexEnd);
+ dependencies.emplace_back(std::move(executableWithConfig));
+ }
+ } else {
+ if (!genVars.Executable.Default.empty()) {
+ dependencies.push_back(genVars.Executable.Default);
+ }
+ }
}
bool cmQtAutoGenInitializer::InitCustomTargets()
@@ -485,6 +530,38 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
}
}
+#ifdef _WIN32
+ {
+ const auto& value =
+ this->GenTarget->GetProperty("AUTOGEN_COMMAND_LINE_LENGTH_MAX");
+ if (value.IsSet()) {
+ using maxCommandLineLengthType =
+ decltype(this->AutogenTarget.MaxCommandLineLength);
+ unsigned long propInt = 0;
+ if (cmStrToULong(value, &propInt) && propInt > 0 &&
+ propInt <= std::numeric_limits<maxCommandLineLengthType>::max()) {
+ this->AutogenTarget.MaxCommandLineLength =
+ static_cast<maxCommandLineLengthType>(propInt);
+ } else {
+ // Warn the project author that AUTOGEN_PARALLEL is not valid.
+ this->Makefile->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat("AUTOGEN_COMMAND_LINE_LENGTH_MAX=\"", *value,
+ "\" for target \"", this->GenTarget->GetName(),
+ "\" is not valid. Using no limit for "
+ "AUTOGEN_COMMAND_LINE_LENGTH_MAX"));
+ this->AutogenTarget.MaxCommandLineLength =
+ std::numeric_limits<maxCommandLineLengthType>::max();
+ }
+ } else {
+ // Actually 32767 (see
+ // https://devblogs.microsoft.com/oldnewthing/20031210-00/?p=41553) but
+ // we allow for a small margin
+ this->AutogenTarget.MaxCommandLineLength = 32000;
+ }
+ }
+#endif
+
// Autogen target info and settings files
{
// Info file
@@ -524,7 +601,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
if (this->Moc.Enabled) {
// Path prefix
- if (cmIsOn(this->GenTarget->GetProperty("AUTOMOC_PATH_PREFIX"))) {
+ if (this->GenTarget->GetProperty("AUTOMOC_PATH_PREFIX").IsOn()) {
this->Moc.PathPrefix = true;
}
@@ -580,7 +657,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
auto const& value =
this->GenTarget->GetProperty("AUTOGEN_USE_SYSTEM_INCLUDE");
if (value.IsSet()) {
- if (cmIsOn(value)) {
+ if (value.IsOn()) {
this->GenTarget->AddSystemIncludeDirectory(this->Dir.IncludeGenExp,
"CXX");
} else {
@@ -779,18 +856,51 @@ bool cmQtAutoGenInitializer::InitRcc()
return false;
}
// Evaluate test output on demand
- CompilerFeatures& features = *this->Rcc.ExecutableFeatures;
- if (!features.Evaluated) {
- // Look for list options
- if (this->QtVersion.Major == 5 || this->QtVersion.Major == 6) {
- if (features.HelpOutput.find("--list") != std::string::npos) {
- features.ListOptions.emplace_back("--list");
- } else if (features.HelpOutput.find("-list") != std::string::npos) {
- features.ListOptions.emplace_back("-list");
+ auto& features = this->Rcc.ExecutableFeatures;
+ auto checkAndAddOptions = [this](CompilerFeaturesHandle& feature) {
+ if (!feature->Evaluated) {
+ // Look for list options
+ if (this->QtVersion.Major == 5 || this->QtVersion.Major == 6) {
+ static std::array<std::string, 2> const listOptions{ { "--list",
+ "-list" } };
+ for (std::string const& opt : listOptions) {
+ if (feature->HelpOutput.find(opt) != std::string::npos) {
+ feature->ListOptions.emplace_back(opt);
+ break;
+ }
+ }
+ }
+ // Evaluation finished
+ feature->Evaluated = true;
+ }
+ };
+ if (this->MultiConfig && this->UseBetterGraph) {
+ for (auto const& config : this->ConfigsList) {
+ checkAndAddOptions(features.Config[config]);
+ }
+ } else {
+ checkAndAddOptions(features.Default);
+ }
+ }
+
+ // Disable zstd if it is not supported
+ {
+ std::string const qtFeatureZSTD = "QT_FEATURE_zstd";
+ if (this->GenTarget->Target->GetMakefile()->IsDefinitionSet(
+ qtFeatureZSTD)) {
+ const auto zstdDef =
+ this->GenTarget->Target->GetMakefile()->GetSafeDefinition(
+ qtFeatureZSTD);
+ const auto zstdVal = cmValue(zstdDef);
+ if (zstdVal.IsOff()) {
+ auto const& kw = this->GlobalInitializer->kw();
+ auto rccOptions = this->GenTarget->GetSafeProperty(kw.AUTORCC_OPTIONS);
+ std::string const nozstd = "--no-zstd";
+ if (rccOptions.find(nozstd) == std::string::npos) {
+ rccOptions.append(";" + nozstd + ";");
}
+ this->GenTarget->Target->SetProperty(kw.AUTORCC_OPTIONS, rccOptions);
}
- // Evaluation finished
- features.Evaluated = true;
}
}
@@ -1126,8 +1236,14 @@ bool cmQtAutoGenInitializer::InitScanFiles()
// Path checksum
qrc.QrcPathChecksum = this->PathCheckSum.getPart(qrc.QrcFile);
// Output file name
- qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum,
- "/qrc_", qrc.QrcName, ".cpp");
+ if (this->MultiConfig && !this->GlobalGen->IsXcode() &&
+ this->UseBetterGraph) {
+ qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum,
+ "_$<CONFIG>", "/qrc_", qrc.QrcName, ".cpp");
+ } else {
+ qrc.OutputFile = cmStrCat(this->Dir.Build, '/', qrc.QrcPathChecksum,
+ "/qrc_", qrc.QrcName, ".cpp");
+ }
std::string const base = cmStrCat(this->Dir.Info, "/AutoRcc_",
qrc.QrcName, '_', qrc.QrcPathChecksum);
qrc.LockFile = cmStrCat(base, "_Lock.lock");
@@ -1159,11 +1275,25 @@ bool cmQtAutoGenInitializer::InitScanFiles()
for (Qrc& qrc : this->Rcc.Qrcs) {
if (!qrc.Generated) {
std::string error;
- RccLister const lister(this->Rcc.Executable,
- this->Rcc.ExecutableFeatures->ListOptions);
- if (!lister.list(qrc.QrcFile, qrc.Resources, error)) {
- cmSystemTools::Error(error);
- return false;
+ if (this->MultiConfig && this->UseBetterGraph) {
+ for (auto const& config : this->ConfigsList) {
+ RccLister const lister(
+ this->Rcc.Executable.Config[config],
+ this->Rcc.ExecutableFeatures.Config[config]->ListOptions);
+ if (!lister.list(qrc.QrcFile, qrc.Resources.Config[config],
+ error)) {
+ cmSystemTools::Error(error);
+ return false;
+ }
+ }
+ } else {
+ RccLister const lister(
+ this->Rcc.Executable.Default,
+ this->Rcc.ExecutableFeatures.Default->ListOptions);
+ if (!lister.list(qrc.QrcFile, qrc.Resources.Default, error)) {
+ cmSystemTools::Error(error);
+ return false;
+ }
}
}
}
@@ -1191,8 +1321,9 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
if (this->Moc.Enabled) {
this->AddGeneratedSource(this->Moc.CompilationFile, this->Moc, true);
if (useDepfile) {
- if (this->MultiConfig && this->CrossConfig &&
- this->GlobalGen->GetName().find("Ninja") != std::string::npos) {
+ if (this->CrossConfig &&
+ this->GlobalGen->GetName().find("Ninja") != std::string::npos &&
+ !this->UseBetterGraph) {
// Make all mocs_compilation_<CONFIG>.cpp files byproducts of the
// ${target}_autogen/timestamp custom command.
// We cannot just use Moc.CompilationFileGenex here, because that
@@ -1235,28 +1366,11 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
// Compose command lines
// FIXME: Take advantage of our per-config mocs_compilation_$<CONFIG>.cpp
// instead of fiddling with the include directories
- std::vector<std::string> configs;
- this->GlobalGen->GetQtAutoGenConfigs(configs);
+
bool constexpr stdPipesUTF8 = true;
cmCustomCommandLines commandLines;
- if (!this->CrossConfig) {
- std::string autogenInfoFileConfig;
- if (this->MultiConfig) {
- autogenInfoFileConfig = "$<CONFIG>";
- } else {
- autogenInfoFileConfig = configs[0];
- }
- commandLines.push_back(cmMakeCommandLine(
- { cmSystemTools::GetCMakeCommand(), "-E", "cmake_autogen",
- this->AutogenTarget.InfoFile, autogenInfoFileConfig }));
-
- } else {
- for (auto const& config : configs) {
- commandLines.push_back(cmMakeCommandLine(
- { cmSystemTools::GetCMakeCommand(), "-E", "cmake_autogen",
- this->AutogenTarget.InfoFile, config }));
- }
- }
+ AddCMakeProcessToCommandLines(this->AutogenTarget.InfoFile, "cmake_autogen",
+ commandLines);
// Use PRE_BUILD on demand
bool usePRE_BUILD = false;
@@ -1410,18 +1524,47 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
AddAutogenExecutableToDependencies(this->Moc, dependencies);
AddAutogenExecutableToDependencies(this->Uic, dependencies);
-
+ std::string outputFile;
+ std::string depFile;
// Create the custom command that outputs the timestamp file.
- const char timestampFileName[] = "timestamp";
- const std::string outputFile =
- cmStrCat(this->Dir.Build, "/", timestampFileName);
- this->AutogenTarget.DepFile = cmStrCat(this->Dir.Build, "/deps");
- this->AutogenTarget.DepFileRuleName =
- cmStrCat(this->Dir.RelativeBuild, "/", timestampFileName);
- commandLines.push_back(cmMakeCommandLine(
- { cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile }));
-
- this->AddGeneratedSource(outputFile, this->Moc);
+ if (this->MultiConfig && this->UseBetterGraph) {
+ // create timestamp file with $<CONFIG> in the name so that
+ // every cmake_autogen target has its own timestamp file
+ std::string const configView = "$<CONFIG>";
+ std::string const timestampFileWithoutConfig = "timestamp_";
+ std::string const depFileWithoutConfig =
+ cmStrCat(this->Dir.Build, "/deps_");
+ std::string const timestampFileName =
+ timestampFileWithoutConfig + configView;
+ outputFile = cmStrCat(this->Dir.Build, "/", timestampFileName);
+ auto const depFileWithConfig =
+ cmStrCat(depFileWithoutConfig, configView);
+ depFile = depFileWithConfig;
+ commandLines.push_back(cmMakeCommandLine(
+ { cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile }));
+
+ ConfigString outputFileWithConfig;
+ for (std::string const& config : this->ConfigsList) {
+ auto tempTimestampFileName = timestampFileWithoutConfig + config;
+ auto tempDepFile = depFileWithoutConfig + config;
+ outputFileWithConfig.Config[config] = tempTimestampFileName;
+ this->AutogenTarget.DepFileRuleName.Config[config] =
+ cmStrCat(this->Dir.RelativeBuild, "/", tempTimestampFileName);
+ this->AutogenTarget.DepFile.Config[config] = tempDepFile;
+ }
+ this->AddGeneratedSource(outputFileWithConfig, this->Moc);
+ } else {
+ cm::string_view const timestampFileName = "timestamp";
+ outputFile = cmStrCat(this->Dir.Build, "/", timestampFileName);
+ this->AutogenTarget.DepFile.Default =
+ cmStrCat(this->Dir.Build, "/deps");
+ depFile = this->AutogenTarget.DepFile.Default;
+ this->AutogenTarget.DepFileRuleName.Default =
+ cmStrCat(this->Dir.RelativeBuild, "/", timestampFileName);
+ commandLines.push_back(cmMakeCommandLine(
+ { cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile }));
+ this->AddGeneratedSource(outputFile, this->Moc);
+ }
cc = cm::make_unique<cmCustomCommand>();
cc->SetOutputs(outputFile);
cc->SetByproducts(timestampByproducts);
@@ -1430,14 +1573,11 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
cc->SetComment(autogenComment.c_str());
cc->SetWorkingDirectory(this->Dir.Work.c_str());
cc->SetEscapeOldStyle(false);
- cc->SetDepfile(this->AutogenTarget.DepFile);
+ cc->SetDepfile(depFile);
cc->SetStdPipesUTF8(stdPipesUTF8);
this->LocalGen->AddCustomCommandToOutput(std::move(cc));
-
- // Alter variables for the autogen target which now merely wraps the
- // custom command
dependencies.clear();
- dependencies.emplace_back(outputFile);
+ dependencies.emplace_back(std::move(outputFile));
commandLines.clear();
autogenComment.clear();
}
@@ -1490,6 +1630,36 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
return true;
}
+void cmQtAutoGenInitializer::AddCMakeProcessToCommandLines(
+ std::string const& infoFile, std::string const& processName,
+ cmCustomCommandLines& commandLines)
+{
+ if (this->CrossConfig && this->UseBetterGraph) {
+ commandLines.push_back(cmMakeCommandLine(
+ { cmSystemTools::GetCMakeCommand(), "-E", processName, infoFile,
+ "$<CONFIG>", "$<COMMAND_CONFIG:$<CONFIG>>" }));
+ } else if ((this->MultiConfig && this->GlobalGen->IsXcode()) ||
+ this->CrossConfig) {
+ for (std::string const& config : this->ConfigsList) {
+ commandLines.push_back(
+ cmMakeCommandLine({ cmSystemTools::GetCMakeCommand(), "-E",
+ processName, infoFile, config }));
+ }
+ } else {
+ std::string autoInfoFileConfig;
+ if (this->MultiConfig) {
+ autoInfoFileConfig = "$<CONFIG>";
+ } else {
+ std::vector<std::string> configs;
+ this->GlobalGen->GetQtAutoGenConfigs(configs);
+ autoInfoFileConfig = configs[0];
+ }
+ commandLines.push_back(
+ cmMakeCommandLine({ cmSystemTools::GetCMakeCommand(), "-E", processName,
+ infoFile, autoInfoFileConfig }));
+ }
+}
+
bool cmQtAutoGenInitializer::InitRccTargets()
{
for (Qrc const& qrc : this->Rcc.Qrcs) {
@@ -1510,18 +1680,7 @@ bool cmQtAutoGenInitializer::InitRccTargets()
ccDepends.push_back(qrc.InfoFile);
cmCustomCommandLines commandLines;
- if (this->MultiConfig) {
- // Build for all configurations
- for (std::string const& config : this->ConfigsList) {
- commandLines.push_back(
- cmMakeCommandLine({ cmSystemTools::GetCMakeCommand(), "-E",
- "cmake_autorcc", qrc.InfoFile, config }));
- }
- } else {
- commandLines.push_back(
- cmMakeCommandLine({ cmSystemTools::GetCMakeCommand(), "-E",
- "cmake_autorcc", qrc.InfoFile, "$<CONFIG>" }));
- }
+ AddCMakeProcessToCommandLines(qrc.InfoFile, "cmake_autorcc", commandLines);
std::string const ccComment =
cmStrCat("Automatic RCC for ",
@@ -1572,13 +1731,28 @@ bool cmQtAutoGenInitializer::InitRccTargets()
// Create custom rcc command
{
// Add the resource files to the dependencies
- for (std::string const& fileName : qrc.Resources) {
- // Add resource file to the custom command dependencies
- ccDepends.push_back(fileName);
+ if (this->MultiConfig && this->UseBetterGraph) {
+ for (auto const& config : this->ConfigsList) {
+ // Add resource file to the custom command dependencies
+ auto resourceFilesWithConfig = cmStrCat(
+ "$<$<CONFIG:", config,
+ ">:", cmList{ qrc.Resources.Config.at(config) }.to_string(),
+ ">");
+ ccDepends.emplace_back(std::move(resourceFilesWithConfig));
+ }
+ } else {
+ for (std::string const& fileName : qrc.Resources.Default) {
+ // Add resource file to the custom command dependencies
+ ccDepends.push_back(fileName);
+ }
}
+
if (!this->Rcc.ExecutableTargetName.empty()) {
ccDepends.push_back(this->Rcc.ExecutableTargetName);
}
+
+ AddAutogenExecutableToDependencies(this->Rcc, ccDepends);
+
cc->SetOutputs(ccOutput);
cc->SetDepends(ccDepends);
this->LocalGen->AddCustomCommandToOutput(std::move(cc));
@@ -1678,7 +1852,13 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
// General
info.SetBool("MULTI_CONFIG", this->MultiConfig);
+ info.SetBool("CROSS_CONFIG", this->CrossConfig);
+ info.SetBool("USE_BETTER_GRAPH", this->UseBetterGraph);
info.SetUInt("PARALLEL", this->AutogenTarget.Parallel);
+#ifdef _WIN32
+ info.SetUInt("AUTOGEN_COMMAND_LINE_LENGTH_MAX",
+ this->AutogenTarget.MaxCommandLineLength);
+#endif
info.SetUInt("VERBOSITY", this->Verbosity);
// Directories
@@ -1691,14 +1871,14 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
info.SetUInt("QT_VERSION_MAJOR", this->QtVersion.Major);
info.SetUInt("QT_VERSION_MINOR", this->QtVersion.Minor);
- info.Set("QT_MOC_EXECUTABLE", this->Moc.Executable);
- info.Set("QT_UIC_EXECUTABLE", this->Uic.Executable);
+ info.SetConfig("QT_MOC_EXECUTABLE", this->Moc.Executable);
+ info.SetConfig("QT_UIC_EXECUTABLE", this->Uic.Executable);
info.Set("CMAKE_EXECUTABLE", cmSystemTools::GetCMakeCommand());
info.SetConfig("SETTINGS_FILE", this->AutogenTarget.SettingsFile);
info.SetConfig("PARSE_CACHE_FILE", this->AutogenTarget.ParseCacheFile);
- info.Set("DEP_FILE", this->AutogenTarget.DepFile);
- info.Set("DEP_FILE_RULE_NAME", this->AutogenTarget.DepFileRuleName);
+ info.SetConfig("DEP_FILE", this->AutogenTarget.DepFile);
+ info.SetConfig("DEP_FILE_RULE_NAME", this->AutogenTarget.DepFileRuleName);
info.SetArray("CMAKE_LIST_FILES", this->Makefile->GetListFiles());
info.SetArray("HEADER_EXTENSIONS",
this->Makefile->GetCMakeInstance()->GetHeaderExtensions());
@@ -1738,8 +1918,9 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
info.SetBool("MOC_RELAXED_MODE", this->Moc.RelaxedMode);
info.SetBool("MOC_PATH_PREFIX", this->Moc.PathPrefix);
- cmGeneratorExpressionDAGChecker dagChecker(
- this->GenTarget, "AUTOMOC_MACRO_NAMES", nullptr, nullptr);
+ cmGeneratorExpressionDAGChecker dagChecker(this->GenTarget,
+ "AUTOMOC_MACRO_NAMES", nullptr,
+ nullptr, this->LocalGen);
EvaluatedTargetPropertyEntries InterfaceAutoMocMacroNamesEntries;
if (this->MultiConfig) {
@@ -1825,6 +2006,8 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo()
// General
info.SetBool("MULTI_CONFIG", this->MultiConfig);
+ info.SetBool("CROSS_CONFIG", this->CrossConfig);
+ info.SetBool("USE_BETTER_GRAPH", this->UseBetterGraph);
info.SetUInt("VERBOSITY", this->Verbosity);
info.Set("GENERATOR", this->GlobalGen->GetName());
@@ -1841,16 +2024,17 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo()
info.SetConfig("INCLUDE_DIR", this->Dir.Include);
// rcc executable
- info.Set("RCC_EXECUTABLE", this->Rcc.Executable);
- info.SetArray("RCC_LIST_OPTIONS",
- this->Rcc.ExecutableFeatures->ListOptions);
+ info.SetConfig("RCC_EXECUTABLE", this->Rcc.Executable);
+ info.SetConfigArray(
+ "RCC_LIST_OPTIONS",
+ generateListOptions(this->Rcc.ExecutableFeatures, this->MultiConfig));
// qrc file
info.Set("SOURCE", qrc.QrcFile);
info.Set("OUTPUT_CHECKSUM", qrc.QrcPathChecksum);
info.Set("OUTPUT_NAME", cmSystemTools::GetFilenameName(qrc.OutputFile));
info.SetArray("OPTIONS", qrc.Options);
- info.SetArray("INPUTS", qrc.Resources);
+ info.SetConfigArray("INPUTS", qrc.Resources);
info.Save(qrc.InfoFile);
}
@@ -2195,16 +2379,32 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars,
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(*this->Makefile->GetCMakeInstance(), lfbt);
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(val);
- genVars.Executable = cge->Evaluate(this->LocalGen, "");
+ if (this->MultiConfig && this->UseBetterGraph) {
+ for (auto const& config : this->ConfigsList) {
+ genVars.Executable.Config[config] =
+ cge->Evaluate(this->LocalGen, config);
+ }
+ } else {
+ genVars.Executable.Default = cge->Evaluate(this->LocalGen, "");
+ }
}
- if (genVars.Executable.empty() && !ignoreMissingTarget) {
+
+ if (genVars.Executable.Default.empty() &&
+ genVars.Executable.Config.empty() && !ignoreMissingTarget) {
print_err(prop + " evaluates to an empty value");
return false;
}
// Create empty compiler features.
- genVars.ExecutableFeatures =
- std::make_shared<cmQtAutoGen::CompilerFeatures>();
+ if (this->MultiConfig && this->UseBetterGraph) {
+ for (auto const& config : this->ConfigsList) {
+ genVars.ExecutableFeatures.Config[config] =
+ std::make_shared<cmQtAutoGen::CompilerFeatures>();
+ }
+ } else {
+ genVars.ExecutableFeatures.Default =
+ std::make_shared<cmQtAutoGen::CompilerFeatures>();
+ }
return true;
}
}
@@ -2229,15 +2429,39 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars,
genVars.ExecutableTargetName = targetName;
genVars.ExecutableTarget = genTarget;
if (genTarget->IsImported()) {
- genVars.Executable = genTarget->ImportedGetLocation("");
+ if (this->MultiConfig && this->UseBetterGraph) {
+ for (auto const& config : this->ConfigsList) {
+ genVars.Executable.Config[config] =
+ genTarget->ImportedGetLocation(config);
+ }
+ } else {
+ genVars.Executable.Default =
+ genTarget->ImportedGetLocation(this->ConfigDefault);
+ }
+
} else {
- genVars.Executable = genTarget->GetLocation("");
+ if (this->MultiConfig && this->UseBetterGraph) {
+ for (auto const& config : this->ConfigsList) {
+ genVars.Executable.Config[config] = genTarget->GetLocation(config);
+ }
+ } else {
+ genVars.Executable.Default =
+ genTarget->GetLocation(this->ConfigDefault);
+ }
}
} else {
if (ignoreMissingTarget) {
// Create empty compiler features.
- genVars.ExecutableFeatures =
- std::make_shared<cmQtAutoGen::CompilerFeatures>();
+ if (this->MultiConfig && this->UseBetterGraph) {
+ for (auto const& config : this->ConfigsList) {
+ genVars.ExecutableFeatures.Config[config] =
+ std::make_shared<cmQtAutoGen::CompilerFeatures>();
+ }
+ } else {
+ genVars.ExecutableFeatures.Default =
+ std::make_shared<cmQtAutoGen::CompilerFeatures>();
+ }
+
return true;
}
print_err(cmStrCat("Could not find ", executable, " executable target ",
@@ -2250,10 +2474,22 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars,
{
std::string err;
genVars.ExecutableFeatures = this->GlobalInitializer->GetCompilerFeatures(
- executable, genVars.Executable, err);
- if (!genVars.ExecutableFeatures) {
- print_err(err);
- return false;
+ executable, genVars.Executable, err, this->MultiConfig,
+ this->UseBetterGraph);
+ if (this->MultiConfig && this->UseBetterGraph) {
+ for (auto const& config : this->ConfigsList) {
+ if (!genVars.ExecutableFeatures.Config[config]) {
+ if (!genVars.ExecutableFeatures.Config[config]) {
+ print_err(err);
+ return false;
+ }
+ }
+ }
+ } else {
+ if (!genVars.ExecutableFeatures.Default) {
+ print_err(err);
+ return false;
+ }
}
}
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index a44d33f..1ab038b 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <cstddef>
+#include <limits>
#include <memory>
#include <set>
#include <string>
@@ -18,6 +19,7 @@
#include "cmFilePathChecksum.h"
#include "cmQtAutoGen.h"
+class cmCustomCommandLines;
class cmGeneratorTarget;
class cmGlobalGenerator;
class cmLocalGenerator;
@@ -32,23 +34,6 @@ class cmTarget;
class cmQtAutoGenInitializer : public cmQtAutoGen
{
public:
- /** String value with per configuration variants. */
- class ConfigString
- {
- public:
- std::string Default;
- std::unordered_map<std::string, std::string> Config;
- };
-
- /** String values with per configuration variants. */
- template <typename C>
- class ConfigStrings
- {
- public:
- C Default;
- std::unordered_map<std::string, C> Config;
- };
-
/** rcc job. */
class Qrc
{
@@ -63,7 +48,7 @@ public:
bool Generated = false;
bool Unique = false;
std::vector<std::string> Options;
- std::vector<std::string> Resources;
+ ConfigStrings<std::vector<std::string>> Resources;
};
/** moc and/or uic file. */
@@ -90,8 +75,8 @@ public:
// Executable
std::string ExecutableTargetName;
cmGeneratorTarget* ExecutableTarget = nullptr;
- std::string Executable;
- CompilerFeaturesHandle ExecutableFeatures;
+ ConfigString Executable;
+ ConfigStrings<CompilerFeaturesHandle> ExecutableFeatures;
GenVarsT(GenT gen)
: Gen(gen)
@@ -141,6 +126,9 @@ private:
GenVarsT const& genVars, bool prepend = false);
void AddToSourceGroup(std::string const& fileName,
cm::string_view genNameUpper);
+ void AddCMakeProcessToCommandLines(std::string const& infoFile,
+ std::string const& processName,
+ cmCustomCommandLines& commandLines);
void AddCleanFile(std::string const& fileName);
void ConfigFileNames(ConfigString& configString, cm::string_view prefix,
@@ -155,6 +143,9 @@ private:
bool ignoreMissingTarget) const;
void handleSkipPch(cmSourceFile* sf);
+ void AddAutogenExecutableToDependencies(
+ cmQtAutoGenInitializer::GenVarsT const& genVars,
+ std::vector<std::string>& dependencies) const;
cmQtAutoGenGlobalInitializer* GlobalInitializer = nullptr;
cmGeneratorTarget* GenTarget = nullptr;
@@ -168,6 +159,7 @@ private:
unsigned int Verbosity = 0;
bool MultiConfig = false;
bool CrossConfig = false;
+ bool UseBetterGraph = false;
bool CMP0071Accept = false;
bool CMP0071Warn = false;
bool CMP0100Accept = false;
@@ -194,6 +186,8 @@ private:
bool GlobalTarget = false;
// Settings
unsigned int Parallel = 1;
+ unsigned int MaxCommandLineLength =
+ std::numeric_limits<unsigned int>::max();
// Configuration files
std::string InfoFile;
ConfigString SettingsFile;
@@ -202,8 +196,8 @@ private:
bool DependOrigin = false;
std::set<std::string> DependFiles;
std::set<cmTarget*> DependTargets;
- std::string DepFile;
- std::string DepFileRuleName;
+ ConfigString DepFile;
+ ConfigString DepFileRuleName;
// Sources to process
std::unordered_map<cmSourceFile*, MUFileHandle> Headers;
std::unordered_map<cmSourceFile*, MUFileHandle> Sources;
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index c048312..ebdec12 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -430,10 +430,12 @@ std::string cmQtAutoGenerator::MessagePath(cm::string_view path) const
return cmQtAutoGen::Quoted(res);
}
-bool cmQtAutoGenerator::Run(cm::string_view infoFile, cm::string_view config)
+bool cmQtAutoGenerator::Run(cm::string_view infoFile, cm::string_view config,
+ cm::string_view executableConfig)
{
// Info config
this->InfoConfig_ = std::string(config);
+ this->ExecutableConfig_ = std::string(executableConfig);
// Info file
this->InfoFile_ = std::string(infoFile);
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index 5c3a8ad..4b15fc7 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -90,6 +90,10 @@ public:
std::string const& InfoDir() const { return this->InfoDir_; }
cmFileTime const& InfoFileTime() const { return this->InfoFileTime_; }
std::string const& InfoConfig() const { return this->InfoConfig_; }
+ std::string const& ExecutableConfig() const
+ {
+ return this->ExecutableConfig_;
+ }
// -- Info file parsing
/** Info file reader class. */
@@ -151,7 +155,8 @@ public:
std::string MessagePath(cm::string_view path) const;
// -- Run
- bool Run(cm::string_view infoFile, cm::string_view config);
+ bool Run(cm::string_view infoFile, cm::string_view config,
+ cm::string_view executableConfig);
protected:
// -- Abstract processing interface
@@ -170,6 +175,7 @@ private:
std::string InfoDir_;
cmFileTime InfoFileTime_;
std::string InfoConfig_;
+ std::string ExecutableConfig_;
// -- Directories
ProjectDirsT ProjectDirs_;
};
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index ece657d..408a22c 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -5,6 +5,7 @@
#include <algorithm>
#include <atomic>
#include <cstddef>
+#include <limits>
#include <map>
#include <mutex>
#include <set>
@@ -170,8 +171,12 @@ public:
// -- Attributes
// - Config
bool MultiConfig = false;
+ bool CrossConfig = false;
+ bool UseBetterGraph = false;
IntegerVersion QtVersion = { 4, 0 };
unsigned int ThreadCount = 0;
+ unsigned int MaxCommandLineLength =
+ std::numeric_limits<unsigned int>::max();
// - Directories
std::string AutogenBuildDir;
std::string AutogenIncludeDir;
@@ -190,7 +195,7 @@ public:
{
public:
// -- Parse Cache
- std::atomic<bool> ParseCacheChanged = ATOMIC_VAR_INIT(false);
+ std::atomic<bool> ParseCacheChanged{ false };
cmFileTime ParseCacheTime;
ParseCacheT ParseCache;
@@ -333,6 +338,13 @@ public:
std::vector<std::string> const& command,
std::string const& output) const;
+ /*
+ * Check if command line exceeds maximum length supported by OS
+ * (if on Windows) and switch to using a response file instead.
+ */
+ void MaybeWriteResponseFile(std::string const& outputFile,
+ std::vector<std::string>& cmd) const;
+
/** @brief Run an external process. Use only during Process() call! */
bool RunProcess(GenT genType, cmWorkerPool::ProcessResultT& result,
std::vector<std::string> const& command,
@@ -498,10 +510,6 @@ public:
protected:
ParseCacheT::FileHandleT CacheEntry;
-
- private:
- void MaybeWriteMocResponseFile(std::string const& outputFile,
- std::vector<std::string>& cmd) const;
};
/** uic compiles a file. */
@@ -583,7 +591,7 @@ private:
std::string SettingsStringMoc_;
std::string SettingsStringUic_;
// -- Worker thread pool
- std::atomic<bool> JobError_ = ATOMIC_VAR_INIT(false);
+ std::atomic<bool> JobError_{ false };
cmWorkerPool WorkerPool_;
// -- Concurrent processing
mutable std::mutex CMakeLibMutex_;
@@ -795,6 +803,51 @@ void cmQtAutoMocUicT::JobT::LogCommandError(
this->Gen()->Log().ErrorCommand(genType, message, command, output);
}
+/*
+ * Check if command line exceeds maximum length supported by OS
+ * (if on Windows) and switch to using a response file instead.
+ */
+void cmQtAutoMocUicT::JobT::MaybeWriteResponseFile(
+ std::string const& outputFile, std::vector<std::string>& cmd) const
+{
+#ifdef _WIN32
+ // Ensure cmd is less than CommandLineLengthMax characters
+ size_t commandLineLength = cmd.size(); // account for separating spaces
+ for (std::string const& str : cmd) {
+ commandLineLength += str.length();
+ }
+ if (commandLineLength >= this->BaseConst().MaxCommandLineLength) {
+ // Command line exceeds maximum size allowed by OS
+ // => create response file
+ std::string const responseFile = cmStrCat(outputFile, ".rsp");
+
+ cmsys::ofstream fout(responseFile.c_str());
+ if (!fout) {
+ this->LogError(
+ GenT::MOC,
+ cmStrCat("AUTOMOC was unable to create a response file at\n ",
+ this->MessagePath(responseFile)));
+ return;
+ }
+
+ auto it = cmd.begin();
+ while (++it != cmd.end()) {
+ fout << *it << "\n";
+ }
+ fout.close();
+
+ // Keep all but executable
+ cmd.resize(1);
+
+ // Specify response file
+ cmd.emplace_back(cmStrCat('@', responseFile));
+ }
+#else
+ static_cast<void>(outputFile);
+ static_cast<void>(cmd);
+#endif
+}
+
bool cmQtAutoMocUicT::JobT::RunProcess(GenT genType,
cmWorkerPool::ProcessResultT& result,
std::vector<std::string> const& command,
@@ -836,6 +889,8 @@ void cmQtAutoMocUicT::JobMocPredefsT::Process()
cm::append(cmd, this->MocConst().OptionsDefinitions);
// Add includes
cm::append(cmd, this->MocConst().OptionsIncludes);
+ // Check if response file is necessary
+ MaybeWriteResponseFile(this->MocConst().PredefsFileAbs, cmd);
// Execute command
if (!this->RunProcess(GenT::MOC, result, cmd, reason.get())) {
this->LogCommandError(GenT::MOC,
@@ -2034,7 +2089,7 @@ void cmQtAutoMocUicT::JobCompileMocT::Process()
// Add source file
cmd.push_back(sourceFile);
- MaybeWriteMocResponseFile(outputFile, cmd);
+ MaybeWriteResponseFile(outputFile, cmd);
}
// Execute moc command
@@ -2080,51 +2135,6 @@ void cmQtAutoMocUicT::JobCompileMocT::Process()
}
}
-/*
- * Check if command line exceeds maximum length supported by OS
- * (if on Windows) and switch to using a response file instead.
- */
-void cmQtAutoMocUicT::JobCompileMocT::MaybeWriteMocResponseFile(
- std::string const& outputFile, std::vector<std::string>& cmd) const
-{
-#ifdef _WIN32
- // Ensure cmd is less than CommandLineLengthMax characters
- size_t commandLineLength = cmd.size(); // account for separating spaces
- for (std::string const& str : cmd) {
- commandLineLength += str.length();
- }
- if (commandLineLength >= CommandLineLengthMax) {
- // Command line exceeds maximum size allowed by OS
- // => create response file
- std::string const responseFile = cmStrCat(outputFile, ".rsp");
-
- cmsys::ofstream fout(responseFile.c_str());
- if (!fout) {
- this->LogError(
- GenT::MOC,
- cmStrCat("AUTOMOC was unable to create a response file at\n ",
- this->MessagePath(responseFile)));
- return;
- }
-
- auto it = cmd.begin();
- while (++it != cmd.end()) {
- fout << *it << "\n";
- }
- fout.close();
-
- // Keep all but executable
- cmd.resize(1);
-
- // Specify response file
- cmd.emplace_back(cmStrCat('@', responseFile));
- }
-#else
- static_cast<void>(outputFile);
- static_cast<void>(cmd);
-#endif
-}
-
void cmQtAutoMocUicT::JobCompileUicT::Process()
{
std::string const& sourceFile = this->Mapping->SourceFile->FileName;
@@ -2372,11 +2382,18 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
{
// -- Required settings
if (!info.GetBool("MULTI_CONFIG", this->BaseConst_.MultiConfig, true) ||
+ !info.GetBool("CROSS_CONFIG", this->BaseConst_.CrossConfig, true) ||
+ !info.GetBool("USE_BETTER_GRAPH", this->BaseConst_.UseBetterGraph,
+ true) ||
!info.GetUInt("QT_VERSION_MAJOR", this->BaseConst_.QtVersion.Major,
true) ||
!info.GetUInt("QT_VERSION_MINOR", this->BaseConst_.QtVersion.Minor,
true) ||
!info.GetUInt("PARALLEL", this->BaseConst_.ThreadCount, false) ||
+#ifdef _WIN32
+ !info.GetUInt("AUTOGEN_COMMAND_LINE_LENGTH_MAX",
+ this->BaseConst_.MaxCommandLineLength, false) ||
+#endif
!info.GetString("BUILD_DIR", this->BaseConst_.AutogenBuildDir, true) ||
!info.GetStringConfig("INCLUDE_DIR", this->BaseConst_.AutogenIncludeDir,
true) ||
@@ -2384,19 +2401,49 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
true) ||
!info.GetStringConfig("PARSE_CACHE_FILE",
this->BaseConst_.ParseCacheFile, true) ||
- !info.GetString("DEP_FILE", this->BaseConst_.DepFile, false) ||
- !info.GetString("DEP_FILE_RULE_NAME", this->BaseConst_.DepFileRuleName,
- false) ||
!info.GetStringConfig("SETTINGS_FILE", this->SettingsFile_, true) ||
!info.GetArray("CMAKE_LIST_FILES", this->BaseConst_.ListFiles, true) ||
!info.GetArray("HEADER_EXTENSIONS", this->BaseConst_.HeaderExtensions,
- true) ||
- !info.GetString("QT_MOC_EXECUTABLE", this->MocConst_.Executable,
- false) ||
- !info.GetString("QT_UIC_EXECUTABLE", this->UicConst_.Executable,
- false)) {
+ true)) {
return false;
}
+ if (this->BaseConst().UseBetterGraph) {
+ if (!info.GetStringConfig("DEP_FILE", this->BaseConst_.DepFile, false) ||
+ !info.GetStringConfig("DEP_FILE_RULE_NAME",
+ this->BaseConst_.DepFileRuleName, false)) {
+ return false;
+ }
+
+ if (this->BaseConst_.CrossConfig) {
+ std::string const mocExecutableWithConfig =
+ "QT_MOC_EXECUTABLE_" + this->ExecutableConfig();
+ std::string const uicExecutableWithConfig =
+ "QT_UIC_EXECUTABLE_" + this->ExecutableConfig();
+ if (!info.GetString(mocExecutableWithConfig, this->MocConst_.Executable,
+ false) ||
+ !info.GetString(uicExecutableWithConfig, this->UicConst_.Executable,
+ false)) {
+ return false;
+ }
+ } else {
+ if (!info.GetStringConfig("QT_MOC_EXECUTABLE",
+ this->MocConst_.Executable, false) ||
+ !info.GetStringConfig("QT_UIC_EXECUTABLE",
+ this->UicConst_.Executable, false)) {
+ return false;
+ }
+ }
+ } else {
+ if (!info.GetString("QT_MOC_EXECUTABLE", this->MocConst_.Executable,
+ false) ||
+ !info.GetString("QT_UIC_EXECUTABLE", this->UicConst_.Executable,
+ false) ||
+ !info.GetString("DEP_FILE", this->BaseConst_.DepFile, false) ||
+ !info.GetString("DEP_FILE_RULE_NAME", this->BaseConst_.DepFileRuleName,
+ false)) {
+ return false;
+ }
+ }
// -- Checks
if (!this->BaseConst_.CMakeExecutableTime.Load(
@@ -3063,7 +3110,8 @@ std::string cmQtAutoMocUicT::AbsoluteIncludePath(
} // End of unnamed namespace
-bool cmQtAutoMocUic(cm::string_view infoFile, cm::string_view config)
+bool cmQtAutoMocUic(cm::string_view infoFile, cm::string_view config,
+ cm::string_view executableConfig)
{
- return cmQtAutoMocUicT().Run(infoFile, config);
+ return cmQtAutoMocUicT().Run(infoFile, config, executableConfig);
}
diff --git a/Source/cmQtAutoMocUic.h b/Source/cmQtAutoMocUic.h
index 20f9d6e..5cb4ff1 100644
--- a/Source/cmQtAutoMocUic.h
+++ b/Source/cmQtAutoMocUic.h
@@ -10,4 +10,5 @@
* Process AUTOMOC and AUTOUIC
* @return true on success
*/
-bool cmQtAutoMocUic(cm::string_view infoFile, cm::string_view config);
+bool cmQtAutoMocUic(cm::string_view infoFile, cm::string_view config,
+ cm::string_view executableConfig);
diff --git a/Source/cmQtAutoRcc.cxx b/Source/cmQtAutoRcc.cxx
index e288645..605dad5 100644
--- a/Source/cmQtAutoRcc.cxx
+++ b/Source/cmQtAutoRcc.cxx
@@ -35,6 +35,11 @@ public:
private:
// -- Utility
bool IsMultiConfig() const { return this->MultiConfig_; }
+ std::string const& GetGenerator() const { return this->Generator_; }
+ bool IsXcode() const
+ {
+ return this->GetGenerator().find("Xcode") != std::string::npos;
+ }
std::string MultiConfigOutput() const;
// -- Abstract processing interface
@@ -53,6 +58,9 @@ private:
// -- Config settings
bool MultiConfig_ = false;
+ bool CrossConfig_ = false;
+ bool UseBetterGraph_ = false;
+ std::string Generator_;
// -- Directories
std::string AutogenBuildDir_;
std::string IncludeDir_;
@@ -92,26 +100,57 @@ bool cmQtAutoRccT::InitFromInfo(InfoT const& info)
{
// -- Required settings
if (!info.GetBool("MULTI_CONFIG", this->MultiConfig_, true) ||
+ !info.GetString("GENERATOR", this->Generator_, true) ||
+ !info.GetBool("CROSS_CONFIG", this->CrossConfig_, true) ||
+ !info.GetBool("USE_BETTER_GRAPH", this->UseBetterGraph_, true) ||
!info.GetString("BUILD_DIR", this->AutogenBuildDir_, true) ||
!info.GetStringConfig("INCLUDE_DIR", this->IncludeDir_, true) ||
- !info.GetString("RCC_EXECUTABLE", this->RccExecutable_, true) ||
- !info.GetArray("RCC_LIST_OPTIONS", this->RccListOptions_, false) ||
+ !info.GetArrayConfig("RCC_LIST_OPTIONS", this->RccListOptions_, false) ||
!info.GetString("LOCK_FILE", this->LockFile_, true) ||
!info.GetStringConfig("SETTINGS_FILE", this->SettingsFile_, true) ||
!info.GetString("SOURCE", this->QrcFile_, true) ||
!info.GetString("OUTPUT_CHECKSUM", this->RccPathChecksum_, true) ||
!info.GetString("OUTPUT_NAME", this->RccFileName_, true) ||
- !info.GetArray("OPTIONS", this->Options_, false) ||
- !info.GetArray("INPUTS", this->Inputs_, false)) {
+ !info.GetArray("OPTIONS", this->Options_, false)) {
return false;
}
+ if (this->UseBetterGraph_) {
+ if (!info.GetArrayConfig("INPUTS", this->Inputs_, false)) {
+ return false;
+ }
+ if (this->CrossConfig_) {
+ std::string const rccExecutableWithConfig =
+ "RCC_EXECUTABLE_" + this->ExecutableConfig();
+ if (!info.GetString(rccExecutableWithConfig, this->RccExecutable_,
+ true)) {
+ return false;
+ }
+ } else {
+ if (!info.GetStringConfig("RCC_EXECUTABLE", this->RccExecutable_,
+ true)) {
+ return false;
+ }
+ }
+ } else {
+ if (!info.GetString("RCC_EXECUTABLE", this->RccExecutable_, true) ||
+ !info.GetArray("RCC_LIST_OPTIONS", this->RccListOptions_, false) ||
+ !info.GetArray("INPUTS", this->Inputs_, false)) {
+ return false;
+ }
+ }
// -- Derive information
this->QrcFileName_ = cmSystemTools::GetFilenameName(this->QrcFile_);
this->QrcFileDir_ = cmSystemTools::GetFilenamePath(this->QrcFile_);
- this->RccFilePublic_ =
- cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, '/',
- this->RccFileName_);
+ if (IsMultiConfig() && !this->IsXcode() && this->UseBetterGraph_) {
+ this->RccFilePublic_ =
+ cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, "_",
+ this->InfoConfig(), '/', this->RccFileName_);
+ } else {
+ this->RccFilePublic_ =
+ cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, '/',
+ this->RccFileName_);
+ }
// rcc output file name
if (this->IsMultiConfig()) {
@@ -520,7 +559,8 @@ bool cmQtAutoRccT::GenerateWrapper()
} // End of unnamed namespace
-bool cmQtAutoRcc(cm::string_view infoFile, cm::string_view config)
+bool cmQtAutoRcc(cm::string_view infoFile, cm::string_view config,
+ cm::string_view executableConfig)
{
- return cmQtAutoRccT().Run(infoFile, config);
+ return cmQtAutoRccT().Run(infoFile, config, executableConfig);
}
diff --git a/Source/cmQtAutoRcc.h b/Source/cmQtAutoRcc.h
index d525efa..9c0a4e9 100644
--- a/Source/cmQtAutoRcc.h
+++ b/Source/cmQtAutoRcc.h
@@ -10,4 +10,5 @@
* Process AUTORCC
* @return true on success
*/
-bool cmQtAutoRcc(cm::string_view infoFile, cm::string_view config);
+bool cmQtAutoRcc(cm::string_view infoFile, cm::string_view config,
+ cm::string_view executableConfig);
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index f48330d..3934a29 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -3,7 +3,6 @@
#include "cmRST.h"
#include <algorithm>
-#include <cctype>
#include <cstddef>
#include <iterator>
#include <utility>
@@ -159,7 +158,7 @@ void cmRST::ProcessLine(std::string const& line)
// A line starting in .. is an explicit markup start.
if (line == ".." ||
(line.size() >= 3 && line[0] == '.' && line[1] == '.' &&
- isspace(line[2]))) {
+ cmIsSpace(line[2]))) {
this->Reset();
this->MarkupType =
(line.find_first_not_of(" \t", 2) == std::string::npos ? Markup::Empty
@@ -219,7 +218,7 @@ void cmRST::ProcessLine(std::string const& line)
}
// Indented lines following an explicit markup start are explicit markup.
else if (this->MarkupType != Markup::None &&
- (line.empty() || isspace(line[0]))) {
+ (line.empty() || cmIsSpace(line[0]))) {
this->MarkupType = Markup::Normal;
// Record markup lines if the start line was recorded.
if (!this->MarkupLines.empty()) {
diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx
index 638bb42..a8c81d0 100644
--- a/Source/cmRulePlaceholderExpander.cxx
+++ b/Source/cmRulePlaceholderExpander.cxx
@@ -27,6 +27,19 @@ std::string cmRulePlaceholderExpander::ExpandVariable(
return this->ReplaceValues->LinkFlags;
}
}
+ if (this->ReplaceValues->Linker) {
+ if (variable == "CMAKE_LINKER") {
+ auto result = this->OutputConverter->ConvertToOutputForExisting(
+ this->ReplaceValues->Linker);
+ if (this->ReplaceValues->Launcher) {
+ // Add launcher as part of expansion so that it always appears
+ // immediately before the command itself, regardless of whether the
+ // overall rule template contains other content at the front.
+ result = cmStrCat(this->ReplaceValues->Launcher, " ", result);
+ }
+ return result;
+ }
+ }
if (this->ReplaceValues->Manifests) {
if (variable == "MANIFESTS") {
return this->ReplaceValues->Manifests;
@@ -325,17 +338,7 @@ std::string cmRulePlaceholderExpander::ExpandVariable(
auto mapIt = this->VariableMappings.find(variable);
if (mapIt != this->VariableMappings.end()) {
if (variable.find("_FLAG") == std::string::npos) {
- std::string ret =
- this->OutputConverter->ConvertToOutputForExisting(mapIt->second);
-
- if (this->ReplaceValues->Launcher && variable == "CMAKE_LINKER") {
- // Add launcher as part of expansion so that it always appears
- // immediately before the command itself, regardless of whether the
- // overall rule template contains other content at the front.
- ret = cmStrCat(this->ReplaceValues->Launcher, " ", ret);
- }
-
- return ret;
+ return this->OutputConverter->ConvertToOutputForExisting(mapIt->second);
}
return mapIt->second;
}
diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h
index 5d1f199..225abd4 100644
--- a/Source/cmRulePlaceholderExpander.h
+++ b/Source/cmRulePlaceholderExpander.h
@@ -53,6 +53,7 @@ public:
const char* SONameFlag = nullptr;
const char* TargetSOName = nullptr;
const char* TargetInstallNameDir = nullptr;
+ const char* Linker = nullptr;
const char* LinkFlags = nullptr;
const char* Manifests = nullptr;
const char* LanguageCompileFlags = nullptr;
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index 60610a4..a229ea2 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -6,6 +6,8 @@
#include <sstream>
#include <unordered_set>
+#include <cm/string_view>
+
#include "cmExecutionStatus.h"
#include "cmGlobalGenerator.h"
#include "cmInstalledFile.h"
@@ -281,12 +283,60 @@ bool HandleAndValidateSourceFilePropertyGENERATED(
cmSourceFile* sf, std::string const& propertyValue, PropertyOp op)
{
const auto& mf = *sf->GetLocation().GetMakefile();
- auto policyStatus = mf.GetPolicyStatus(cmPolicies::CMP0118);
- const bool policyWARN = policyStatus == cmPolicies::WARN;
- const bool policyNEW = policyStatus != cmPolicies::OLD && !policyWARN;
+ auto isProblematic = [&mf, &propertyValue,
+ op](cm::string_view policy) -> bool {
+ if (!cmIsOn(propertyValue) && !cmIsOff(propertyValue)) {
+ mf.IssueMessage(
+ MessageType::AUTHOR_ERROR,
+ cmStrCat("Policy ", policy,
+ " is set to NEW and the following non-boolean value given "
+ "for property 'GENERATED' is therefore not allowed:\n",
+ propertyValue, "\nReplace it with a boolean value!\n"));
+ return true;
+ }
+ if (cmIsOff(propertyValue)) {
+ mf.IssueMessage(
+ MessageType::AUTHOR_ERROR,
+ cmStrCat("Unsetting the 'GENERATED' property is not allowed under ",
+ policy, "!\n"));
+ return true;
+ }
+ if (op == PropertyOp::Append || op == PropertyOp::AppendAsString) {
+ mf.IssueMessage(
+ MessageType::AUTHOR_ERROR,
+ cmStrCat(
+ "Policy ", policy,
+ " is set to NEW and appending to the 'GENERATED' property is "
+ "therefore not allowed. Only setting it to \"1\" is allowed!\n"));
+ return true;
+ }
+ return false;
+ };
+
+ const auto cmp0163PolicyStatus = mf.GetPolicyStatus(cmPolicies::CMP0163);
+ const bool cmp0163PolicyNEW = cmp0163PolicyStatus != cmPolicies::OLD &&
+ cmp0163PolicyStatus != cmPolicies::WARN;
+ if (cmp0163PolicyNEW) {
+ if (!isProblematic("CMP0163")) {
+ sf->MarkAsGenerated();
+ }
+ return true;
+ }
+
+ const auto cmp0118PolicyStatus = mf.GetPolicyStatus(cmPolicies::CMP0118);
+ const bool cmp0118PolicyWARN = cmp0118PolicyStatus == cmPolicies::WARN;
+ const bool cmp0118PolicyNEW =
+ cmp0118PolicyStatus != cmPolicies::OLD && !cmp0118PolicyWARN;
+
+ if (cmp0118PolicyNEW) {
+ if (!isProblematic("CMP0118")) {
+ sf->MarkAsGenerated();
+ }
+ return true;
+ }
- if (policyWARN) {
+ if (cmp0118PolicyWARN) {
if (!cmIsOn(propertyValue) && !cmIsOff(propertyValue)) {
mf.IssueMessage(
MessageType::AUTHOR_WARNING,
@@ -312,50 +362,22 @@ bool HandleAndValidateSourceFilePropertyGENERATED(
"\nAppending to property 'GENERATED' will not be allowed "
"under policy CMP0118!\n"));
}
- } else if (policyNEW) {
- if (!cmIsOn(propertyValue) && !cmIsOff(propertyValue)) {
- mf.IssueMessage(
- MessageType::AUTHOR_ERROR,
- cmStrCat(
- "Policy CMP0118 is set to NEW and the following non-boolean value "
- "given for property 'GENERATED' is therefore not allowed:\n",
- propertyValue, "\nReplace it with a boolean value!\n"));
- return true;
- }
- if (cmIsOff(propertyValue)) {
- mf.IssueMessage(
- MessageType::AUTHOR_ERROR,
- "Unsetting the 'GENERATED' property is not allowed under CMP0118!\n");
- return true;
- }
- if (op == PropertyOp::Append || op == PropertyOp::AppendAsString) {
- mf.IssueMessage(MessageType::AUTHOR_ERROR,
- "Policy CMP0118 is set to NEW and appending to the "
- "'GENERATED' property is therefore not allowed. Only "
- "setting it to \"1\" is allowed!\n");
- return true;
- }
}
- // Set property.
- if (!policyNEW) {
- // Do it the traditional way.
- switch (op) {
- case PropertyOp::Append:
- sf->AppendProperty("GENERATED", propertyValue, false);
- break;
- case PropertyOp::AppendAsString:
- sf->AppendProperty("GENERATED", propertyValue, true);
- break;
- case PropertyOp::Remove:
- sf->RemoveProperty("GENERATED");
- break;
- case PropertyOp::Set:
- sf->SetProperty("GENERATED", propertyValue);
- break;
- }
- } else {
- sf->MarkAsGenerated();
+ // Set property the traditional way.
+ switch (op) {
+ case PropertyOp::Append:
+ sf->AppendProperty("GENERATED", propertyValue, false);
+ break;
+ case PropertyOp::AppendAsString:
+ sf->AppendProperty("GENERATED", propertyValue, true);
+ break;
+ case PropertyOp::Remove:
+ sf->RemoveProperty("GENERATED");
+ break;
+ case PropertyOp::Set:
+ sf->SetProperty("GENERATED", propertyValue);
+ break;
}
return true;
}
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 1be680a..30ee369 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -123,7 +123,8 @@ bool cmSourceFile::FindFullPath(std::string* error,
{
// If the file is generated compute the location without checking on disk.
// Note: We also check for a locally set GENERATED property, because
- // it might have been set before policy CMP0118 was set to NEW.
+ // it might have been set before policy CMP0118 (or CMP0163) was set
+ // to NEW.
if (this->GetIsGenerated(CheckScope::GlobalAndLocal)) {
// The file is either already a full path or is relative to the
// build directory for the target.
@@ -146,9 +147,12 @@ bool cmSourceFile::FindFullPath(std::string* error,
std::vector<std::string> exts =
makefile->GetCMakeInstance()->GetAllExtensions();
auto cmp0115 = makefile->GetPolicyStatus(cmPolicies::CMP0115);
+ auto cmp0163 = makefile->GetPolicyStatus(cmPolicies::CMP0163);
auto cmp0118 = makefile->GetPolicyStatus(cmPolicies::CMP0118);
+ bool const cmp0163new =
+ cmp0163 != cmPolicies::OLD && cmp0163 != cmPolicies::WARN;
bool const cmp0118new =
- cmp0118 != cmPolicies::OLD && cmp0118 != cmPolicies::WARN;
+ cmp0163new || (cmp0118 != cmPolicies::OLD && cmp0118 != cmPolicies::WARN);
// Tries to find the file in a given directory
auto findInDir = [this, &exts, &lPath, cmp0115, cmp0115Warning, cmp0118new,
@@ -156,6 +160,7 @@ bool cmSourceFile::FindFullPath(std::string* error,
// Compute full path
std::string const fullPath = cmSystemTools::CollapseFullPath(lPath, dir);
// Try full path
+ // Is this file globally marked as generated? Then mark so locally.
if (cmp0118new &&
makefile->GetGlobalGenerator()->IsGeneratedFile(fullPath)) {
this->IsGenerated = true;
@@ -172,6 +177,7 @@ bool cmSourceFile::FindFullPath(std::string* error,
for (std::string const& ext : exts) {
if (!ext.empty()) {
std::string extPath = cmStrCat(fullPath, '.', ext);
+ // Is this file globally marked as generated? Then mark so locally.
if (cmp0118new &&
makefile->GetGlobalGenerator()->IsGeneratedFile(extPath)) {
this->IsGenerated = true;
@@ -357,14 +363,19 @@ cmValue cmSourceFile::GetPropertyForUser(const std::string& prop)
// Special handling for GENERATED property.
if (prop == propGENERATED) {
- // We need to check policy CMP0118 in order to determine if we need to
- // possibly consider the value of a locally set GENERATED property, too.
- auto policyStatus =
+ // We need to check policy CMP0163 and CMP0118 in order to determine if we
+ // need to possibly consider the value of a locally set GENERATED property,
+ // too.
+ auto cmp0163 =
+ this->Location.GetMakefile()->GetPolicyStatus(cmPolicies::CMP0163);
+ auto cmp0118 =
this->Location.GetMakefile()->GetPolicyStatus(cmPolicies::CMP0118);
- if (this->GetIsGenerated(
- (policyStatus == cmPolicies::WARN || policyStatus == cmPolicies::OLD)
- ? CheckScope::GlobalAndLocal
- : CheckScope::Global)) {
+ bool const cmp0163new =
+ cmp0163 != cmPolicies::OLD && cmp0163 != cmPolicies::WARN;
+ bool const cmp0118new = cmp0163new ||
+ (cmp0118 != cmPolicies::OLD && cmp0118 != cmPolicies::WARN);
+ if (this->GetIsGenerated((!cmp0118new) ? CheckScope::GlobalAndLocal
+ : CheckScope::Global)) {
return cmValue(propTRUE);
}
return cmValue(propFALSE);
@@ -442,7 +453,7 @@ const std::string& cmSourceFile::GetSafeProperty(const std::string& prop) const
bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
void cmSourceFile::MarkAsGenerated()
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx
index e814690..44c4ae1 100644
--- a/Source/cmStandardLevelResolver.cxx
+++ b/Source/cmStandardLevelResolver.cxx
@@ -88,8 +88,10 @@ struct StandardLevelComputer
cmPolicies::PolicyStatus const cmp0128{ makefile->GetPolicyStatus(
cmPolicies::CMP0128) };
- bool const defaultExt{ cmIsOn(*makefile->GetDefinition(
- cmStrCat("CMAKE_", this->Language, "_EXTENSIONS_DEFAULT"))) };
+ bool const defaultExt{ makefile
+ ->GetDefinition(cmStrCat("CMAKE_", this->Language,
+ "_EXTENSIONS_DEFAULT"))
+ .IsOn() };
bool ext = true;
if (cmp0128 == cmPolicies::NEW) {
@@ -97,7 +99,7 @@ struct StandardLevelComputer
}
if (cmValue extPropValue = target->GetLanguageExtensions(this->Language)) {
- ext = cmIsOn(*extPropValue);
+ ext = extPropValue.IsOn();
}
std::string const type{ ext ? "EXTENSION" : "STANDARD" };
@@ -252,8 +254,10 @@ struct StandardLevelComputer
cmPolicies::PolicyStatus const cmp0128{ makefile->GetPolicyStatus(
cmPolicies::CMP0128) };
- bool const defaultExt{ cmIsOn(*makefile->GetDefinition(
- cmStrCat("CMAKE_", this->Language, "_EXTENSIONS_DEFAULT"))) };
+ bool const defaultExt{ makefile
+ ->GetDefinition(cmStrCat("CMAKE_", this->Language,
+ "_EXTENSIONS_DEFAULT"))
+ .IsOn() };
bool ext = true;
if (cmp0128 == cmPolicies::NEW) {
@@ -261,7 +265,7 @@ struct StandardLevelComputer
}
if (cmValue extPropValue = target->GetLanguageExtensions(this->Language)) {
- ext = cmIsOn(*extPropValue);
+ ext = extPropValue.IsOn();
}
std::string const type{ ext ? "EXTENSION" : "STANDARD" };
@@ -537,6 +541,21 @@ std::string cmStandardLevelResolver::GetEffectiveStandard(
return mapping->second.GetEffectiveStandard(this->Makefile, target, config);
}
+std::string cmStandardLevelResolver::GetLevelString(
+ std::string const& lang, cmStandardLevel const& level) const
+{
+ auto mapping = StandardComputerMapping.find(lang);
+ if (mapping == StandardComputerMapping.end()) {
+ return {};
+ }
+
+ if (mapping->second.LevelsAsStrings.size() <= level.Index()) {
+ return {};
+ }
+
+ return mapping->second.LevelsAsStrings[level.Index()];
+}
+
bool cmStandardLevelResolver::AddRequiredTargetFeature(
cmTarget* target, const std::string& feature, std::string* error) const
{
diff --git a/Source/cmStandardLevelResolver.h b/Source/cmStandardLevelResolver.h
index 29cab55..523aa73 100644
--- a/Source/cmStandardLevelResolver.h
+++ b/Source/cmStandardLevelResolver.h
@@ -29,6 +29,9 @@ public:
std::string const& lang,
std::string const& config) const;
+ std::string GetLevelString(std::string const& lang,
+ cmStandardLevel const& level) const;
+
bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature,
std::string* error = nullptr) const;
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index d104268..72eeb9d 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -16,6 +16,7 @@
#include "cmCommand.h"
#include "cmDefinitions.h"
#include "cmExecutionStatus.h"
+#include "cmGlobCacheEntry.h"
#include "cmGlobVerificationManager.h"
#include "cmList.h"
#include "cmListFileCache.h"
@@ -238,15 +239,18 @@ bool cmState::SaveVerificationScript(const std::string& path,
messenger);
}
-void cmState::AddGlobCacheEntry(
- bool recurse, bool listDirectories, bool followSymlinks,
- const std::string& relative, const std::string& expression,
- const std::vector<std::string>& files, const std::string& variable,
- cmListFileBacktrace const& backtrace, cmMessenger* messenger)
+void cmState::AddGlobCacheEntry(const cmGlobCacheEntry& entry,
+ const std::string& variable,
+ cmListFileBacktrace const& backtrace,
+ cmMessenger* messenger)
{
- this->GlobVerificationManager->AddCacheEntry(
- recurse, listDirectories, followSymlinks, relative, expression, files,
- variable, backtrace, messenger);
+ this->GlobVerificationManager->AddCacheEntry(entry, variable, backtrace,
+ messenger);
+}
+
+std::vector<cmGlobCacheEntry> cmState::GetGlobCacheEntries() const
+{
+ return this->GlobVerificationManager->GetCacheEntries();
}
void cmState::RemoveCacheEntry(std::string const& key)
@@ -662,7 +666,7 @@ cmValue cmState::GetGlobalProperty(const std::string& prop)
bool cmState::GetGlobalPropertyAsBool(const std::string& prop)
{
- return cmIsOn(this->GetGlobalProperty(prop));
+ return this->GetGlobalProperty(prop).IsOn();
}
void cmState::SetSourceDirectory(std::string const& sourceDirectory)
diff --git a/Source/cmState.h b/Source/cmState.h
index ae0d52b..5aceb6a 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -34,6 +34,7 @@ class cmStateSnapshot;
class cmMessenger;
class cmExecutionStatus;
class cmListFileBacktrace;
+struct cmGlobCacheEntry;
struct cmListFileArgument;
template <typename T>
@@ -263,13 +264,11 @@ private:
std::string const& GetGlobVerifyScript() const;
std::string const& GetGlobVerifyStamp() const;
bool SaveVerificationScript(const std::string& path, cmMessenger* messenger);
- void AddGlobCacheEntry(bool recurse, bool listDirectories,
- bool followSymlinks, const std::string& relative,
- const std::string& expression,
- const std::vector<std::string>& files,
+ void AddGlobCacheEntry(const cmGlobCacheEntry& entry,
const std::string& variable,
cmListFileBacktrace const& bt,
cmMessenger* messenger);
+ std::vector<cmGlobCacheEntry> GetGlobCacheEntries() const;
cmPropertyDefinitionMap PropertyDefinitions;
std::vector<std::string> EnabledLanguages;
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 39353f3..343bee5 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -451,7 +451,7 @@ cmValue cmStateDirectory::GetProperty(const std::string& prop,
bool cmStateDirectory::GetPropertyAsBool(const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
std::vector<std::string> cmStateDirectory::GetPropertyKeys() const
diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h
index 4a9840b..55a1e46 100644
--- a/Source/cmStringAlgorithms.h
+++ b/Source/cmStringAlgorithms.h
@@ -44,7 +44,10 @@ private:
/** Returns true if the character @a ch is a whitespace character. **/
inline bool cmIsSpace(char ch)
{
- return ((ch & 0x80) == 0) && std::isspace(ch);
+ // isspace takes 'int' but documents that the value must be representable
+ // by 'unsigned char', or be EOF. Cast to 'unsigned char' to avoid sign
+ // extension while converting to 'int'.
+ return std::isspace(static_cast<unsigned char>(ch));
}
/** Returns a string that has whitespace removed from the start and the end. */
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 5a64588..ab87f34 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -6,7 +6,6 @@
#include "cmStringCommand.h"
#include <algorithm>
-#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <limits>
@@ -660,7 +659,7 @@ bool HandleStripCommand(std::vector<std::string> const& args,
const char* ptr = stringValue.c_str();
size_t cc;
for (cc = 0; cc < inStringLength; ++cc) {
- if (!isspace(*ptr)) {
+ if (!cmIsSpace(*ptr)) {
if (startPos > inStringLength) {
startPos = cc;
}
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 2bdc928..964bac1 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -6,7 +6,8 @@
// NOLINTNEXTLINE(bugprone-reserved-identifier)
# define _POSIX_C_SOURCE 200809L
#endif
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__QNX__)
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || \
+ defined(__QNX__)
// For isascii
// NOLINTNEXTLINE(bugprone-reserved-identifier)
# define _XOPEN_SOURCE 700
@@ -31,6 +32,9 @@
#include "cmProcessOutput.h"
#include "cmRange.h"
#include "cmStringAlgorithms.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVProcessChain.h"
+#include "cmUVStream.h"
#include "cmValue.h"
#if !defined(CMAKE_BOOTSTRAP)
@@ -59,12 +63,14 @@
#include <cassert>
#include <cctype>
#include <cerrno>
+#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
+#include <memory>
#include <sstream>
#include <utility>
#include <vector>
@@ -479,7 +485,7 @@ bool cmSystemTools::SplitProgramFromArgs(std::string const& command,
const char* c = command.c_str();
// Skip leading whitespace.
- while (isspace(static_cast<unsigned char>(*c))) {
+ while (cmIsSpace(*c)) {
++c;
}
@@ -509,7 +515,7 @@ bool cmSystemTools::SplitProgramFromArgs(std::string const& command,
in_double = true;
} else if (*c == '\'') {
in_single = true;
- } else if (isspace(static_cast<unsigned char>(*c))) {
+ } else if (cmIsSpace(*c)) {
break;
} else {
program += *c;
@@ -568,85 +574,111 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
const char* dir, OutputOption outputflag,
cmDuration timeout, Encoding encoding)
{
- std::vector<const char*> argv;
- argv.reserve(command.size() + 1);
- for (std::string const& cmd : command) {
- argv.push_back(cmd.c_str());
- }
- argv.push_back(nullptr);
-
- cmsysProcess* cp = cmsysProcess_New();
- cmsysProcess_SetCommand(cp, argv.data());
- cmsysProcess_SetWorkingDirectory(cp, dir);
- if (cmSystemTools::GetRunCommandHideConsole()) {
- cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
+ cmUVProcessChainBuilder builder;
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, stdin)
+ .AddCommand(command);
+ if (dir) {
+ builder.SetWorkingDirectory(dir);
}
if (outputflag == OUTPUT_PASSTHROUGH) {
- cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDOUT, 1);
- cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDERR, 1);
captureStdOut = nullptr;
captureStdErr = nullptr;
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, stdout)
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, stderr);
} else if (outputflag == OUTPUT_MERGE ||
(captureStdErr && captureStdErr == captureStdOut)) {
- cmsysProcess_SetOption(cp, cmsysProcess_Option_MergeOutput, 1);
+ builder.SetMergedBuiltinStreams();
captureStdErr = nullptr;
+ } else {
+ builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR);
}
assert(!captureStdErr || captureStdErr != captureStdOut);
- cmsysProcess_SetTimeout(cp, timeout.count());
- cmsysProcess_Execute(cp);
+ auto chain = builder.Start();
+ bool timedOut = false;
+ cm::uv_timer_ptr timer;
+ if (timeout.count()) {
+ timer.init(chain.GetLoop(), &timedOut);
+ timer.start(
+ [](uv_timer_t* t) {
+ auto* timedOutPtr = static_cast<bool*>(t->data);
+ *timedOutPtr = true;
+ },
+ static_cast<uint64_t>(timeout.count() * 1000.0), 0);
+ }
std::vector<char> tempStdOut;
std::vector<char> tempStdErr;
- char* data;
- int length;
- int pipe;
+ cm::uv_pipe_ptr outStream;
+ bool outFinished = true;
+ cm::uv_pipe_ptr errStream;
+ bool errFinished = true;
cmProcessOutput processOutput(encoding);
- std::string strdata;
+ std::unique_ptr<cmUVStreamReadHandle> outputHandle;
+ std::unique_ptr<cmUVStreamReadHandle> errorHandle;
if (outputflag != OUTPUT_PASSTHROUGH &&
(captureStdOut || captureStdErr || outputflag != OUTPUT_NONE)) {
- while ((pipe = cmsysProcess_WaitForData(cp, &data, &length, nullptr)) >
- 0) {
- // Translate NULL characters in the output into valid text.
- for (int i = 0; i < length; ++i) {
- if (data[i] == '\0') {
- data[i] = ' ';
- }
- }
+ auto startRead =
+ [&outputflag, &processOutput,
+ &chain](cm::uv_pipe_ptr& pipe, int stream, std::string* captureStd,
+ std::vector<char>& tempStd, int id,
+ void (*outputFunc)(const std::string&),
+ bool& finished) -> std::unique_ptr<cmUVStreamReadHandle> {
+ if (stream < 0) {
+ return nullptr;
+ }
+
+ pipe.init(chain.GetLoop(), 0);
+ uv_pipe_open(pipe, stream);
+
+ finished = false;
+ return cmUVStreamRead(
+ pipe,
+ [outputflag, &processOutput, captureStd, &tempStd, id,
+ outputFunc](std::vector<char> data) {
+ // Translate NULL characters in the output into valid text.
+ for (auto& c : data) {
+ if (c == '\0') {
+ c = ' ';
+ }
+ }
- if (pipe == cmsysProcess_Pipe_STDOUT) {
- if (outputflag != OUTPUT_NONE) {
- processOutput.DecodeText(data, length, strdata, 1);
- cmSystemTools::Stdout(strdata);
- }
- if (captureStdOut) {
- cm::append(tempStdOut, data, data + length);
- }
- } else if (pipe == cmsysProcess_Pipe_STDERR) {
- if (outputflag != OUTPUT_NONE) {
- processOutput.DecodeText(data, length, strdata, 2);
- cmSystemTools::Stderr(strdata);
- }
- if (captureStdErr) {
- cm::append(tempStdErr, data, data + length);
- }
- }
- }
+ if (outputflag != OUTPUT_NONE) {
+ std::string strdata;
+ processOutput.DecodeText(data.data(), data.size(), strdata, id);
+ outputFunc(strdata);
+ }
+ if (captureStd) {
+ cm::append(tempStd, data.data(), data.data() + data.size());
+ }
+ },
+ [&finished, outputflag, &processOutput, id, outputFunc]() {
+ finished = true;
+ if (outputflag != OUTPUT_NONE) {
+ std::string strdata;
+ processOutput.DecodeText(std::string(), strdata, id);
+ if (!strdata.empty()) {
+ outputFunc(strdata);
+ }
+ }
+ });
+ };
- if (outputflag != OUTPUT_NONE) {
- processOutput.DecodeText(std::string(), strdata, 1);
- if (!strdata.empty()) {
- cmSystemTools::Stdout(strdata);
- }
- processOutput.DecodeText(std::string(), strdata, 2);
- if (!strdata.empty()) {
- cmSystemTools::Stderr(strdata);
- }
+ outputHandle =
+ startRead(outStream, chain.OutputStream(), captureStdOut, tempStdOut, 1,
+ cmSystemTools::Stdout, outFinished);
+ if (chain.OutputStream() != chain.ErrorStream()) {
+ errorHandle =
+ startRead(errStream, chain.ErrorStream(), captureStdErr, tempStdErr, 2,
+ cmSystemTools::Stderr, errFinished);
}
}
- cmsysProcess_WaitForExit(cp, nullptr);
+ while (!timedOut && !(chain.Finished() && outFinished && errFinished)) {
+ uv_run(&chain.GetLoop(), UV_RUN_ONCE);
+ }
if (captureStdOut) {
captureStdOut->assign(tempStdOut.begin(), tempStdOut.end());
@@ -658,37 +690,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
}
bool result = true;
- if (cmsysProcess_GetState(cp) == cmsysProcess_State_Exited) {
- if (retVal) {
- *retVal = cmsysProcess_GetExitValue(cp);
- } else {
- if (cmsysProcess_GetExitValue(cp) != 0) {
- result = false;
- }
- }
- } else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Exception) {
- const char* exception_str = cmsysProcess_GetExceptionString(cp);
- if (outputflag != OUTPUT_NONE) {
- std::cerr << exception_str << std::endl;
- }
- if (captureStdErr) {
- captureStdErr->append(exception_str, strlen(exception_str));
- } else if (captureStdOut) {
- captureStdOut->append(exception_str, strlen(exception_str));
- }
- result = false;
- } else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Error) {
- const char* error_str = cmsysProcess_GetErrorString(cp);
- if (outputflag != OUTPUT_NONE) {
- std::cerr << error_str << std::endl;
- }
- if (captureStdErr) {
- captureStdErr->append(error_str, strlen(error_str));
- } else if (captureStdOut) {
- captureStdOut->append(error_str, strlen(error_str));
- }
- result = false;
- } else if (cmsysProcess_GetState(cp) == cmsysProcess_State_Expired) {
+ if (timedOut) {
const char* error_str = "Process terminated due to timeout\n";
if (outputflag != OUTPUT_NONE) {
std::cerr << error_str << std::endl;
@@ -697,9 +699,34 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
captureStdErr->append(error_str, strlen(error_str));
}
result = false;
+ } else {
+ auto const& status = chain.GetStatus(0);
+ auto exception = status.GetException();
+
+ switch (exception.first) {
+ case cmUVProcessChain::ExceptionCode::None:
+ if (retVal) {
+ *retVal = static_cast<int>(status.ExitStatus);
+ } else {
+ if (status.ExitStatus != 0) {
+ result = false;
+ }
+ }
+ break;
+ default: {
+ if (outputflag != OUTPUT_NONE) {
+ std::cerr << exception.second << std::endl;
+ }
+ if (captureStdErr) {
+ captureStdErr->append(exception.second);
+ } else if (captureStdOut) {
+ captureStdOut->append(exception.second);
+ }
+ result = false;
+ } break;
+ }
}
- cmsysProcess_Delete(cp);
return result;
}
@@ -1641,7 +1668,7 @@ void cmSystemTools::EnvDiff::PutEnv(const std::string& env)
void cmSystemTools::EnvDiff::UnPutEnv(const std::string& env)
{
- diff[env] = {};
+ diff[env] = cm::nullopt;
}
bool cmSystemTools::EnvDiff::ParseOperation(const std::string& envmod)
@@ -1696,7 +1723,7 @@ bool cmSystemTools::EnvDiff::ParseOperation(const std::string& envmod)
} else if (op == "set"_s) {
diff[name] = value;
} else if (op == "unset"_s) {
- diff[name] = {};
+ diff[name] = cm::nullopt;
} else if (op == "string_append"_s) {
apply_diff(name, [&value](std::string& output) { output += value; });
} else if (op == "string_prepend"_s) {
@@ -2213,9 +2240,10 @@ bool cmSystemTools::ListTar(const std::string& outFileName,
#endif
}
-int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
- cmDuration timeout, std::vector<char>& out,
- std::vector<char>& err)
+cmSystemTools::WaitForLineResult cmSystemTools::WaitForLine(
+ uv_loop_t* loop, uv_stream_t* outPipe, uv_stream_t* errPipe,
+ std::string& line, cmDuration timeout, std::vector<char>& out,
+ std::vector<char>& err)
{
line.clear();
auto outiter = out.begin();
@@ -2237,7 +2265,7 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
line.append(out.data(), length);
}
out.erase(out.begin(), outiter + 1);
- return cmsysProcess_Pipe_STDOUT;
+ return WaitForLineResult::STDOUT;
}
}
@@ -2255,33 +2283,66 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
line.append(err.data(), length);
}
err.erase(err.begin(), erriter + 1);
- return cmsysProcess_Pipe_STDERR;
+ return WaitForLineResult::STDERR;
}
}
// No newlines found. Wait for more data from the process.
- int length;
- char* data;
- double timeoutAsDbl = timeout.count();
- int pipe =
- cmsysProcess_WaitForData(process, &data, &length, &timeoutAsDbl);
- if (pipe == cmsysProcess_Pipe_Timeout) {
+ struct ReadData
+ {
+ uv_stream_t* Stream;
+ std::vector<char> Buffer;
+ bool Read = false;
+ bool Finished = false;
+ };
+ auto startRead =
+ [](uv_stream_t* stream,
+ ReadData& data) -> std::unique_ptr<cmUVStreamReadHandle> {
+ data.Stream = stream;
+ return cmUVStreamRead(
+ stream,
+ [&data](std::vector<char> buf) {
+ data.Buffer = std::move(buf);
+ data.Read = true;
+ uv_read_stop(data.Stream);
+ },
+ [&data]() { data.Finished = true; });
+ };
+ ReadData outData;
+ auto outHandle = startRead(outPipe, outData);
+ ReadData errData;
+ auto errHandle = startRead(errPipe, errData);
+
+ cm::uv_timer_ptr timer;
+ bool timedOut = false;
+ timer.init(*loop, &timedOut);
+ timer.start(
+ [](uv_timer_t* handle) {
+ auto* timedOutPtr = static_cast<bool*>(handle->data);
+ *timedOutPtr = true;
+ },
+ static_cast<uint64_t>(timeout.count() * 1000.0), 0);
+
+ uv_run(loop, UV_RUN_ONCE);
+ if (timedOut) {
// Timeout has been exceeded.
- return pipe;
+ return WaitForLineResult::Timeout;
}
- if (pipe == cmsysProcess_Pipe_STDOUT) {
- processOutput.DecodeText(data, length, strdata, 1);
+ if (outData.Read) {
+ processOutput.DecodeText(outData.Buffer.data(), outData.Buffer.size(),
+ strdata, 1);
// Append to the stdout buffer.
std::vector<char>::size_type size = out.size();
cm::append(out, strdata);
outiter = out.begin() + size;
- } else if (pipe == cmsysProcess_Pipe_STDERR) {
- processOutput.DecodeText(data, length, strdata, 2);
+ } else if (errData.Read) {
+ processOutput.DecodeText(errData.Buffer.data(), errData.Buffer.size(),
+ strdata, 2);
// Append to the stderr buffer.
std::vector<char>::size_type size = err.size();
cm::append(err, strdata);
erriter = err.begin() + size;
- } else if (pipe == cmsysProcess_Pipe_None) {
+ } else if (outData.Finished && errData.Finished) {
// Both stdout and stderr pipes have broken. Return leftover data.
processOutput.DecodeText(std::string(), strdata, 1);
if (!strdata.empty()) {
@@ -2298,56 +2359,49 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
if (!out.empty()) {
line.append(out.data(), outiter - out.begin());
out.erase(out.begin(), out.end());
- return cmsysProcess_Pipe_STDOUT;
+ return WaitForLineResult::STDOUT;
}
if (!err.empty()) {
line.append(err.data(), erriter - err.begin());
err.erase(err.begin(), err.end());
- return cmsysProcess_Pipe_STDERR;
+ return WaitForLineResult::STDERR;
}
- return cmsysProcess_Pipe_None;
+ return WaitForLineResult::None;
+ }
+ if (!outData.Finished) {
+ uv_read_stop(outPipe);
+ }
+ if (!errData.Finished) {
+ uv_read_stop(errPipe);
}
}
}
#ifdef _WIN32
-static void EnsureStdPipe(DWORD fd)
+static void EnsureStdPipe(int stdFd, DWORD nStdHandle, FILE* stream,
+ const wchar_t* mode)
{
- if (GetStdHandle(fd) != INVALID_HANDLE_VALUE) {
+ if (fileno(stream) >= 0) {
return;
}
- SECURITY_ATTRIBUTES sa;
- sa.nLength = sizeof(sa);
- sa.lpSecurityDescriptor = nullptr;
- sa.bInheritHandle = TRUE;
-
- HANDLE h = CreateFileW(
- L"NUL",
- fd == STD_INPUT_HANDLE ? FILE_GENERIC_READ
- : FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES,
- FILE_SHARE_READ | FILE_SHARE_WRITE, &sa, OPEN_EXISTING, 0, nullptr);
-
- if (h == INVALID_HANDLE_VALUE) {
- LPSTR message = nullptr;
- DWORD size = FormatMessageA(
- FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- nullptr, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPSTR)&message, 0, nullptr);
- std::string msg = std::string(message, size);
- LocalFree(message);
- std::cerr << "failed to open NUL for missing stdio pipe: " << msg;
+ _close(stdFd);
+ _wfreopen(L"NUL", mode, stream);
+ int fd = fileno(stream);
+ if (fd < 0) {
+ perror("failed to open NUL for missing stdio pipe");
abort();
}
-
- SetStdHandle(fd, h);
+ if (fd != stdFd) {
+ _dup2(fd, stdFd);
+ }
+ SetStdHandle(nStdHandle, reinterpret_cast<HANDLE>(_get_osfhandle(fd)));
}
void cmSystemTools::EnsureStdPipes()
{
- EnsureStdPipe(STD_INPUT_HANDLE);
- EnsureStdPipe(STD_OUTPUT_HANDLE);
- EnsureStdPipe(STD_ERROR_HANDLE);
+ EnsureStdPipe(0, STD_INPUT_HANDLE, stdin, L"rb");
+ EnsureStdPipe(1, STD_OUTPUT_HANDLE, stdout, L"wb");
+ EnsureStdPipe(2, STD_ERROR_HANDLE, stderr, L"wb");
}
#else
static void EnsureStdPipe(int fd)
@@ -3644,6 +3698,10 @@ cm::string_view cmSystemTools::GetSystemName()
{
#if defined(_WIN32)
return "Windows";
+#elif defined(__MSYS__)
+ return "MSYS";
+#elif defined(__CYGWIN__)
+ return "CYGWIN";
#elif defined(__ANDROID__)
return "Android";
#else
@@ -3672,15 +3730,6 @@ cm::string_view cmSystemTools::GetSystemName()
if (systemName.find("kFreeBSD") != cm::string_view::npos) {
systemName = "kFreeBSD";
}
-
- // fix for CYGWIN and MSYS which have windows version in them
- if (systemName.find("CYGWIN") != cm::string_view::npos) {
- systemName = "CYGWIN";
- }
-
- if (systemName.find("MSYS") != cm::string_view::npos) {
- systemName = "MSYS";
- }
return systemName;
}
return "";
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 9563fd6..7e33e58 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -18,7 +18,8 @@
#include <cm/optional>
#include <cm/string_view>
-#include "cmsys/Process.h"
+#include <cm3p/uv.h>
+
#include "cmsys/Status.hxx" // IWYU pragma: export
#include "cmsys/SystemTools.hxx" // IWYU pragma: export
@@ -339,10 +340,20 @@ public:
*/
static void ReportLastSystemError(const char* m);
- /** a general output handler for cmsysProcess */
- static int WaitForLine(cmsysProcess* process, std::string& line,
- cmDuration timeout, std::vector<char>& out,
- std::vector<char>& err);
+ enum class WaitForLineResult
+ {
+ None,
+ STDOUT,
+ STDERR,
+ Timeout,
+ };
+
+ /** a general output handler for libuv */
+ static WaitForLineResult WaitForLine(uv_loop_t* loop, uv_stream_t* outPipe,
+ uv_stream_t* errPipe, std::string& line,
+ cmDuration timeout,
+ std::vector<char>& out,
+ std::vector<char>& err);
static void SetForceUnixPaths(bool v) { s_ForceUnixPaths = v; }
static bool GetForceUnixPaths() { return s_ForceUnixPaths; }
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index fd2d5d1..1284130 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -8,6 +8,7 @@
#include <map>
#include <set>
#include <sstream>
+#include <unordered_map>
#include <unordered_set>
#include <cm/memory>
@@ -20,6 +21,7 @@
#include "cmAlgorithms.h"
#include "cmCustomCommand.h"
#include "cmFileSet.h"
+#include "cmFindPackageStack.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
@@ -402,6 +404,7 @@ TargetProperty const StaticTargetProperties[] = {
{ "VS_DEBUGGER_COMMAND_ARGUMENTS"_s, IC::ExecutableTarget },
{ "VS_DEBUGGER_ENVIRONMENT"_s, IC::ExecutableTarget },
{ "VS_DEBUGGER_WORKING_DIRECTORY"_s, IC::ExecutableTarget },
+ { "VS_USE_DEBUG_LIBRARIES"_s, IC::NonImportedTarget },
// ---- OpenWatcom
{ "WATCOM_RUNTIME_LIBRARY"_s, IC::CanCompileSources },
// -- Language
@@ -409,6 +412,7 @@ TargetProperty const StaticTargetProperties[] = {
COMMON_LANGUAGE_PROPERTIES(C),
// ---- C++
COMMON_LANGUAGE_PROPERTIES(CXX),
+ { "CXX_MODULE_STD"_s, IC::CanCompileSources },
// ---- CSharp
{ "DOTNET_SDK"_s, IC::NonImportedTarget },
{ "DOTNET_TARGET_FRAMEWORK"_s, IC::TargetWithCommands },
@@ -438,6 +442,7 @@ TargetProperty const StaticTargetProperties[] = {
// ---- Swift
{ "Swift_LANGUAGE_VERSION"_s, IC::CanCompileSources },
{ "Swift_MODULE_DIRECTORY"_s, IC::CanCompileSources },
+ { "Swift_COMPILATION_MODE"_s, IC::CanCompileSources },
// ---- moc
{ "AUTOMOC"_s, IC::CanCompileSources },
{ "AUTOMOC_COMPILER_PREDEFINES"_s, IC::CanCompileSources },
@@ -456,6 +461,7 @@ TargetProperty const StaticTargetProperties[] = {
{ "AUTORCC_EXECUTABLE"_s, IC::CanCompileSources },
// Linking properties
+ { "LINKER_TYPE"_s, IC::CanCompileSources },
{ "ENABLE_EXPORTS"_s, IC::TargetWithSymbolExports },
{ "LINK_LIBRARIES_ONLY_TARGETS"_s, IC::NormalNonImportedTarget },
{ "LINK_SEARCH_START_STATIC"_s, IC::CanCompileSources },
@@ -549,9 +555,11 @@ TargetProperty const StaticTargetProperties[] = {
{ "ANDROID_PROCESS_MAX"_s, IC::CanCompileSources },
{ "ANDROID_SKIP_ANT_STEP"_s, IC::CanCompileSources },
// -- Autogen
+ { "AUTOGEN_COMMAND_LINE_LENGTH_MAX"_s, IC::CanCompileSources },
{ "AUTOGEN_ORIGIN_DEPENDS"_s, IC::CanCompileSources },
{ "AUTOGEN_PARALLEL"_s, IC::CanCompileSources },
{ "AUTOGEN_USE_SYSTEM_INCLUDE"_s, IC::CanCompileSources },
+ { "AUTOGEN_BETTER_GRAPH_MULTI_CONFIG"_s, IC::CanCompileSources },
// -- moc
{ "AUTOMOC_DEPEND_FILTERS"_s, IC::CanCompileSources },
// -- C++
@@ -584,11 +592,13 @@ TargetProperty const StaticTargetProperties[] = {
// Usage requirement properties
{ "LINK_INTERFACE_LIBRARIES"_s, IC::CanCompileSources },
{ "MAP_IMPORTED_CONFIG_"_s, IC::NormalTarget, R::PerConfig },
+ { "EXPORT_FIND_PACKAGE_NAME"_s, IC::NormalTarget },
// Metadata
{ "CROSSCOMPILING_EMULATOR"_s, IC::ExecutableTarget },
{ "EXPORT_COMPILE_COMMANDS"_s, IC::CanCompileSources },
{ "FOLDER"_s },
+ { "TEST_LAUNCHER"_s, IC::ExecutableTarget },
// Xcode properties
{ "XCODE_GENERATE_SCHEME"_s, IC::NeedsXcode },
@@ -660,6 +670,7 @@ public:
TLLCommands;
std::map<std::string, cmFileSet> FileSets;
cmListFileBacktrace Backtrace;
+ cmFindPackageStack FindPackageStack;
UsageRequirementProperty IncludeDirectories;
UsageRequirementProperty CompileOptions;
@@ -794,18 +805,6 @@ bool FileSetType::WriteProperties(cmTarget* tgt, cmTargetInternals* impl,
}
return true;
}
- if (prop == this->SelfEntries.PropertyName) {
- impl->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- cmStrCat(this->SelfEntries.PropertyName, " property is read-only\n"));
- return true;
- }
- if (prop == this->InterfaceEntries.PropertyName) {
- impl->Makefile->IssueMessage(MessageType::FATAL_ERROR,
- cmStrCat(this->InterfaceEntries.PropertyName,
- " property is read-only\n"));
- return true;
- }
return false;
}
@@ -960,6 +959,9 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
// Save the backtrace of target construction.
this->impl->Backtrace = this->impl->Makefile->GetBacktrace();
+ if (this->impl->IsImported()) {
+ this->impl->FindPackageStack = this->impl->Makefile->GetFindPackageStack();
+ }
if (this->IsNormal()) {
// Initialize the INCLUDE_DIRECTORIES property based on the current value
@@ -1247,6 +1249,11 @@ cmListFileBacktrace const& cmTarget::GetBacktrace() const
return this->impl->Backtrace;
}
+cmFindPackageStack const& cmTarget::GetFindPackageStack() const
+{
+ return this->impl->FindPackageStack;
+}
+
bool cmTarget::IsExecutableWithExports() const
{
return (this->GetType() == cmStateEnums::EXECUTABLE &&
@@ -1836,6 +1843,7 @@ void cmTarget::CopyImportedCxxModulesProperties(cmTarget const* tgt)
"CXX_STANDARD_REQUIRED",
"CXX_EXTENSIONS",
"CXX_VISIBILITY_PRESET",
+ "CXX_MODULE_STD",
// Static analysis
"CXX_CLANG_TIDY",
@@ -1965,7 +1973,6 @@ MAKE_PROP(CUDA_CUBIN_COMPILATION);
MAKE_PROP(CUDA_FATBIN_COMPILATION);
MAKE_PROP(CUDA_OPTIX_COMPILATION);
MAKE_PROP(CUDA_PTX_COMPILATION);
-MAKE_PROP(EXPORT_NAME);
MAKE_PROP(IMPORTED);
MAKE_PROP(IMPORTED_GLOBAL);
MAKE_PROP(INCLUDE_DIRECTORIES);
@@ -1991,43 +1998,118 @@ MAKE_PROP(INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE);
#undef MAKE_PROP
}
-void cmTarget::SetProperty(const std::string& prop, cmValue value)
+namespace {
+
+enum class ReadOnlyCondition
{
- if (prop == propMANUALLY_ADDED_DEPENDENCIES) {
- this->impl->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "MANUALLY_ADDED_DEPENDENCIES property is read-only\n");
- return;
- }
- if (prop == propNAME) {
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR,
- "NAME property is read-only\n");
- return;
- }
- if (prop == propTYPE) {
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR,
- "TYPE property is read-only\n");
- return;
+ All,
+ Imported,
+ NonImported,
+};
+
+struct ReadOnlyProperty
+{
+ ReadOnlyProperty(ReadOnlyCondition cond)
+ : Condition{ cond }
+ , Policy{} {};
+ ReadOnlyProperty(ReadOnlyCondition cond, cmPolicies::PolicyID id)
+ : Condition{ cond }
+ , Policy{ id } {};
+
+ ReadOnlyCondition Condition;
+ cm::optional<cmPolicies::PolicyID> Policy;
+
+ std::string message(const std::string& prop, cmTarget* target) const
+ {
+ std::string msg;
+ if (this->Condition == ReadOnlyCondition::All) {
+ msg = " property is read-only for target(\"";
+ } else if (this->Condition == ReadOnlyCondition::Imported) {
+ msg = " property can't be set on imported targets(\"";
+ } else if (this->Condition == ReadOnlyCondition::NonImported) {
+ msg = " property can't be set on non-imported targets(\"";
+ }
+ return cmStrCat(prop, msg, target->GetName(), "\")\n");
}
- if (prop == propEXPORT_NAME && this->IsImported()) {
- std::ostringstream e;
- e << "EXPORT_NAME property can't be set on imported targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
- return;
+
+ bool isReadOnly(const std::string& prop, cmMakefile* context,
+ cmTarget* target) const
+ {
+ auto importedTarget = target->IsImported();
+ bool matchingCondition = true;
+ if ((!importedTarget && this->Condition == ReadOnlyCondition::Imported) ||
+ (importedTarget &&
+ this->Condition == ReadOnlyCondition::NonImported)) {
+ matchingCondition = false;
+ }
+ if (!matchingCondition) {
+ // Not read-only in this scenario
+ return false;
+ }
+
+ bool readOnly = true;
+ if (!this->Policy) {
+ // No policy associated, so is always read-only
+ context->IssueMessage(MessageType::FATAL_ERROR,
+ this->message(prop, target));
+ } else {
+ switch (target->GetPolicyStatus(*this->Policy)) {
+ case cmPolicies::WARN:
+ context->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmPolicies::GetPolicyWarning(cmPolicies::CMP0160) + "\n" +
+ this->message(prop, target));
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ readOnly = false;
+ break;
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::NEW:
+ context->IssueMessage(MessageType::FATAL_ERROR,
+ this->message(prop, target));
+ break;
+ }
+ }
+ return readOnly;
}
- if (prop == propSOURCES && this->IsImported()) {
- std::ostringstream e;
- e << "SOURCES property can't be set on imported targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
- return;
+};
+
+bool IsSetableProperty(cmMakefile* context, cmTarget* target,
+ const std::string& prop)
+{
+ using ROC = ReadOnlyCondition;
+ static std::unordered_map<std::string, ReadOnlyProperty> const readOnlyProps{
+ { "EXPORT_NAME", { ROC::Imported } },
+ { "HEADER_SETS", { ROC::All } },
+ { "IMPORTED_GLOBAL", { ROC::NonImported } },
+ { "INTERFACE_HEADER_SETS", { ROC::All } },
+ { "MANUALLY_ADDED_DEPENDENCIES", { ROC::All } },
+ { "NAME", { ROC::All } },
+ { "SOURCES", { ROC::Imported } },
+ { "TYPE", { ROC::All } },
+ { "ALIAS_GLOBAL", { ROC::All, cmPolicies::CMP0160 } },
+ { "BINARY_DIR", { ROC::All, cmPolicies::CMP0160 } },
+ { "CXX_MODULE_SETS", { ROC::All, cmPolicies::CMP0160 } },
+ { "IMPORTED", { ROC::All, cmPolicies::CMP0160 } },
+ { "INTERFACE_CXX_MODULE_SETS", { ROC::All, cmPolicies::CMP0160 } },
+ { "LOCATION", { ROC::All, cmPolicies::CMP0160 } },
+ { "LOCATION_CONFIG", { ROC::All, cmPolicies::CMP0160 } },
+ { "SOURCE_DIR", { ROC::All, cmPolicies::CMP0160 } }
+ };
+
+ auto it = readOnlyProps.find(prop);
+
+ if (it != readOnlyProps.end()) {
+ return !(it->second.isReadOnly(prop, context, target));
}
- if (prop == propIMPORTED_GLOBAL && !this->IsImported()) {
- std::ostringstream e;
- e << "IMPORTED_GLOBAL property can't be set on non-imported targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ return true;
+}
+}
+
+void cmTarget::SetProperty(const std::string& prop, cmValue value)
+{
+ if (!IsSetableProperty(this->impl->Makefile, this, prop)) {
return;
}
@@ -2071,7 +2153,7 @@ void cmTarget::SetProperty(const std::string& prop, cmValue value)
}
if (prop == propIMPORTED_GLOBAL) {
- if (!cmIsOn(value)) {
+ if (!value.IsOn()) {
std::ostringstream e;
e << "IMPORTED_GLOBAL property can't be set to FALSE on targets (\""
<< this->impl->Name << "\")\n";
@@ -2172,40 +2254,23 @@ void cmTarget::AppendProperty(const std::string& prop,
cm::optional<cmListFileBacktrace> const& bt,
bool asString)
{
- if (prop == "NAME") {
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR,
- "NAME property is read-only\n");
- return;
- }
- if (prop == "EXPORT_NAME" && this->IsImported()) {
- std::ostringstream e;
- e << "EXPORT_NAME property can't be set on imported targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
- return;
- }
- if (prop == "SOURCES" && this->IsImported()) {
- std::ostringstream e;
- e << "SOURCES property can't be set on imported targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ if (!IsSetableProperty(this->impl->Makefile, this, prop)) {
return;
}
if (prop == "IMPORTED_GLOBAL") {
- std::ostringstream e;
- e << "IMPORTED_GLOBAL property can't be appended, only set on imported "
- "targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
- return;
+ this->impl->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("IMPORTED_GLOBAL property can't be appended, only set on "
+ "imported targets (\"",
+ this->impl->Name, "\")\n"));
}
if (prop == propPRECOMPILE_HEADERS &&
this->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM")) {
- std::ostringstream e;
- e << "PRECOMPILE_HEADERS_REUSE_FROM property is already set on target "
- "(\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ this->impl->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(
+ "PRECOMPILE_HEADERS_REUSE_FROM property is already set on target (\"",
+ this->impl->Name, "\")\n"));
return;
}
@@ -2782,7 +2847,7 @@ std::string const& cmTarget::GetSafeProperty(std::string const& prop) const
bool cmTarget::GetPropertyAsBool(const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
cmPropertyMap const& cmTarget::GetProperties() const
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 584856a..385dfe7 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -24,6 +24,7 @@
class cmCustomCommand;
class cmFileSet;
+class cmFindPackageStack;
class cmGlobalGenerator;
class cmInstallTargetGenerator;
class cmMakefile;
@@ -239,6 +240,9 @@ public:
//! Get a backtrace from the creation of the target.
cmListFileBacktrace const& GetBacktrace() const;
+ //! Get a find_package call stack from the creation of the target.
+ cmFindPackageStack const& GetFindPackageStack() const;
+
void InsertInclude(BT<std::string> const& entry, bool before = false);
void InsertCompileOption(BT<std::string> const& entry, bool before = false);
void InsertCompileDefinition(BT<std::string> const& entry);
diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h
index 1cef888..caeb54d 100644
--- a/Source/cmTargetExport.h
+++ b/Source/cmTargetExport.h
@@ -4,6 +4,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <map>
#include <string>
class cmFileSet;
@@ -37,4 +38,5 @@ public:
///@}
bool NamelinkOnly = false;
+ std::string XcFrameworkLocation;
};
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index b0d9c2d..8a39144 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -9,6 +9,7 @@
cmTest::cmTest(cmMakefile* mf)
: Backtrace(mf->GetBacktrace())
+ , PolicyStatusCMP0158(mf->GetPolicyStatus(cmPolicies::CMP0158))
{
this->Makefile = mf;
this->OldStyle = true;
@@ -49,7 +50,7 @@ cmValue cmTest::GetProperty(const std::string& prop) const
bool cmTest::GetPropertyAsBool(const std::string& prop) const
{
- return cmIsOn(this->GetProperty(prop));
+ return this->GetProperty(prop).IsOn();
}
void cmTest::SetProperty(const std::string& prop, cmValue value)
diff --git a/Source/cmTest.h b/Source/cmTest.h
index 8b50b87..480966a 100644
--- a/Source/cmTest.h
+++ b/Source/cmTest.h
@@ -9,6 +9,7 @@
#include <vector>
#include "cmListFileCache.h"
+#include "cmPolicies.h"
#include "cmPropertyMap.h"
#include "cmValue.h"
@@ -60,6 +61,12 @@ public:
bool GetOldStyle() const { return this->OldStyle; }
void SetOldStyle(bool b) { this->OldStyle = b; }
+ /** Get/Set if CMP0158 policy is NEW */
+ bool GetCMP0158IsNew() const
+ {
+ return this->PolicyStatusCMP0158 == cmPolicies::NEW;
+ }
+
/** Set/Get whether lists in command lines should be expanded. */
bool GetCommandExpandLists() const;
void SetCommandExpandLists(bool b);
@@ -74,4 +81,5 @@ private:
cmMakefile* Makefile;
cmListFileBacktrace Backtrace;
+ cmPolicies::PolicyStatus PolicyStatusCMP0158;
};
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index ca1226a..840d8cf 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -168,16 +168,32 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// Use the target file on disk.
exe = target->GetFullPath(config);
- // Prepend with the emulator when cross compiling if required.
- cmValue emulator = target->GetProperty("CROSSCOMPILING_EMULATOR");
- if (cmNonempty(emulator)) {
- cmList emulatorWithArgs{ *emulator };
- std::string emulatorExe(emulatorWithArgs[0]);
- cmSystemTools::ConvertToUnixSlashes(emulatorExe);
- os << cmOutputConverter::EscapeForCMake(emulatorExe) << " ";
- for (std::string const& arg : cmMakeRange(emulatorWithArgs).advance(1)) {
- os << cmOutputConverter::EscapeForCMake(arg) << " ";
+ auto addLauncher = [this, &config, &ge, &os,
+ target](std::string const& propertyName) {
+ cmValue launcher = target->GetProperty(propertyName);
+ if (!cmNonempty(launcher)) {
+ return;
+ }
+ cmList launcherWithArgs{ ge.Parse(*launcher)->Evaluate(this->LG,
+ config) };
+ if (!launcherWithArgs.empty() && !launcherWithArgs[0].empty()) {
+ std::string launcherExe(launcherWithArgs[0]);
+ cmSystemTools::ConvertToUnixSlashes(launcherExe);
+ os << cmOutputConverter::EscapeForCMake(launcherExe) << " ";
+ for (std::string const& arg :
+ cmMakeRange(launcherWithArgs).advance(1)) {
+ os << cmOutputConverter::EscapeForCMake(arg) << " ";
+ }
}
+ };
+
+ // Prepend with the test launcher if specified.
+ addLauncher("TEST_LAUNCHER");
+
+ // Prepend with the emulator when cross compiling if required.
+ if (!this->GetTest()->GetCMP0158IsNew() ||
+ this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")) {
+ addLauncher("CROSSCOMPILING_EMULATOR");
}
} else {
// Use the command name given.
diff --git a/Source/cmTransformDepfile.cxx b/Source/cmTransformDepfile.cxx
index 914172b..ffc4de9 100644
--- a/Source/cmTransformDepfile.cxx
+++ b/Source/cmTransformDepfile.cxx
@@ -16,6 +16,9 @@
#include "cmGccDepfileReaderTypes.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
+#include "cmMakefile.h"
+#include "cmMessageType.h"
+#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
namespace {
@@ -121,6 +124,10 @@ bool cmTransformDepfile(cmDepfileFormat format, const cmLocalGenerator& lg,
return false;
}
content = *std::move(result);
+ } else {
+ lg.GetMakefile()->IssueMessage(
+ MessageType::WARNING,
+ cmStrCat("Expected depfile does not exist.\n ", infile));
}
cmSystemTools::MakeDirectory(cmSystemTools::GetFilenamePath(outfile));
diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx
index 34e6a70..168f1a6 100644
--- a/Source/cmUVHandlePtr.cxx
+++ b/Source/cmUVHandlePtr.cxx
@@ -6,6 +6,9 @@
#include <cassert>
#include <cstdlib>
#include <mutex>
+#include <utility>
+
+#include <cm/memory>
#include <cm3p/uv.h>
@@ -44,7 +47,7 @@ void uv_loop_ptr::reset()
this->loop.reset();
}
-uv_loop_ptr::operator uv_loop_t*()
+uv_loop_ptr::operator uv_loop_t*() const
{
return this->loop.get();
}
@@ -54,6 +57,11 @@ uv_loop_t* uv_loop_ptr::operator->() const noexcept
return this->loop.get();
}
+uv_loop_t& uv_loop_ptr::operator*() const
+{
+ return *this->loop;
+}
+
uv_loop_t* uv_loop_ptr::get() const
{
return this->loop.get();
@@ -97,13 +105,19 @@ void uv_handle_ptr_base_<T>::allocate(void* data)
}
template <typename T>
+uv_handle_ptr_base_<T>::operator bool() const
+{
+ return this->handle.get();
+}
+
+template <typename T>
void uv_handle_ptr_base_<T>::reset()
{
this->handle.reset();
}
template <typename T>
-uv_handle_ptr_base_<T>::operator uv_handle_t*()
+uv_handle_ptr_base_<T>::operator uv_handle_t*() const
{
return reinterpret_cast<uv_handle_t*>(this->handle.get());
}
@@ -235,6 +249,12 @@ int uv_timer_ptr::start(uv_timer_cb cb, uint64_t timeout, uint64_t repeat)
return uv_timer_start(*this, cb, timeout, repeat);
}
+void uv_timer_ptr::stop()
+{
+ assert(this->handle);
+ uv_timer_stop(*this);
+}
+
#ifndef CMAKE_BOOTSTRAP
uv_tty_ptr::operator uv_stream_t*() const
{
@@ -248,12 +268,32 @@ int uv_tty_ptr::init(uv_loop_t& loop, int fd, int readable, void* data)
}
#endif
+int uv_idle_ptr::init(uv_loop_t& loop, void* data)
+{
+ this->allocate(data);
+ return uv_idle_init(&loop, *this);
+}
+
+int uv_idle_ptr::start(uv_idle_cb cb)
+{
+ assert(this->handle);
+ return uv_idle_start(*this, cb);
+}
+
+void uv_idle_ptr::stop()
+{
+ assert(this->handle);
+ uv_idle_stop(*this);
+}
+
template class uv_handle_ptr_base_<uv_handle_t>;
#define UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(NAME) \
template class uv_handle_ptr_base_<uv_##NAME##_t>; \
template class uv_handle_ptr_<uv_##NAME##_t>;
+UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(idle)
+
UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(signal)
UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(pipe)
@@ -269,4 +309,38 @@ UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(async)
UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(tty)
#endif
+
+namespace {
+struct write_req : public uv_write_t
+{
+ std::weak_ptr<std::function<void(int)>> cb_;
+ write_req(std::weak_ptr<std::function<void(int)>> wcb)
+ : cb_(std::move(wcb))
+ {
+ }
+};
+
+void write_req_cb(uv_write_t* req, int status)
+{
+ // Ownership has been transferred from the event loop.
+ std::unique_ptr<write_req> self(static_cast<write_req*>(req));
+
+ // Notify the original uv_write caller if it is still interested.
+ if (auto cb = self->cb_.lock()) {
+ (*cb)(status);
+ }
+}
+}
+
+int uv_write(uv_stream_t* handle, const uv_buf_t bufs[], unsigned int nbufs,
+ std::weak_ptr<std::function<void(int)>> cb)
+{
+ auto req = cm::make_unique<write_req>(std::move(cb));
+ int status = uv_write(req.get(), handle, bufs, nbufs, write_req_cb);
+ if (status == 0) {
+ // Ownership has been transferred to the event loop.
+ static_cast<void>(req.release());
+ }
+ return status;
+}
}
diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h
index 027d690..b8b3491 100644
--- a/Source/cmUVHandlePtr.h
+++ b/Source/cmUVHandlePtr.h
@@ -5,6 +5,7 @@
#include <cstddef>
#include <cstdint>
+#include <functional>
#include <memory>
#include <type_traits>
@@ -61,10 +62,11 @@ public:
* Allow less verbose calling of uv_loop_* functions
* @return reinterpreted handle
*/
- operator uv_loop_t*();
+ operator uv_loop_t*() const;
uv_loop_t* get() const;
uv_loop_t* operator->() const noexcept;
+ uv_loop_t& operator*() const;
};
/***
@@ -130,6 +132,16 @@ public:
uv_handle_ptr_base_(std::nullptr_t) {}
~uv_handle_ptr_base_() { this->reset(); }
+#if defined(__SUNPRO_CC)
+ // The Oracle Studio compiler recognizes 'explicit operator bool()' in
+ // 'if(foo)' but not 'if(foo && ...)'. The purpose of 'explicit' here
+ // is to avoid accidental conversion in non-boolean contexts. Just
+ // leave it out on this compiler so we can compile valid code.
+ operator bool() const;
+#else
+ explicit operator bool() const;
+#endif
+
/**
* Properly close the handle if needed and sets the inner handle to nullptr
*/
@@ -139,7 +151,7 @@ public:
* Allow less verbose calling of uv_handle_* functions
* @return reinterpreted handle
*/
- operator uv_handle_t*();
+ operator uv_handle_t*() const;
T* get() const;
T* operator->() const noexcept;
@@ -194,6 +206,17 @@ public:
void send();
};
+struct uv_idle_ptr : public uv_handle_ptr_<uv_idle_t>
+{
+ CM_INHERIT_CTOR(uv_idle_ptr, uv_handle_ptr_, <uv_idle_t>);
+
+ int init(uv_loop_t& loop, void* data = nullptr);
+
+ int start(uv_idle_cb cb);
+
+ void stop();
+};
+
struct uv_signal_ptr : public uv_handle_ptr_<uv_signal_t>
{
CM_INHERIT_CTOR(uv_signal_ptr, uv_handle_ptr_, <uv_signal_t>);
@@ -229,6 +252,8 @@ struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t>
int init(uv_loop_t& loop, void* data = nullptr);
int start(uv_timer_cb cb, uint64_t timeout, uint64_t repeat);
+
+ void stop();
};
struct uv_tty_ptr : public uv_handle_ptr_<uv_tty_t>
@@ -253,6 +278,8 @@ extern template class uv_handle_ptr_base_<uv_handle_t>;
UV_HANDLE_PTR_INSTANTIATE_EXTERN(async)
+UV_HANDLE_PTR_INSTANTIATE_EXTERN(idle)
+
UV_HANDLE_PTR_INSTANTIATE_EXTERN(signal)
UV_HANDLE_PTR_INSTANTIATE_EXTERN(pipe)
@@ -268,4 +295,27 @@ UV_HANDLE_PTR_INSTANTIATE_EXTERN(tty)
# undef UV_HANDLE_PTR_INSTANTIATE_EXTERN
#endif
+
+/**
+ * Wraps uv_write to add synchronous cancellation.
+ *
+ * libuv provides no way to synchronously cancel a write request.
+ * Closing a write handle will cancel its pending write request, but its
+ * callback will still be called asynchronously later with UV_ECANCELED.
+ *
+ * This wrapper provides a solution by handing ownership of the uv_write_t
+ * request object to the event loop and taking it back in the callback.
+ * Use this in combination with uv_loop_ptr to ensure the event loop
+ * runs to completion and cleans up all resources.
+ *
+ * The caller may optionally provide a callback it owns with std::shared_ptr.
+ * If the caller's lifetime ends before the write request completes, the
+ * callback can be safely deleted and will not be called.
+ *
+ * The bufs array does not need to live beyond this call, but the memory
+ * referenced by the uv_buf_t values must remain alive until the callback
+ * is made or the stream is closed.
+ */
+int uv_write(uv_stream_t* handle, const uv_buf_t bufs[], unsigned int nbufs,
+ std::weak_ptr<std::function<void(int)>> cb);
}
diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx
index b0f1cf1..b787f19 100644
--- a/Source/cmUVProcessChain.cxx
+++ b/Source/cmUVProcessChain.cxx
@@ -40,7 +40,8 @@ struct cmUVProcessChain::InternalData
bool Valid = false;
- cm::uv_loop_ptr Loop;
+ cm::uv_loop_ptr BuiltinLoop;
+ uv_loop_t* Loop;
StreamData InputStreamData;
StreamData OutputStreamData;
@@ -71,6 +72,19 @@ cmUVProcessChainBuilder& cmUVProcessChainBuilder::AddCommand(
return *this;
}
+cmUVProcessChainBuilder& cmUVProcessChainBuilder::SetBuiltinLoop()
+{
+ this->Loop = nullptr;
+ return *this;
+}
+
+cmUVProcessChainBuilder& cmUVProcessChainBuilder::SetExternalLoop(
+ uv_loop_t& loop)
+{
+ this->Loop = &loop;
+ return *this;
+}
+
cmUVProcessChainBuilder& cmUVProcessChainBuilder::SetNoStream(Stream stdio)
{
switch (stdio) {
@@ -142,6 +156,11 @@ cmUVProcessChainBuilder& cmUVProcessChainBuilder::SetWorkingDirectory(
return *this;
}
+uv_loop_t* cmUVProcessChainBuilder::GetLoop() const
+{
+ return this->Loop;
+}
+
cmUVProcessChain cmUVProcessChainBuilder::Start() const
{
cmUVProcessChain chain;
@@ -165,6 +184,13 @@ bool cmUVProcessChain::InternalData::Prepare(
{
this->Builder = builder;
+ if (this->Builder->Loop) {
+ this->Loop = this->Builder->Loop;
+ } else {
+ this->BuiltinLoop.init();
+ this->Loop = this->BuiltinLoop;
+ }
+
auto const& input =
this->Builder->Stdio[cmUVProcessChainBuilder::Stream_INPUT];
auto& inputData = this->InputStreamData;
@@ -365,7 +391,6 @@ void cmUVProcessChain::InternalData::Finish()
cmUVProcessChain::cmUVProcessChain()
: Data(cm::make_unique<InternalData>())
{
- this->Data->Loop.init();
}
cmUVProcessChain::cmUVProcessChain(cmUVProcessChain&& other) noexcept
diff --git a/Source/cmUVProcessChain.h b/Source/cmUVProcessChain.h
index aa63ba1..65816e2 100644
--- a/Source/cmUVProcessChain.h
+++ b/Source/cmUVProcessChain.h
@@ -31,6 +31,8 @@ public:
cmUVProcessChainBuilder& AddCommand(
const std::vector<std::string>& arguments);
+ cmUVProcessChainBuilder& SetBuiltinLoop();
+ cmUVProcessChainBuilder& SetExternalLoop(uv_loop_t& loop);
cmUVProcessChainBuilder& SetNoStream(Stream stdio);
cmUVProcessChainBuilder& SetBuiltinStream(Stream stdio);
cmUVProcessChainBuilder& SetMergedBuiltinStreams();
@@ -38,6 +40,8 @@ public:
cmUVProcessChainBuilder& SetExternalStream(Stream stdio, FILE* stream);
cmUVProcessChainBuilder& SetWorkingDirectory(std::string dir);
+ uv_loop_t* GetLoop() const;
+
cmUVProcessChain Start() const;
private:
@@ -65,6 +69,7 @@ private:
std::vector<ProcessConfiguration> Processes;
std::string WorkingDirectory;
bool MergedBuiltinStreams = false;
+ uv_loop_t* Loop = nullptr;
};
class cmUVProcessChain
diff --git a/Source/cmUVSignalHackRAII.h b/Source/cmUVSignalHackRAII.h
deleted file mode 100644
index 60e4ca8..0000000
--- a/Source/cmUVSignalHackRAII.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#pragma once
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include <cm3p/uv.h>
-
-#if defined(CMAKE_USE_SYSTEM_LIBUV) && !defined(_WIN32) && \
- UV_VERSION_MAJOR == 1 && UV_VERSION_MINOR < 19
-# define CMAKE_UV_SIGNAL_HACK
-# include "cmUVHandlePtr.h"
-/*
- libuv does not use SA_RESTART on its signal handler, but C++ streams
- depend on it for reliable i/o operations. This RAII helper convinces
- libuv to install its handler, and then revises the handler to add the
- SA_RESTART flag. We use a distinct uv loop that never runs to avoid
- ever really getting a callback. libuv may fill the hack loop's signal
- pipe and then stop writing, but that won't break any real loops.
- */
-class cmUVSignalHackRAII
-{
- uv_loop_t HackLoop;
- cm::uv_signal_ptr HackSignal;
- static void HackCB(uv_signal_t*, int) {}
-
-public:
- cmUVSignalHackRAII()
- {
- uv_loop_init(&this->HackLoop);
- this->HackSignal.init(this->HackLoop);
- this->HackSignal.start(HackCB, SIGCHLD);
- struct sigaction hack_sa;
- sigaction(SIGCHLD, nullptr, &hack_sa);
- if (!(hack_sa.sa_flags & SA_RESTART)) {
- hack_sa.sa_flags |= SA_RESTART;
- sigaction(SIGCHLD, &hack_sa, nullptr);
- }
- }
- ~cmUVSignalHackRAII()
- {
- this->HackSignal.stop();
- uv_loop_close(&this->HackLoop);
- }
-};
-#endif
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 73fd89f..0fb8bae 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1177,7 +1177,7 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReference(
const char* privateReference = "True";
if (cmValue value = this->GeneratorTarget->GetProperty(
"VS_DOTNET_REFERENCES_COPY_LOCAL")) {
- if (cmIsOff(*value)) {
+ if (value.IsOff()) {
privateReference = "False";
}
}
@@ -1522,7 +1522,6 @@ void cmVisualStudio10TargetGenerator::WriteCEDebugProjectConfigurationValues(
void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
Elem& e1, std::string const& config)
{
- cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
cmValue mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG");
if (mfcFlag) {
std::string const mfcFlagValue =
@@ -1553,12 +1552,9 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
} else {
e1.Element("CharacterSet", "MultiByte");
}
- if (cmValue projectToolsetOverride =
- this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) {
- e1.Element("PlatformToolset", *projectToolsetOverride);
- } else if (const char* toolset = gg->GetPlatformToolset()) {
- e1.Element("PlatformToolset", toolset);
- }
+
+ this->WriteMSToolConfigurationValuesCommon(e1, config);
+
if (this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
this->GeneratorTarget->GetPropertyAsBool("VS_WINRT_EXTENSIONS")) {
e1.Element("WindowsAppContainer", "true");
@@ -1589,11 +1585,9 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
return;
}
- cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
-
Options& o = *(this->ClOptions[config]);
- if (o.IsDebug()) {
+ if (o.UsingDebugInfo()) {
e1.Element("DebugSymbols", "true");
e1.Element("DefineDebug", "true");
}
@@ -1608,12 +1602,7 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
o.RemoveFlag("Platform");
}
- if (cmValue projectToolsetOverride =
- this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) {
- e1.Element("PlatformToolset", *projectToolsetOverride);
- } else if (const char* toolset = gg->GetPlatformToolset()) {
- e1.Element("PlatformToolset", toolset);
- }
+ this->WriteMSToolConfigurationValuesCommon(e1, config);
std::string postfixName =
cmStrCat(cmSystemTools::UpperCase(config), "_POSTFIX");
@@ -1633,6 +1622,50 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
oh.OutputFlagMap();
}
+void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesCommon(
+ Elem& e1, std::string const& config)
+{
+ cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
+ if (cmValue projectToolsetOverride =
+ this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) {
+ e1.Element("PlatformToolset", *projectToolsetOverride);
+ } else if (const char* toolset = gg->GetPlatformToolset()) {
+ e1.Element("PlatformToolset", toolset);
+ }
+
+ cm::optional<bool> maybeUseDebugLibraries;
+ if (cmValue useDebugLibrariesProp =
+ this->GeneratorTarget->GetProperty("VS_USE_DEBUG_LIBRARIES")) {
+ // The project explicitly specified a value for this target.
+ // An empty string suppresses generation of the setting altogether.
+ std::string const useDebugLibraries = cmGeneratorExpression::Evaluate(
+ *useDebugLibrariesProp, this->LocalGenerator, config);
+ if (!useDebugLibraries.empty()) {
+ maybeUseDebugLibraries = cmIsOn(useDebugLibraries);
+ }
+ } else if (this->GeneratorTarget->GetPolicyStatusCMP0162() ==
+ cmPolicies::NEW) {
+ // The project did not explicitly specify a value for this target.
+ // If the target compiles sources for a known MSVC runtime library,
+ // base our default value on that.
+ if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
+ maybeUseDebugLibraries = this->ClOptions[config]->UsingDebugRuntime();
+ }
+ // For other targets, such as UTILITY targets, base our default
+ // on the configuration name.
+ if (!maybeUseDebugLibraries) {
+ maybeUseDebugLibraries = cmSystemTools::UpperCase(config) == "DEBUG"_s;
+ }
+ }
+ if (maybeUseDebugLibraries) {
+ if (*maybeUseDebugLibraries) {
+ e1.Element("UseDebugLibraries", "true");
+ } else {
+ e1.Element("UseDebugLibraries", "false");
+ }
+ }
+}
+
//----------------------------------------------------------------------------
void cmVisualStudio10TargetGenerator::WriteNsightTegraConfigurationValues(
Elem& e1, std::string const&)
@@ -2051,6 +2084,18 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
"gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms");
}
}
+ {
+ if (cmValue p = this->GeneratorTarget->GetProperty("VS_FILTER_PROPS")) {
+ auto props = *p;
+ if (!props.empty()) {
+ ConvertToWindowsSlash(props);
+ Elem(e0, "Import")
+ .Attribute("Project", props)
+ .Attribute("Condition", cmStrCat("exists('", props, "')"))
+ .Attribute("Label", "LocalAppDataPlatform");
+ }
+ }
+ }
}
fout << '\n';
@@ -3008,6 +3053,16 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
e1.WritePlatformConfigTag(
"IntDir", cond, R"($(Platform)\$(Configuration)\$(ProjectName)\)");
} else {
+ if (ttype == cmStateEnums::SHARED_LIBRARY ||
+ ttype == cmStateEnums::MODULE_LIBRARY ||
+ ttype == cmStateEnums::EXECUTABLE) {
+ auto linker = this->GeneratorTarget->GetLinkerTool(config);
+ if (!linker.empty()) {
+ ConvertToWindowsSlash(linker);
+ e1.WritePlatformConfigTag("LinkToolExe", cond, linker);
+ }
+ }
+
std::string intermediateDir = cmStrCat(
this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget), '/',
config, '/');
@@ -3158,7 +3213,10 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
Options& linkOptions = *(this->LinkOptions[configName]);
const std::string cond = this->CalcCondition(configName);
- if (this->IPOEnabledConfigurations.count(configName) == 0) {
+ if (this->IPOEnabledConfigurations.count(configName) > 0) {
+ // Suppress LinkIncremental in favor of WholeProgramOptimization.
+ e1.WritePlatformConfigTag("LinkIncremental", cond, "");
+ } else {
const char* incremental = linkOptions.GetFlag("LinkIncremental");
e1.WritePlatformConfigTag("LinkIncremental", cond,
(incremental ? incremental : "true"));
@@ -3503,6 +3561,26 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
clOptions.RemoveFlag("CompileAs");
}
+ if (this->ProjectType == VsProjectType::vcxproj && this->MSTools) {
+ // Suppress Microsoft.Cl.Common.props default settings for which the
+ // project specifies no flags. Do not let UseDebugLibraries affect them.
+ if (!clOptions.HasFlag("BasicRuntimeChecks")) {
+ clOptions.AddFlag("BasicRuntimeChecks", "Default");
+ }
+ if (!clOptions.HasFlag("MinimalRebuild")) {
+ clOptions.AddFlag("MinimalRebuild", "");
+ }
+ if (!clOptions.HasFlag("Optimization")) {
+ clOptions.AddFlag("Optimization", "");
+ }
+ if (!clOptions.HasFlag("RuntimeLibrary")) {
+ clOptions.AddFlag("RuntimeLibrary", "");
+ }
+ if (!clOptions.HasFlag("SupportJustMyCode")) {
+ clOptions.AddFlag("SupportJustMyCode", "");
+ }
+ }
+
this->ClOptions[configName] = std::move(pOptions);
return true;
}
@@ -3545,7 +3623,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
// without value so PDBs don't get generated uselessly. Each tag
// goes on its own line because Visual Studio corrects it this
// way when saving the project after CMake generates it.
- if (!clOptions.IsDebug()) {
+ if (!clOptions.UsingDebugInfo()) {
Elem e3(e2, "DebugInformationFormat");
e3.SetHasElements();
}
@@ -4166,9 +4244,9 @@ void cmVisualStudio10TargetGenerator::WriteManifestOptions(
if (dpiAware) {
if (*dpiAware == "PerMonitor"_s) {
e2.Element("EnableDpiAwareness", "PerMonitorHighDPIAware");
- } else if (cmIsOn(*dpiAware)) {
+ } else if (dpiAware.IsOn()) {
e2.Element("EnableDpiAwareness", "true");
- } else if (cmIsOff(*dpiAware)) {
+ } else if (dpiAware.IsOff()) {
e2.Element("EnableDpiAwareness", "false");
} else {
cmSystemTools::Error(
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 1f8b2eb..056f426 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -72,6 +72,8 @@ private:
void WriteCEDebugProjectConfigurationValues(Elem& e0);
void WriteMSToolConfigurationValuesManaged(Elem& e1,
std::string const& config);
+ void WriteMSToolConfigurationValuesCommon(Elem& e1,
+ std::string const& config);
void WriteHeaderSource(Elem& e1, cmSourceFile const* sf,
ConfigToSettings const& toolSettings);
void WriteExtraSource(Elem& e1, cmSourceFile const* sf,
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 6188134..659510c 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -110,7 +110,7 @@ void cmVisualStudioGeneratorOptions::SetVerboseMakefile(bool verbose)
}
}
-bool cmVisualStudioGeneratorOptions::IsDebug() const
+bool cmVisualStudioGeneratorOptions::UsingDebugInfo() const
{
if (this->CurrentTool != CSharpCompiler) {
return this->FlagMap.find("DebugInformationFormat") != this->FlagMap.end();
@@ -124,6 +124,15 @@ bool cmVisualStudioGeneratorOptions::IsDebug() const
return false;
}
+cm::optional<bool> cmVisualStudioGeneratorOptions::UsingDebugRuntime() const
+{
+ cm::optional<bool> result;
+ if (const char* rtl = this->GetFlag("RuntimeLibrary")) {
+ result = strstr(rtl, "Debug") != nullptr;
+ }
+ return result;
+}
+
bool cmVisualStudioGeneratorOptions::IsWinRt() const
{
return this->FlagMap.find("CompileAsWinRT") != this->FlagMap.end();
@@ -137,14 +146,18 @@ bool cmVisualStudioGeneratorOptions::IsManaged() const
bool cmVisualStudioGeneratorOptions::UsingUnicode() const
{
// Look for a _UNICODE definition.
- return std::any_of(this->Defines.begin(), this->Defines.end(),
- [](std::string const& di) { return di == "_UNICODE"_s; });
+ return std::any_of(
+ this->Defines.begin(), this->Defines.end(), [](std::string const& di) {
+ return di == "_UNICODE"_s || cmHasLiteralPrefix(di, "_UNICODE=");
+ });
}
bool cmVisualStudioGeneratorOptions::UsingSBCS() const
{
// Look for a _SBCS definition.
- return std::any_of(this->Defines.begin(), this->Defines.end(),
- [](std::string const& di) { return di == "_SBCS"_s; });
+ return std::any_of(
+ this->Defines.begin(), this->Defines.end(), [](std::string const& di) {
+ return di == "_SBCS"_s || cmHasLiteralPrefix(di, "_SBCS=");
+ });
}
void cmVisualStudioGeneratorOptions::FixCudaCodeGeneration()
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 20e2d22..1ca569d 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -7,6 +7,8 @@
#include <iosfwd>
#include <string>
+#include <cm/optional>
+
#include "cmGlobalVisualStudioGenerator.h"
#include "cmIDEFlagTable.h"
#include "cmIDEOptions.h"
@@ -65,7 +67,8 @@ public:
void FixManifestUACFlags();
- bool IsDebug() const;
+ bool UsingDebugInfo() const;
+ cm::optional<bool> UsingDebugRuntime() const;
bool IsWinRt() const;
bool IsManaged() const;
// Write options to output.
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index e80d1fc..6b454d7 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -105,6 +105,10 @@ bool cmWhileFunctionBlocker::Replay(std::vector<cmListFileFunction> functions,
if (status.GetContinueInvoked()) {
break;
}
+ if (status.HasExitCode()) {
+ inStatus.SetExitCode(status.GetExitCode());
+ return true;
+ }
if (cmSystemTools::GetFatalErrorOccurred()) {
return true;
}
diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx
index 27cdbba..dd8f459 100644
--- a/Source/cmWorkerPool.cxx
+++ b/Source/cmWorkerPool.cxx
@@ -18,7 +18,6 @@
#include "cmRange.h"
#include "cmStringAlgorithms.h"
#include "cmUVHandlePtr.h"
-#include "cmUVSignalHackRAII.h" // IWYU pragma: keep
/**
* @brief libuv pipe buffer class
@@ -516,9 +515,6 @@ public:
static void UVSlotEnd(uv_async_t* handle);
// -- UV loop
-#ifdef CMAKE_UV_SIGNAL_HACK
- std::unique_ptr<cmUVSignalHackRAII> UVHackRAII;
-#endif
std::unique_ptr<uv_loop_t> UVLoop;
cm::uv_async_ptr UVRequestBegin;
cm::uv_async_ptr UVRequestEnd;
@@ -563,9 +559,6 @@ cmWorkerPoolInternal::cmWorkerPoolInternal(cmWorkerPool* pool)
{
// Initialize libuv loop
uv_disable_stdio_inheritance();
-#ifdef CMAKE_UV_SIGNAL_HACK
- UVHackRAII = cm::make_unique<cmUVSignalHackRAII>();
-#endif
this->UVLoop = cm::make_unique<uv_loop_t>();
uv_loop_init(this->UVLoop.get());
}
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index 80327e4..12272d1 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -77,7 +77,7 @@ void cmXCodeScheme::WriteXCodeXCScheme(std::ostream& fout,
WriteBuildAction(xout, container);
WriteTestAction(xout, FindConfiguration("Debug"), container);
WriteLaunchAction(xout, FindConfiguration(launchConfiguration), container);
- WriteProfileAction(xout, FindConfiguration("Release"));
+ WriteProfileAction(xout, FindConfiguration("Release"), container);
WriteAnalyzeAction(xout, FindConfiguration("Debug"));
WriteArchiveAction(xout, FindConfiguration("Release"));
@@ -240,18 +240,13 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
// Diagnostics tab end
if (IsExecutable(this->Target)) {
- xout.StartElement("BuildableProductRunnable");
- xout.BreakAttributes();
- xout.Attribute("runnableDebuggingMode", "0");
-
+ WriteBuildableProductRunnable(xout, this->Target, container);
} else {
xout.StartElement("MacroExpansion");
+ WriteBuildableReference(xout, this->Target, container);
+ xout.EndElement();
}
- WriteBuildableReference(xout, this->Target, container);
-
- xout.EndElement(); // MacroExpansion
-
// Info tab begin
if (cmValue exe =
@@ -374,7 +369,7 @@ bool cmXCodeScheme::WriteLaunchActionBooleanAttribute(
bool defaultValue)
{
cmValue property = Target->GetTarget()->GetProperty(varName);
- bool isOn = (!property && defaultValue) || cmIsOn(property);
+ bool isOn = (!property && defaultValue) || property.IsOn();
if (isOn) {
xout.Attribute(attrName.c_str(), "YES");
@@ -404,7 +399,8 @@ bool cmXCodeScheme::WriteLaunchActionAdditionalOption(
}
void cmXCodeScheme::WriteProfileAction(cmXMLWriter& xout,
- const std::string& configuration)
+ const std::string& configuration,
+ const std::string& container)
{
xout.StartElement("ProfileAction");
xout.BreakAttributes();
@@ -415,6 +411,11 @@ void cmXCodeScheme::WriteProfileAction(cmXMLWriter& xout,
WriteLaunchActionBooleanAttribute(xout, "debugDocumentVersioning",
"XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING",
true);
+
+ if (IsExecutable(this->Target)) {
+ WriteBuildableProductRunnable(xout, this->Target, container);
+ }
+
xout.EndElement();
}
@@ -437,6 +438,17 @@ void cmXCodeScheme::WriteArchiveAction(cmXMLWriter& xout,
xout.EndElement();
}
+void cmXCodeScheme::WriteBuildableProductRunnable(cmXMLWriter& xout,
+ const cmXCodeObject* xcObj,
+ const std::string& container)
+{
+ xout.StartElement("BuildableProductRunnable");
+ xout.BreakAttributes();
+ xout.Attribute("runnableDebuggingMode", "0");
+ WriteBuildableReference(xout, xcObj, container);
+ xout.EndElement();
+}
+
void cmXCodeScheme::WriteBuildableReference(cmXMLWriter& xout,
const cmXCodeObject* xcObj,
const std::string& container)
diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h
index 07fdedb..c933a6e 100644
--- a/Source/cmXCodeScheme.h
+++ b/Source/cmXCodeScheme.h
@@ -57,10 +57,14 @@ private:
const std::string& value,
const std::string& varName);
- void WriteProfileAction(cmXMLWriter& xout, const std::string& configuration);
+ void WriteProfileAction(cmXMLWriter& xout, const std::string& configuration,
+ const std::string& container);
void WriteAnalyzeAction(cmXMLWriter& xout, const std::string& configuration);
void WriteArchiveAction(cmXMLWriter& xout, const std::string& configuration);
+ void WriteBuildableProductRunnable(cmXMLWriter& xout,
+ const cmXCodeObject* xcObj,
+ const std::string& container);
void WriteBuildableReference(cmXMLWriter& xout, const cmXCodeObject* xcObj,
const std::string& container);
diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx
index 24da8c6..f4433e3 100644
--- a/Source/cmXMLParser.cxx
+++ b/Source/cmXMLParser.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmXMLParser.h"
-#include <cctype>
#include <cstring>
#include <iostream>
#include <sstream>
@@ -143,11 +142,6 @@ void cmXMLParser::CharacterDataHandler(const char* /*inData*/,
{
}
-int cmXMLParser::IsSpace(char c)
-{
- return isspace(c);
-}
-
const char* cmXMLParser::FindAttribute(const char** atts,
const char* attribute)
{
diff --git a/Source/cmXMLParser.h b/Source/cmXMLParser.h
index 176252d..d35e44f 100644
--- a/Source/cmXMLParser.h
+++ b/Source/cmXMLParser.h
@@ -89,10 +89,6 @@ protected:
/** Called by ReportXmlParseError with basic error info. */
virtual void ReportError(int line, int column, const char* msg);
- //! Utility for convenience of subclasses. Wraps isspace C library
- // routine.
- static int IsSpace(char c);
-
//! Send the given buffer to the XML parser.
virtual int ParseBuffer(const char* buffer, std::string::size_type length);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 636a0da..319e597 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -48,6 +48,7 @@
#include "cmExternalMakefileProjectGenerator.h"
#include "cmFileTimeCache.h"
#include "cmGeneratorTarget.h"
+#include "cmGlobCacheEntry.h"
#include "cmGlobalGenerator.h"
#include "cmGlobalGeneratorFactory.h"
#include "cmLinkLineComputer.h"
@@ -1575,14 +1576,15 @@ void cmake::SetArgs(const std::vector<std::string>& args)
if (!expandedPreset->ArchitectureStrategy ||
expandedPreset->ArchitectureStrategy ==
cmCMakePresetsGraph::ArchToolsetStrategy::Set) {
- if (!this->GeneratorPlatformSet) {
+ if (!this->GeneratorPlatformSet &&
+ !expandedPreset->Architecture.empty()) {
this->SetGeneratorPlatform(expandedPreset->Architecture);
}
}
if (!expandedPreset->ToolsetStrategy ||
expandedPreset->ToolsetStrategy ==
cmCMakePresetsGraph::ArchToolsetStrategy::Set) {
- if (!this->GeneratorToolsetSet) {
+ if (!this->GeneratorToolsetSet && !expandedPreset->Toolset.empty()) {
this->SetGeneratorToolset(expandedPreset->Toolset);
}
}
@@ -2345,16 +2347,16 @@ int cmake::Configure()
// so we cannot rely on command line options alone. Always ensure our
// messenger is in sync with the cache.
cmValue value = this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED");
- this->Messenger->SetSuppressDeprecatedWarnings(value && cmIsOff(*value));
+ this->Messenger->SetSuppressDeprecatedWarnings(value && value.IsOff());
value = this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED");
- this->Messenger->SetDeprecatedWarningsAsErrors(cmIsOn(value));
+ this->Messenger->SetDeprecatedWarningsAsErrors(value.IsOn());
value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
- this->Messenger->SetSuppressDevWarnings(cmIsOn(value));
+ this->Messenger->SetSuppressDevWarnings(value.IsOn());
value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS");
- this->Messenger->SetDevWarningsAsErrors(value && cmIsOff(*value));
+ this->Messenger->SetDevWarningsAsErrors(value && value.IsOff());
int ret = this->ActualConfigure();
cmValue delCacheVars =
@@ -2394,8 +2396,15 @@ int cmake::ActualConfigure()
cmSystemTools::RemoveADirectory(redirectsDir);
if (!cmSystemTools::MakeDirectory(redirectsDir)) {
cmSystemTools::Error(
- "Unable to (re)create the private pkgRedirects directory:\n" +
- redirectsDir);
+ cmStrCat("Unable to (re)create the private pkgRedirects directory:\n ",
+ redirectsDir,
+ "\n"
+ "This may be caused by not having read/write access to "
+ "the build directory.\n"
+ "Try specifying a location with read/write access like:\n"
+ " cmake -B build\n"
+ "If using a CMake presets file, ensure that preset parameter\n"
+ "'binaryDir' expands to a writable directory.\n"));
return -1;
}
this->AddCacheEntry("CMAKE_FIND_PACKAGE_REDIRECTS_DIR", redirectsDir,
@@ -2507,6 +2516,16 @@ int cmake::ActualConfigure()
"Name of generator toolset.", cmStateEnums::INTERNAL);
}
+ if (!this->State->GetInitializedCacheValue("CMAKE_TEST_LAUNCHER")) {
+ cm::optional<std::string> testLauncher =
+ cmSystemTools::GetEnvVar("CMAKE_TEST_LAUNCHER");
+ if (testLauncher && !testLauncher->empty()) {
+ std::string message = "Test launcher to run tests executable.";
+ this->AddCacheEntry("CMAKE_TEST_LAUNCHER", *testLauncher, message,
+ cmStateEnums::STRING);
+ }
+ }
+
if (!this->State->GetInitializedCacheValue(
"CMAKE_CROSSCOMPILING_EMULATOR")) {
cm::optional<std::string> emulator =
@@ -2801,7 +2820,7 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
if (cmSystemTools::GetErrorOccurredFlag()) {
return -1;
}
- return 0;
+ return this->HasScriptModeExitCode() ? this->GetScriptModeExitCode() : 0;
}
// If MAKEFLAGS are given in the environment, remove the environment
@@ -2906,13 +2925,13 @@ void cmake::AddCacheEntry(const std::string& key, cmValue value,
this->UnwatchUnusedCli(key);
if (key == "CMAKE_WARN_DEPRECATED"_s) {
- this->Messenger->SetSuppressDeprecatedWarnings(value && cmIsOff(value));
+ this->Messenger->SetSuppressDeprecatedWarnings(value && value.IsOff());
} else if (key == "CMAKE_ERROR_DEPRECATED"_s) {
- this->Messenger->SetDeprecatedWarningsAsErrors(cmIsOn(value));
+ this->Messenger->SetDeprecatedWarningsAsErrors(value.IsOn());
} else if (key == "CMAKE_SUPPRESS_DEVELOPER_WARNINGS"_s) {
- this->Messenger->SetSuppressDevWarnings(cmIsOn(value));
+ this->Messenger->SetSuppressDevWarnings(value.IsOn());
} else if (key == "CMAKE_SUPPRESS_DEVELOPER_ERRORS"_s) {
- this->Messenger->SetDevWarningsAsErrors(value && cmIsOff(value));
+ this->Messenger->SetDevWarningsAsErrors(value && value.IsOff());
}
}
@@ -2931,16 +2950,17 @@ std::string const& cmake::GetGlobVerifyStamp() const
return this->State->GetGlobVerifyStamp();
}
-void cmake::AddGlobCacheEntry(bool recurse, bool listDirectories,
- bool followSymlinks, const std::string& relative,
- const std::string& expression,
- const std::vector<std::string>& files,
+void cmake::AddGlobCacheEntry(const cmGlobCacheEntry& entry,
const std::string& variable,
cmListFileBacktrace const& backtrace)
{
- this->State->AddGlobCacheEntry(recurse, listDirectories, followSymlinks,
- relative, expression, files, variable,
- backtrace, this->Messenger.get());
+ this->State->AddGlobCacheEntry(entry, variable, backtrace,
+ this->Messenger.get());
+}
+
+std::vector<cmGlobCacheEntry> cmake::GetGlobCacheEntries() const
+{
+ return this->State->GetGlobCacheEntries();
}
std::vector<std::string> cmake::GetAllExtensions() const
@@ -3751,7 +3771,7 @@ int cmake::Build(int jobs, std::string dir, std::vector<std::string> targets,
}
projName = *cachedProjectName;
- if (cmIsOn(this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE"))) {
+ if (this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE").IsOn()) {
verbose = true;
}
diff --git a/Source/cmake.h b/Source/cmake.h
index 58f90c9..2d17ed2 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -53,6 +53,7 @@ class cmMakefile;
class cmMessenger;
class cmVariableWatch;
struct cmBuildOptions;
+struct cmGlobCacheEntry;
/** \brief Represents a cmake invocation.
*
@@ -351,12 +352,10 @@ public:
bool DoWriteGlobVerifyTarget() const;
std::string const& GetGlobVerifyScript() const;
std::string const& GetGlobVerifyStamp() const;
- void AddGlobCacheEntry(bool recurse, bool listDirectories,
- bool followSymlinks, const std::string& relative,
- const std::string& expression,
- const std::vector<std::string>& files,
+ void AddGlobCacheEntry(const cmGlobCacheEntry& entry,
const std::string& variable,
cmListFileBacktrace const& bt);
+ std::vector<cmGlobCacheEntry> GetGlobCacheEntries() const;
/**
* Get the system information and write it to the file specified
@@ -835,7 +834,13 @@ private:
std::string DebuggerDapLogFile;
#endif
+ cm::optional<int> ScriptModeExitCode;
+
public:
+ bool HasScriptModeExitCode() const { return ScriptModeExitCode.has_value(); }
+ void SetScriptModeExitCode(int code) { ScriptModeExitCode = code; }
+ int GetScriptModeExitCode() const { return ScriptModeExitCode.value_or(-1); }
+
static cmDocumentationEntry CMAKE_STANDARD_OPTIONS_TABLE[18];
};
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index ced83dc..8462734 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -389,13 +389,16 @@ int do_cmake(int ac, char const* const* av)
}
}
- // Always return a non-negative value. Windows tools do not always
- // interpret negative return values as errors.
+ // Always return a non-negative value (except exit code from SCRIPT_MODE).
+ // Windows tools do not always interpret negative return values as errors.
if (res != 0) {
+ auto scriptModeExitCode =
+ cm.HasScriptModeExitCode() ? cm.GetScriptModeExitCode() : 0;
+ res = scriptModeExitCode ? scriptModeExitCode : 1;
#ifdef CMake_ENABLE_DEBUGGER
- cm.StopDebuggerIfNeeded(1);
+ cm.StopDebuggerIfNeeded(res);
#endif
- return 1;
+ return res;
}
#ifdef CMake_ENABLE_DEBUGGER
cm.StopDebuggerIfNeeded(0);
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 9d7bf50..25b2ced 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -72,7 +72,6 @@
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
-#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
#include "cmsys/Terminal.h"
@@ -202,11 +201,16 @@ bool cmTarFilesFrom(std::string const& file, std::vector<std::string>& files)
void cmCatFile(const std::string& fileToAppend)
{
#ifdef _WIN32
+ _setmode(fileno(stdin), _O_BINARY);
_setmode(fileno(stdout), _O_BINARY);
#endif
- cmsys::ifstream source(fileToAppend.c_str(),
- (std::ios::binary | std::ios::in));
- std::cout << source.rdbuf();
+ std::streambuf* buf = std::cin.rdbuf();
+ cmsys::ifstream source;
+ if (fileToAppend != "-") {
+ source.open(fileToAppend.c_str(), (std::ios::binary | std::ios::in));
+ buf = source.rdbuf();
+ }
+ std::cout << buf;
}
bool cmRemoveDirectory(const std::string& dir, bool recursive = true)
@@ -295,14 +299,8 @@ int CLCompileAndDependencies(const std::vector<std::string>& args)
}
}
- std::unique_ptr<cmsysProcess, void (*)(cmsysProcess*)> cp(
- cmsysProcess_New(), cmsysProcess_Delete);
- std::vector<const char*> argv(command.size() + 1);
- std::transform(command.begin(), command.end(), argv.begin(),
- [](std::string const& s) { return s.c_str(); });
- argv.back() = nullptr;
- cmsysProcess_SetCommand(cp.get(), argv.data());
- cmsysProcess_SetWorkingDirectory(cp.get(), currentBinaryDir.c_str());
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand(command).SetWorkingDirectory(currentBinaryDir);
cmsys::ofstream fout(depFile.c_str());
if (!fout) {
@@ -313,22 +311,18 @@ int CLCompileAndDependencies(const std::vector<std::string>& args)
CLOutputLogger errLogger(std::cerr);
// Start the process.
- cmProcessTools::RunProcess(cp.get(), &includeParser, &errLogger);
+ auto result =
+ cmProcessTools::RunProcess(builder, &includeParser, &errLogger);
+ auto const& subStatus = result.front();
int status = 0;
// handle status of process
- switch (cmsysProcess_GetState(cp.get())) {
- case cmsysProcess_State_Exited:
- status = cmsysProcess_GetExitValue(cp.get());
- break;
- case cmsysProcess_State_Exception:
- status = 1;
- break;
- case cmsysProcess_State_Error:
- status = 2;
- break;
- default:
- break;
+ if (subStatus.SpawnResult != 0) {
+ status = 2;
+ } else if (subStatus.TermSignal != 0) {
+ status = 1;
+ } else {
+ status = static_cast<int>(subStatus.ExitStatus);
}
if (status != 0) {
@@ -1116,7 +1110,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
int ret = 0;
auto time_start = std::chrono::steady_clock::now();
- cmSystemTools::RunSingleCommand(command, nullptr, nullptr, &ret);
+ cmSystemTools::RunSingleCommand(command, nullptr, nullptr, &ret, nullptr,
+ cmSystemTools::OUTPUT_PASSTHROUGH);
auto time_finish = std::chrono::steady_clock::now();
std::chrono::duration<double> time_elapsed = time_finish - time_start;
@@ -1155,7 +1150,12 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
int return_value = 0;
bool doing_options = true;
for (auto const& arg : cmMakeRange(args).advance(2)) {
- if (doing_options && cmHasLiteralPrefix(arg, "-")) {
+ if (arg == "-") {
+ doing_options = false;
+ // Destroy console buffers to drop cout/cerr encoding transform.
+ consoleBuf.reset();
+ cmCatFile(arg);
+ } else if (doing_options && cmHasLiteralPrefix(arg, "-")) {
if (arg == "--") {
doing_options = false;
} else {
@@ -1441,13 +1441,17 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
if ((args[1] == "cmake_autogen") && (args.size() >= 4)) {
cm::string_view const infoFile = args[2];
cm::string_view const config = args[3];
- return cmQtAutoMocUic(infoFile, config) ? 0 : 1;
+ cm::string_view const executableConfig =
+ (args.size() >= 5) ? cm::string_view(args[4]) : cm::string_view();
+ return cmQtAutoMocUic(infoFile, config, executableConfig) ? 0 : 1;
}
if ((args[1] == "cmake_autorcc") && (args.size() >= 3)) {
cm::string_view const infoFile = args[2];
cm::string_view const config =
(args.size() > 3) ? cm::string_view(args[3]) : cm::string_view();
- return cmQtAutoRcc(infoFile, config) ? 0 : 1;
+ cm::string_view const executableConfig =
+ (args.size() >= 5) ? cm::string_view(args[4]) : cm::string_view();
+ return cmQtAutoRcc(infoFile, config, executableConfig) ? 0 : 1;
}
#endif
@@ -1890,21 +1894,6 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string> const& args)
}
}
- // Allocate a process instance.
- cmsysProcess* cp = cmsysProcess_New();
- if (!cp) {
- std::cerr << "Error allocating process instance in link script."
- << std::endl;
- return 1;
- }
-
- // Children should share stdout and stderr with this process.
- cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDOUT, 1);
- cmsysProcess_SetPipeShared(cp, cmsysProcess_Pipe_STDERR, 1);
-
- // Run the command lines verbatim.
- cmsysProcess_SetOption(cp, cmsysProcess_Option_Verbatim, 1);
-
// Read command lines from the script.
cmsys::ifstream fin(args[2].c_str());
if (!fin) {
@@ -1922,9 +1911,21 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string> const& args)
continue;
}
+ // Allocate a process instance.
+ cmUVProcessChainBuilder builder;
+
+ // Children should share stdout and stderr with this process.
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, stdout)
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, stderr);
+
// Setup this command line.
- const char* cmd[2] = { command.c_str(), nullptr };
- cmsysProcess_SetCommand(cp, cmd);
+ std::vector<std::string> args2;
+#ifdef _WIN32
+ cmSystemTools::ParseWindowsCommandLine(command.c_str(), args2);
+#else
+ cmSystemTools::ParseUnixCommandLine(command.c_str(), args2);
+#endif
+ builder.AddCommand(args2);
// Report the command if verbose output is enabled.
if (verbose) {
@@ -1932,35 +1933,29 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string> const& args)
}
// Run the command and wait for it to exit.
- cmsysProcess_Execute(cp);
- cmsysProcess_WaitForExit(cp, nullptr);
+ auto chain = builder.Start();
+ chain.Wait();
// Report failure if any.
- switch (cmsysProcess_GetState(cp)) {
- case cmsysProcess_State_Exited: {
- int value = cmsysProcess_GetExitValue(cp);
- if (value != 0) {
- result = value;
+ auto const& status = chain.GetStatus(0);
+ auto exception = status.GetException();
+ switch (exception.first) {
+ case cmUVProcessChain::ExceptionCode::None:
+ if (status.ExitStatus != 0) {
+ result = static_cast<int>(status.ExitStatus);
}
- } break;
- case cmsysProcess_State_Exception:
- std::cerr << "Error running link command: "
- << cmsysProcess_GetExceptionString(cp) << std::endl;
- result = 1;
break;
- case cmsysProcess_State_Error:
- std::cerr << "Error running link command: "
- << cmsysProcess_GetErrorString(cp) << std::endl;
+ case cmUVProcessChain::ExceptionCode::Spawn:
+ std::cerr << "Error running link command: " << exception.second;
result = 2;
break;
default:
+ std::cerr << "Error running link command: " << exception.second;
+ result = 1;
break;
}
}
- // Free the process instance.
- cmsysProcess_Delete(cp);
-
// Return the final resulting return value.
return result;
}
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index fa38a65..f6a11b4 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -25,7 +25,7 @@ const cmDocumentationEntry cmDocumentationName = {
const cmDocumentationEntry cmDocumentationUsage = { {}, " ctest [options]" };
-const cmDocumentationEntry cmDocumentationOptions[74] = {
+const cmDocumentationEntry cmDocumentationOptions[] = {
{ "--preset <preset>, --preset=<preset>",
"Read arguments from a test preset." },
{ "--list-presets", "List available test presets." },
@@ -48,9 +48,9 @@ const cmDocumentationEntry cmDocumentationOptions[74] = {
"Truncate 'tail' (default), 'middle' or 'head' of test output once "
"maximum output size is reached" },
{ "-F", "Enable failover." },
- { "-j <jobs>, --parallel <jobs>",
- "Run the tests in parallel using the "
- "given number of jobs." },
+ { "-j [<level>], --parallel [<level>]",
+ "Run tests in parallel, "
+ "optionally limited to a given level of parallelism." },
{ "-Q,--quiet", "Make ctest quiet." },
{ "-O <file>, --output-log <file>", "Output to log file" },
{ "--output-junit <file>", "Output test results to JUnit XML file." },
@@ -107,6 +107,9 @@ const cmDocumentationEntry cmDocumentationOptions[74] = {
"Run a specific number of tests by number." },
{ "-U, --union", "Take the Union of -I and -R" },
{ "--rerun-failed", "Run only the tests that failed previously" },
+ { "--tests-from-file <file>", "Run the tests listed in the given file" },
+ { "--exclude-from-file <file>",
+ "Run tests except those listed in the given file" },
{ "--repeat until-fail:<n>, --repeat-until-fail <n>",
"Require each test to run <n> times without failing in order to pass" },
{ "--repeat until-pass:<n>",
@@ -143,6 +146,7 @@ const cmDocumentationEntry cmDocumentationOptions[74] = {
{ "--tomorrow-tag", "Nightly or experimental starts with next day tag." },
{ "--overwrite", "Overwrite CTest configuration option." },
{ "--extra-submit <file>[;<file>]", "Submit extra files to the dashboard." },
+ { "--http-header <header>", "Append HTTP header when submitting" },
{ "--force-new-ctest-process",
"Run child CTest instances as new processes" },
{ "--schedule-random", "Use a random order for scheduling tests" },
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 2b7f2cc..562d5e6 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -298,14 +298,6 @@ endif()
set(KWSYS_HEADER_INSTALL_DIR)
set(KWSYS_LIBRARY_INSTALL_DIR)
-# Generated source files will need this header.
-string(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}"
- KWSYS_IN_SOURCE_BUILD)
-if(NOT KWSYS_IN_SOURCE_BUILD)
- configure_file(${PROJECT_SOURCE_DIR}/kwsysPrivate.h
- ${PROJECT_BINARY_DIR}/kwsysPrivate.h COPYONLY IMMEDIATE)
-endif()
-
# Select plugin module file name convention.
if(NOT KWSYS_DynamicLoader_PREFIX)
set(KWSYS_DynamicLoader_PREFIX ${CMAKE_SHARED_MODULE_PREFIX})
diff --git a/Source/kwsys/CONTRIBUTING.rst b/Source/kwsys/CONTRIBUTING.rst
index ebd3ed3..d62afa5 100644
--- a/Source/kwsys/CONTRIBUTING.rst
+++ b/Source/kwsys/CONTRIBUTING.rst
@@ -34,7 +34,7 @@ code. It automatically runs ``clang-format`` on the set of source files
for which we enforce style. The script also has options to format only
a subset of files, such as those that are locally modified.
-.. _`clang-format`: http://clang.llvm.org/docs/ClangFormat.html
+.. _`clang-format`: https://clang.llvm.org/docs/ClangFormat.html
.. _`.clang-format`: .clang-format
.. _`clang-format.bash`: clang-format.bash
diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx
index 50171dd..61703ad 100644
--- a/Source/kwsys/CommandLineArguments.cxx
+++ b/Source/kwsys/CommandLineArguments.cxx
@@ -132,7 +132,7 @@ bool CommandLineArguments::GetMatchedArguments(
// Does the argument match to any we know about?
for (it = this->Internals->Callbacks.begin();
- it != this->Internals->Callbacks.end(); it++) {
+ it != this->Internals->Callbacks.end(); ++it) {
const CommandLineArguments::Internal::String& parg = it->first;
CommandLineArgumentsCallbackStructure* cs = &it->second;
if (cs->ArgumentType == CommandLineArguments::NO_ARGUMENT ||
@@ -467,7 +467,7 @@ void CommandLineArguments::GenerateHelp()
MapArgs mp;
MapArgs::iterator mpit, smpit;
for (it = this->Internals->Callbacks.begin();
- it != this->Internals->Callbacks.end(); it++) {
+ it != this->Internals->Callbacks.end(); ++it) {
CommandLineArgumentsCallbackStructure* cs = &(it->second);
mpit = mp.find(cs->Help);
if (mpit != mp.end()) {
@@ -478,14 +478,14 @@ void CommandLineArguments::GenerateHelp()
}
}
for (it = this->Internals->Callbacks.begin();
- it != this->Internals->Callbacks.end(); it++) {
+ it != this->Internals->Callbacks.end(); ++it) {
CommandLineArgumentsCallbackStructure* cs = &(it->second);
mpit = mp.find(cs->Help);
if (mpit != mp.end()) {
mpit->second.insert(it->first);
smpit = mp.find(it->first);
CommandLineArguments::Internal::SetOfStrings::iterator sit;
- for (sit = smpit->second.begin(); sit != smpit->second.end(); sit++) {
+ for (sit = smpit->second.begin(); sit != smpit->second.end(); ++sit) {
mpit->second.insert(*sit);
}
mp.erase(smpit);
@@ -496,9 +496,9 @@ void CommandLineArguments::GenerateHelp()
// Find the length of the longest string
CommandLineArguments::Internal::String::size_type maxlen = 0;
- for (mpit = mp.begin(); mpit != mp.end(); mpit++) {
+ for (mpit = mp.begin(); mpit != mp.end(); ++mpit) {
CommandLineArguments::Internal::SetOfStrings::iterator sit;
- for (sit = mpit->second.begin(); sit != mpit->second.end(); sit++) {
+ for (sit = mpit->second.begin(); sit != mpit->second.end(); ++sit) {
CommandLineArguments::Internal::String::size_type clen = sit->size();
switch (this->Internals->Callbacks[*sit].ArgumentType) {
case CommandLineArguments::NO_ARGUMENT:
@@ -524,9 +524,9 @@ void CommandLineArguments::GenerateHelp()
maxlen += 4; // For the space before and after the option
// Print help for each option
- for (mpit = mp.begin(); mpit != mp.end(); mpit++) {
+ for (mpit = mp.begin(); mpit != mp.end(); ++mpit) {
CommandLineArguments::Internal::SetOfStrings::iterator sit;
- for (sit = mpit->second.begin(); sit != mpit->second.end(); sit++) {
+ for (sit = mpit->second.begin(); sit != mpit->second.end(); ++sit) {
str << std::endl;
std::string argument = *sit;
switch (this->Internals->Callbacks[*sit].ArgumentType) {
diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx
index f239576..f152ca4 100644
--- a/Source/kwsys/Directory.cxx
+++ b/Source/kwsys/Directory.cxx
@@ -269,7 +269,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name,
# include <string.h>
// PGI with glibc has trouble with dirent and large file support:
-// http://www.pgroup.com/userforum/viewtopic.php?
+// https://www.pgroup.com/userforum/viewtopic.php?
// p=1992&sid=f16167f51964f1a68fe5041b8eb213b6
// Work around the problem by mapping dirent the same way as readdir.
# if defined(__PGI) && defined(__GLIBC__)
diff --git a/Source/kwsys/MD5.c b/Source/kwsys/MD5.c
index 76995e2..b0faa0e 100644
--- a/Source/kwsys/MD5.c
+++ b/Source/kwsys/MD5.c
@@ -52,7 +52,7 @@
This code implements the MD5 Algorithm defined in RFC 1321, whose
text is available at
- http://www.ietf.org/rfc/rfc1321.txt
+ https://www.ietf.org/rfc/rfc1321.txt
The code is derived from the text of the RFC, including the test suite
(section A.5) but excluding the rest of Appendix A. It does not include
any code or documentation that is identified in the RFC as being
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 369ff9a..5e07e80 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -22,10 +22,10 @@
// Consider using these on Win32/Win64 for some of them:
//
// IsProcessorFeaturePresent
-// http://msdn.microsoft.com/en-us/library/ms724482(VS.85).aspx
+// https://msdn.microsoft.com/en-us/library/ms724482(VS.85).aspx
//
// GetProcessMemoryInfo
-// http://msdn.microsoft.com/en-us/library/ms683219(VS.85).aspx
+// https://msdn.microsoft.com/en-us/library/ms683219(VS.85).aspx
#include "kwsysPrivate.h"
#include KWSYS_HEADER(SystemInformation.hxx)
@@ -4265,7 +4265,7 @@ bool SystemInformationImplementation::QueryCygwinMemory()
{
#ifdef __CYGWIN__
// _SC_PAGE_SIZE does return the mmap() granularity on Cygwin,
- // see http://cygwin.com/ml/cygwin/2006-06/msg00350.html
+ // see https://sourceware.org/legacy-ml/cygwin/2006-06/msg00350.html
// Therefore just use 4096 as the page size of Windows.
long m = sysconf(_SC_PHYS_PAGES);
if (m < 0) {
@@ -4890,7 +4890,7 @@ std::string SystemInformationImplementation::ParseValueFromKStat(
args.reserve(3 + args_string.size());
args.push_back("kstat");
args.push_back("-p");
- for (auto& i : args_string) {
+ for (const auto& i : args_string) {
args.push_back(i.c_str());
}
args.push_back(nullptr);
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 3bb7869..11018a6 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -412,18 +412,6 @@ inline void Realpath(const std::string& path, std::string& resolved_path,
}
#endif
-#if !defined(_WIN32) && defined(__COMO__)
-// Hack for como strict mode to avoid defining _SVID_SOURCE or _BSD_SOURCE.
-extern "C" {
-extern FILE* popen(__const char* __command, __const char* __modes) __THROW;
-extern int pclose(FILE* __stream) __THROW;
-extern char* realpath(__const char* __restrict __name,
- char* __restrict __resolved) __THROW;
-extern char* strdup(__const char* __s) __THROW;
-extern int putenv(char* __string) __THROW;
-}
-#endif
-
namespace KWSYS_NAMESPACE {
double SystemTools::GetTime()
@@ -777,12 +765,16 @@ const char* SystemTools::GetEnv(const std::string& key)
bool SystemTools::GetEnv(const char* key, std::string& result)
{
#if defined(_WIN32)
- const std::wstring wkey = Encoding::ToWide(key);
- const wchar_t* wv = _wgetenv(wkey.c_str());
- if (wv) {
- result = Encoding::ToNarrow(wv);
- return true;
+ auto wide_key = Encoding::ToWide(key);
+ auto result_size = GetEnvironmentVariableW(wide_key.data(), nullptr, 0);
+ if (result_size <= 0) {
+ return false;
}
+ std::wstring wide_result;
+ wide_result.resize(result_size - 1);
+ GetEnvironmentVariableW(wide_key.data(), &wide_result[0], result_size);
+ result = Encoding::ToNarrow(wide_result);
+ return true;
#else
const char* v = getenv(key);
if (v) {
@@ -2802,14 +2794,14 @@ Status SystemTools::RemoveFile(std::string const& source)
Status SystemTools::RemoveADirectory(std::string const& source)
{
- // Add write permission to the directory so we can modify its
- // content to remove files and directories from it.
+ // Add read and write permission to the directory so we can read
+ // and modify its content to remove files and directories from it.
mode_t mode = 0;
if (SystemTools::GetPermissions(source, mode)) {
#if defined(_WIN32) && !defined(__CYGWIN__)
- mode |= S_IWRITE;
+ mode |= S_IREAD | S_IWRITE;
#else
- mode |= S_IWUSR;
+ mode |= S_IRUSR | S_IWUSR;
#endif
SystemTools::SetPermissions(source, mode);
}
@@ -2875,9 +2867,8 @@ std::string SystemToolsStatic::FindName(
path.reserve(path.size() + userPaths.size());
path.insert(path.end(), userPaths.begin(), userPaths.end());
// now look for the file
- std::string tryPath;
for (std::string const& p : path) {
- tryPath = p;
+ std::string tryPath = p;
if (tryPath.empty() || tryPath.back() != '/') {
tryPath += '/';
}
@@ -2946,8 +2937,6 @@ std::string SystemTools::FindProgram(const std::string& name,
const std::vector<std::string>& userPaths,
bool no_system_path)
{
- std::string tryPath;
-
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
std::vector<std::string> extensions;
// check to see if the name already has a .xxx at
@@ -2959,7 +2948,7 @@ std::string SystemTools::FindProgram(const std::string& name,
// first try with extensions if the os supports them
for (std::string const& ext : extensions) {
- tryPath = name;
+ std::string tryPath = name;
tryPath += ext;
if (SystemTools::FileIsExecutable(tryPath)) {
return SystemTools::CollapseFullPath(tryPath);
@@ -2996,7 +2985,7 @@ std::string SystemTools::FindProgram(const std::string& name,
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
// first try with extensions
for (std::string const& ext : extensions) {
- tryPath = p;
+ std::string tryPath = p;
tryPath += name;
tryPath += ext;
if (SystemTools::FileIsExecutable(tryPath)) {
@@ -3005,7 +2994,7 @@ std::string SystemTools::FindProgram(const std::string& name,
}
#endif
// now try it without them
- tryPath = p;
+ std::string tryPath = p;
tryPath += name;
if (SystemTools::FileIsExecutable(tryPath)) {
return SystemTools::CollapseFullPath(tryPath);
@@ -3160,16 +3149,13 @@ bool SystemTools::FileIsDirectory(const std::string& inName)
#if defined(_WIN32)
DWORD attr =
GetFileAttributesW(Encoding::ToWindowsExtendedPath(name).c_str());
- if (attr != INVALID_FILE_ATTRIBUTES) {
- return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0;
+ return (attr != INVALID_FILE_ATTRIBUTES) &&
+ (attr & FILE_ATTRIBUTE_DIRECTORY);
#else
struct stat fs;
- if (stat(name, &fs) == 0) {
- return S_ISDIR(fs.st_mode);
+
+ return (stat(name, &fs) == 0) && S_ISDIR(fs.st_mode);
#endif
- } else {
- return false;
- }
}
bool SystemTools::FileIsExecutable(const std::string& inName)
@@ -3234,11 +3220,7 @@ bool SystemTools::FileIsSymlink(const std::string& name)
return FileIsSymlinkWithAttr(path, GetFileAttributesW(path.c_str()));
#else
struct stat fs;
- if (lstat(name.c_str(), &fs) == 0) {
- return S_ISLNK(fs.st_mode);
- } else {
- return false;
- }
+ return (lstat(name.c_str(), &fs) == 0) && S_ISLNK(fs.st_mode);
#endif
}
@@ -3256,11 +3238,7 @@ bool SystemTools::FileIsFIFO(const std::string& name)
return type == FILE_TYPE_PIPE;
#else
struct stat fs;
- if (lstat(name.c_str(), &fs) == 0) {
- return S_ISFIFO(fs.st_mode);
- } else {
- return false;
- }
+ return (lstat(name.c_str(), &fs) == 0) && S_ISFIFO(fs.st_mode);
#endif
}
@@ -4897,7 +4875,7 @@ SystemToolsManager::~SystemToolsManager()
#if defined(__VMS)
// On VMS we configure the run time C library to be more UNIX like.
-// http://h71000.www7.hp.com/doc/732final/5763/5763pro_004.html
+// https://h71000.www7.hp.com/doc/732final/5763/5763pro_004.html
extern "C" int decc$feature_get_index(char* name);
extern "C" int decc$feature_set_value(int index, int mode, int value);
static int SetVMSFeature(char* name, int value)
diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c
index 39081a7..eb6e01b 100644
--- a/Source/kwsys/Terminal.c
+++ b/Source/kwsys/Terminal.c
@@ -168,7 +168,7 @@ static const char* kwsysTerminalVT100Names[] = { "Eterm",
static int kwsysTerminalStreamIsVT100(FILE* stream, int default_vt100,
int default_tty)
{
- /* Force color according to http://bixense.com/clicolors/ convention. */
+ /* Force color according to https://bixense.com/clicolors/ convention. */
{
const char* clicolor_force = getenv("CLICOLOR_FORCE");
if (clicolor_force && *clicolor_force &&
@@ -177,7 +177,7 @@ static int kwsysTerminalStreamIsVT100(FILE* stream, int default_vt100,
}
}
- /* Disable color according to http://bixense.com/clicolors/ convention. */
+ /* Disable color according to https://bixense.com/clicolors/ convention. */
{
const char* clicolor = getenv("CLICOLOR");
if (clicolor && strcmp(clicolor, "0") == 0) {
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index 8afcb68..9275043 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -1148,12 +1148,12 @@ static bool CheckCopyFileIfDifferent()
static bool CheckURLParsing()
{
bool ret = true;
- std::string url = "http://user:pw@hostname:42/full/url.com";
+ std::string url = "https://user:pw@hostname:42/full/url.com";
std::string protocol, username, password, hostname, dataport, database;
kwsys::SystemTools::ParseURL(url, protocol, username, password, hostname,
dataport, database);
- if (protocol != "http" || username != "user" || password != "pw" ||
+ if (protocol != "https" || username != "user" || password != "pw" ||
hostname != "hostname" || dataport != "42" ||
database != "full/url.com") {
std::cerr << "Incorrect URL parsing" << std::endl;
diff --git a/Tests/Architecture/CMakeLists.txt b/Tests/Architecture/CMakeLists.txt
index 3d10ee0..8b3d0af 100644
--- a/Tests/Architecture/CMakeLists.txt
+++ b/Tests/Architecture/CMakeLists.txt
@@ -1,30 +1,21 @@
cmake_minimum_required(VERSION 3.5)
project(Architecture C)
-function(test_for_xcode4 result_var)
- set(${result_var} 0 PARENT_SCOPE)
- if(APPLE)
- execute_process(COMMAND xcodebuild -version
- OUTPUT_VARIABLE ov RESULT_VARIABLE rv
- )
- if("${rv}" STREQUAL "0" AND ov MATCHES "^Xcode ([0-9]+)\\.")
- if(NOT CMAKE_MATCH_1 VERSION_LESS 4)
- set(${result_var} 1 PARENT_SCOPE)
- endif()
- endif()
- endif()
-endfunction()
-
-test_for_xcode4(is_xcode4)
-
-set(arch0 i386)
-set(arch1 ppc)
-
-if(is_xcode4)
- # Xcode 4, use modern architectures as defaults
- # Arch 'ppc' no longer works: tools no longer available starting with Xcode 4
+if (CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 12)
+ # Since Xcode 12 we have two architectures again: arm64 and x86_64.
+ set(arch0 x86_64)
+ set(arch1 arm64)
+elseif(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 10)
+ # Xcode 10 / 11 do not have two supported architectures for the host.
+ message(STATUS "Skip test x86_64 only")
+ return()
+elseif(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 4)
+ # Xcode 4 no longer supports ppc, but does support x86_64.
set(arch0 i386)
set(arch1 x86_64)
+else()
+ set(arch0 i386)
+ set(arch1 ppc)
endif()
add_library(foo foo.c)
@@ -43,7 +34,6 @@ if(CMAKE_OSX_ARCHITECTURES)
endif()
endif()
-message("is_xcode4='${is_xcode4}'")
message("archs='${archs}'")
message("arch0='${arch0}'")
message("arch1='${arch1}'")
diff --git a/Tests/Architecture/bar.c b/Tests/Architecture/bar.c
index 37946c7..18ddb78 100644
--- a/Tests/Architecture/bar.c
+++ b/Tests/Architecture/bar.c
@@ -1,5 +1,5 @@
extern int foo(void);
-int main()
+int main(void)
{
return foo();
}
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 5ddae83..dbafc85 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -47,6 +47,10 @@ if(NOT CMAKE_GENERATOR MATCHES "Visual Studio ([^9]|9[0-9])")
list(APPEND _cmake_options "-DTEST_MULTI3=1")
endif()
+if (APPLE)
+ list(APPEND _cmake_options "-DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION}")
+endif()
+
file(MAKE_DIRECTORY ${BuildDepends_BINARY_DIR}/Project)
message("Creating Project/foo.cxx")
write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index 7fddf4b..2abda2e 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -1,23 +1,13 @@
cmake_minimum_required(VERSION 2.6)
project(testRebuild)
-if(APPLE)
- set(CMake_TEST_XCODE_VERSION 0)
- if(XCODE_VERSION)
- set(CMake_TEST_XCODE_VERSION "${XCODE_VERSION}")
- else()
- execute_process(
- COMMAND xcodebuild -version
- OUTPUT_VARIABLE _version ERROR_VARIABLE _version_err
- )
- if(_version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)")
- set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}")
- endif()
- endif()
+if(APPLE AND CMake_TEST_XCODE_VERSION)
# only use multi-arch if the sysroot exists on this machine
# Ninja needs -M which could not be used with multiple -arch flags
if(EXISTS "${CMAKE_OSX_SYSROOT}" AND NOT "${CMAKE_GENERATOR}" MATCHES "Ninja")
- if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 10)
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 12)
+ set(CMAKE_OSX_ARCHITECTURES arm64 x86_64)
+ elseif(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 10)
# Arch 'i386' no longer works in Xcode 10.
set(CMAKE_OSX_ARCHITECTURES x86_64)
elseif(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 4)
diff --git a/Tests/BuildDepends/Project/link_depends_no_shared_exe.c b/Tests/BuildDepends/Project/link_depends_no_shared_exe.c
index cfaf051..8830776 100644
--- a/Tests/BuildDepends/Project/link_depends_no_shared_exe.c
+++ b/Tests/BuildDepends/Project/link_depends_no_shared_exe.c
@@ -3,7 +3,7 @@
__declspec(dllimport)
#endif
int link_depends_no_shared_lib(void);
-int main()
+int main(void)
{
return link_depends_no_shared_lib() + link_depends_no_shared_exe_value;
}
diff --git a/Tests/CMakeCommands/target_compile_definitions/consumer.c b/Tests/CMakeCommands/target_compile_definitions/consumer.c
index bb65e01..08554f4 100644
--- a/Tests/CMakeCommands/target_compile_definitions/consumer.c
+++ b/Tests/CMakeCommands/target_compile_definitions/consumer.c
@@ -39,6 +39,6 @@
# error Expected LANG_IS_C_OR_CXX
#endif
-void consumer_c()
+void consumer_c(void)
{
}
diff --git a/Tests/CMakeCommands/target_compile_features/main.c b/Tests/CMakeCommands/target_compile_features/main.c
index 76e98c4..60f0f9e 100644
--- a/Tests/CMakeCommands/target_compile_features/main.c
+++ b/Tests/CMakeCommands/target_compile_features/main.c
@@ -6,7 +6,7 @@ int foo(int* restrict a, int* restrict b)
return 0;
}
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/CMakeCommands/target_compile_features/restrict_user.c b/Tests/CMakeCommands/target_compile_features/restrict_user.c
index 76c956f..42e3efb 100644
--- a/Tests/CMakeCommands/target_compile_features/restrict_user.c
+++ b/Tests/CMakeCommands/target_compile_features/restrict_user.c
@@ -8,7 +8,7 @@ int bar(int* restrict a, int* restrict b)
return foo(a, b);
}
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/CMakeCommands/target_compile_options/consumer.c b/Tests/CMakeCommands/target_compile_options/consumer.c
index f9b6654..0984166 100644
--- a/Tests/CMakeCommands/target_compile_options/consumer.c
+++ b/Tests/CMakeCommands/target_compile_options/consumer.c
@@ -35,6 +35,6 @@
# endif
#endif
-void consumer_c()
+void consumer_c(void)
{
}
diff --git a/Tests/CMakeCommands/target_include_directories/consumer.c b/Tests/CMakeCommands/target_include_directories/consumer.c
index 7fd694b..1975050 100644
--- a/Tests/CMakeCommands/target_include_directories/consumer.c
+++ b/Tests/CMakeCommands/target_include_directories/consumer.c
@@ -15,7 +15,7 @@
# endif
#endif
-int consumer_c()
+int consumer_c(void)
{
return 0;
}
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt
index b44c8dd..4d43e08 100644
--- a/Tests/CMakeLib/CMakeLists.txt
+++ b/Tests/CMakeLib/CMakeLists.txt
@@ -25,6 +25,8 @@ set(CMakeLib_TESTS
testXMLParser.cxx
testXMLSafe.cxx
testFindPackageCommand.cxx
+ testUVHandlePtr.cxx
+ testUVJobServerClient.cxx
testUVProcessChain.cxx
testUVRAII.cxx
testUVStreambuf.cxx
@@ -42,6 +44,7 @@ if(CMake_ENABLE_DEBUGGER)
testDebuggerVariables.cxx
testDebuggerVariablesHelper.cxx
testDebuggerVariablesManager.cxx
+ testDebuggerThread.cxx
)
endif()
if (CMake_TEST_FILESYSTEM_PATH OR NOT CMake_HAVE_CXX_FILESYSTEM)
@@ -50,6 +53,7 @@ endif()
add_executable(testUVProcessChainHelper testUVProcessChainHelper.cxx)
target_link_libraries(testUVProcessChainHelper CMakeLib)
+target_compile_definitions(testUVProcessChainHelper PRIVATE WIN32_LEAN_AND_MEAN)
set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
set(testUVProcessChain_ARGS $<TARGET_FILE:testUVProcessChainHelper>)
diff --git a/Tests/CMakeLib/PseudoMemcheck/NoLog/CMakeLists.txt b/Tests/CMakeLib/PseudoMemcheck/NoLog/CMakeLists.txt
index e47b9db..f3de7e1 100644
--- a/Tests/CMakeLib/PseudoMemcheck/NoLog/CMakeLists.txt
+++ b/Tests/CMakeLib/PseudoMemcheck/NoLog/CMakeLists.txt
@@ -1,7 +1,7 @@
# A dummy checker implementation that does not write the requested output file
# so it triggers an error for every checker.
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" "int main(){return 0;}\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" "int main(void){return 0;}\n")
configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in"
diff --git a/Tests/CMakeLib/testDebuggerNamedPipe.cxx b/Tests/CMakeLib/testDebuggerNamedPipe.cxx
index 1ae3f64..67e1372 100644
--- a/Tests/CMakeLib/testDebuggerNamedPipe.cxx
+++ b/Tests/CMakeLib/testDebuggerNamedPipe.cxx
@@ -194,7 +194,7 @@ int runTest(int argc, char* argv[])
R"("command" *: *"disconnect".*"success" *: *true.*"type" *: *"response")"
};
- for (auto& regexString : expectedResponses) {
+ for (const auto& regexString : expectedResponses) {
cmsys::RegularExpression regex(regexString);
if (!regex.find(debuggerResponse)) {
std::cout << "Expected response not found: " << regexString << std::endl;
diff --git a/Tests/CMakeLib/testDebuggerThread.cxx b/Tests/CMakeLib/testDebuggerThread.cxx
new file mode 100644
index 0000000..0ea95b6
--- /dev/null
+++ b/Tests/CMakeLib/testDebuggerThread.cxx
@@ -0,0 +1,33 @@
+#include <functional>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <cm3p/cppdap/protocol.h>
+#include <cm3p/cppdap/types.h>
+
+#include "cmDebuggerThread.h"
+#include "cmListFileCache.h"
+
+#include "testCommon.h"
+
+static bool testStackFrameFunctionName()
+{
+ auto thread = std::make_shared<cmDebugger::cmDebuggerThread>(0, "name");
+ const auto* functionName = "function_name";
+ auto arguments = std::vector<cmListFileArgument>{};
+ cmListFileFunction func(functionName, 10, 20, arguments);
+ thread->PushStackFrame(nullptr, "CMakeLists.txt", func);
+
+ auto stackTrace = GetStackTraceResponse(thread);
+
+ ASSERT_TRUE(stackTrace.stackFrames[0].name == functionName);
+ return true;
+}
+
+int testDebuggerThread(int, char*[])
+{
+ return runTests(std::vector<std::function<bool()>>{
+ testStackFrameFunctionName,
+ });
+}
diff --git a/Tests/CMakeLib/testUVHandlePtr.cxx b/Tests/CMakeLib/testUVHandlePtr.cxx
new file mode 100644
index 0000000..17f672d
--- /dev/null
+++ b/Tests/CMakeLib/testUVHandlePtr.cxx
@@ -0,0 +1,153 @@
+#include <functional>
+#include <iostream>
+#include <memory>
+
+#include <cm3p/uv.h>
+
+#include "cmGetPipes.h"
+#include "cmUVHandlePtr.h"
+
+static bool testBool()
+{
+ cm::uv_async_ptr async;
+ cm::uv_handle_ptr handle;
+ cm::uv_idle_ptr idle;
+ cm::uv_pipe_ptr pipe;
+ cm::uv_process_ptr process;
+ cm::uv_signal_ptr signal;
+ cm::uv_stream_ptr stream;
+ cm::uv_timer_ptr timer;
+ cm::uv_tty_ptr tty;
+ return !async && !handle && !idle && !pipe && !process && !signal &&
+ !stream && !timer && !tty;
+}
+
+static bool testIdle()
+{
+ bool idled = false;
+
+ cm::uv_loop_ptr loop;
+ loop.init();
+
+ auto cb = [](uv_idle_t* handle) {
+ auto idledPtr = static_cast<bool*>(handle->data);
+ *idledPtr = true;
+ uv_idle_stop(handle);
+ };
+
+ cm::uv_idle_ptr idle;
+ idle.init(*loop, &idled);
+ idle.start(cb);
+ uv_run(loop, UV_RUN_DEFAULT);
+
+ if (!idled) {
+ std::cerr << "uv_idle_ptr did not trigger callback" << std::endl;
+ return false;
+ }
+
+ idled = false;
+
+ idle.start(cb);
+ idle.stop();
+ uv_run(loop, UV_RUN_DEFAULT);
+
+ if (idled) {
+ std::cerr << "uv_idle_ptr::stop did not stop callback" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+static bool testTimer()
+{
+ bool timed = false;
+
+ cm::uv_loop_ptr loop;
+ loop.init();
+
+ auto cb = [](uv_timer_t* handle) {
+ auto timedPtr = static_cast<bool*>(handle->data);
+ *timedPtr = true;
+ uv_timer_stop(handle);
+ };
+
+ cm::uv_timer_ptr timer;
+ timer.init(*loop, &timed);
+ timer.start(cb, 10, 0);
+ uv_run(loop, UV_RUN_DEFAULT);
+
+ if (!timed) {
+ std::cerr << "uv_timer_ptr did not trigger callback" << std::endl;
+ return false;
+ }
+
+ timed = false;
+ timer.start(cb, 10, 0);
+ timer.stop();
+ uv_run(loop, UV_RUN_DEFAULT);
+
+ if (timed) {
+ std::cerr << "uv_timer_ptr::stop did not stop callback" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+static bool testWriteCallback()
+{
+ int pipe[] = { -1, -1 };
+ if (cmGetPipes(pipe) < 0) {
+ std::cout << "cmGetPipes() returned an error" << std::endl;
+ return false;
+ }
+
+ cm::uv_loop_ptr loop;
+ loop.init();
+
+ cm::uv_pipe_ptr pipeRead;
+ pipeRead.init(*loop, 0);
+ uv_pipe_open(pipeRead, pipe[0]);
+
+ cm::uv_pipe_ptr pipeWrite;
+ pipeWrite.init(*loop, 0);
+ uv_pipe_open(pipeWrite, pipe[1]);
+
+ char c = '.';
+ uv_buf_t buf = uv_buf_init(&c, sizeof(c));
+ int status = -1;
+ auto cb = std::make_shared<std::function<void(int)>>(
+ [&status](int s) { status = s; });
+
+ // Test getting a callback after the write is done.
+ cm::uv_write(pipeWrite, &buf, 1, cb);
+ uv_run(loop, UV_RUN_DEFAULT);
+ if (status != 0) {
+ std::cout << "cm::uv_write non-zero status: " << status << std::endl;
+ return false;
+ }
+
+ // Test deleting the callback before it is made.
+ status = -1;
+ cm::uv_write(pipeWrite, &buf, 1, cb);
+ cb.reset();
+ uv_run(loop, UV_RUN_DEFAULT);
+ if (status != -1) {
+ std::cout << "cm::uv_write callback incorrectly called with status: "
+ << status << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+int testUVHandlePtr(int, char** const)
+{
+ bool passed = true;
+ passed = testBool() && passed;
+ passed = testIdle() && passed;
+ passed = testTimer() && passed;
+ passed = testWriteCallback() && passed;
+ return passed ? 0 : -1;
+}
diff --git a/Tests/CMakeLib/testUVJobServerClient.cxx b/Tests/CMakeLib/testUVJobServerClient.cxx
new file mode 100644
index 0000000..13f0f40
--- /dev/null
+++ b/Tests/CMakeLib/testUVJobServerClient.cxx
@@ -0,0 +1,179 @@
+#include <cassert>
+#include <cstddef>
+#include <deque>
+#include <iostream>
+#include <vector>
+
+#include <cm/optional>
+
+#include <cm3p/uv.h>
+
+#ifndef _WIN32
+# include <unistd.h>
+#endif
+
+#include "cmGetPipes.h"
+#include "cmStringAlgorithms.h"
+#include "cmSystemTools.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVJobServerClient.h"
+
+namespace {
+
+const std::size_t kTOTAL_JOBS = 10;
+const std::size_t kTOTAL_TOKENS = 3;
+
+struct Job
+{
+ cm::uv_timer_ptr Timer;
+};
+
+struct JobRunner
+{
+ cm::uv_loop_ptr Loop;
+ cm::optional<cmUVJobServerClient> JSC;
+ std::vector<Job> Jobs;
+ std::size_t NextJobIndex = 0;
+
+ std::size_t ActiveJobs = 0;
+
+ std::deque<std::size_t> Queue;
+
+ bool Okay = true;
+
+ JobRunner()
+ : Jobs(kTOTAL_JOBS)
+ {
+ this->Loop.init(nullptr);
+ this->JSC = cmUVJobServerClient::Connect(
+ *this->Loop, [this]() { this->StartQueuedJob(); }, nullptr);
+ if (!this->JSC) {
+ std::cerr << "Failed to connect to job server.\n";
+ this->Okay = false;
+ }
+ }
+
+ ~JobRunner() {}
+
+ bool Run()
+ {
+ if (this->Okay) {
+ this->QueueNextJobs();
+ uv_run(this->Loop, UV_RUN_DEFAULT);
+ std::cerr << "HeldTokens: " << this->JSC->GetHeldTokens() << '\n';
+ std::cerr << "NeedTokens: " << this->JSC->GetNeedTokens() << '\n';
+ }
+#ifdef _WIN32
+ // FIXME: Windows job server client not yet implemented.
+ return true;
+#else
+ return this->Okay;
+#endif
+ }
+
+ void QueueNextJobs()
+ {
+ std::cerr << "QueueNextJobs()\n";
+ std::size_t queued = 0;
+ while (queued < 2 && this->NextJobIndex < this->Jobs.size()) {
+ this->QueueJob(this->NextJobIndex);
+ ++this->NextJobIndex;
+ ++queued;
+ }
+ std::cerr << "QueueNextJobs done\n";
+ }
+
+ void StartQueuedJob()
+ {
+ std::cerr << "StartQueuedJob()\n";
+ assert(!this->Queue.empty());
+
+ std::size_t index = this->Queue.front();
+ this->Queue.pop_front();
+ this->StartJob(index);
+
+ std::cerr << "StartQueuedJob done\n";
+ }
+
+ void StartJob(std::size_t index)
+ {
+ cm::uv_timer_ptr& job = this->Jobs[index].Timer;
+ job.init(*this->Loop, this);
+ uv_timer_start(
+ job,
+ [](uv_timer_t* handle) {
+ uv_timer_stop(handle);
+ auto self = static_cast<JobRunner*>(handle->data);
+ self->FinishJob();
+ },
+ /*timeout_ms=*/10 * (1 + (index % 3)), /*repeat_ms=*/0);
+ ++this->ActiveJobs;
+ std::cerr << " StartJob(" << index
+ << "): Active jobs: " << this->ActiveJobs << '\n';
+
+ if (this->ActiveJobs > kTOTAL_TOKENS) {
+ std::cerr << "Started more than " << kTOTAL_TOKENS << " jobs at once!\n";
+ this->Okay = false;
+ return;
+ }
+ }
+
+ void QueueJob(std::size_t index)
+ {
+ this->JSC->RequestToken();
+ this->Queue.push_back(index);
+ std::cerr << " QueueJob(" << index
+ << "): Queue length: " << this->Queue.size() << '\n';
+ }
+
+ void FinishJob()
+ {
+ --this->ActiveJobs;
+ std::cerr << "FinishJob: Active jobs: " << this->ActiveJobs << '\n';
+
+ this->JSC->ReleaseToken();
+ this->QueueNextJobs();
+ }
+};
+
+bool testJobServer()
+{
+#ifdef _WIN32
+ // FIXME: Windows job server client not yet implemented.
+#else
+ // Create a job server pipe.
+ int jobServerPipe[2];
+ if (cmGetPipes(jobServerPipe) < 0) {
+ std::cerr << "Failed to create job server pipe\n";
+ return false;
+ }
+
+ // Write N-1 tokens to the pipe.
+ std::vector<char> jobServerInit(kTOTAL_TOKENS - 1, '.');
+ if (write(jobServerPipe[1], jobServerInit.data(), jobServerInit.size()) !=
+ kTOTAL_TOKENS - 1) {
+ std::cerr << "Failed to initialize job server pipe\n";
+ return false;
+ }
+
+ // Establish the job server client context.
+ // Add a bogus server spec to verify we use the last spec.
+ cmSystemTools::PutEnv(cmStrCat("MAKEFLAGS=--flags-before"
+ " --jobserver-auth=bogus"
+ " --flags-between"
+ " --jobserver-fds=",
+ jobServerPipe[0], ',', jobServerPipe[1],
+ " --flags-after"));
+#endif
+
+ JobRunner jobRunner;
+ return jobRunner.Run();
+}
+}
+
+int testUVJobServerClient(int, char** const)
+{
+ bool passed = true;
+ passed = testJobServer() && passed;
+ return passed ? 0 : -1;
+}
diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx
index c6404ac..b669f65 100644
--- a/Tests/CMakeLib/testUVProcessChain.cxx
+++ b/Tests/CMakeLib/testUVProcessChain.cxx
@@ -295,7 +295,12 @@ bool testUVProcessChainBuiltin(const char* helperCommand)
.AddCommand({ helperCommand, "capitalize" })
.AddCommand({ helperCommand, "dedup" })
.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
- .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR);
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR)
+ .SetBuiltinLoop();
+ if (builder.GetLoop()) {
+ std::cout << "GetLoop() should return null" << std::endl;
+ return false;
+ }
if (!checkExecution(builder, chain)) {
return false;
@@ -398,6 +403,10 @@ bool testUVProcessChainExternal(const char* helperCommand)
.AddCommand({ helperCommand, "dedup" })
.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, outputPipe[1])
.SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, errorPipe[1]);
+ if (builder.GetLoop()) {
+ std::cout << "GetLoop() should return null" << std::endl;
+ return false;
+ }
if (!checkExecution(builder, chain)) {
return false;
@@ -665,6 +674,43 @@ bool testUVProcessChainWait0(const char* helperCommand)
return true;
}
+bool testUVProcessChainExternalLoop(const char* helperCommand)
+{
+ cm::uv_loop_ptr loop;
+ loop.init();
+
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand({ helperCommand, "echo" })
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
+ .SetExternalLoop(*loop);
+ if (builder.GetLoop() != loop) {
+ std::cout << "GetLoop() should return external loop" << std::endl;
+ return false;
+ }
+
+ auto chain = builder.Start();
+
+ if (&chain.GetLoop() != loop) {
+ std::cout << "GetLoop() should return external loop" << std::endl;
+ return false;
+ }
+
+ if (!chain.Wait()) {
+ std::cout << "Wait() timed out" << std::endl;
+ return false;
+ }
+
+ cmUVPipeIStream stream(chain.GetLoop(), chain.OutputStream());
+ std::string output = getInput(stream);
+ if (output != "HELLO world!") {
+ std::cout << "Output was \"" << output << "\", expected \"HELLO world!\""
+ << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
int testUVProcessChain(int argc, char** const argv)
{
if (argc < 2) {
@@ -717,5 +763,10 @@ int testUVProcessChain(int argc, char** const argv)
return -1;
}
+ if (!testUVProcessChainExternalLoop(argv[1])) {
+ std::cout << "While executing testUVProcessChainExternalLoop().\n";
+ return -1;
+ }
+
return 0;
}
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index 0bdd44c..9e79d5c 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/Tests/CMakeLib/testUVRAII.cxx
@@ -37,7 +37,7 @@ static bool testAsyncShutdown()
return false;
}
- if (signal.get()) {
+ if (signal) {
std::cerr << "Loop exited with signal not being cleaned up" << std::endl;
return false;
}
@@ -125,13 +125,13 @@ static bool testCrossAssignment()
pipe.init(Loop, 0);
cm::uv_stream_ptr stream = std::move(pipe);
- if (pipe.get()) {
+ if (pipe) {
std::cerr << "Move should be sure to invalidate the previous ptr"
<< std::endl;
return false;
}
cm::uv_handle_ptr handle = std::move(stream);
- if (stream.get()) {
+ if (stream) {
std::cerr << "Move should be sure to invalidate the previous ptr"
<< std::endl;
return false;
@@ -162,6 +162,7 @@ static bool testAllMoves()
uv_async_ptr _13;
uv_signal_ptr _14;
uv_handle_ptr _15;
+ uv_idle_ptr _16;
};
allTypes a;
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index a1619ec..a75f6c2 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -299,25 +299,20 @@ if(BUILD_TESTING)
"Should the tests that use '--build-target package' be run?"
ON)
mark_as_advanced(CTEST_TEST_CPACK)
- set(CTEST_TEST_OSX_ARCH 0)
set(CMake_TEST_XCODE_VERSION 0)
if(APPLE)
- set(CTEST_TEST_OSX_ARCH 1)
if(XCODE_VERSION)
set(CMake_TEST_XCODE_VERSION "${XCODE_VERSION}")
else()
execute_process(
COMMAND xcodebuild -version
- OUTPUT_VARIABLE _version ERROR_VARIABLE _version_err
+ OUTPUT_VARIABLE _version
+ RESULT_VARIABLE _failed
)
- if(_version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)")
+ if(NOT _failed AND _version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)")
set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}")
endif()
endif()
- if(NOT CMake_TEST_XCODE_VERSION VERSION_LESS 10)
- # Since Xcode 10 we do not have two supported architectures for the host.
- set(CTEST_TEST_OSX_ARCH 0)
- endif()
if(CMAKE_OSX_SYSROOT)
execute_process(
COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version ProductName
@@ -392,7 +387,19 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(TryCompile TryCompile)
ADD_TEST_MACRO(SystemInformation SystemInformation)
ADD_TEST_MACRO(MathTest MathTest)
+
+ string(REPLACE ";" "$<SEMICOLON>" TEST_STDS_C "${CMake_TEST_C_STANDARDS}")
+ string(REPLACE ";" "$<SEMICOLON>" TEST_STDS_CXX "${CMake_TEST_CXX_STANDARDS}")
+ string(REPLACE ";" "$<SEMICOLON>" TEST_STDS_CUDA "${CMake_TEST_CUDA_STANDARDS}")
+ set(CompileFeatures_BUILD_OPTIONS
+ -DCMake_TEST_C_STANDARDS=${TEST_STDS_C}
+ -DCMake_TEST_CXX_STANDARDS=${TEST_STDS_CXX}
+ -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
+ -DCMake_TEST_CUDA_STANDARDS=${TEST_STDS_CUDA}
+ )
ADD_TEST_MACRO(CompileFeatures CompileFeatures)
+ set_property(TEST CompileFeatures APPEND PROPERTY LABELS "CUDA")
+
ADD_TEST_MACRO(CMakeCommands.target_compile_features)
if(CMake_TEST_RESOURCES)
@@ -412,6 +419,7 @@ if(BUILD_TESTING)
PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c")
if(CMake_TEST_Swift)
ADD_TEST_MACRO(SwiftOnly SwiftOnly)
+ ADD_TEST_MACRO(SwiftMixPCH SwiftMixPCH)
if(CMake_TEST_XCODE_SWIFT)
ADD_TEST_MACRO(SwiftMix SwiftMix)
endif()
@@ -421,6 +429,7 @@ if(BUILD_TESTING)
endif()
if(CMAKE_Fortran_COMPILER)
ADD_TEST_MACRO(FortranOnly FortranOnly)
+ set_property(TEST FortranOnly APPEND PROPERTY LABELS "Fortran")
endif()
# test Visual Studio GNU Fortran mixing with cmake_add_fortran_subdirectory
# run this project if we have a working fortran compiler or
@@ -454,6 +463,7 @@ if(BUILD_TESTING)
endif()
if(NOT CMAKE_SKIP_VSGNUFortran)
ADD_TEST_MACRO(VSGNUFortran ${CMAKE_CMAKE_COMMAND} -P runtest.cmake)
+ set_property(TEST VSGNUFortran APPEND PROPERTY LABELS "Fortran")
endif()
endif()
@@ -495,6 +505,10 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(ReturnTest ReturnTest)
ADD_TEST_MACRO(Properties Properties)
ADD_TEST_MACRO(Assembler HelloAsm)
+ # relies on Linux syscall interface
+ if(CMake_TEST_ASM_NASM AND CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ ADD_TEST_MACRO(NasmOnly NasmOnly)
+ endif()
ADD_TEST_MACRO(SourceGroups SourceGroups)
ADD_TEST_MACRO(Preprocess Preprocess)
set(ExportImport_BUILD_OPTIONS -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
@@ -508,15 +522,18 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(PolicyScope PolicyScope)
ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
ADD_TEST_MACRO(CompileDefinitions CompileDefinitions)
- if(CMAKE_Fortran_COMPILER)
- set(CompileOptions_BUILD_OPTIONS -DTEST_FORTRAN=1)
- endif()
+
if(_isMultiConfig)
set(CompileOptions_CTEST_OPTIONS --build-config $<CONFIGURATION>)
else()
set(CompileOptions_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
endif()
+ if(CMAKE_Fortran_COMPILER)
+ list(APPEND CompileOptions_BUILD_OPTIONS -DTEST_FORTRAN=1)
+ endif()
ADD_TEST_MACRO(CompileOptions CompileOptions)
+ set_property(TEST CompileOptions APPEND PROPERTY LABELS "Fortran")
+
ADD_TEST_MACRO(CompatibleInterface CompatibleInterface)
ADD_TEST_MACRO(AliasTarget AliasTarget)
ADD_TEST_MACRO(StagingPrefix StagingPrefix)
@@ -556,10 +573,13 @@ if(BUILD_TESTING)
if("${CMAKE_GENERATOR}" MATCHES "Make")
ADD_TEST_MACRO(Policy0002 Policy0002)
endif()
- if(CTEST_TEST_OSX_ARCH)
+ if(CMake_TEST_XCODE_VERSION)
+ set(Architecture_BUILD_OPTIONS -DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION})
ADD_TEST_MACRO(Architecture Architecture)
set_tests_properties(Architecture PROPERTIES
PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked|but attempting to link with file built for)")
+ set_property(TEST Architecture APPEND PROPERTY
+ PASS_REGULAR_EXPRESSION "Skip test x86_64 only|found architecture '.*', required architecture '.*'")
endif()
list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX})
@@ -659,6 +679,7 @@ if(BUILD_TESTING)
if(CMAKE_Fortran_COMPILER)
set(Module.CheckIPOSupported-Fortran_BUILD_OPTIONS -DCMake_TEST_IPO_WORKS_Fortran=${CMake_TEST_IPO_WORKS_Fortran})
ADD_TEST_MACRO(Module.CheckIPOSupported-Fortran CheckIPOSupported-Fortran)
+ set_property(TEST Module.CheckIPOSupported-Fortran APPEND PROPERTY LABELS "Fortran")
endif()
add_test(Module.ExternalData ${CMAKE_CTEST_COMMAND}
@@ -926,6 +947,8 @@ if(BUILD_TESTING)
"${CMake_BINARY_DIR}/Tests/BuildDepends"
${build_generator_args}
--build-project BuildDepends
+ --build-options
+ "-DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION}"
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends")
@@ -967,36 +990,6 @@ if(BUILD_TESTING)
endif()
endif()
- # On Windows run the CPackWiXGenerator test
- # if the WiX Toolset seems to be available
- if(WIN32)
- file(TO_CMAKE_PATH "$ENV{WIX}" WIX_ROOT)
-
- find_program(WIX_LIGHT_EXECUTABLE light
- PATHS "${WIX_ROOT}/bin"
- DOC "WiX Toolset light.exe location")
-
- if(WIX_LIGHT_EXECUTABLE)
- add_test(CPackWiXGenerator ${CMAKE_CTEST_COMMAND}
- -C \${CTEST_CONFIGURATION_TYPE}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/CPackWiXGenerator"
- "${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
- ${build_generator_args}
- --build-project CPackWiXGenerator
- --build-options
- --test-command ${CMAKE_CMAKE_COMMAND}
- "-DCPackWiXGenerator_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
- "-Dno_verify:BOOL=${CMake_TEST_WIX_NO_VERIFY}"
- "-Dconfig=\${CTEST_CONFIGURATION_TYPE}"
- -P "${CMake_SOURCE_DIR}/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake")
-
- set_property(TEST CPackWiXGenerator PROPERTY
- ATTACHED_FILES_ON_FAIL
- "${CMake_BINARY_DIR}/Tests/CPackWiXGenerator/_CPack_Packages/win32/WIX/wix.log")
- endif()
- endif()
-
# On Windows run the CPackInnoSetupGenerator test
if(WIN32 AND CMake_TEST_CPACK_INNOSETUP)
add_test(CPackInnoSetupGenerator ${CMAKE_CTEST_COMMAND}
@@ -1466,6 +1459,7 @@ if(BUILD_TESTING)
_mod
IN ITEMS
ALSA
+ Backtrace
BLAS
Boost
BZip2
@@ -2159,7 +2153,7 @@ if(BUILD_TESTING)
endif()
ADD_TEST_MACRO(MSVCDebugInformationFormat)
set_property(TEST MSVCDebugInformationFormat APPEND
- PROPERTY LABELS "CUDA")
+ PROPERTY LABELS "CUDA" "Fortran")
set(MSVCRuntimeLibrary_BUILD_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
ADD_TEST_MACRO(MSVCRuntimeLibrary)
@@ -2167,6 +2161,7 @@ if(BUILD_TESTING)
PROPERTY LABELS "CUDA")
if(CMAKE_Fortran_COMPILER)
ADD_TEST_MACRO(MSVCRuntimeLibrary.Fortran)
+ set_property(TEST MSVCRuntimeLibrary.Fortran APPEND PROPERTY LABELS "Fortran")
endif()
endif()
if(MSVC OR
@@ -2798,7 +2793,6 @@ if(BUILD_TESTING)
-S "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" -VV
--output-log "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/testOut.log"
)
- set_property(TEST CTestCoverageCollectGCOV PROPERTY ENVIRONMENT CTEST_PARALLEL_LEVEL=)
configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake.in"
@@ -3065,19 +3059,6 @@ if(BUILD_TESTING)
"Test command:.*Working Directory:.*Environment variables:.*foo=bar.*this=that"
)
- configure_file(
- "${CMake_SOURCE_DIR}/Tests/CTestTestSkipReturnCode/test.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestTestSkipReturnCode/test.cmake"
- @ONLY ESCAPE_QUOTES)
- add_test(CTestTestSkipReturnCode ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestTestSkipReturnCode/test.cmake" -V
- --output-log "${CMake_BINARY_DIR}/Tests/CTestTestSkipReturnCode/testOutput.log"
- -C \${CTEST_CONFIGURATION_TYPE}
- )
- set_tests_properties(CTestTestSkipReturnCode PROPERTIES
- PASS_REGULAR_EXPRESSION "CMakeV1 \\.* +Passed.*CMakeV2 \\.+\\*+Skipped")
- set_property(TEST CTestTestSkipReturnCode PROPERTY ENVIRONMENT CTEST_PARALLEL_LEVEL=)
-
ADD_TEST_MACRO(CTestTestSerialInDepends ${CMAKE_CTEST_COMMAND} -j 4
--output-on-failure -C "\${CTestTest_CONFIG}")
@@ -3087,10 +3068,6 @@ if(BUILD_TESTING)
PASS_REGULAR_EXPRESSION "\\*\\*\\*Not Run"
)
- ADD_TEST_MACRO(CTestTestSerialOrder ${CMAKE_CTEST_COMMAND}
- --output-on-failure -C "\${CTestTest_CONFIG}")
- set_property(TEST CTestTestSerialOrder PROPERTY ENVIRONMENT CTEST_PARALLEL_LEVEL=)
-
if(NOT BORLAND)
set(CTestLimitDashJ_CTEST_OPTIONS --force-new-ctest-process)
add_test_macro(CTestLimitDashJ ${CMAKE_CTEST_COMMAND} -j 4
@@ -3114,15 +3091,6 @@ if(BUILD_TESTING)
)
configure_file(
- "${CMake_SOURCE_DIR}/Tests/CTestTestResourceLock/test.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake"
- @ONLY ESCAPE_QUOTES)
- add_test(CTestTestResourceLock ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake" -V
- --output-log "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/output.log"
- )
-
- configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestScheduler/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestScheduler/test.cmake"
@ONLY ESCAPE_QUOTES)
@@ -3361,6 +3329,7 @@ if(BUILD_TESTING)
--build-two-config
--test-command testf)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran")
+ set_property(TEST Fortran APPEND PROPERTY LABELS "Fortran")
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
add_test(FortranModules ${CMAKE_CTEST_COMMAND}
@@ -3375,6 +3344,7 @@ if(BUILD_TESTING)
${CMake_TEST_FortranModules_BUILD_OPTIONS}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranModules")
+ set_property(TEST FortranModules APPEND PROPERTY LABELS "Fortran")
endif()
# FortranCInterface tests.
@@ -3384,6 +3354,7 @@ if(BUILD_TESTING)
add_test(FortranC.Flags ${CMAKE_CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/FortranC/Flags.cmake)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC/Flags")
+ set_property(TEST FortranC.Flags APPEND PROPERTY LABELS "Fortran")
else()
add_test(FortranC ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -3394,6 +3365,7 @@ if(BUILD_TESTING)
--build-two-config
--test-command CMakeFiles/FortranCInterface/FortranCInterface)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC")
+ set_property(TEST FortranC APPEND PROPERTY LABELS "Fortran")
endif()
endif()
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index 30cabf1..ea06464 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -25,8 +25,8 @@ add_CMakeOnly_test(CheckCXXSymbolExists)
add_CMakeOnly_test(CheckCXXCompilerFlag)
add_CMakeOnly_test(CheckLanguage)
+set_property(TEST CMakeOnly.CheckLanguage APPEND PROPERTY LABELS "HIP" "Fortran")
if (CMake_TEST_HIP)
- set_property(TEST CMakeOnly.CheckLanguage APPEND PROPERTY LABELS "HIP")
add_CMakeOnly_test(CheckLanguageHIPPlatform)
set_property(TEST CMakeOnly.CheckLanguageHIPPlatform APPEND PROPERTY LABELS "HIP")
add_CMakeOnly_test(CheckLanguageHIPPlatform2)
@@ -52,6 +52,7 @@ endif()
if(CMAKE_Fortran_COMPILER)
add_CMakeOnly_test(CompilerIdFortran)
+ set_property(TEST CMakeOnly.CompilerIdFortran APPEND PROPERTY LABELS "Fortran")
endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio ([^9]|9[0-9])")
add_CMakeOnly_test(CompilerIdCSharp)
diff --git a/Tests/COnly/conly.c b/Tests/COnly/conly.c
index 2ae8a1a..c5f18ad 100644
--- a/Tests/COnly/conly.c
+++ b/Tests/COnly/conly.c
@@ -4,7 +4,7 @@
#include "libc1.h"
#include "libc2.h"
-int main()
+int main(void)
{
int class = 0;
if (LibC1Func() != 2.0) {
diff --git a/Tests/COnly/libc1.c b/Tests/COnly/libc1.c
index b01e1e1..e1f7e27 100644
--- a/Tests/COnly/libc1.c
+++ b/Tests/COnly/libc1.c
@@ -1,4 +1,4 @@
-float LibC1Func()
+float LibC1Func(void)
{
return 2.0;
}
diff --git a/Tests/COnly/libc2.c b/Tests/COnly/libc2.c
index 0fd8956..28d46f3 100644
--- a/Tests/COnly/libc2.c
+++ b/Tests/COnly/libc2.c
@@ -1,6 +1,6 @@
#include "libc2.h"
-float LibC2Func()
+float LibC2Func(void)
{
return 1.0;
}
diff --git a/Tests/CPackInnoSetupGenerator/main.c b/Tests/CPackInnoSetupGenerator/main.c
index 413899c..9165c97 100644
--- a/Tests/CPackInnoSetupGenerator/main.c
+++ b/Tests/CPackInnoSetupGenerator/main.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-int main()
+int main(void)
{
printf("Hello, World!\n");
return 42;
diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt
deleted file mode 100644
index 33fdc5e..0000000
--- a/Tests/CPackWiXGenerator/CMakeLists.txt
+++ /dev/null
@@ -1,119 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-project(CPackWiXGenerator)
-
-add_library(mylib mylib.cpp)
-
-add_executable(my-libapp mylibapp.cpp)
-target_link_libraries(my-libapp mylib)
-
-add_executable(my-other-app myotherapp.cpp)
-
-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/empty)
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/empty
- DESTINATION extras
- COMPONENT extras)
-
-install(TARGETS mylib
- ARCHIVE
- DESTINATION lib
- COMPONENT libraries)
-
-install(TARGETS my-libapp
- RUNTIME
- DESTINATION bin
- COMPONENT applications)
-
-install(TARGETS my-other-app
- RUNTIME
- DESTINATION bin
- COMPONENT applications2)
-
-install(FILES mylib.h "file with spaces.h"
- DESTINATION include
- COMPONENT headers)
-
-set(CPACK_GENERATOR "WIX")
-
-set(CPACK_PACKAGE_NAME "MyLib")
-set(CPACK_PACKAGE_VENDOR "CMake.org")
-set(CPACK_PACKAGE_CONTACT "somebody@cmake.org")
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
- "MyLib - CPack Component Installation Example")
-
-set(CPACK_PACKAGE_VERSION_MAJOR "1")
-set(CPACK_PACKAGE_VERSION_MINOR "0")
-set(CPACK_PACKAGE_VERSION_PATCH "0")
-set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
-
-set(CPACK_WIX_UPGRADE_GUID "BF20CE5E-7F7C-401D-8F7C-AB45E8D170E6")
-set(CPACK_WIX_UNINSTALL "1")
-
-# Support non-interactive sessions (like CI).
-set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-sval")
-
-set(CPACK_PACKAGE_EXECUTABLES
- "my-libapp" "CPack WiX Test"
- "my-other-app" "Second CPack WiX Test"
-)
-
-set(CPACK_CREATE_DESKTOP_LINKS
- "my-libapp"
- "my-other-app"
-)
-
-set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patch.xml")
-
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/license.txt")
-
-set(CPACK_WIX_PROPERTY_ARPCOMMENTS "My Custom ARPCOMMENTS")
-set(CPACK_WIX_PROPERTY_ARPHELPLINK "https://cmake.org")
-
-include(CPack)
-
-cpack_add_install_type(Full DISPLAY_NAME "Everything")
-cpack_add_install_type(Developer)
-
-cpack_add_component_group(Runtime)
-
-cpack_add_component_group(Development
- EXPANDED
- DESCRIPTION "All of the tools you'll ever need to develop software")
-
-cpack_add_component(extras
- DISPLAY_NAME "Extras"
- DESCRIPTION "Extras"
- GROUP Runtime
- INSTALL_TYPES Full)
-
-cpack_add_component(applications
- REQUIRED
- DISPLAY_NAME "MyLib Application"
- DESCRIPTION "An extremely useful application that makes use of MyLib"
- GROUP Runtime
- INSTALL_TYPES Full)
-
-cpack_add_component(applications2
- DISPLAY_NAME "MyLib Extra Application"
- DESCRIPTION "Another extremely useful application that makes use of MyLib"
- GROUP Runtime
- INSTALL_TYPES Full)
-
-cpack_add_component(documentation
- DISPLAY_NAME "MyLib Documentation"
- DESCRIPTION "The extensive suite of MyLib Application documentation files"
- GROUP Runtime
- INSTALL_TYPES Full)
-
-cpack_add_component(libraries
- DISPLAY_NAME "Libraries"
- DESCRIPTION "Static libraries used to build programs with MyLib"
- GROUP Development
- INSTALL_TYPES Developer Full)
-
-cpack_add_component(headers
- DISPLAY_NAME "C++ Headers"
- DESCRIPTION "C/C++ header files for use with MyLib"
- GROUP Development
- DEPENDS libraries
- INSTALL_TYPES Developer Full)
diff --git a/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake b/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake
deleted file mode 100644
index c549e61..0000000
--- a/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake
+++ /dev/null
@@ -1,79 +0,0 @@
-message(STATUS "=============================================================")
-message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
-message(STATUS "")
-
-if(NOT CPackWiXGenerator_BINARY_DIR)
- message(FATAL_ERROR "CPackWiXGenerator_BINARY_DIR not set")
-endif()
-
-message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}")
-message(STATUS "CMAKE_CPACK_COMMAND: ${CMAKE_CPACK_COMMAND}")
-message(STATUS "CPackWiXGenerator_BINARY_DIR: ${CPackWiXGenerator_BINARY_DIR}")
-
-if(config)
- set(_C_config -C ${config})
-endif()
-
-execute_process(COMMAND "${CMAKE_CPACK_COMMAND}"
- ${_C_config}
- RESULT_VARIABLE CPack_result
- OUTPUT_VARIABLE CPack_output
- ERROR_VARIABLE CPack_error
- WORKING_DIRECTORY "${CPackWiXGenerator_BINARY_DIR}")
-
-if(CPack_result)
- message(FATAL_ERROR "CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}")
-else ()
- message(STATUS "CPack_output=${CPack_output}")
-endif()
-
-set(expected_file_mask "*.msi")
-file(GLOB installer_file "${expected_file_mask}")
-
-message(STATUS "installer_file='${installer_file}'")
-message(STATUS "expected_file_mask='${expected_file_mask}'")
-
-if(NOT installer_file)
- message(FATAL_ERROR "installer_file does not exist.")
-endif()
-
-function(run_wix_command command)
- file(TO_CMAKE_PATH "$ENV{WIX}" WIX_ROOT)
- set(WIX_PROGRAM "${WIX_ROOT}/bin/${command}.exe")
-
- if(NOT EXISTS "${WIX_PROGRAM}")
- message(FATAL_ERROR "Failed to find WiX Tool: ${WIX_PROGRAM}")
- endif()
-
- message(STATUS "Running WiX Tool: ${command} ${ARGN}")
-
- execute_process(COMMAND "${WIX_PROGRAM}" ${ARGN}
- RESULT_VARIABLE WIX_result
- OUTPUT_VARIABLE WIX_output
- ERROR_VARIABLE WIX_output
- WORKING_DIRECTORY "${CPackWiXGenerator_BINARY_DIR}")
-
- message(STATUS "${command} Output: \n${WIX_output}")
-
- if(WIX_result)
- message(FATAL_ERROR "WiX ${command} failed: ${WIX_result}")
- endif()
-endfunction()
-
-file(GLOB WXS_SOURCE_FILES
- "${CPackWiXGenerator_BINARY_DIR}/_CPack_Packages/*/WIX/*.wxs")
-
-if(NOT WXS_SOURCE_FILES)
- message(FATAL_ERROR "Failed finding WiX source files to validate.")
-endif()
-
-foreach(WXS_SOURCE_FILE IN LISTS WXS_SOURCE_FILES)
- run_wix_command(wixcop "${WXS_SOURCE_FILE}")
-endforeach()
-
-# error SMOK1076 : ICE61: This product should remove only older
-# versions of itself. The Maximum version is not less
-# than the current product. (1.0.0 1.0.0)
-if (NOT no_verify)
- run_wix_command(smoke -nologo -wx -sw1076 "${installer_file}")
-endif ()
diff --git a/Tests/CTestTestResourceLock/CMakeLists.txt b/Tests/CTestTestResourceLock/CMakeLists.txt
deleted file mode 100644
index 683aba5..0000000
--- a/Tests/CTestTestResourceLock/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-cmake_minimum_required (VERSION 3.5)
-project(CTestTestResourceLock)
-include(CTest)
-
-add_executable (LockFile lockFile.c)
-
-add_test (TestLockedFile1.1 LockFile locked1.txt)
-add_test (TestLockedFile1.2 LockFile locked1.txt)
-set_tests_properties(TestLockedFile1.1 TestLockedFile1.2 PROPERTIES RESOURCE_LOCK "locked1.txt")
-
-add_test (TestLockedFile2.1 LockFile locked2.txt)
-add_test (TestLockedFile2.2 LockFile locked2.txt)
-set_tests_properties(TestLockedFile2.1 TestLockedFile2.2 PROPERTIES RESOURCE_LOCK "locked2.txt")
diff --git a/Tests/CTestTestResourceLock/CTestConfig.cmake b/Tests/CTestTestResourceLock/CTestConfig.cmake
deleted file mode 100644
index bd265f9..0000000
--- a/Tests/CTestTestResourceLock/CTestConfig.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "open.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
diff --git a/Tests/CTestTestResourceLock/lockFile.c b/Tests/CTestTestResourceLock/lockFile.c
deleted file mode 100644
index 8c023ef..0000000
--- a/Tests/CTestTestResourceLock/lockFile.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <stdio.h>
-
-/* Disable deprecation warning for fopen */
-#pragma warning(disable : 4996)
-
-/*if run serially, works fine.
- If run in parallel, someone will attempt to delete
- a locked file, which will fail */
-int main(int argc, char** argv)
-{
- FILE* file;
- int i;
- const char* fname;
- if (argc >= 2) {
- fname = argv[1];
- } else {
- fname = "lockedFile.txt";
- }
- file = fopen(fname, "w");
-
- for (i = 0; i < 10000; i++) {
- fprintf(file, "%s", "x");
- fflush(file);
- }
- fclose(file);
- return remove(fname);
-}
diff --git a/Tests/CTestTestResourceLock/test.cmake.in b/Tests/CTestTestResourceLock/test.cmake.in
deleted file mode 100644
index dab26fc..0000000
--- a/Tests/CTestTestResourceLock/test.cmake.in
+++ /dev/null
@@ -1,21 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-# Settings:
-set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
-set(CTEST_SITE "@SITE@")
-set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ResourceLock")
-
-set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestResourceLock")
-set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestResourceLock")
-set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
-set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
-set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@")
-set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
-set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
-set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
-set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
-
-CTEST_START(Experimental)
-CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 4)
diff --git a/Tests/CTestTestSerialOrder/CMakeLists.txt b/Tests/CTestTestSerialOrder/CMakeLists.txt
deleted file mode 100644
index d46d80e..0000000
--- a/Tests/CTestTestSerialOrder/CMakeLists.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-project(CTestTestSerialOrder)
-
-set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt")
-
-enable_testing()
-
-function(add_serial_order_test TEST_NAME)
- add_test(NAME ${TEST_NAME}
- COMMAND ${CMAKE_COMMAND}
- "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
- "-DTEST_NAME=${TEST_NAME}"
- -P "${CMAKE_CURRENT_SOURCE_DIR}/test.cmake"
- )
-
- if(ARGC GREATER 1)
- set_tests_properties(${TEST_NAME} PROPERTIES ${ARGN})
- endif()
-endfunction()
-
-add_serial_order_test(initialization COST 1000)
-add_serial_order_test(test1)
-add_serial_order_test(test2)
-add_serial_order_test(test3)
-add_serial_order_test(test4 DEPENDS test5)
-
-add_serial_order_test(test5)
-set_tests_properties(test5 PROPERTIES DEPENDS "test6;test7b;test7a")
-
-add_serial_order_test(test6 COST -2)
-add_serial_order_test(test7a COST -1)
-add_serial_order_test(test7b COST -1)
-add_serial_order_test(test8 COST 10)
-add_serial_order_test(test9 COST 20)
-add_serial_order_test(test10 COST 0)
-add_serial_order_test(test11)
-add_serial_order_test(test12 COST 0)
-
-add_serial_order_test(verification COST -1000)
diff --git a/Tests/CTestTestSerialOrder/test.cmake b/Tests/CTestTestSerialOrder/test.cmake
deleted file mode 100644
index 8479cae..0000000
--- a/Tests/CTestTestSerialOrder/test.cmake
+++ /dev/null
@@ -1,31 +0,0 @@
-list(APPEND EXPECTED_OUTPUT
- initialization
- test9
- test8
- test1
- test2
- test3
- test6
- test7a
- test7b
- test5
- test4
- test10
- test11
- test12
-)
-
-
-if("${TEST_NAME}" STREQUAL "initialization")
- file(WRITE ${TEST_OUTPUT_FILE} "${TEST_NAME}")
-
-elseif("${TEST_NAME}" STREQUAL "verification")
- file(READ ${TEST_OUTPUT_FILE} ACTUAL_OUTPUT)
- if(NOT "${ACTUAL_OUTPUT}" STREQUAL "${EXPECTED_OUTPUT}")
- message(FATAL_ERROR "Actual test order [${ACTUAL_OUTPUT}] differs from expected test order [${EXPECTED_OUTPUT}]")
- endif()
-
-else()
- file(APPEND ${TEST_OUTPUT_FILE} ";${TEST_NAME}")
-
-endif()
diff --git a/Tests/CTestTestSkipReturnCode/CMakeLists.txt b/Tests/CTestTestSkipReturnCode/CMakeLists.txt
deleted file mode 100644
index 1eeeec6..0000000
--- a/Tests/CTestTestSkipReturnCode/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-project(CTestTestSkipReturnCode)
-include(CTest)
-
-add_test (NAME CMakeV1 COMMAND ${CMAKE_COMMAND} "--version")
-add_test (NAME CMakeV2 COMMAND ${CMAKE_COMMAND} "--version")
-
-set_tests_properties(CMakeV2 PROPERTIES SKIP_RETURN_CODE 0)
diff --git a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake b/Tests/CTestTestSkipReturnCode/CTestConfig.cmake
deleted file mode 100644
index 5bc1e9e..0000000
--- a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "open.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
diff --git a/Tests/CTestTestSkipReturnCode/test.cmake.in b/Tests/CTestTestSkipReturnCode/test.cmake.in
deleted file mode 100644
index b45e4a6..0000000
--- a/Tests/CTestTestSkipReturnCode/test.cmake.in
+++ /dev/null
@@ -1,23 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-
-# Settings:
-set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
-set(CTEST_SITE "@SITE@")
-set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-SkipReturnCode")
-
-set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestSkipReturnCode")
-set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSkipReturnCode")
-set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
-set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
-set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@")
-set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
-set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
-set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
-set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
-
-#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
-
-CTEST_START(Experimental)
-CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestVerboseOutput/nop.c b/Tests/CTestTestVerboseOutput/nop.c
index f8b643a..8488f4e 100644
--- a/Tests/CTestTestVerboseOutput/nop.c
+++ b/Tests/CTestTestVerboseOutput/nop.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index 7fddaa3..5e3448b 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -193,7 +193,7 @@ run_child(
)
run_child(
WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} push origin
+ COMMAND ${GIT} push origin HEAD
)
#-----------------------------------------------------------------------------
@@ -214,7 +214,7 @@ run_child(
)
run_child(
WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} push origin
+ COMMAND ${GIT} push origin HEAD
)
#-----------------------------------------------------------------------------
diff --git a/Tests/CommandLength/test.c b/Tests/CommandLength/test.c
index f8b643a..8488f4e 100644
--- a/Tests/CommandLength/test.c
+++ b/Tests/CommandLength/test.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/CompatibleInterface/CMakeLists.txt b/Tests/CompatibleInterface/CMakeLists.txt
index 668a97b..5d57ce4 100644
--- a/Tests/CompatibleInterface/CMakeLists.txt
+++ b/Tests/CompatibleInterface/CMakeLists.txt
@@ -13,12 +13,14 @@ set_property(TARGET iface1 APPEND PROPERTY
BOOL_PROP2
BOOL_PROP3
BOOL_PROP4
+ BOOL_PROP5
)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING
STRING_PROP1
STRING_PROP2
STRING_PROP3
+ STRING_PROP4
)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_NUMBER_MIN
@@ -26,30 +28,40 @@ set_property(TARGET iface1 APPEND PROPERTY
NUMBER_MIN_PROP2
NUMBER_MIN_PROP3
NUMBER_MIN_PROP4
+ NUMBER_MIN_PROP5
+ NUMBER_MIN_PROP6
)
set_property(TARGET iface1 APPEND PROPERTY
COMPATIBLE_INTERFACE_NUMBER_MAX
NUMBER_MAX_PROP1
NUMBER_MAX_PROP2
+ NUMBER_MAX_PROP3
+ NUMBER_MAX_PROP4
)
set(CMAKE_DEBUG_TARGET_PROPERTIES
- BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4
- STRING_PROP1 STRING_PROP2 STRING_PROP3
- NUMBER_MIN_PROP1 NUMBER_MIN_PROP2 NUMBER_MIN_PROP3 NUMBER_MIN_PROP4
- NUMBER_MAX_PROP1 NUMBER_MAX_PROP2
+ BOOL_PROP1 BOOL_PROP2 BOOL_PROP3 BOOL_PROP4 BOOL_PROP5
+ STRING_PROP1 STRING_PROP2 STRING_PROP3 STRING_PROP4
+ NUMBER_MIN_PROP1 NUMBER_MIN_PROP2 NUMBER_MIN_PROP3 NUMBER_MIN_PROP4 NUMBER_MIN_PROP5 NUMBER_MIN_PROP6
+ NUMBER_MAX_PROP1 NUMBER_MAX_PROP2 NUMBER_MAX_PROP3 NUMBER_MAX_PROP4
)
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP1 ON)
set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP2 ON)
+set_property(TARGET iface1 PROPERTY INTERFACE_BOOL_PROP5 ON)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP1 prop1)
set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP2 prop2)
+set_property(TARGET iface1 PROPERTY INTERFACE_STRING_PROP4 prop4)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP1 100)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP2 200)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP3 0x10)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP4 0x10)
+set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP5 5)
+set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MIN_PROP6 6)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP1 100)
set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP2 200)
+set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP3 3)
+set_property(TARGET iface1 PROPERTY INTERFACE_NUMBER_MAX_PROP4 4)
add_executable(CompatibleInterface main.cpp)
target_link_libraries(CompatibleInterface iface1)
@@ -86,8 +98,48 @@ target_compile_definitions(CompatibleInterface
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP2>,200>:NUMBER_MIN_PROP2=200>
$<$<EQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP3>,0xA>:NUMBER_MIN_PROP3=0xA>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP4>,0x10>:NUMBER_MIN_PROP4=0x10>
+ $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MIN_PROP5>,5>:NUMBER_MIN_PROP5=5>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP1>,100>:NUMBER_MAX_PROP1=100>
$<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP2>,250>:NUMBER_MAX_PROP2=250>
+ $<$<STREQUAL:$<TARGET_PROPERTY:NUMBER_MAX_PROP3>,3>:NUMBER_MAX_PROP3=3>
+
+ # Static libraries compute COMPATIBLE_INTERFACE_ properties transitively.
+ $<$<BOOL:$<TARGET_PROPERTY:static1,BOOL_PROP1>>:STATIC1_BOOL_PROP1>
+ $<$<STREQUAL:$<TARGET_PROPERTY:static1,STRING_PROP1>,prop1>:STATIC1_STRING_PROP1>
+ $<$<EQUAL:$<TARGET_PROPERTY:static1,NUMBER_MAX_PROP3>,3>:STATIC1_NUMBER_MAX_PROP3>
+ $<$<EQUAL:$<TARGET_PROPERTY:static1,NUMBER_MIN_PROP5>,5>:STATIC1_NUMBER_MIN_PROP5>
+
+ # Object libraries do not compute COMPATIBLE_INTERFACE_ properties transitively.
+ $<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:object1,BOOL_PROP1>,>>:OBJECT1_BOOL_PROP1>
+ $<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:object1,STRING_PROP1>,>>:OBJECT1_STRING_PROP1>
+ $<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:object1,NUMBER_MAX_PROP3>,>>:OBJECT1_NUMBER_MAX_PROP3>
+ $<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:object1,NUMBER_MIN_PROP5>,>>:OBJECT1_NUMBER_MIN_PROP5>
+
+ # Interface libraries do not compute COMPATIBLE_INTERFACE_ properties transitively.
+ $<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:iface3,BOOL_PROP1>,>>:IFACE3_BOOL_PROP1>
+ $<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:iface3,STRING_PROP1>,>>:IFACE3_STRING_PROP1>
+ $<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:iface3,NUMBER_MAX_PROP3>,>>:IFACE3_NUMBER_MAX_PROP3>
+ $<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:iface3,NUMBER_MIN_PROP5>,>>:IFACE3_NUMBER_MIN_PROP5>
+
+ # Static libraries compute COMPATIBLE_INTERFACE_ properties transitively.
+ $<$<BOOL:$<TARGET_PROPERTY:static1,BOOL_PROP5>>:STATIC1_BOOL_PROP5>
+ $<$<STREQUAL:$<TARGET_PROPERTY:static1,STRING_PROP4>,prop4>:STATIC1_STRING_PROP4>
+ $<$<EQUAL:$<TARGET_PROPERTY:static1,NUMBER_MIN_PROP6>,6>:STATIC1_NUMBER_MIN_PROP6>
+ $<$<EQUAL:$<TARGET_PROPERTY:static1,NUMBER_MAX_PROP4>,4>:STATIC1_NUMBER_MAX_PROP4>
+
+ # Object libraries do not compute COMPATIBLE_INTERFACE_ properties transitively,
+ # but can have properties set on them.
+ $<$<BOOL:$<TARGET_PROPERTY:object1,BOOL_PROP5>>:OBJECT1_BOOL_PROP5>
+ $<$<STREQUAL:$<TARGET_PROPERTY:object1,STRING_PROP4>,prop4>:OBJECT1_STRING_PROP4>
+ $<$<EQUAL:$<TARGET_PROPERTY:object1,NUMBER_MIN_PROP6>,7>:OBJECT1_NUMBER_MIN_PROP6>
+ $<$<EQUAL:$<TARGET_PROPERTY:object1,NUMBER_MAX_PROP4>,1>:OBJECT1_NUMBER_MAX_PROP4>
+
+ # Interface libraries do not compute COMPATIBLE_INTERFACE_ properties transitively,
+ # but can have properties set on them.
+ $<$<BOOL:$<TARGET_PROPERTY:iface3,BOOL_PROP5>>:IFACE3_BOOL_PROP5>
+ $<$<STREQUAL:$<TARGET_PROPERTY:iface3,STRING_PROP4>,prop4>:IFACE3_STRING_PROP4>
+ $<$<EQUAL:$<TARGET_PROPERTY:iface3,NUMBER_MIN_PROP6>,7>:IFACE3_NUMBER_MIN_PROP6>
+ $<$<EQUAL:$<TARGET_PROPERTY:iface3,NUMBER_MAX_PROP4>,1>:IFACE3_NUMBER_MAX_PROP4>
)
@@ -128,3 +180,64 @@ set_property(TARGET CompatibleInterface APPEND PROPERTY
COMPATIBLE_INTERFACE_BOOL
NON_RELEVANT_PROP
)
+
+add_library(static1 STATIC foo.cpp)
+set_property(TARGET static1 PROPERTY BOOL_PROP5 ON)
+set_property(TARGET static1 PROPERTY STRING_PROP4 prop4)
+set_property(TARGET static1 PROPERTY NUMBER_MIN_PROP6 7)
+set_property(TARGET static1 PROPERTY NUMBER_MAX_PROP4 1)
+target_link_libraries(static1 PUBLIC iface1)
+
+add_library(object1 OBJECT foo.cpp)
+set_property(TARGET object1 PROPERTY BOOL_PROP5 ON)
+set_property(TARGET object1 PROPERTY STRING_PROP4 prop4)
+set_property(TARGET object1 PROPERTY NUMBER_MIN_PROP6 7)
+set_property(TARGET object1 PROPERTY NUMBER_MAX_PROP4 1)
+target_link_libraries(object1 PUBLIC iface1)
+
+add_library(iface3 INTERFACE)
+set_property(TARGET iface3 PROPERTY BOOL_PROP5 ON)
+set_property(TARGET iface3 PROPERTY STRING_PROP4 prop4)
+set_property(TARGET iface3 PROPERTY NUMBER_MIN_PROP6 7)
+set_property(TARGET iface3 PROPERTY NUMBER_MAX_PROP4 1)
+target_link_libraries(iface3 INTERFACE iface1)
+
+# Test COMPATIBLE_INTERFACE_* property evaluation outside of usage requirements.
+add_custom_target(check ALL VERBATIM
+ COMMAND CompatibleInterface
+ # expect actual
+ "1" "$<TARGET_PROPERTY:CompatibleInterface,BOOL_PROP1>"
+ "prop1" "$<TARGET_PROPERTY:CompatibleInterface,STRING_PROP1>"
+ "3" "$<TARGET_PROPERTY:CompatibleInterface,NUMBER_MAX_PROP3>"
+ "5" "$<TARGET_PROPERTY:CompatibleInterface,NUMBER_MIN_PROP5>"
+
+ "1" "$<TARGET_PROPERTY:static1,BOOL_PROP1>"
+ "prop1" "$<TARGET_PROPERTY:static1,STRING_PROP1>"
+ "3" "$<TARGET_PROPERTY:static1,NUMBER_MAX_PROP3>"
+ "5" "$<TARGET_PROPERTY:static1,NUMBER_MIN_PROP5>"
+
+ "" "$<TARGET_PROPERTY:object1,BOOL_PROP1>"
+ "" "$<TARGET_PROPERTY:object1,STRING_PROP1>"
+ "" "$<TARGET_PROPERTY:object1,NUMBER_MAX_PROP3>"
+ "" "$<TARGET_PROPERTY:object1,NUMBER_MIN_PROP5>"
+
+ "" "$<TARGET_PROPERTY:iface3,BOOL_PROP1>"
+ "" "$<TARGET_PROPERTY:iface3,STRING_PROP1>"
+ "" "$<TARGET_PROPERTY:iface3,NUMBER_MAX_PROP3>"
+ "" "$<TARGET_PROPERTY:iface3,NUMBER_MIN_PROP5>"
+
+ "ON" "$<TARGET_PROPERTY:static1,BOOL_PROP5>"
+ "prop4" "$<TARGET_PROPERTY:static1,STRING_PROP4>"
+ "6" "$<TARGET_PROPERTY:static1,NUMBER_MIN_PROP6>"
+ "4" "$<TARGET_PROPERTY:static1,NUMBER_MAX_PROP4>"
+
+ "ON" "$<TARGET_PROPERTY:object1,BOOL_PROP5>"
+ "prop4" "$<TARGET_PROPERTY:object1,STRING_PROP4>"
+ "7" "$<TARGET_PROPERTY:object1,NUMBER_MIN_PROP6>"
+ "1" "$<TARGET_PROPERTY:object1,NUMBER_MAX_PROP4>"
+
+ "ON" "$<TARGET_PROPERTY:iface3,BOOL_PROP5>"
+ "prop4" "$<TARGET_PROPERTY:iface3,STRING_PROP4>"
+ "7" "$<TARGET_PROPERTY:iface3,NUMBER_MIN_PROP6>"
+ "1" "$<TARGET_PROPERTY:iface3,NUMBER_MAX_PROP4>"
+ )
diff --git a/Tests/CompatibleInterface/main.cpp b/Tests/CompatibleInterface/main.cpp
index 0bccb82..1205cca 100644
--- a/Tests/CompatibleInterface/main.cpp
+++ b/Tests/CompatibleInterface/main.cpp
@@ -1,3 +1,5 @@
+#include <stdio.h>
+#include <string.h>
#ifndef BOOL_PROP1
# error Expected BOOL_PROP1
@@ -23,6 +25,102 @@
# error Expected STRING_PROP3
#endif
+#ifndef STATIC1_BOOL_PROP1
+# error Expected STATIC1_BOOL_PROP1
+#endif
+
+#ifndef STATIC1_STRING_PROP1
+# error Expected STATIC1_STRING_PROP1
+#endif
+
+#ifndef STATIC1_NUMBER_MAX_PROP3
+# error Expected STATIC1_NUMBER_MAX_PROP3
+#endif
+
+#ifndef STATIC1_NUMBER_MIN_PROP5
+# error Expected STATIC1_NUMBER_MIN_PROP5
+#endif
+
+#ifdef OBJECT1_BOOL_PROP1
+# error Unexpected OBJECT1_BOOL_PROP1
+#endif
+
+#ifdef OBJECT1_STRING_PROP1
+# error Unexpected OBJECT1_STRING_PROP1
+#endif
+
+#ifdef OBJECT1_NUMBER_MAX_PROP3
+# error Unexpected OBJECT1_NUMBER_MAX_PROP3
+#endif
+
+#ifdef OBJECT1_NUMBER_MIN_PROP5
+# error Unexpected OBJECT1_NUMBER_MIN_PROP5
+#endif
+
+#ifdef IFACE3_BOOL_PROP1
+# error Unexpected IFACE3_BOOL_PROP1
+#endif
+
+#ifdef IFACE3_STRING_PROP1
+# error Unexpected IFACE3_STRING_PROP1
+#endif
+
+#ifdef IFACE3_NUMBER_MAX_PROP3
+# error Unexpected IFACE3_NUMBER_MAX_PROP3
+#endif
+
+#ifdef IFACE3_NUMBER_MIN_PROP5
+# error Unexpected IFACE3_NUMBER_MIN_PROP5
+#endif
+
+#ifndef STATIC1_BOOL_PROP5
+# error Expected STATIC1_BOOL_PROP5
+#endif
+
+#ifndef STATIC1_STRING_PROP4
+# error Expected STATIC1_STRING_PROP4
+#endif
+
+#ifndef STATIC1_NUMBER_MIN_PROP6
+# error Expected STATIC1_NUMBER_MIN_PROP6
+#endif
+
+#ifndef STATIC1_NUMBER_MAX_PROP4
+# error Expected STATIC1_NUMBER_MAX_PROP4
+#endif
+
+#ifndef OBJECT1_BOOL_PROP5
+# error Expected OBJECT1_BOOL_PROP5
+#endif
+
+#ifndef OBJECT1_STRING_PROP4
+# error Expected OBJECT1_STRING_PROP4
+#endif
+
+#ifndef OBJECT1_NUMBER_MIN_PROP6
+# error Expected OBJECT1_NUMBER_MIN_PROP6
+#endif
+
+#ifndef OBJECT1_NUMBER_MAX_PROP4
+# error Expected OBJECT1_NUMBER_MAX_PROP4
+#endif
+
+#ifndef IFACE3_BOOL_PROP5
+# error Expected IFACE3_BOOL_PROP5
+#endif
+
+#ifndef IFACE3_STRING_PROP4
+# error Expected IFACE3_STRING_PROP4
+#endif
+
+#ifndef IFACE3_NUMBER_MIN_PROP6
+# error Expected IFACE3_NUMBER_MIN_PROP6
+#endif
+
+#ifndef IFACE3_NUMBER_MAX_PROP4
+# error Expected IFACE3_NUMBER_MAX_PROP4
+#endif
+
template <bool test>
struct CMakeStaticAssert;
@@ -35,10 +133,12 @@ enum
{
NumericMaxTest1 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP1 == 100>),
NumericMaxTest2 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP2 == 250>),
+ NumericMaxTest3 = sizeof(CMakeStaticAssert<NUMBER_MAX_PROP3 == 3>),
NumericMinTest1 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP1 == 50>),
NumericMinTest2 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP2 == 200>),
NumericMinTest3 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP3 == 0xA>),
- NumericMinTest4 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP4 == 0x10>)
+ NumericMinTest4 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP4 == 0x10>),
+ NumericMinTest5 = sizeof(CMakeStaticAssert<NUMBER_MIN_PROP5 == 5>)
};
#include "iface2.h"
@@ -51,6 +151,14 @@ __declspec(dllimport)
int main(int argc, char** argv)
{
+ int result = 0;
+ for (int i = 2; i < argc; i += 2) {
+ if (strcmp(argv[i - 1], argv[i]) != 0) {
+ fprintf(stderr, "Argument %d expected '%s' but got '%s'.\n", i,
+ argv[i - 1], argv[i]);
+ result = 1;
+ }
+ }
Iface2 if2;
- return if2.foo() + foo() + bar();
+ return result + if2.foo() + foo() + bar();
}
diff --git a/Tests/CompileDefinitions/runtest.c b/Tests/CompileDefinitions/runtest.c
index c6dac4d..37317b8 100644
--- a/Tests/CompileDefinitions/runtest.c
+++ b/Tests/CompileDefinitions/runtest.c
@@ -6,7 +6,7 @@
# error "BUILD_CONFIG_NAME not defined!"
#endif
-int main()
+int main(void)
{
char build_config_name[] = BUILD_CONFIG_NAME;
char* c;
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index d9bb447..469a085 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -6,6 +6,25 @@ project(CompileFeatures)
set(ext_C c)
set(ext_CXX cpp)
+set(std_C 90 99 11 17 23)
+set(std_CXX 98 11 14 17 20 23 26)
+
+if(CMake_TEST_CUDA)
+ enable_language(CUDA)
+ set(ext_CUDA cu)
+ set(std_CUDA 03 11 14 17 20 23 26)
+endif()
+
+foreach(lang C CXX CUDA)
+ foreach(std IN LISTS std_${lang})
+ string(TOLOWER "${lang}_std_${std}" feature)
+ if("${std}" IN_LIST CMake_TEST_${lang}_STANDARDS
+ OR CMAKE_${lang}${std}_STANDARD_COMPILE_OPTION)
+ add_library(test_${feature} OBJECT ${feature}.${ext_${lang}})
+ target_compile_features(test_${feature} PRIVATE ${feature})
+ endif()
+ endforeach()
+endforeach()
macro(run_test feature lang)
if (${feature} IN_LIST CMAKE_${lang}_COMPILE_FEATURES)
@@ -273,6 +292,7 @@ if (CMAKE_CXX_COMPILE_FEATURES)
if (std_flag_idx EQUAL -1)
add_executable(default_dialect default_dialect.cpp)
target_compile_definitions(default_dialect PRIVATE
+ DEFAULT_CXX26=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},26>
DEFAULT_CXX23=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},23>
DEFAULT_CXX20=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},20>
DEFAULT_CXX17=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},17>
@@ -284,6 +304,22 @@ if (CMAKE_CXX_COMPILE_FEATURES)
endif()
endif ()
+if (CMake_TEST_CUDA
+ AND CMAKE_CUDA_COMPILE_FEATURES
+ AND CMAKE_CUDA_STANDARD_DEFAULT
+ AND NOT CMAKE_CUDA_FLAGS MATCHES "-std=")
+ add_executable(default_dialect_cuda default_dialect.cu)
+ target_compile_definitions(default_dialect_cuda PRIVATE
+ DEFAULT_CXX26=$<EQUAL:${CMAKE_CUDA_STANDARD_DEFAULT},26>
+ DEFAULT_CXX23=$<EQUAL:${CMAKE_CUDA_STANDARD_DEFAULT},23>
+ DEFAULT_CXX20=$<EQUAL:${CMAKE_CUDA_STANDARD_DEFAULT},20>
+ DEFAULT_CXX17=$<EQUAL:${CMAKE_CUDA_STANDARD_DEFAULT},17>
+ DEFAULT_CXX14=$<EQUAL:${CMAKE_CUDA_STANDARD_DEFAULT},14>
+ DEFAULT_CXX11=$<EQUAL:${CMAKE_CUDA_STANDARD_DEFAULT},11>
+ DEFAULT_CXX98=$<EQUAL:${CMAKE_CUDA_STANDARD_DEFAULT},03>
+ )
+endif ()
+
# always add a target "CompileFeatures"
if ((NOT CXX_expected_features) OR
(NOT cxx_auto_type IN_LIST CXX_expected_features))
diff --git a/Tests/CompileFeatures/c_std.h b/Tests/CompileFeatures/c_std.h
new file mode 100644
index 0000000..afe0308
--- /dev/null
+++ b/Tests/CompileFeatures/c_std.h
@@ -0,0 +1,8 @@
+#define C_STD_99 199901L
+#define C_STD_11 201112L
+#define C_STD_17 201710L
+#define C_STD_23 202311L
+
+#ifdef __STDC_VERSION__
+# define C_STD __STDC_VERSION__
+#endif
diff --git a/Tests/CompileFeatures/c_std_11.c b/Tests/CompileFeatures/c_std_11.c
new file mode 100644
index 0000000..2938c17
--- /dev/null
+++ b/Tests/CompileFeatures/c_std_11.c
@@ -0,0 +1,5 @@
+#include "c_std.h"
+#if defined(C_STD) && C_STD <= C_STD_99 && \
+ !(defined(__SUNPRO_C) && __SUNPRO_C < 0x5140 && C_STD == C_STD_99)
+# error "c_std_11 not honored"
+#endif
diff --git a/Tests/CompileFeatures/c_std_17.c b/Tests/CompileFeatures/c_std_17.c
new file mode 100644
index 0000000..938cba4
--- /dev/null
+++ b/Tests/CompileFeatures/c_std_17.c
@@ -0,0 +1,4 @@
+#include "c_std.h"
+#if defined(C_STD) && C_STD <= C_STD_11
+# error "c_std_17 not honored"
+#endif
diff --git a/Tests/CompileFeatures/c_std_23.c b/Tests/CompileFeatures/c_std_23.c
new file mode 100644
index 0000000..a60a16e
--- /dev/null
+++ b/Tests/CompileFeatures/c_std_23.c
@@ -0,0 +1,5 @@
+#include "c_std.h"
+#if defined(C_STD) && C_STD <= C_STD_17 && \
+ !(C_STD == C_STD_17 && defined(__clang_major__) && __clang_major__ < 14)
+# error "c_std_23 not honored"
+#endif
diff --git a/Tests/CPackWiXGenerator/file with spaces.h b/Tests/CompileFeatures/c_std_90.c
index e69de29..e69de29 100644
--- a/Tests/CPackWiXGenerator/file with spaces.h
+++ b/Tests/CompileFeatures/c_std_90.c
diff --git a/Tests/CompileFeatures/c_std_99.c b/Tests/CompileFeatures/c_std_99.c
new file mode 100644
index 0000000..20b6372
--- /dev/null
+++ b/Tests/CompileFeatures/c_std_99.c
@@ -0,0 +1,4 @@
+#include "c_std.h"
+#if defined(C_STD) && C_STD < C_STD_99
+# error "c_std_99 not honored"
+#endif
diff --git a/Tests/CompileFeatures/c_variadic_macros.c b/Tests/CompileFeatures/c_variadic_macros.c
index 4da111e..7a21902 100644
--- a/Tests/CompileFeatures/c_variadic_macros.c
+++ b/Tests/CompileFeatures/c_variadic_macros.c
@@ -9,7 +9,7 @@ int someFunc(int i1, char c, int i2)
#define FUNC_WRAPPER(...) someFunc(__VA_ARGS__)
-void otherFunc()
+void otherFunc(void)
{
FUNC_WRAPPER(42, 'a', 7);
}
diff --git a/Tests/CompileFeatures/cuda_std_03.cu b/Tests/CompileFeatures/cuda_std_03.cu
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/CompileFeatures/cuda_std_03.cu
diff --git a/Tests/CompileFeatures/cuda_std_11.cu b/Tests/CompileFeatures/cuda_std_11.cu
new file mode 100644
index 0000000..76813fd
--- /dev/null
+++ b/Tests/CompileFeatures/cuda_std_11.cu
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD < CXX_STD_11
+# error "cuda_std_11 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cuda_std_14.cu b/Tests/CompileFeatures/cuda_std_14.cu
new file mode 100644
index 0000000..53e23c8
--- /dev/null
+++ b/Tests/CompileFeatures/cuda_std_14.cu
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_11
+# error "cuda_std_14 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cuda_std_17.cu b/Tests/CompileFeatures/cuda_std_17.cu
new file mode 100644
index 0000000..502defb
--- /dev/null
+++ b/Tests/CompileFeatures/cuda_std_17.cu
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_14
+# error "cuda_std_17 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cuda_std_20.cu b/Tests/CompileFeatures/cuda_std_20.cu
new file mode 100644
index 0000000..afdd3ba
--- /dev/null
+++ b/Tests/CompileFeatures/cuda_std_20.cu
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_17
+# error "cuda_std_20 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cuda_std_23.cu b/Tests/CompileFeatures/cuda_std_23.cu
new file mode 100644
index 0000000..6bdaeb9
--- /dev/null
+++ b/Tests/CompileFeatures/cuda_std_23.cu
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_20
+# error "cuda_std_23 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cuda_std_26.cu b/Tests/CompileFeatures/cuda_std_26.cu
new file mode 100644
index 0000000..efeca8d
--- /dev/null
+++ b/Tests/CompileFeatures/cuda_std_26.cu
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_23
+# error "cuda_std_26 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cxx_std.h b/Tests/CompileFeatures/cxx_std.h
new file mode 100644
index 0000000..f17b683
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_std.h
@@ -0,0 +1,54 @@
+#define CXX_STD_98 199711L
+#define CXX_STD_11 201103L
+#define CXX_STD_14 201402L
+#define CXX_STD_17 201703L
+#define CXX_STD_20 202002L
+#define CXX_STD_23 202302L
+
+#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG)
+# if _MSVC_LANG > CXX_STD_17
+# define CXX_STD _MSVC_LANG
+# elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
+# define CXX_STD CXX_STD_20
+# elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17
+# define CXX_STD CXX_STD_20
+# elif _MSVC_LANG > CXX_STD_14
+# define CXX_STD CXX_STD_17
+# elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)
+# define CXX_STD CXX_STD_14
+# elif defined(__INTEL_CXX11_MODE__)
+# define CXX_STD CXX_STD_11
+# else
+# define CXX_STD CXX_STD_98
+# endif
+#elif defined(_MSC_VER) && defined(_MSVC_LANG)
+# if _MSVC_LANG > __cplusplus
+# define CXX_STD _MSVC_LANG
+# else
+# define CXX_STD __cplusplus
+# endif
+#elif defined(__NVCOMPILER)
+# if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
+# define CXX_STD CXX_STD_20
+# else
+# define CXX_STD __cplusplus
+# endif
+#elif defined(__INTEL_COMPILER) || defined(__PGI)
+# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes)
+# define CXX_STD CXX_STD_17
+# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
+# define CXX_STD CXX_STD_14
+# else
+# define CXX_STD __cplusplus
+# endif
+#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__)
+# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
+# define CXX_STD CXX_STD_14
+# else
+# define CXX_STD __cplusplus
+# endif
+#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define CXX_STD CXX_STD_11
+#else
+# define CXX_STD __cplusplus
+#endif
diff --git a/Tests/CompileFeatures/cxx_std_11.cpp b/Tests/CompileFeatures/cxx_std_11.cpp
new file mode 100644
index 0000000..aa85cdb
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_std_11.cpp
@@ -0,0 +1,6 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD < CXX_STD_11 && \
+ !(CXX_STD == CXX_STD_98 && \
+ (defined(__IBMCPP__) && defined(_AIX) && __IBMCPP__ == 1610))
+# error "cxx_std_11 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cxx_std_14.cpp b/Tests/CompileFeatures/cxx_std_14.cpp
new file mode 100644
index 0000000..dabd2ee
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_std_14.cpp
@@ -0,0 +1,9 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_11 && \
+ !(CXX_STD == CXX_STD_11 && \
+ ((defined(__GNUC__) && defined(__GNUC_MINOR__) && __GNUC__ == 4 && \
+ __GNUC_MINOR__ <= 8 && !defined(__clang__) && \
+ !defined(__INTEL_COMPILER) && !defined(__PGI)) || \
+ (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5150)))
+# error "cxx_std_14 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cxx_std_17.cpp b/Tests/CompileFeatures/cxx_std_17.cpp
new file mode 100644
index 0000000..3ca6bbe
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_std_17.cpp
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_14
+# error "cxx_std_17 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cxx_std_20.cpp b/Tests/CompileFeatures/cxx_std_20.cpp
new file mode 100644
index 0000000..35f5ac1
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_std_20.cpp
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_17
+# error "cxx_std_20 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cxx_std_23.cpp b/Tests/CompileFeatures/cxx_std_23.cpp
new file mode 100644
index 0000000..020578d
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_std_23.cpp
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_20
+# error "cxx_std_23 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cxx_std_26.cpp b/Tests/CompileFeatures/cxx_std_26.cpp
new file mode 100644
index 0000000..db3f6bc
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_std_26.cpp
@@ -0,0 +1,4 @@
+#include "cxx_std.h"
+#if defined(CXX_STD) && CXX_STD <= CXX_STD_23
+# error "cxx_std_26 not honored"
+#endif
diff --git a/Tests/CompileFeatures/cxx_std_98.cpp b/Tests/CompileFeatures/cxx_std_98.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_std_98.cpp
diff --git a/Tests/CompileFeatures/default_dialect.c b/Tests/CompileFeatures/default_dialect.c
index c696c83..4cd4ca0 100644
--- a/Tests/CompileFeatures/default_dialect.c
+++ b/Tests/CompileFeatures/default_dialect.c
@@ -1,18 +1,19 @@
+#include "c_std.h"
#if DEFAULT_C23
-# if __STDC_VERSION__ <= 201710L
+# if C_STD <= C_STD_17
# error Unexpected value for __STDC_VERSION__.
# endif
#elif DEFAULT_C17
-# if __STDC_VERSION__ < 201710L
+# if C_STD <= C_STD_11
# error Unexpected value for __STDC_VERSION__.
# endif
#elif DEFAULT_C11
-# if __STDC_VERSION__ < 201112L
+# if C_STD <= C_STD_99
# error Unexpected value for __STDC_VERSION__.
# endif
#elif DEFAULT_C99
-# if __STDC_VERSION__ != 199901L
+# if C_STD != C_STD_99
# error Unexpected value for __STDC_VERSION__.
# endif
#else
@@ -26,7 +27,7 @@
# endif
#endif
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp
index bd504ff..b873b14 100644
--- a/Tests/CompileFeatures/default_dialect.cpp
+++ b/Tests/CompileFeatures/default_dialect.cpp
@@ -1,48 +1,37 @@
+#include "cxx_std.h"
template <long l>
struct Outputter;
-#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
-# if defined(__INTEL_CXX11_MODE__)
-# if defined(__cpp_aggregate_nsdmi)
-# define CXX_STD 201402L
-# else
-# define CXX_STD 201103L
-# endif
-# else
-# define CXX_STD 199711L
-# endif
-#elif defined(_MSC_VER) && defined(_MSVC_LANG)
-# define CXX_STD _MSVC_LANG
-#else
-# define CXX_STD __cplusplus
-#endif
-
-#if DEFAULT_CXX23
-# if CXX_STD <= 202002L
+#if DEFAULT_CXX26
+# if CXX_STD <= CXX_STD_23
+Outputter<CXX_STD> o;
+# endif
+#elif DEFAULT_CXX23
+# if CXX_STD <= CXX_STD_20
Outputter<CXX_STD> o;
# endif
#elif DEFAULT_CXX20
-# if CXX_STD <= 201703L
+# if CXX_STD <= CXX_STD_17
Outputter<CXX_STD> o;
# endif
#elif DEFAULT_CXX17
-# if CXX_STD <= 201402L
+# if CXX_STD <= CXX_STD_14
Outputter<CXX_STD> o;
# endif
#elif DEFAULT_CXX14
-# if CXX_STD != 201402L
+# if CXX_STD <= CXX_STD_11
Outputter<CXX_STD> o;
# endif
#elif DEFAULT_CXX11
-# if CXX_STD != 201103L
+# if CXX_STD != CXX_STD_11
Outputter<CXX_STD> o;
# endif
#else
# if !DEFAULT_CXX98
# error Buildsystem error
# endif
-# if CXX_STD != 199711L && CXX_STD != 1 && \
+# if CXX_STD != CXX_STD_98 && CXX_STD != 1 && \
!defined(__GXX_EXPERIMENTAL_CXX0X__)
Outputter<CXX_STD> o;
# endif
diff --git a/Tests/CompileFeatures/default_dialect.cu b/Tests/CompileFeatures/default_dialect.cu
new file mode 100644
index 0000000..a549a5c
--- /dev/null
+++ b/Tests/CompileFeatures/default_dialect.cu
@@ -0,0 +1 @@
+#include "default_dialect.cpp"
diff --git a/Tests/CompileFeatures/genex_test.c b/Tests/CompileFeatures/genex_test.c
index de408ce..8ccad35 100644
--- a/Tests/CompileFeatures/genex_test.c
+++ b/Tests/CompileFeatures/genex_test.c
@@ -38,6 +38,6 @@
# endif
#endif
-int main()
+int main(void)
{
}
diff --git a/Tests/Complex/Executable/Sub1/NameConflictTest.c b/Tests/Complex/Executable/Sub1/NameConflictTest.c
index 8720386..740c236 100644
--- a/Tests/Complex/Executable/Sub1/NameConflictTest.c
+++ b/Tests/Complex/Executable/Sub1/NameConflictTest.c
@@ -1,4 +1,4 @@
-int NameConflictTest1()
+int NameConflictTest1(void)
{
return 0;
}
diff --git a/Tests/Complex/Executable/Sub2/NameConflictTest.c b/Tests/Complex/Executable/Sub2/NameConflictTest.c
index 4a32572..cee9f6f 100644
--- a/Tests/Complex/Executable/Sub2/NameConflictTest.c
+++ b/Tests/Complex/Executable/Sub2/NameConflictTest.c
@@ -1,4 +1,4 @@
-int NameConflictTest2()
+int NameConflictTest2(void)
{
return 0;
}
diff --git a/Tests/Complex/Library/TestLink.c b/Tests/Complex/Library/TestLink.c
index 25dee08..f4bc255 100644
--- a/Tests/Complex/Library/TestLink.c
+++ b/Tests/Complex/Library/TestLink.c
@@ -1,4 +1,4 @@
-int TestLinkGetType()
+int TestLinkGetType(void)
{
#ifdef CMakeTestLinkShared_EXPORTS
return 0;
diff --git a/Tests/Complex/Library/testConly.c b/Tests/Complex/Library/testConly.c
index eb933a2..05ecc18 100644
--- a/Tests/Complex/Library/testConly.c
+++ b/Tests/Complex/Library/testConly.c
@@ -2,7 +2,7 @@
#include <stdio.h>
-int CsharedFunction()
+int CsharedFunction(void)
{
#ifndef TEST_C_FLAGS
printf("TEST_C_FLAGS failed\n");
diff --git a/Tests/ComplexOneConfig/Executable/Sub1/NameConflictTest.c b/Tests/ComplexOneConfig/Executable/Sub1/NameConflictTest.c
index 8720386..740c236 100644
--- a/Tests/ComplexOneConfig/Executable/Sub1/NameConflictTest.c
+++ b/Tests/ComplexOneConfig/Executable/Sub1/NameConflictTest.c
@@ -1,4 +1,4 @@
-int NameConflictTest1()
+int NameConflictTest1(void)
{
return 0;
}
diff --git a/Tests/ComplexOneConfig/Executable/Sub2/NameConflictTest.c b/Tests/ComplexOneConfig/Executable/Sub2/NameConflictTest.c
index 4a32572..cee9f6f 100644
--- a/Tests/ComplexOneConfig/Executable/Sub2/NameConflictTest.c
+++ b/Tests/ComplexOneConfig/Executable/Sub2/NameConflictTest.c
@@ -1,4 +1,4 @@
-int NameConflictTest2()
+int NameConflictTest2(void)
{
return 0;
}
diff --git a/Tests/ComplexOneConfig/Library/TestLink.c b/Tests/ComplexOneConfig/Library/TestLink.c
index 25dee08..f4bc255 100644
--- a/Tests/ComplexOneConfig/Library/TestLink.c
+++ b/Tests/ComplexOneConfig/Library/TestLink.c
@@ -1,4 +1,4 @@
-int TestLinkGetType()
+int TestLinkGetType(void)
{
#ifdef CMakeTestLinkShared_EXPORTS
return 0;
diff --git a/Tests/ComplexOneConfig/Library/testConly.c b/Tests/ComplexOneConfig/Library/testConly.c
index eb933a2..05ecc18 100644
--- a/Tests/ComplexOneConfig/Library/testConly.c
+++ b/Tests/ComplexOneConfig/Library/testConly.c
@@ -2,7 +2,7 @@
#include <stdio.h>
-int CsharedFunction()
+int CsharedFunction(void)
{
#ifndef TEST_C_FLAGS
printf("TEST_C_FLAGS failed\n");
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt
index 38475f8..770afb3 100644
--- a/Tests/ConfigSources/CMakeLists.txt
+++ b/Tests/ConfigSources/CMakeLists.txt
@@ -154,7 +154,15 @@ else()
endif()
add_library(OneConfigOnly OBJECT "$<$<CONFIG:${one_config}>:${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp>")
set_property(TARGET OneConfigOnly PROPERTY LINKER_LANGUAGE CXX)
+add_executable(ConfigSourcesUseOne main_one_config.cpp)
+target_compile_definitions(ConfigSourcesUseOne PRIVATE "$<$<CONFIG:${one_config}>:CFG_ONE>")
+target_link_libraries(ConfigSourcesUseOne PRIVATE "$<$<CONFIG:${one_config}>:OneConfigOnly>")
+add_library(OneConfigOnlyIface INTERFACE)
+target_sources(OneConfigOnlyIface INTERFACE "$<$<CONFIG:${one_config}>:${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp>")
+add_executable(ConfigSourcesUseOneIface main_one_config.cpp)
+target_compile_definitions(ConfigSourcesUseOneIface PRIVATE "$<$<CONFIG:${one_config}>:CFG_ONE>")
+target_link_libraries(ConfigSourcesUseOneIface PRIVATE "$<$<CONFIG:${one_config}>:OneConfigOnlyIface>")
# ---------------------------------------------------------------------------
# Makes sure that each configuration uses the correct generated file.
diff --git a/Tests/ConfigSources/main_one_config.cpp b/Tests/ConfigSources/main_one_config.cpp
new file mode 100644
index 0000000..318944b
--- /dev/null
+++ b/Tests/ConfigSources/main_one_config.cpp
@@ -0,0 +1,8 @@
+#include "iface.h"
+int main()
+{
+#ifdef CFG_ONE
+ iface_src();
+#endif
+ return 0;
+}
diff --git a/Tests/Cuda/CMakeLists.txt b/Tests/Cuda/CMakeLists.txt
index efe0358..04ef86d 100644
--- a/Tests/Cuda/CMakeLists.txt
+++ b/Tests/Cuda/CMakeLists.txt
@@ -9,8 +9,10 @@ add_cuda_test_macro(Cuda.ObjectLibrary CudaObjectLibrary)
add_cuda_test_macro(Cuda.MixedStandardLevels1 MixedStandardLevels1)
add_cuda_test_macro(Cuda.MixedStandardLevels2 MixedStandardLevels2)
add_cuda_test_macro(Cuda.MixedStandardLevels3 MixedStandardLevels3)
-add_cuda_test_macro(Cuda.MixedStandardLevels4 MixedStandardLevels4)
-add_cuda_test_macro(Cuda.MixedStandardLevels5 MixedStandardLevels5)
+if(NOT WIN32 OR NOT CMake_TEST_CUDA STREQUAL "Clang") # MSVC std lib needs C++14
+ add_cuda_test_macro(Cuda.MixedStandardLevels4 MixedStandardLevels4)
+ add_cuda_test_macro(Cuda.MixedStandardLevels5 MixedStandardLevels5)
+endif()
add_cuda_test_macro(Cuda.NotEnabled CudaNotEnabled)
add_cuda_test_macro(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly)
add_cuda_test_macro(Cuda.StubRPATH StubRPATH)
diff --git a/Tests/Cuda/Complex/main.cpp b/Tests/Cuda/Complex/main.cpp
index da09b44..032f910 100644
--- a/Tests/Cuda/Complex/main.cpp
+++ b/Tests/Cuda/Complex/main.cpp
@@ -1,5 +1,3 @@
-#include <iostream>
-
#include "file1.h"
#include "file2.h"
diff --git a/Tests/Cuda/ObjectLibrary/main.cpp b/Tests/Cuda/ObjectLibrary/main.cpp
index e28f088..cc727c6 100644
--- a/Tests/Cuda/ObjectLibrary/main.cpp
+++ b/Tests/Cuda/ObjectLibrary/main.cpp
@@ -1,6 +1,3 @@
-
-#include <iostream>
-
int cpp_sq_func(int);
int cu1_sq_func(int);
int cu2_sq_func(int);
diff --git a/Tests/Cuda/ProperLinkFlags/main.cxx b/Tests/Cuda/ProperLinkFlags/main.cxx
index 7c0ee9e..665f31c 100644
--- a/Tests/Cuda/ProperLinkFlags/main.cxx
+++ b/Tests/Cuda/ProperLinkFlags/main.cxx
@@ -1,6 +1,3 @@
-
-#include <iostream>
-
#include "file1.h"
int main(int argc, char** argv)
diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp b/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp
index ac5341c..1e7350a 100644
--- a/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp
+++ b/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp
@@ -8,7 +8,6 @@
#endif
#include <cstdio>
-#include <iostream>
#include <assert.h>
#include <cuda_runtime_api.h>
diff --git a/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp b/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp
index ac5341c..1e7350a 100644
--- a/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp
+++ b/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp
@@ -8,7 +8,6 @@
#endif
#include <cstdio>
-#include <iostream>
#include <assert.h>
#include <cuda_runtime_api.h>
diff --git a/Tests/Cuda/Toolkit/CMakeLists.txt b/Tests/Cuda/Toolkit/CMakeLists.txt
index 4255b82..08ba20a 100644
--- a/Tests/Cuda/Toolkit/CMakeLists.txt
+++ b/Tests/Cuda/Toolkit/CMakeLists.txt
@@ -70,7 +70,11 @@ foreach (cuda_lib IN LISTS npp_libs)
endif()
endforeach()
-foreach (cuda_lib nvrtc nvToolsExt OpenCL)
+set(nv_libs nvrtc OpenCL)
+if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 12)
+ list(APPEND nv_libs nvToolsExt)
+endif()
+foreach (cuda_lib IN LISTS nv_libs)
if(NOT TARGET CUDA::${cuda_lib})
message(FATAL_ERROR "The CUDA::${cuda_lib} target was expected but couldn't be found")
endif()
diff --git a/Tests/Cuda/WithC/main.c b/Tests/Cuda/WithC/main.c
index 5f3c781..ed64427 100644
--- a/Tests/Cuda/WithC/main.c
+++ b/Tests/Cuda/WithC/main.c
@@ -4,7 +4,7 @@ extern int use_cuda(void);
# include <windows.h>
#endif
-int main()
+int main(void)
{
#ifdef _WIN32
/* Use an API that requires CMake's "standard" C libraries. */
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index 82366df..128d371 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -11,11 +11,14 @@ add_cuda_test_macro(CudaOnly.EnableStandard CudaOnlyEnableStandard)
add_cuda_test_macro(CudaOnly.ExportPTX CudaOnlyExportPTX)
add_cuda_test_macro(CudaOnly.SharedRuntimePlusToolkit CudaOnlySharedRuntimePlusToolkit)
add_cuda_test_macro(CudaOnly.StaticRuntimePlusToolkit CudaOnlyStaticRuntimePlusToolkit)
-add_cuda_test_macro(CudaOnly.Standard98 CudaOnlyStandard98)
+if(NOT WIN32 OR NOT CMake_TEST_CUDA STREQUAL "Clang") # MSVC std lib needs C++14
+ add_cuda_test_macro(CudaOnly.Standard98 CudaOnlyStandard98)
+endif()
set(CudaOnly.Toolkit_BUILD_OPTIONS -DHAS_CUPTI:BOOL=${CMake_TEST_CUDA_CUPTI})
add_cuda_test_macro(CudaOnly.Toolkit CudaOnlyToolkit)
add_cuda_test_macro(CudaOnly.ToolkitBeforeLang CudaOnlyToolkitBeforeLang)
add_cuda_test_macro(CudaOnly.ToolkitMultipleDirs CudaOnlyToolkitMultipleDirs)
+add_cuda_test_macro(CudaOnly.TryCompileTargetStatic CudaOnlyTryCompileTargetStatic)
add_cuda_test_macro(CudaOnly.WithDefs CudaOnlyWithDefs)
add_cuda_test_macro(CudaOnly.CircularLinkLine CudaOnlyCircularLinkLine)
add_cuda_test_macro(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols)
diff --git a/Tests/CudaOnly/DeviceLTO/file1.cu b/Tests/CudaOnly/DeviceLTO/file1.cu
index 703927c..5ca000d 100644
--- a/Tests/CudaOnly/DeviceLTO/file1.cu
+++ b/Tests/CudaOnly/DeviceLTO/file1.cu
@@ -1,16 +1,10 @@
-#ifdef _WIN32
-# define EXPORT __declspec(dllexport)
-#else
-# define EXPORT
-#endif
-
extern __device__ int file2_func(int);
void __global__ kernel(int x)
{
file2_func(x);
}
-EXPORT int launch_kernel(int x)
+int launch_kernel(int x)
{
kernel<<<1, 1>>>(x);
return x;
diff --git a/Tests/CudaOnly/DeviceLTO/main.cu b/Tests/CudaOnly/DeviceLTO/main.cu
index 8ef4873..bb72471 100644
--- a/Tests/CudaOnly/DeviceLTO/main.cu
+++ b/Tests/CudaOnly/DeviceLTO/main.cu
@@ -2,13 +2,7 @@
#include "cuda.h"
-#ifdef _WIN32
-# define IMPORT __declspec(dllimport)
-#else
-# define IMPORT
-#endif
-
-IMPORT int launch_kernel(int x);
+int launch_kernel(int x);
int choose_cuda_device()
{
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu b/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu
index 84a7a19..d123e09 100644
--- a/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu
@@ -1,6 +1,3 @@
-
-#include <iostream>
-
int main(int argc, char** argv)
{
return 0;
diff --git a/Tests/CudaOnly/EnableStandard/main.cu b/Tests/CudaOnly/EnableStandard/main.cu
index 740c832..acbbee3 100644
--- a/Tests/CudaOnly/EnableStandard/main.cu
+++ b/Tests/CudaOnly/EnableStandard/main.cu
@@ -1,6 +1,3 @@
-
-#include <iostream>
-
#ifdef _WIN32
# define IMPORT __declspec(dllimport)
#else
diff --git a/Tests/CudaOnly/ExportPTX/main.cu b/Tests/CudaOnly/ExportPTX/main.cu
index 132377c..d2a9b90 100644
--- a/Tests/CudaOnly/ExportPTX/main.cu
+++ b/Tests/CudaOnly/ExportPTX/main.cu
@@ -1,6 +1,3 @@
-
-#include <iostream>
-
/*
Define GENERATED_HEADER macro to allow c++ files to include headers
generated based on different configuration types.
diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
index ca73b1a..f2eb406 100644
--- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
+++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
@@ -20,7 +20,7 @@ set_target_properties(CUDASeparateLibA
POSITION_INDEPENDENT_CODE ON)
unset(CMAKE_CUDA_SEPARABLE_COMPILATION)
-if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC")
+if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC")
# Test adding a flag that is not in our CUDA flag table for VS.
if(NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 8)
string(APPEND CMAKE_CUDA_FLAGS " --ftemplate-depth 50")
diff --git a/Tests/CudaOnly/SeparateCompilation/file4.cu b/Tests/CudaOnly/SeparateCompilation/file4.cu
index cc24a46..f2ef8e7 100644
--- a/Tests/CudaOnly/SeparateCompilation/file4.cu
+++ b/Tests/CudaOnly/SeparateCompilation/file4.cu
@@ -1,6 +1,3 @@
-
-#include <iostream>
-
#include "file1.h"
#include "file2.h"
diff --git a/Tests/CudaOnly/SeparateCompilation/file5.cu b/Tests/CudaOnly/SeparateCompilation/file5.cu
index 38cbeb2..9b2c92a 100644
--- a/Tests/CudaOnly/SeparateCompilation/file5.cu
+++ b/Tests/CudaOnly/SeparateCompilation/file5.cu
@@ -1,6 +1,3 @@
-
-#include <iostream>
-
#include "file1.h"
#include "file2.h"
diff --git a/Tests/CudaOnly/SeparateCompilationTargetObjects/bar.cu b/Tests/CudaOnly/SeparateCompilationTargetObjects/bar.cu
index 234586f..2e824ec 100644
--- a/Tests/CudaOnly/SeparateCompilationTargetObjects/bar.cu
+++ b/Tests/CudaOnly/SeparateCompilationTargetObjects/bar.cu
@@ -1,6 +1,3 @@
-
-#include <iostream>
-
#ifdef _WIN32
# define EXPORT __declspec(dllexport)
#else
diff --git a/Tests/CudaOnly/SeparateCompilationTargetObjects/foo.cu b/Tests/CudaOnly/SeparateCompilationTargetObjects/foo.cu
index 75c04af..88acaca 100644
--- a/Tests/CudaOnly/SeparateCompilationTargetObjects/foo.cu
+++ b/Tests/CudaOnly/SeparateCompilationTargetObjects/foo.cu
@@ -1,6 +1,3 @@
-
-#include <iostream>
-
#ifdef _WIN32
# define EXPORT __declspec(dllexport)
#else
diff --git a/Tests/CudaOnly/SeparateCompilationTargetObjects/main.cu b/Tests/CudaOnly/SeparateCompilationTargetObjects/main.cu
index 78b10b1..367c488 100644
--- a/Tests/CudaOnly/SeparateCompilationTargetObjects/main.cu
+++ b/Tests/CudaOnly/SeparateCompilationTargetObjects/main.cu
@@ -1,6 +1,3 @@
-// main.cu
-#include <iostream>
-
#ifdef _WIN32
# define IMPORT __declspec(dllimport)
#else
diff --git a/Tests/CudaOnly/SharedRuntimePlusToolkit/nppif.cu b/Tests/CudaOnly/SharedRuntimePlusToolkit/nppif.cu
index ac5341c..1e7350a 100644
--- a/Tests/CudaOnly/SharedRuntimePlusToolkit/nppif.cu
+++ b/Tests/CudaOnly/SharedRuntimePlusToolkit/nppif.cu
@@ -8,7 +8,6 @@
#endif
#include <cstdio>
-#include <iostream>
#include <assert.h>
#include <cuda_runtime_api.h>
diff --git a/Tests/CudaOnly/StaticRuntimePlusToolkit/nppif.cu b/Tests/CudaOnly/StaticRuntimePlusToolkit/nppif.cu
index ac5341c..1e7350a 100644
--- a/Tests/CudaOnly/StaticRuntimePlusToolkit/nppif.cu
+++ b/Tests/CudaOnly/StaticRuntimePlusToolkit/nppif.cu
@@ -8,7 +8,6 @@
#endif
#include <cstdio>
-#include <iostream>
#include <assert.h>
#include <cuda_runtime_api.h>
diff --git a/Tests/CudaOnly/Toolkit/CMakeLists.txt b/Tests/CudaOnly/Toolkit/CMakeLists.txt
index b2694bf..477c816 100644
--- a/Tests/CudaOnly/Toolkit/CMakeLists.txt
+++ b/Tests/CudaOnly/Toolkit/CMakeLists.txt
@@ -57,7 +57,7 @@ set(npp_libs nppc nppial nppicc nppidei nppif nppig nppim nppist nppitc npps npp
if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11)
list(APPEND npp_libs nppicom)
endif()
-foreach (cuda_lib )
+foreach (cuda_lib IN LISTS npp_libs)
if(NOT CUDA_${cuda_lib}_LIBRARY)
message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found")
elseif(CUDA_${cuda_lib}_LIBRARY MATCHES [[\.\./]])
@@ -68,7 +68,11 @@ foreach (cuda_lib )
endif()
endforeach()
-foreach (cuda_lib nvrtc nvToolsExt OpenCL)
+set(nv_libs nvrtc OpenCL)
+if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 12)
+ list(APPEND nv_libs nvToolsExt)
+endif()
+foreach (cuda_lib IN LISTS nv_libs)
if(NOT CUDA_${cuda_lib}_LIBRARY)
message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found")
elseif(CUDA_${cuda_lib}_LIBRARY MATCHES [[\.\./]])
diff --git a/Tests/CudaOnly/TryCompileTargetStatic/CMakeLists.txt b/Tests/CudaOnly/TryCompileTargetStatic/CMakeLists.txt
new file mode 100644
index 0000000..340c1c9
--- /dev/null
+++ b/Tests/CudaOnly/TryCompileTargetStatic/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.25)
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+project(TryCompileTargetStatic LANGUAGES CUDA)
+
+add_executable(CudaOnlyTryCompileTargetStatic main.cu)
diff --git a/Tests/CudaOnly/TryCompileTargetStatic/main.cu b/Tests/CudaOnly/TryCompileTargetStatic/main.cu
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/CudaOnly/TryCompileTargetStatic/main.cu
@@ -0,0 +1,5 @@
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index 25df300..d46ee08 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -214,11 +214,13 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx
add_executable(CustomCommandUsingTargetTest main.cxx ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx )
+add_executable(CustomCommandUsingTargetTestAlias ALIAS CustomCommandUsingTargetTest )
+
add_custom_target(RunTarget
COMMAND generator_extern ${CMAKE_CURRENT_BINARY_DIR}/run_target.cxx
)
-add_custom_command(TARGET CustomCommandUsingTargetTest POST_BUILD
+add_custom_command(TARGET CustomCommandUsingTargetTestAlias POST_BUILD
COMMAND dummy_generator ${CMAKE_CURRENT_BINARY_DIR}/generated_dummy.cxx)
add_subdirectory(GeneratorInExtraDir)
diff --git a/Tests/CustomCommand/gen_redirect_in.c b/Tests/CustomCommand/gen_redirect_in.c
index 6af364b..c71123a 100644
--- a/Tests/CustomCommand/gen_redirect_in.c
+++ b/Tests/CustomCommand/gen_redirect_in.c
@@ -1,6 +1,6 @@
#if 1
-int gen_redirect()
+int gen_redirect(void)
{
return 3;
}
diff --git a/Tests/CustomCommandWorkingDirectory/customTarget.c b/Tests/CustomCommandWorkingDirectory/customTarget.c
index 8dbf0d4..9735287 100644
--- a/Tests/CustomCommandWorkingDirectory/customTarget.c
+++ b/Tests/CustomCommandWorkingDirectory/customTarget.c
@@ -1,4 +1,4 @@
-int customTarget()
+int customTarget(void)
{
return 0;
}
diff --git a/Tests/Dependency/1/OneSrc.c b/Tests/Dependency/1/OneSrc.c
index 9801c25..7f527f4 100644
--- a/Tests/Dependency/1/OneSrc.c
+++ b/Tests/Dependency/1/OneSrc.c
@@ -1,3 +1,3 @@
-void OneFunction()
+void OneFunction(void)
{
}
diff --git a/Tests/Dependency/Case1/a.c b/Tests/Dependency/Case1/a.c
index 262f523..bf1c773 100644
--- a/Tests/Dependency/Case1/a.c
+++ b/Tests/Dependency/Case1/a.c
@@ -1,4 +1,4 @@
-int a()
+int a(void)
{
return 5;
}
diff --git a/Tests/Dependency/Case1/b.c b/Tests/Dependency/Case1/b.c
index deda685..f4ef707 100644
--- a/Tests/Dependency/Case1/b.c
+++ b/Tests/Dependency/Case1/b.c
@@ -1,6 +1,6 @@
-extern int a();
+extern int a(void);
-int b()
+int b(void)
{
return a() + 17;
}
diff --git a/Tests/Dependency/Case1/b2.c b/Tests/Dependency/Case1/b2.c
index f341da7..108e76a 100644
--- a/Tests/Dependency/Case1/b2.c
+++ b/Tests/Dependency/Case1/b2.c
@@ -1,4 +1,4 @@
-int b2()
+int b2(void)
{
return 3;
}
diff --git a/Tests/Dependency/Case1/c.c b/Tests/Dependency/Case1/c.c
index a3ec162..ddda855 100644
--- a/Tests/Dependency/Case1/c.c
+++ b/Tests/Dependency/Case1/c.c
@@ -1,6 +1,6 @@
-extern int b();
+extern int b(void);
-int c()
+int c(void)
{
return b() + 42;
}
diff --git a/Tests/Dependency/Case1/c2.c b/Tests/Dependency/Case1/c2.c
index 317bb0f..826c746 100644
--- a/Tests/Dependency/Case1/c2.c
+++ b/Tests/Dependency/Case1/c2.c
@@ -1,6 +1,6 @@
-extern int b2();
+extern int b2(void);
-int c2()
+int c2(void)
{
return b2() + 1;
}
diff --git a/Tests/Dependency/Case1/d.c b/Tests/Dependency/Case1/d.c
index f67aef7..fdeb2bf 100644
--- a/Tests/Dependency/Case1/d.c
+++ b/Tests/Dependency/Case1/d.c
@@ -1,6 +1,6 @@
-extern int c2();
+extern int c2(void);
-int d()
+int d(void)
{
return c2() + 2;
}
diff --git a/Tests/Dependency/Case1/main.c b/Tests/Dependency/Case1/main.c
index 07191cc..6847f7d 100644
--- a/Tests/Dependency/Case1/main.c
+++ b/Tests/Dependency/Case1/main.c
@@ -2,7 +2,7 @@ extern int b();
extern int c();
extern int d();
-int main()
+int main(void)
{
c();
b();
diff --git a/Tests/Dependency/Case4/bar.c b/Tests/Dependency/Case4/bar.c
index 08092f9..18ddb78 100644
--- a/Tests/Dependency/Case4/bar.c
+++ b/Tests/Dependency/Case4/bar.c
@@ -1,5 +1,5 @@
-extern int foo();
-int main()
+extern int foo(void);
+int main(void)
{
return foo();
}
diff --git a/Tests/Dependency/Case4/foo.c b/Tests/Dependency/Case4/foo.c
index e05eb7e..c83d856 100644
--- a/Tests/Dependency/Case4/foo.c
+++ b/Tests/Dependency/Case4/foo.c
@@ -1,4 +1,4 @@
-int foo()
+int foo(void)
{
return 0;
}
diff --git a/Tests/Dependency/Eight/EightSrc.c b/Tests/Dependency/Eight/EightSrc.c
index 7bfa481..16605ce 100644
--- a/Tests/Dependency/Eight/EightSrc.c
+++ b/Tests/Dependency/Eight/EightSrc.c
@@ -1,6 +1,6 @@
-void SevenFunction();
+void SevenFunction(void);
-void EightFunction()
+void EightFunction(void)
{
SevenFunction();
}
diff --git a/Tests/Dependency/Exec/ExecMain.c b/Tests/Dependency/Exec/ExecMain.c
index 9572afd..793bc18 100644
--- a/Tests/Dependency/Exec/ExecMain.c
+++ b/Tests/Dependency/Exec/ExecMain.c
@@ -5,7 +5,7 @@ void NoDepCFunction();
void SixAFunction();
void SixBFunction();
-int main()
+int main(void)
{
SixAFunction();
SixBFunction();
diff --git a/Tests/Dependency/Exec2/ExecMain.c b/Tests/Dependency/Exec2/ExecMain.c
index 385cce1..085f30f 100644
--- a/Tests/Dependency/Exec2/ExecMain.c
+++ b/Tests/Dependency/Exec2/ExecMain.c
@@ -3,7 +3,7 @@
void FiveFunction();
void EightFunction();
-int main()
+int main(void)
{
FiveFunction();
EightFunction();
diff --git a/Tests/Dependency/Exec3/ExecMain.c b/Tests/Dependency/Exec3/ExecMain.c
index 385cce1..085f30f 100644
--- a/Tests/Dependency/Exec3/ExecMain.c
+++ b/Tests/Dependency/Exec3/ExecMain.c
@@ -3,7 +3,7 @@
void FiveFunction();
void EightFunction();
-int main()
+int main(void)
{
FiveFunction();
EightFunction();
diff --git a/Tests/Dependency/Exec4/ExecMain.c b/Tests/Dependency/Exec4/ExecMain.c
index 0cfcce9..48552d3 100644
--- a/Tests/Dependency/Exec4/ExecMain.c
+++ b/Tests/Dependency/Exec4/ExecMain.c
@@ -3,7 +3,7 @@
void FiveFunction();
void TwoFunction();
-int main()
+int main(void)
{
FiveFunction();
TwoFunction();
diff --git a/Tests/Dependency/Five/FiveSrc.c b/Tests/Dependency/Five/FiveSrc.c
index 33d8ad7..b35b05b 100644
--- a/Tests/Dependency/Five/FiveSrc.c
+++ b/Tests/Dependency/Five/FiveSrc.c
@@ -1,6 +1,6 @@
-void TwoFunction();
+void TwoFunction(void);
-void FiveFunction()
+void FiveFunction(void)
{
TwoFunction();
}
diff --git a/Tests/Dependency/Four/FourSrc.c b/Tests/Dependency/Four/FourSrc.c
index 4ea996d..b91c5fd 100644
--- a/Tests/Dependency/Four/FourSrc.c
+++ b/Tests/Dependency/Four/FourSrc.c
@@ -1,9 +1,9 @@
#include <two-test.h> /* Requires TwoCustom to be built first. */
-void NoDepAFunction();
-void OneFunction();
-void TwoFunction();
+void NoDepAFunction(void);
+void OneFunction(void);
+void TwoFunction(void);
-void FourFunction()
+void FourFunction(void)
{
static int count = 0;
if (count == 0) {
diff --git a/Tests/Dependency/NoDepA/NoDepASrc.c b/Tests/Dependency/NoDepA/NoDepASrc.c
index 8c4072b..e972df2 100644
--- a/Tests/Dependency/NoDepA/NoDepASrc.c
+++ b/Tests/Dependency/NoDepA/NoDepASrc.c
@@ -1,3 +1,3 @@
-void NoDepAFunction()
+void NoDepAFunction(void)
{
}
diff --git a/Tests/Dependency/NoDepB/NoDepBSrc.c b/Tests/Dependency/NoDepB/NoDepBSrc.c
index ddc71c5..81dc5ed 100644
--- a/Tests/Dependency/NoDepB/NoDepBSrc.c
+++ b/Tests/Dependency/NoDepB/NoDepBSrc.c
@@ -1,6 +1,6 @@
-void NoDepAFunction();
+void NoDepAFunction(void);
-void NoDepBFunction()
+void NoDepBFunction(void)
{
NoDepAFunction();
}
diff --git a/Tests/Dependency/NoDepC/NoDepCSrc.c b/Tests/Dependency/NoDepC/NoDepCSrc.c
index b478c59..d90007e 100644
--- a/Tests/Dependency/NoDepC/NoDepCSrc.c
+++ b/Tests/Dependency/NoDepC/NoDepCSrc.c
@@ -1,6 +1,6 @@
-void NoDepAFunction();
+void NoDepAFunction(void);
-void NoDepCFunction()
+void NoDepCFunction(void)
{
NoDepAFunction();
}
diff --git a/Tests/Dependency/Seven/SevenSrc.c b/Tests/Dependency/Seven/SevenSrc.c
index e1f3329..9c74ec8 100644
--- a/Tests/Dependency/Seven/SevenSrc.c
+++ b/Tests/Dependency/Seven/SevenSrc.c
@@ -1,6 +1,6 @@
-void TwoFunction();
+void TwoFunction(void);
-void SevenFunction()
+void SevenFunction(void)
{
TwoFunction();
}
diff --git a/Tests/Dependency/Six/SixASrc.c b/Tests/Dependency/Six/SixASrc.c
index 7ea3711..ddd2d7d 100644
--- a/Tests/Dependency/Six/SixASrc.c
+++ b/Tests/Dependency/Six/SixASrc.c
@@ -1,7 +1,7 @@
-void FiveFunction();
-void TwoFunction();
+void FiveFunction(void);
+void TwoFunction(void);
-void SixAFunction()
+void SixAFunction(void)
{
FiveFunction();
TwoFunction();
diff --git a/Tests/Dependency/Six/SixBSrc.c b/Tests/Dependency/Six/SixBSrc.c
index 92f9607..42f2de6 100644
--- a/Tests/Dependency/Six/SixBSrc.c
+++ b/Tests/Dependency/Six/SixBSrc.c
@@ -1,8 +1,8 @@
-void TwoFunction();
-void FiveFunction();
-void FourFunction();
+void TwoFunction(void);
+void FiveFunction(void);
+void FourFunction(void);
-void SixBFunction()
+void SixBFunction(void)
{
TwoFunction();
FiveFunction();
diff --git a/Tests/Dependency/Three/ThreeSrc.c b/Tests/Dependency/Three/ThreeSrc.c
index 3e814f3..85c51fc 100644
--- a/Tests/Dependency/Three/ThreeSrc.c
+++ b/Tests/Dependency/Three/ThreeSrc.c
@@ -1,7 +1,7 @@
-void OneFunction();
-void FourFunction();
+void OneFunction(void);
+void FourFunction(void);
-void ThreeFunction()
+void ThreeFunction(void)
{
static int count = 0;
if (count == 0) {
diff --git a/Tests/Dependency/Two/TwoCustomSrc.c b/Tests/Dependency/Two/TwoCustomSrc.c
index ac31dcf..432dca1 100644
--- a/Tests/Dependency/Two/TwoCustomSrc.c
+++ b/Tests/Dependency/Two/TwoCustomSrc.c
@@ -1,10 +1,10 @@
-extern void NoFunction();
+extern void NoFunction(void);
/* Provide a function that is supposed to be found in the Three
library. If Two links to TwoCustom then TwoCustom will come before
Three and this symbol will be used. Since NoFunction is not
defined, that will cause a link failure. */
-void ThreeFunction()
+void ThreeFunction(void)
{
NoFunction();
}
diff --git a/Tests/Dependency/Two/TwoSrc.c b/Tests/Dependency/Two/TwoSrc.c
index dbdf524..dadac22 100644
--- a/Tests/Dependency/Two/TwoSrc.c
+++ b/Tests/Dependency/Two/TwoSrc.c
@@ -1,6 +1,6 @@
#include <two-test.h>
-void TwoFunction()
+void TwoFunction(void)
{
static int count = 0;
if (count == 0) {
diff --git a/Tests/DoubleProject/silly.c b/Tests/DoubleProject/silly.c
index f8b643a..8488f4e 100644
--- a/Tests/DoubleProject/silly.c
+++ b/Tests/DoubleProject/silly.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index 67f2fcb..0b7f739 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -1,9 +1,12 @@
+set(CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_DEPENDENCIES "1942b4fa-b2c5-4546-9385-83f254070067")
cmake_minimum_required (VERSION 2.7.20090711)
if(POLICY CMP0129)
cmake_policy(SET CMP0129 NEW)
endif()
project(Export C CXX)
+find_package(Foo REQUIRED CONFIG NO_DEFAULT_PATH)
+
# Pretend that RelWithDebInfo should link to debug libraries to test
# the DEBUG_CONFIGURATIONS property.
set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS Debug RelWithDebInfo)
@@ -110,6 +113,7 @@ add_library(testLib9ObjIface OBJECT testLib9ObjIface.c)
target_compile_definitions(testLib9ObjIface INTERFACE testLib9ObjIface_USED)
add_library(testLib9 STATIC testLib9.c)
target_link_libraries(testLib9 INTERFACE testLib9ObjIface PUBLIC testLib9ObjPub PRIVATE testLib9ObjPriv)
+target_link_libraries(testLib9 PUBLIC Foo::Foo)
cmake_policy(POP)
# Test using the target_link_libraries command to set the
@@ -624,7 +628,7 @@ install(
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
-install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp)
+install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp EXPORT_PACKAGE_DEPENDENCIES)
# Install testLib5.dll outside the export.
if(WIN32)
diff --git a/Tests/ExportImport/Export/testExe2.c b/Tests/ExportImport/Export/testExe2.c
index 958e4d2..8e6ee44 100644
--- a/Tests/ExportImport/Export/testExe2.c
+++ b/Tests/ExportImport/Export/testExe2.c
@@ -9,7 +9,7 @@ testExe2_EXPORT int testExe2Func(void)
return 123;
}
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/ExportImport/External/FooConfig.cmake b/Tests/ExportImport/External/FooConfig.cmake
new file mode 100644
index 0000000..48b6289
--- /dev/null
+++ b/Tests/ExportImport/External/FooConfig.cmake
@@ -0,0 +1,3 @@
+if(NOT TARGET Foo::Foo)
+ add_library(Foo::Foo INTERFACE IMPORTED)
+endif()
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 2c5662d..2a57633 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -500,7 +500,7 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA
OUTPUT_VARIABLE OUTPUT
)
if(NOT BLD_ERROR_VARIABLE)
- message(SEND_ERROR "BLD_ERROR_VARIABLE try_compile failed, but it was expected to succeed.")
+ message(SEND_ERROR "BLD_ERROR_VARIABLE try_compile failed, but it was expected to succeed. ${OUTPUT}")
endif()
if(NOT CMAKE_CROSSCOMPILING)
@@ -518,6 +518,91 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA
endif()
endif()
endif()
+
+ # Testing try_compile with ALIAS targets.
+ # These assume that previous test were successful, or at least the failures will be at the linking stage
+ # with symbol not found errors
+
+ # First make sure that if the test run without appropriate alias targets, they should error out
+ try_compile(FAILING_LIBRARY_ALIAS_ERROR_VARIABLE
+ "${CMAKE_CURRENT_BINARY_DIR}/test_failing_library_alias"
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
+ LINK_LIBRARIES not_existing_library
+ OUTPUT_VARIABLE OUTPUT
+ NO_CACHE
+ )
+ if(FAILING_LIBRARY_ALIAS_ERROR_VARIABLE)
+ message(SEND_ERROR "FAILING_LIBRARY_ALIAS_ERROR_VARIABLE try_compile succeeded, but it was expected to fail ${OUTPUT}.")
+ endif()
+
+ # FIXME: CMAKE_TRY_COMPILE_TARGET_TYPE=MODULE is needed to properly link and test targets linked to an executable
+# set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+# try_compile(FAILING_EXE_ALIAS_ERROR_VARIABLE
+# "${CMAKE_CURRENT_BINARY_DIR}/test_failing_exe_alias"
+# "${CMAKE_CURRENT_SOURCE_DIR}/imp_mod1.c"
+# LINK_LIBRARIES not_existing_executable
+# OUTPUT_VARIABLE OUTPUT
+# NO_CACHE
+# )
+# unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
+# if(FAILING_EXE_ALIAS_ERROR_VARIABLE)
+# message(SEND_ERROR "FAILING_EXE_ALIAS_ERROR_VARIABLE try_compile succeeded, but it was expected to fail ${OUTPUT}.")
+# endif()
+
+ # Do the actual try_compile tests for ALIAS targets
+ add_library(exp_systemlib_alias ALIAS exp_systemlib)
+ try_compile(EXP_LIBRARY_ALIAS_ERROR_VARIABLE
+ "${CMAKE_CURRENT_BINARY_DIR}/test_library_alias"
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
+ LINK_LIBRARIES exp_systemlib_alias
+ OUTPUT_VARIABLE OUTPUT
+ NO_CACHE
+ )
+ if(NOT EXP_LIBRARY_ALIAS_ERROR_VARIABLE)
+ message(SEND_ERROR "EXP_LIBRARY_ALIAS_ERROR_VARIABLE try_compile failed with library aliased target, but it was expected to succeed ${OUTPUT}.")
+ endif()
+
+ # FIXME: CMAKE_TRY_COMPILE_TARGET_TYPE=MODULE is needed to properly link and test targets linked to an executable
+# set(CMAKE_TRY_COMPILE_TARGET_TYPE MODULE)
+# add_executable(exp_exe_alias ALIAS exp_testExe2)
+# try_compile(EXP_EXE_ALIAS_ERROR_VARIABLE
+# "${CMAKE_CURRENT_BINARY_DIR}/test_exe_alias"
+# "${CMAKE_CURRENT_SOURCE_DIR}/imp_mod1.c"
+# LINK_LIBRARIES exp_exe_alias
+# OUTPUT_VARIABLE OUTPUT
+# NO_CACHE
+# )
+# unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
+# if(NOT EXP_EXE_ALIAS_ERROR_VARIABLE)
+# message(SEND_ERROR "EXP_EXE_ALIAS_ERROR_VARIABLE try_compile failed with executable aliased target, but it was expected to succeed ${OUTPUT}.")
+# endif()
+
+ add_library(bld_systemlib_alias ALIAS bld_systemlib)
+ try_compile(BLD_LIBRARY_ALIAS_ERROR_VARIABLE
+ "${CMAKE_CURRENT_BINARY_DIR}/test_library_alias"
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
+ LINK_LIBRARIES bld_systemlib_alias
+ OUTPUT_VARIABLE OUTPUT
+ NO_CACHE
+ )
+ if(NOT BLD_LIBRARY_ALIAS_ERROR_VARIABLE)
+ message(SEND_ERROR "BLD_LIBRARY_ALIAS_ERROR_VARIABLE try_compile failed with library aliased target, but it was expected to succeed. ${OUTPUT}")
+ endif()
+
+ # FIXME: CMAKE_TRY_COMPILE_TARGET_TYPE=MODULE is needed to properly link and test targets linked to an executable
+# set(CMAKE_TRY_COMPILE_TARGET_TYPE MODULE)
+# add_executable(bld_exe_alias ALIAS bld_testExe2)
+# try_compile(BLD_EXE_ALIAS_ERROR_VARIABLE
+# "${CMAKE_CURRENT_BINARY_DIR}/test_exe_alias"
+# "${CMAKE_CURRENT_SOURCE_DIR}/imp_mod1.c"
+# LINK_LIBRARIES bld_exe_alias
+# OUTPUT_VARIABLE OUTPUT
+# NO_CACHE
+# )
+# unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
+# if(NOT BLD_EXE_ALIAS_ERROR_VARIABLE)
+# message(SEND_ERROR "BLD_EXE_ALIAS_ERROR_VARIABLE try_compile failed with executable aliased target, but it was expected to succeed. ${OUTPUT}")
+# endif()
endif()
#---------------------------------------------------------------------------------
diff --git a/Tests/ExportImport/Import/A/deps_iface.c b/Tests/ExportImport/Import/A/deps_iface.c
index afb1af0..fd2c47f 100644
--- a/Tests/ExportImport/Import/A/deps_iface.c
+++ b/Tests/ExportImport/Import/A/deps_iface.c
@@ -26,7 +26,7 @@
extern int testLibDepends(void);
-int main()
+int main(void)
{
return testLibDepends();
}
diff --git a/Tests/ExportImport/Import/A/imp_mod1.c b/Tests/ExportImport/Import/A/imp_mod1.c
index 9385d55..138962e 100644
--- a/Tests/ExportImport/Import/A/imp_mod1.c
+++ b/Tests/ExportImport/Import/A/imp_mod1.c
@@ -7,7 +7,7 @@
testExe2_IMPORT int testExe2Func(void);
testExe2_IMPORT int testExe2lib(void);
-int imp_mod1()
+int imp_mod1(void)
{
return testExe2Func() + testExe2lib();
}
diff --git a/Tests/ExportImport/Import/A/imp_testExe1.c b/Tests/ExportImport/Import/A/imp_testExe1.c
index d3b0e9e..e409b1c 100644
--- a/Tests/ExportImport/Import/A/imp_testExe1.c
+++ b/Tests/ExportImport/Import/A/imp_testExe1.c
@@ -21,7 +21,7 @@ extern int testStaticLibPlugin(void);
#endif
extern int testLib4libcfg(void);
-int main()
+int main(void)
{
return (testLib2() + generated_by_testExe1() + testLib3() + testLib4() +
testLib5() + testLib6() + testLib7() + testLibCycleA1() +
diff --git a/Tests/ExportImport/Import/A/imp_testExeAbs1.c b/Tests/ExportImport/Import/A/imp_testExeAbs1.c
index fd05242..07d33a5 100644
--- a/Tests/ExportImport/Import/A/imp_testExeAbs1.c
+++ b/Tests/ExportImport/Import/A/imp_testExeAbs1.c
@@ -7,7 +7,7 @@
#ifndef testLibAbs1b
# error "testLibAbs1b not defined"
#endif
-int main()
+int main(void)
{
return 0 + testLibAbs1();
}
diff --git a/Tests/ExportImport/Import/A/imp_testLib8.c b/Tests/ExportImport/Import/A/imp_testLib8.c
index 2749b17..ef97dbe 100644
--- a/Tests/ExportImport/Import/A/imp_testLib8.c
+++ b/Tests/ExportImport/Import/A/imp_testLib8.c
@@ -2,7 +2,7 @@
int testLib8A(void);
int testLib8B(void);
-int main()
+int main(void)
{
return (testLib8A() + testLib8B());
}
diff --git a/Tests/ExportImport/Import/A/imp_testLib9.c b/Tests/ExportImport/Import/A/imp_testLib9.c
index e014857..2a8d8d5 100644
--- a/Tests/ExportImport/Import/A/imp_testLib9.c
+++ b/Tests/ExportImport/Import/A/imp_testLib9.c
@@ -10,7 +10,7 @@
int testLib9(void);
-int main()
+int main(void)
{
return testLib9();
}
diff --git a/Tests/ExportImport/Import/CMakeLists.txt b/Tests/ExportImport/Import/CMakeLists.txt
index e6dcd65..83c87a8 100644
--- a/Tests/ExportImport/Import/CMakeLists.txt
+++ b/Tests/ExportImport/Import/CMakeLists.txt
@@ -1,5 +1,6 @@
cmake_minimum_required (VERSION 2.7.20090711)
cmake_policy(SET CMP0025 NEW)
+cmake_policy(SET CMP0028 NEW)
if(POLICY CMP0129)
cmake_policy(SET CMP0129 NEW)
endif()
diff --git a/Tests/ExportImport/Import/imp_testTransExe1.c b/Tests/ExportImport/Import/imp_testTransExe1.c
index 360a112..579c992 100644
--- a/Tests/ExportImport/Import/imp_testTransExe1.c
+++ b/Tests/ExportImport/Import/imp_testTransExe1.c
@@ -1,6 +1,6 @@
extern int imp_lib1(void);
-int main()
+int main(void)
{
return imp_lib1();
}
diff --git a/Tests/ExportImport/InitialCache.cmake.in b/Tests/ExportImport/InitialCache.cmake.in
index 44cd179..55aef86 100644
--- a/Tests/ExportImport/InitialCache.cmake.in
+++ b/Tests/ExportImport/InitialCache.cmake.in
@@ -15,3 +15,4 @@ set(CMAKE_INSTALL_PREFIX "@ExportImport_BINARY_DIR@/Root" CACHE STRING "Installa
set(CMAKE_SKIP_RPATH ON CACHE BOOL "No RPATH")
set(CMAKE_GNUtoMS "@ExportImport_GNUtoMS@" CACHE BOOL "CMAKE_GNUtoMS")
set(CMake_TEST_CUDA "@CMake_TEST_CUDA@" CACHE BOOL "CMake_TEST_CUDA")
+set(Foo_DIR "@CMAKE_CURRENT_SOURCE_DIR@/External" CACHE PATH "Foo cmake package directory")
diff --git a/Tests/ExportImport/main.c b/Tests/ExportImport/main.c
index f8b643a..8488f4e 100644
--- a/Tests/ExportImport/main.c
+++ b/Tests/ExportImport/main.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/FindALSA/Test/main.c b/Tests/FindALSA/Test/main.c
index d3303d0..53831a9 100644
--- a/Tests/FindALSA/Test/main.c
+++ b/Tests/FindALSA/Test/main.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
printf("Found ALSA version %s, expected version %s\n",
snd_asoundlib_version(), CMAKE_EXPECTED_ALSA_VERSION);
diff --git a/Tests/FindBLAS/Test/main.c b/Tests/FindBLAS/Test/main.c
index 4fc9fe4..4ce1efb 100644
--- a/Tests/FindBLAS/Test/main.c
+++ b/Tests/FindBLAS/Test/main.c
@@ -13,7 +13,7 @@ typedef int64_t blas_int;
// declare what parts of the blas C-API we need
void dswap_(blas_int* N, double* X, blas_int* incX, double* Y, blas_int* incY);
-int main()
+int main(void)
{
double x[4] = { 1, 2, 3, 4 };
double y[4] = { 8, 7, 7, 6 };
diff --git a/Tests/FindBZip2/Test/main.c b/Tests/FindBZip2/Test/main.c
index 8e24c94..b3cf34b 100644
--- a/Tests/FindBZip2/Test/main.c
+++ b/Tests/FindBZip2/Test/main.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
-int main()
+int main(void)
{
int chunksize = 1024;
FILE* file = fopen("test.bzip2", "wb");
diff --git a/Tests/FindBacktrace/CMakeLists.txt b/Tests/FindBacktrace/CMakeLists.txt
new file mode 100644
index 0000000..8ee2a4d
--- /dev/null
+++ b/Tests/FindBacktrace/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindBacktrace.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindBacktrace/Test"
+ "${CMake_BINARY_DIR}/Tests/FindBacktrace/Test"
+ ${build_generator_args}
+ --build-project TestFindBacktrace
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindBacktrace/Test/CMakeLists.txt b/Tests/FindBacktrace/Test/CMakeLists.txt
new file mode 100644
index 0000000..7f5d8ec
--- /dev/null
+++ b/Tests/FindBacktrace/Test/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required(VERSION 3.29)
+project(TestFindBLAS C)
+include(CTest)
+
+find_package(Backtrace REQUIRED)
+
+add_executable(test_tgt backtrace.c)
+target_link_libraries(test_tgt Backtrace::Backtrace)
+target_compile_options(test_tgt PUBLIC -rdynamic -fno-omit-frame-pointer)
+target_link_options(test_tgt PUBLIC -rdynamic -fno-omit-frame-pointer)
+add_test(NAME test_tgt COMMAND test_tgt)
diff --git a/Tests/FindBacktrace/Test/backtrace.c b/Tests/FindBacktrace/Test/backtrace.c
new file mode 100644
index 0000000..e143bc7
--- /dev/null
+++ b/Tests/FindBacktrace/Test/backtrace.c
@@ -0,0 +1,56 @@
+/* This is the code from `man backtrace_symbols`, reformatted, and without
+ * requiring a command-line argument */
+
+#include <execinfo.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define BT_BUF_SIZE 100
+
+void myfunc3(void)
+{
+ int nptrs;
+ void* buffer[BT_BUF_SIZE];
+ char** strings;
+ size_t j;
+
+ nptrs = backtrace(buffer, BT_BUF_SIZE);
+ printf("backtrace() returned %d addresses\n", nptrs);
+
+ /* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO)
+ would produce similar output to the following: */
+
+ strings = backtrace_symbols(buffer, nptrs);
+ if (strings == NULL) {
+ perror("backtrace_symbols");
+ exit(EXIT_FAILURE);
+ }
+
+ for (j = 0; j < nptrs; j++) {
+ printf("%s\n", strings[j]);
+ }
+
+ free(strings);
+}
+
+static void /* "static" means don't export the symbol... */
+myfunc2(void)
+{
+ myfunc3();
+}
+
+void myfunc(int ncalls)
+{
+ if (ncalls > 1) {
+ myfunc(ncalls - 1);
+ } else {
+ myfunc2();
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ myfunc(5);
+ exit(EXIT_SUCCESS);
+}
diff --git a/Tests/FindCURL/Test/main.c b/Tests/FindCURL/Test/main.c
index 263775f..82075f1 100644
--- a/Tests/FindCURL/Test/main.c
+++ b/Tests/FindCURL/Test/main.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
-int main()
+int main(void)
{
struct curl_slist* slist;
diff --git a/Tests/FindCups/Test/main.c b/Tests/FindCups/Test/main.c
index b69d621..86952db 100644
--- a/Tests/FindCups/Test/main.c
+++ b/Tests/FindCups/Test/main.c
@@ -1,6 +1,6 @@
#include <cups/cups.h>
-int main()
+int main(void)
{
int num_options = 0;
cups_option_t* options = NULL;
diff --git a/Tests/FindDevIL/Test/main.c b/Tests/FindDevIL/Test/main.c
index 4a07087..dfb2f63 100644
--- a/Tests/FindDevIL/Test/main.c
+++ b/Tests/FindDevIL/Test/main.c
@@ -1,6 +1,6 @@
#include <IL/il.h>
-int main()
+int main(void)
{
// Test 1 requires to link to the library.
ilInit();
diff --git a/Tests/FindDevIL/Test/main_ilu.c b/Tests/FindDevIL/Test/main_ilu.c
index a9e7819..ac7237a 100644
--- a/Tests/FindDevIL/Test/main_ilu.c
+++ b/Tests/FindDevIL/Test/main_ilu.c
@@ -1,6 +1,6 @@
#include <IL/ilu.h>
-int main()
+int main(void)
{
// IL Utilities requires only initialization.
// Unlike main DevIL there are no shutdown function.
diff --git a/Tests/FindEXPAT/Test/main.c b/Tests/FindEXPAT/Test/main.c
index 94ee3ef..703aaf9 100644
--- a/Tests/FindEXPAT/Test/main.c
+++ b/Tests/FindEXPAT/Test/main.c
@@ -3,7 +3,7 @@
#include <stdlib.h>
#include <string.h>
-int main()
+int main(void)
{
XML_Expat_Version expat_version;
char expat_version_string[16];
diff --git a/Tests/FindFontconfig/Test/main.c b/Tests/FindFontconfig/Test/main.c
index c5b5963..96b0af1 100644
--- a/Tests/FindFontconfig/Test/main.c
+++ b/Tests/FindFontconfig/Test/main.c
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
FcInit();
printf("Found Fontconfig.\n");
diff --git a/Tests/FindFreetype/Test/main.c b/Tests/FindFreetype/Test/main.c
index bb838a5..315a6cb 100644
--- a/Tests/FindFreetype/Test/main.c
+++ b/Tests/FindFreetype/Test/main.c
@@ -3,7 +3,7 @@
#include FT_FREETYPE_H
#include <string.h>
-int main()
+int main(void)
{
FT_Library library;
FT_Error error;
diff --git a/Tests/FindGDAL/Test/main.c b/Tests/FindGDAL/Test/main.c
index 7b31a13..2e19843 100644
--- a/Tests/FindGDAL/Test/main.c
+++ b/Tests/FindGDAL/Test/main.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
printf("Found GDAL version %s, expected version %s\n", GDAL_RELEASE_NAME,
CMAKE_EXPECTED_GDAL_VERSION);
diff --git a/Tests/FindGIF/Test/main.c b/Tests/FindGIF/Test/main.c
index 656a99c..fa2c224 100644
--- a/Tests/FindGIF/Test/main.c
+++ b/Tests/FindGIF/Test/main.c
@@ -8,7 +8,7 @@
# define GIFLIB_MAJOR 4
#endif
-int main()
+int main(void)
{
// because of the API changes we have to test different functions depending
// on the version of GIFLIB
diff --git a/Tests/FindGLUT/Test/main.c b/Tests/FindGLUT/Test/main.c
index 1c8569c..02ac34f 100644
--- a/Tests/FindGLUT/Test/main.c
+++ b/Tests/FindGLUT/Test/main.c
@@ -1,7 +1,7 @@
#include <GL/glut.h>
#include <stdio.h>
-int main()
+int main(void)
{
/* The following should call exit(1) and print
freeglut ERROR: Function <glutCreateWindow> called
diff --git a/Tests/FindGTK2/gdk/main.c b/Tests/FindGTK2/gdk/main.c
index 71f523b..2d03fbe 100644
--- a/Tests/FindGTK2/gdk/main.c
+++ b/Tests/FindGTK2/gdk/main.c
@@ -2,6 +2,6 @@
int main(int argc, char* argv[])
{
- gdk_init(argc, argv);
+ gdk_init(&argc, &argv);
return 0;
}
diff --git a/Tests/FindGnuTLS/Test/main.c b/Tests/FindGnuTLS/Test/main.c
index 1105358..c379cc2 100644
--- a/Tests/FindGnuTLS/Test/main.c
+++ b/Tests/FindGnuTLS/Test/main.c
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
// test the linker
gnutls_session_t session;
diff --git a/Tests/FindImageMagick/Test/main_magick_wand.c b/Tests/FindImageMagick/Test/main_magick_wand.c
index fa6d170..52d179d 100644
--- a/Tests/FindImageMagick/Test/main_magick_wand.c
+++ b/Tests/FindImageMagick/Test/main_magick_wand.c
@@ -1,6 +1,6 @@
#include <wand/MagickWand.h>
-int main()
+int main(void)
{
MagickWand* wand = NewMagickWand();
wand = DestroyMagickWand(wand);
diff --git a/Tests/FindJPEG/Test/main.c b/Tests/FindJPEG/Test/main.c
index 5a67faa..0116cb6 100644
--- a/Tests/FindJPEG/Test/main.c
+++ b/Tests/FindJPEG/Test/main.c
@@ -4,7 +4,7 @@
#include <jpeglib.h>
// clang-format on
-int main()
+int main(void)
{
/* Without any JPEG file to open, test that the call fails as
expected. This tests that linking worked. */
diff --git a/Tests/FindJasper/Test/CMakeLists.txt b/Tests/FindJasper/Test/CMakeLists.txt
index 1e9467d..93873bf 100644
--- a/Tests/FindJasper/Test/CMakeLists.txt
+++ b/Tests/FindJasper/Test/CMakeLists.txt
@@ -4,7 +4,7 @@ include(CTest)
find_package(Jasper)
-add_definitions(-DCMAKE_EXPECTED_JASPER_VERSION=${JASPER_VERSION_STRING})
+add_definitions(-DCMAKE_EXPECTED_JASPER_VERSION="${JASPER_VERSION_STRING}")
add_executable(test_jasper_tgt main.c)
target_link_libraries(test_jasper_tgt Jasper::Jasper)
diff --git a/Tests/FindJasper/Test/main.c b/Tests/FindJasper/Test/main.c
index 771344d..b9dbe1e 100644
--- a/Tests/FindJasper/Test/main.c
+++ b/Tests/FindJasper/Test/main.c
@@ -1,17 +1,11 @@
-#include <assert.h>
-// clang-format off
-#include <stdio.h>
#include <jasper/jasper.h>
-// clang-format on
+#include <string.h>
-int main()
+int main(void)
{
- /* Without any JPEG file to open, test that the call fails as
- expected. This tests that linking worked. */
- jas_init();
- jas_image_t* img = jas_image_create0();
- jas_image_destroy(img);
- jas_cleanup();
-
- return (JAS_VERSION != CMAKE_EXPECTED_JASPER_VERSION);
+ jas_conf_clear();
+ jas_conf_set_max_mem_usage(0x100000);
+ jas_init_library();
+ jas_cleanup_library();
+ return strcmp(JAS_VERSION, CMAKE_EXPECTED_JASPER_VERSION);
}
diff --git a/Tests/FindLAPACK/Test/main.c b/Tests/FindLAPACK/Test/main.c
index dd33fb3..3c7ad9f 100644
--- a/Tests/FindLAPACK/Test/main.c
+++ b/Tests/FindLAPACK/Test/main.c
@@ -14,7 +14,7 @@ typedef int64_t blas_int;
void dgesv_(blas_int*, blas_int*, double*, blas_int*, blas_int*, double*,
blas_int*, blas_int*);
-int main()
+int main(void)
{
double A[8] = {
0, 1, 2, 3, 4, 5, 6, 7,
diff --git a/Tests/FindLibLZMA/Test/main.c b/Tests/FindLibLZMA/Test/main.c
index 06e8065..0b3de31 100644
--- a/Tests/FindLibLZMA/Test/main.c
+++ b/Tests/FindLibLZMA/Test/main.c
@@ -4,7 +4,7 @@
static const uint8_t test_string[9] = "123456789";
-int main()
+int main(void)
{
static const uint32_t test_vector = 0xCBF43926;
diff --git a/Tests/FindLibRHash/Test/main.c b/Tests/FindLibRHash/Test/main.c
index 201dced..4cc6394 100644
--- a/Tests/FindLibRHash/Test/main.c
+++ b/Tests/FindLibRHash/Test/main.c
@@ -1,6 +1,6 @@
#include <rhash.h>
-int main()
+int main(void)
{
rhash_library_init();
return 0;
diff --git a/Tests/FindLibUV/Test/main.c b/Tests/FindLibUV/Test/main.c
index cbd0db3..a14adbb 100644
--- a/Tests/FindLibUV/Test/main.c
+++ b/Tests/FindLibUV/Test/main.c
@@ -1,6 +1,6 @@
#include <uv.h>
-int main()
+int main(void)
{
uv_loop_close(uv_default_loop());
return 0;
diff --git a/Tests/FindLibXml2/Test/main.c b/Tests/FindLibXml2/Test/main.c
index 264f07d..4ded2f7 100644
--- a/Tests/FindLibXml2/Test/main.c
+++ b/Tests/FindLibXml2/Test/main.c
@@ -2,7 +2,7 @@
#include <libxml/tree.h>
#include <string.h>
-int main()
+int main(void)
{
xmlDoc* doc;
diff --git a/Tests/FindLibXslt/Test/libexslt.c b/Tests/FindLibXslt/Test/libexslt.c
index ea6eb3d..5916024 100644
--- a/Tests/FindLibXslt/Test/libexslt.c
+++ b/Tests/FindLibXslt/Test/libexslt.c
@@ -2,7 +2,7 @@
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
-int main()
+int main(void)
{
xsltInit();
diff --git a/Tests/FindLibXslt/Test/libxslt.c b/Tests/FindLibXslt/Test/libxslt.c
index 5b3d766..4a149c1 100644
--- a/Tests/FindLibXslt/Test/libxslt.c
+++ b/Tests/FindLibXslt/Test/libxslt.c
@@ -4,7 +4,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
xsltInit();
diff --git a/Tests/FindLibinput/Test/main.c b/Tests/FindLibinput/Test/main.c
index 3919962..a6b1aa4 100644
--- a/Tests/FindLibinput/Test/main.c
+++ b/Tests/FindLibinput/Test/main.c
@@ -1,7 +1,7 @@
#include <libinput.h>
#include <stdio.h>
-int main()
+int main(void)
{
struct libinput_interface interface;
interface.open_restricted = 0;
diff --git a/Tests/FindODBC/Test/main.c b/Tests/FindODBC/Test/main.c
index 34f279c..6c4318b 100644
--- a/Tests/FindODBC/Test/main.c
+++ b/Tests/FindODBC/Test/main.c
@@ -3,7 +3,7 @@
#endif
#include <sql.h>
-int main()
+int main(void)
{
SQLHENV env;
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
diff --git a/Tests/FindOpenACC/CMakeLists.txt b/Tests/FindOpenACC/CMakeLists.txt
index ef7de65..1b6bcf2 100644
--- a/Tests/FindOpenACC/CMakeLists.txt
+++ b/Tests/FindOpenACC/CMakeLists.txt
@@ -1,11 +1,5 @@
-
-set(langs C CXX)
-if(NOT CMAKE_GENERATOR STREQUAL "Ninja")
- list(APPEND langs Fortran)
-endif()
-
-foreach(lang IN LISTS langs)
- if(CMAKE_${lang}_COMPILER)
+foreach(lang IN ITEMS C CXX Fortran)
+ if(CMake_TEST_FindOpenACC_${lang})
add_test(NAME FindOpenACC.Test${lang} COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
--build-and-test
diff --git a/Tests/FindOpenACC/CTest/main.c b/Tests/FindOpenACC/CTest/main.c
index 53b6cae..6c005c1 100644
--- a/Tests/FindOpenACC/CTest/main.c
+++ b/Tests/FindOpenACC/CTest/main.c
@@ -8,7 +8,7 @@ void vecaddgpu(float* r, float* a, float* b, int n)
r[i] = a[i] + b[i];
}
-int main()
+int main(void)
{
int n = 100000; /* vector length */
float* a; /* input vector 1 */
diff --git a/Tests/FindOpenCL/Test/main.c b/Tests/FindOpenCL/Test/main.c
index 2fe949b..d3d0cfb 100644
--- a/Tests/FindOpenCL/Test/main.c
+++ b/Tests/FindOpenCL/Test/main.c
@@ -4,7 +4,7 @@
# include <CL/cl.h>
#endif
-int main()
+int main(void)
{
cl_uint platformIdCount;
diff --git a/Tests/FindOpenGL/Test/main.c b/Tests/FindOpenGL/Test/main.c
index e1f25c6..88a4a8a 100644
--- a/Tests/FindOpenGL/Test/main.c
+++ b/Tests/FindOpenGL/Test/main.c
@@ -9,7 +9,7 @@
#include <stdio.h>
-int main()
+int main(void)
{
/* Reference a GL symbol without requiring a context at runtime. */
printf("&glGetString = %p\n", &glGetString);
diff --git a/Tests/FindOpenGL/Test/main_gles2.c b/Tests/FindOpenGL/Test/main_gles2.c
index 52f5936..355795b 100644
--- a/Tests/FindOpenGL/Test/main_gles2.c
+++ b/Tests/FindOpenGL/Test/main_gles2.c
@@ -9,7 +9,7 @@
#include <stdio.h>
-int main()
+int main(void)
{
/* Reference a GL symbol without requiring a context at runtime. */
printf("&glGetString = %p\n", &glGetString);
diff --git a/Tests/FindOpenGL/Test/main_gles3.c b/Tests/FindOpenGL/Test/main_gles3.c
index 875f73c..383954f7 100644
--- a/Tests/FindOpenGL/Test/main_gles3.c
+++ b/Tests/FindOpenGL/Test/main_gles3.c
@@ -9,7 +9,7 @@
#include <stdio.h>
-int main()
+int main(void)
{
/* Reference a GL symbol without requiring a context at runtime. */
printf("&glGetString = %p\n", &glGetString);
diff --git a/Tests/FindOpenMP/Test/CMakeLists.txt b/Tests/FindOpenMP/Test/CMakeLists.txt
index ebdb6b8..7ead835 100644
--- a/Tests/FindOpenMP/Test/CMakeLists.txt
+++ b/Tests/FindOpenMP/Test/CMakeLists.txt
@@ -26,8 +26,21 @@ foreach(c C CXX Fortran)
endif()
endforeach()
+if(CMAKE_C_COMPILER_ID STREQUAL "MSVC"
+ AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.30
+ AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64")
+ set(test_msvc_runtime 1)
+ set(OpenMP_RUNTIME_MSVC "llvm")
+endif()
+
find_package(OpenMP REQUIRED)
+if(test_msvc_runtime)
+ if(NOT OpenMP_C_FLAGS STREQUAL "-openmp:llvm")
+ message(FATAL_ERROR "OpenMP_RUNTIME_MSVC='${OpenMP_RUNTIME_MSVC}' not honored: '${OpenMP_C_FLAGS}'")
+ endif()
+endif()
+
foreach(c C CXX Fortran)
if(NOT "${OpenMP_TEST_${c}}")
continue()
diff --git a/Tests/FindOpenMP/Test/main.c b/Tests/FindOpenMP/Test/main.c
index 4f0e874..9fb67e4 100644
--- a/Tests/FindOpenMP/Test/main.c
+++ b/Tests/FindOpenMP/Test/main.c
@@ -1,5 +1,5 @@
#include <omp.h>
-int main()
+int main(void)
{
#ifndef _OPENMP
breaks_on_purpose
diff --git a/Tests/FindOpenMP/Test/scaltest.c b/Tests/FindOpenMP/Test/scaltest.c
index 4678b87..be48827 100644
--- a/Tests/FindOpenMP/Test/scaltest.c
+++ b/Tests/FindOpenMP/Test/scaltest.c
@@ -6,7 +6,7 @@ extern "C"
#endif
int scalprod(int n, double* x, double* y, double* res);
-int main()
+int main(void)
{
double a[5] = { 1., 2., 3., 4., 5. };
double b[5] = { 2., 3., 4., 5., 6. };
diff --git a/Tests/FindPNG/Test/main.c b/Tests/FindPNG/Test/main.c
index b33b28e..05b55c0 100644
--- a/Tests/FindPNG/Test/main.c
+++ b/Tests/FindPNG/Test/main.c
@@ -2,7 +2,7 @@
#include <png.h>
#include <string.h>
-int main()
+int main(void)
{
png_uint_32 png_version;
char png_version_string[16];
diff --git a/Tests/FindPackageTest/Exporter/dummy.c b/Tests/FindPackageTest/Exporter/dummy.c
index f8b643a..8488f4e 100644
--- a/Tests/FindPackageTest/Exporter/dummy.c
+++ b/Tests/FindPackageTest/Exporter/dummy.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/FindPostgreSQL/Test/main.c b/Tests/FindPostgreSQL/Test/main.c
index a63377a..b5fcf64 100644
--- a/Tests/FindPostgreSQL/Test/main.c
+++ b/Tests/FindPostgreSQL/Test/main.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
int version = PQlibVersion();
char version_string[100];
diff --git a/Tests/FindPython/display_time.c b/Tests/FindPython/display_time.c
index 0e78434..568d510 100644
--- a/Tests/FindPython/display_time.c
+++ b/Tests/FindPython/display_time.c
@@ -6,7 +6,7 @@
#include "display_time.h"
-void display_time()
+void display_time(void)
{
#if defined(PYTHON3)
wchar_t* program = Py_DecodeLocale("display_time", NULL);
diff --git a/Tests/FindPython/main.c b/Tests/FindPython/main.c
index 0acba29..0119ce0 100644
--- a/Tests/FindPython/main.c
+++ b/Tests/FindPython/main.c
@@ -1,7 +1,7 @@
#include "display_time.h"
-int main()
+int main(void)
{
display_time();
}
diff --git a/Tests/FindSDL/Test/main.c b/Tests/FindSDL/Test/main.c
index 057289c..3b774f5 100644
--- a/Tests/FindSDL/Test/main.c
+++ b/Tests/FindSDL/Test/main.c
@@ -1,6 +1,6 @@
#include <SDL.h>
-int main()
+int main(void)
{
// Test 1 requires headers only.
SDL_version compiled;
diff --git a/Tests/FindSQLite3/Test/main.c b/Tests/FindSQLite3/Test/main.c
index fb17c67..f812034 100644
--- a/Tests/FindSQLite3/Test/main.c
+++ b/Tests/FindSQLite3/Test/main.c
@@ -1,7 +1,7 @@
#include <sqlite3.h>
#include <string.h>
-int main()
+int main(void)
{
char sqlite3_version[] = SQLITE_VERSION;
diff --git a/Tests/FindTIFF/Test/main.c b/Tests/FindTIFF/Test/main.c
index 9182652..bce4a3e 100644
--- a/Tests/FindTIFF/Test/main.c
+++ b/Tests/FindTIFF/Test/main.c
@@ -1,7 +1,7 @@
#include <assert.h>
#include <tiffio.h>
-int main()
+int main(void)
{
/* Without any TIFF file to open, test that the call fails as
expected. This tests that linking worked. */
diff --git a/Tests/FindVulkan/CMakeLists.txt b/Tests/FindVulkan/CMakeLists.txt
index 46ce1c6..d7c99ce 100644
--- a/Tests/FindVulkan/CMakeLists.txt
+++ b/Tests/FindVulkan/CMakeLists.txt
@@ -5,6 +5,7 @@ add_test(NAME FindVulkan.Test COMMAND
"${CMake_BINARY_DIR}/Tests/FindVulkan/Test"
${build_generator_args}
--build-project TestFindVulkan
- --build-options ${build_options}
+ # Use --fresh to make testing multiple SDK versions on the same computer easier
+ --build-options ${build_options} --fresh
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
diff --git a/Tests/FindVulkan/Test/Run-glslangValidator.cmake b/Tests/FindVulkan/Test/Run-glslangValidator.cmake
index 27fd950..fd7867f 100644
--- a/Tests/FindVulkan/Test/Run-glslangValidator.cmake
+++ b/Tests/FindVulkan/Test/Run-glslangValidator.cmake
@@ -11,8 +11,10 @@ function(run_glslangValidator exe exe_display)
message(SEND_ERROR "Result of ${exe_display} --help is ${result}, should be 1")
endif()
- if(NOT output MATCHES "^Usage: glslangValidator")
- message(SEND_ERROR "Output of ${exe_display} --help is \"${output}\", should begin with \"Usage: glslangValidator\"")
+ # NOTE: Newer version prefer just "glslang" since it's no longer really just a validator.
+ # This approach is still compatible with older version that output glslangValidator
+ if(NOT output MATCHES "^Usage: glslang")
+ message(SEND_ERROR "Output of ${exe_display} --help is \"${output}\", should begin with \"Usage: glslang\"")
endif()
endfunction()
diff --git a/Tests/FindVulkan/Test/main-SPIRV-Tools.c b/Tests/FindVulkan/Test/main-SPIRV-Tools.c
index 097198d..c38f38d 100644
--- a/Tests/FindVulkan/Test/main-SPIRV-Tools.c
+++ b/Tests/FindVulkan/Test/main-SPIRV-Tools.c
@@ -2,7 +2,7 @@
#include <spirv-tools/libspirv.h>
#include <stdio.h>
-int main()
+int main(void)
{
const char* spv_version = spvSoftwareVersionString();
const char* spv_details = spvSoftwareVersionDetailsString();
diff --git a/Tests/FindVulkan/Test/main.c b/Tests/FindVulkan/Test/main.c
index 1bff651..78eaa4d 100644
--- a/Tests/FindVulkan/Test/main.c
+++ b/Tests/FindVulkan/Test/main.c
@@ -1,6 +1,6 @@
#include <vulkan/vulkan.h>
-int main()
+int main(void)
{
VkInstanceCreateInfo instanceCreateInfo = { 0 };
instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
diff --git a/Tests/Fortran/mainc.c b/Tests/Fortran/mainc.c
index 9efafc5..607b9fd 100644
--- a/Tests/Fortran/mainc.c
+++ b/Tests/Fortran/mainc.c
@@ -1,5 +1,5 @@
extern int myc(void);
-int main()
+int main(void)
{
return myc();
}
diff --git a/Tests/Fortran/maincxx.c b/Tests/Fortran/maincxx.c
index d35ea7e..3056d96 100644
--- a/Tests/Fortran/maincxx.c
+++ b/Tests/Fortran/maincxx.c
@@ -1,6 +1,6 @@
extern int myc(void);
extern int mycxx(void);
-int main()
+int main(void)
{
return myc() + mycxx();
}
diff --git a/Tests/FortranModules/Issue25252-iface-sources/lib.c b/Tests/FortranModules/Issue25252-iface-sources/lib.c
index 6ccdb8d..894540c 100644
--- a/Tests/FortranModules/Issue25252-iface-sources/lib.c
+++ b/Tests/FortranModules/Issue25252-iface-sources/lib.c
@@ -1,4 +1,4 @@
-int f()
+int f(void)
{
return 0;
}
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index df7cda0..be750e1 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -70,6 +70,7 @@ add_custom_target(check-part1 ALL
-Dtest_strequal_comma=$<STREQUAL:$<COMMA>,$<COMMA>>
-Dtest_strequal_semicolon=$<STREQUAL:$<SEMICOLON>,$<SEMICOLON>>
-Dtest_strequal_angle_r_comma=$<STREQUAL:$<ANGLE-R>,$<COMMA>>
+ -Dtest_strequal_quote=$<STREQUAL:$<QUOTE>,$<QUOTE>>
-Dtest_strequal_both_empty=$<STREQUAL:,>
-Dtest_strequal_one_empty=$<STREQUAL:something,>
-Dtest_inlist_true=$<IN_LIST:a,a$<SEMICOLON>b>
diff --git a/Tests/GeneratorExpression/check-part1.cmake b/Tests/GeneratorExpression/check-part1.cmake
index 41bcd6d..ddf2507 100644
--- a/Tests/GeneratorExpression/check-part1.cmake
+++ b/Tests/GeneratorExpression/check-part1.cmake
@@ -47,6 +47,7 @@ check(test_strequal_angle_r "1")
check(test_strequal_comma "1")
check(test_strequal_semicolon "1")
check(test_strequal_angle_r_comma "0")
+check(test_strequal_quote "1")
check(test_strequal_both_empty "1")
check(test_strequal_one_empty "0")
check(test_inlist_true "1")
diff --git a/Tests/GeneratorExpression/objlib1.c b/Tests/GeneratorExpression/objlib1.c
index 98a95a4..b33aa48 100644
--- a/Tests/GeneratorExpression/objlib1.c
+++ b/Tests/GeneratorExpression/objlib1.c
@@ -1,4 +1,4 @@
-void objlib1()
+void objlib1(void)
{
}
diff --git a/Tests/GeneratorExpression/objlib2.c b/Tests/GeneratorExpression/objlib2.c
index b2c1050..5543f75 100644
--- a/Tests/GeneratorExpression/objlib2.c
+++ b/Tests/GeneratorExpression/objlib2.c
@@ -1,4 +1,4 @@
-void objlib2()
+void objlib2(void)
{
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
index 5d857dd..ef922a3 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
@@ -1,4 +1,4 @@
-int test_b()
+int test_b(void)
{
return 2;
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
index 66ee6f3..1df9613 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
@@ -1,4 +1,4 @@
-int test_f()
+int test_f(void)
{
return 1;
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
index 83589ba..8bcb13a 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
@@ -1,4 +1,4 @@
-int test_c()
+int test_c(void)
{
return 1;
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
index 82f9a52..24e2d75 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
@@ -1,4 +1,4 @@
-int test_d()
+int test_d(void)
{
return 1;
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
index feba80e..5dd1214 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
@@ -1,4 +1,4 @@
-int test_a()
+int test_a(void)
{
return 1;
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
index 943c19d..658f5ab 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
@@ -1,4 +1,4 @@
-int test_e()
+int test_e(void)
{
return 1;
}
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
index d1bce33..9282163 100644
--- a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
@@ -1,7 +1,7 @@
#include "INTEGRITY.h"
#include "boottable.h"
-void main()
+void main(void)
{
Exit(0);
}
diff --git a/Tests/GoogleTest/Test/CMakeLists.txt b/Tests/GoogleTest/Test/CMakeLists.txt
index baf00d5..201c39e 100644
--- a/Tests/GoogleTest/Test/CMakeLists.txt
+++ b/Tests/GoogleTest/Test/CMakeLists.txt
@@ -81,10 +81,30 @@ gtest_add_tests(test_gtest3 "" AUTO)
if(NOT TEST GoogleTest.Foo)
message(FATAL_ERROR "Test case GoogleTest.Foo not defined")
endif()
+# Check if test has property DEF_SOURCE_LINE
+get_test_property(GoogleTest.Foo DEF_SOURCE_LINE testSourceLineFoo)
+if(NOT testSourceLineFoo)
+ message(FATAL_ERROR "Test GoogleTest.Foo should have DEF_SOURCE_LINE property")
+endif()
+# If check property ends with correct value
+string(FIND "${testSourceLineFoo}" "main3.cxx:3" testSourceLineFooFound)
+if(${testSourceLineFooFound} EQUAL -1)
+ message(FATAL_ERROR "Test GoogleTest.Foo should have DEF_SOURCE_LINE property with value main3.cxx:3")
+endif()
+
if(NOT TEST GoogleTest.Bar)
message(FATAL_ERROR "Test case GoogleTest.Bar not defined")
endif()
-
+# Check if test has property DEF_SOURCE_LINE
+get_test_property(GoogleTest.Bar DEF_SOURCE_LINE testSourceLineBar)
+if(NOT testSourceLineBar)
+ message(FATAL_ERROR "Test GoogleTest.Bar should have DEF_SOURCE_LINE property")
+endif()
+# If check property ends with correct value
+string(FIND "${testSourceLineBar}" "main3.cxx:8" testSourceLineBarFound)
+if(${testSourceLineBarFound} EQUAL -1)
+ message(FATAL_ERROR "Test GoogleTest.Bar should have DEF_SOURCE_LINE property with value main3.cxx:8")
+endif()
# Non-keyword form, explicitly specified sources. Allows a non-target to be
# given for the executable.
diff --git a/Tests/IncludeDirectories/StandardIncludeDirectories/main.c b/Tests/IncludeDirectories/StandardIncludeDirectories/main.c
index edfe9ce..29a2ee1 100644
--- a/Tests/IncludeDirectories/StandardIncludeDirectories/main.c
+++ b/Tests/IncludeDirectories/StandardIncludeDirectories/main.c
@@ -1,5 +1,5 @@
#include "StdIncDir.h"
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectoriesPerLang/main.c b/Tests/IncludeDirectories/SystemIncludeDirectoriesPerLang/main.c
index f8b643a..8488f4e 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectoriesPerLang/main.c
+++ b/Tests/IncludeDirectories/SystemIncludeDirectoriesPerLang/main.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/JavaExportImport/main.c b/Tests/JavaExportImport/main.c
index f8b643a..8488f4e 100644
--- a/Tests/JavaExportImport/main.c
+++ b/Tests/JavaExportImport/main.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/LibName/bar.c b/Tests/LibName/bar.c
index c6c1e66..b1c5cf2 100644
--- a/Tests/LibName/bar.c
+++ b/Tests/LibName/bar.c
@@ -2,6 +2,6 @@
__declspec(dllexport)
#endif
- extern void foo()
+ extern void foo(void)
{
}
diff --git a/Tests/LibName/foo.c b/Tests/LibName/foo.c
index 52e8d89..1bdb58b 100644
--- a/Tests/LibName/foo.c
+++ b/Tests/LibName/foo.c
@@ -1,11 +1,11 @@
#ifdef _WIN32
__declspec(dllimport)
#endif
- extern void foo();
+ extern void foo(void);
#ifdef _WIN32
__declspec(dllexport)
#endif
- void bar()
+ void bar(void)
{
foo();
}
diff --git a/Tests/LibName/foobar.c b/Tests/LibName/foobar.c
index 2f28d30..fa7d3e9 100644
--- a/Tests/LibName/foobar.c
+++ b/Tests/LibName/foobar.c
@@ -3,7 +3,7 @@ __declspec(dllimport)
#endif
extern void bar();
-int main()
+int main(void)
{
bar();
return 0;
diff --git a/Tests/LinkLanguage/LinkLanguage.c b/Tests/LinkLanguage/LinkLanguage.c
index 37946c7..18ddb78 100644
--- a/Tests/LinkLanguage/LinkLanguage.c
+++ b/Tests/LinkLanguage/LinkLanguage.c
@@ -1,5 +1,5 @@
extern int foo(void);
-int main()
+int main(void)
{
return foo();
}
diff --git a/Tests/LinkLine/Exec.c b/Tests/LinkLine/Exec.c
index 807a7a8..11b5650 100644
--- a/Tests/LinkLine/Exec.c
+++ b/Tests/LinkLine/Exec.c
@@ -1,7 +1,7 @@
void OneFunc();
void TwoFunc();
-int main()
+int main(void)
{
OneFunc();
TwoFunc();
diff --git a/Tests/LinkLine/One.c b/Tests/LinkLine/One.c
index 856d0d1..4f3ad63 100644
--- a/Tests/LinkLine/One.c
+++ b/Tests/LinkLine/One.c
@@ -1,6 +1,6 @@
-void TwoFunc();
+void TwoFunc(void);
-void OneFunc()
+void OneFunc(void)
{
static int i = 0;
++i;
diff --git a/Tests/LinkLine/Two.c b/Tests/LinkLine/Two.c
index 5fc212e..ac84367 100644
--- a/Tests/LinkLine/Two.c
+++ b/Tests/LinkLine/Two.c
@@ -1,6 +1,6 @@
-void OneFunc();
+void OneFunc(void);
-void TwoFunc()
+void TwoFunc(void)
{
static int i = 0;
++i;
diff --git a/Tests/LinkLineOrder/Exec1.c b/Tests/LinkLineOrder/Exec1.c
index 9bbf0f6..e47841d 100644
--- a/Tests/LinkLineOrder/Exec1.c
+++ b/Tests/LinkLineOrder/Exec1.c
@@ -1,7 +1,7 @@
/* Directly depends on One */
void OneFunc();
-int main()
+int main(void)
{
OneFunc();
return 0;
diff --git a/Tests/LinkLineOrder/Exec2.c b/Tests/LinkLineOrder/Exec2.c
index 91b8575..d60c94e 100644
--- a/Tests/LinkLineOrder/Exec2.c
+++ b/Tests/LinkLineOrder/Exec2.c
@@ -1,7 +1,7 @@
/* Directly depends on Two */
void TwoFunc();
-int main()
+int main(void)
{
TwoFunc();
return 0;
diff --git a/Tests/LinkLineOrder/NoDepA.c b/Tests/LinkLineOrder/NoDepA.c
index 76f97bc..72333bc 100644
--- a/Tests/LinkLineOrder/NoDepA.c
+++ b/Tests/LinkLineOrder/NoDepA.c
@@ -1,7 +1,7 @@
/* depends on NoDepB */
-void NoDepB_func();
+void NoDepB_func(void);
-void NoDepA_func()
+void NoDepA_func(void)
{
NoDepB_func();
}
diff --git a/Tests/LinkLineOrder/NoDepB.c b/Tests/LinkLineOrder/NoDepB.c
index fa89ae9..a5c30e5 100644
--- a/Tests/LinkLineOrder/NoDepB.c
+++ b/Tests/LinkLineOrder/NoDepB.c
@@ -1,4 +1,4 @@
/* No dependencies */
-void NoDepB_func()
+void NoDepB_func(void)
{
}
diff --git a/Tests/LinkLineOrder/NoDepC.c b/Tests/LinkLineOrder/NoDepC.c
index f05d962..cafb3fd 100644
--- a/Tests/LinkLineOrder/NoDepC.c
+++ b/Tests/LinkLineOrder/NoDepC.c
@@ -1,7 +1,7 @@
/* depends on NoDepA */
-void NoDepA_func();
+void NoDepA_func(void);
-void NoDepC_func()
+void NoDepC_func(void)
{
NoDepA_func();
}
diff --git a/Tests/LinkLineOrder/NoDepE.c b/Tests/LinkLineOrder/NoDepE.c
index c47bb85..6e33c7b 100644
--- a/Tests/LinkLineOrder/NoDepE.c
+++ b/Tests/LinkLineOrder/NoDepE.c
@@ -1,7 +1,7 @@
/* depends on NoDepF */
-void NoDepF_func();
+void NoDepF_func(void);
-void NoDepE_func()
+void NoDepE_func(void)
{
static int firstcall = 1;
if (firstcall) {
diff --git a/Tests/LinkLineOrder/NoDepF.c b/Tests/LinkLineOrder/NoDepF.c
index a814310..f4afcb5 100644
--- a/Tests/LinkLineOrder/NoDepF.c
+++ b/Tests/LinkLineOrder/NoDepF.c
@@ -1,7 +1,7 @@
/* depends on NoDepE */
-void NoDepE_func();
+void NoDepE_func(void);
-void NoDepF_func()
+void NoDepF_func(void)
{
static int firstcall = 1;
if (firstcall) {
diff --git a/Tests/LinkLineOrder/NoDepX.c b/Tests/LinkLineOrder/NoDepX.c
index c895dd1..c8de222 100644
--- a/Tests/LinkLineOrder/NoDepX.c
+++ b/Tests/LinkLineOrder/NoDepX.c
@@ -1,7 +1,7 @@
/* depends on NoDepY*/
-void NoDepY_func();
+void NoDepY_func(void);
-void NoDepX_func()
+void NoDepX_func(void)
{
NoDepY_func();
}
diff --git a/Tests/LinkLineOrder/NoDepY.c b/Tests/LinkLineOrder/NoDepY.c
index 1e6a4ae..dc492d5 100644
--- a/Tests/LinkLineOrder/NoDepY.c
+++ b/Tests/LinkLineOrder/NoDepY.c
@@ -1,4 +1,4 @@
/* No dependencies */
-void NoDepY_func()
+void NoDepY_func(void)
{
}
diff --git a/Tests/LinkLineOrder/NoDepZ.c b/Tests/LinkLineOrder/NoDepZ.c
index 045e570..c866667 100644
--- a/Tests/LinkLineOrder/NoDepZ.c
+++ b/Tests/LinkLineOrder/NoDepZ.c
@@ -1,7 +1,7 @@
/* depends on NoDepX */
-void NoDepX_func();
+void NoDepX_func(void);
-void NoDepZ_func()
+void NoDepZ_func(void)
{
NoDepX_func();
}
diff --git a/Tests/LinkLineOrder/One.c b/Tests/LinkLineOrder/One.c
index b23b1ec..b95fa6d 100644
--- a/Tests/LinkLineOrder/One.c
+++ b/Tests/LinkLineOrder/One.c
@@ -1,9 +1,9 @@
/* depends on NoDepC and NoDepE (and hence on NoDepA, NoDepB and */
/* NoDepF) */
-void NoDepC_func();
-void NoDepE_func();
+void NoDepC_func(void);
+void NoDepE_func(void);
-void OneFunc()
+void OneFunc(void)
{
NoDepC_func();
NoDepE_func();
diff --git a/Tests/LinkLineOrder/Two.c b/Tests/LinkLineOrder/Two.c
index 6bffaa8..9955d67 100644
--- a/Tests/LinkLineOrder/Two.c
+++ b/Tests/LinkLineOrder/Two.c
@@ -1,7 +1,7 @@
-void OneFunc();
-void NoDepZ_func();
+void OneFunc(void);
+void NoDepZ_func(void);
-void TwoFunc()
+void TwoFunc(void)
{
OneFunc();
NoDepZ_func();
diff --git a/Tests/MSVCDebugInformationFormat/override-CUDA.cmake b/Tests/MSVCDebugInformationFormat/override-CUDA.cmake
index f870775..eaa7bff 100644
--- a/Tests/MSVCDebugInformationFormat/override-CUDA.cmake
+++ b/Tests/MSVCDebugInformationFormat/override-CUDA.cmake
@@ -1,5 +1,6 @@
set(var "CMAKE_CUDA_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded")
string(REPLACE "-Z7" "-Z7;-DTEST_Z7" "${var}" "${${var}}")
+string(REPLACE "-gcodeview" "-gcodeview;-DTEST_Z7" "${var}" "${${var}}")
set(var "CMAKE_CUDA_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase")
string(REPLACE "-Zi" "-Zi;-DTEST_Zi" "${var}" "${${var}}")
set(var "CMAKE_CUDA_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue")
diff --git a/Tests/MSVCRuntimeLibrary/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/CMakeLists.txt
index f7d9fec..f1ed9b4 100644
--- a/Tests/MSVCRuntimeLibrary/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/CMakeLists.txt
@@ -57,10 +57,6 @@ function(verify lang src)
# VS 2005 and above default to multi-threaded.
target_compile_definitions(empty-${lang} PRIVATE VERIFY_MT)
endif()
- if(CMAKE_GENERATOR MATCHES "Visual Studio ([^9]|9[0-9])")
- # VS 2010 and above have a different default runtime library for projects than 'cl'.
- target_compile_definitions(empty-${lang} PRIVATE VERIFY_DLL)
- endif()
endif()
endfunction()
diff --git a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
index 2a8a152..4cd200a 100644
--- a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
@@ -21,14 +21,16 @@ foreach(t MultiThreaded SingleThreaded)
endforeach()
endforeach()
endforeach()
-if(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
- # LLVMFlang does not actually define these, so inject them
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
+ # LLVMFlang < 18.0 does not define these, so inject them.
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "-D_MT")
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "-D_MT;-D_DLL")
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "-D_MT;-D_DEBUG")
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "-D_MT;-D_DEBUG;-D_DLL")
endif()
-string(APPEND CMAKE_Fortran_FLAGS " -w")
+if(NOT CMAKE_Fortran_SIMULATE_ID STREQUAL "MSVC")
+ string(APPEND CMAKE_Fortran_FLAGS " -w")
+endif()
function(verify_combinations threads lang src)
set(verify_tc_config_ Release)
diff --git a/Tests/Module/CheckIPOSupported-C/bar.c b/Tests/Module/CheckIPOSupported-C/bar.c
index 680f213..728d8fb 100644
--- a/Tests/Module/CheckIPOSupported-C/bar.c
+++ b/Tests/Module/CheckIPOSupported-C/bar.c
@@ -1,4 +1,4 @@
-int bar()
+int bar(void)
{
return 0x42;
}
diff --git a/Tests/Module/CheckIPOSupported-C/foo.c b/Tests/Module/CheckIPOSupported-C/foo.c
index 1e56597..6a64a99 100644
--- a/Tests/Module/CheckIPOSupported-C/foo.c
+++ b/Tests/Module/CheckIPOSupported-C/foo.c
@@ -1,4 +1,4 @@
-int foo()
+int foo(void)
{
return 0x42;
}
diff --git a/Tests/Module/CheckIPOSupported-C/main.c b/Tests/Module/CheckIPOSupported-C/main.c
index 28ab26f..7d8ad9a 100644
--- a/Tests/Module/CheckIPOSupported-C/main.c
+++ b/Tests/Module/CheckIPOSupported-C/main.c
@@ -1,7 +1,7 @@
int foo();
int bar();
-int main()
+int main(void)
{
if (foo() != bar()) {
return 1;
diff --git a/Tests/Module/CheckTypeSize/CheckTypeSize.c b/Tests/Module/CheckTypeSize/CheckTypeSize.c
index adfd2fc..eb1aa94 100644
--- a/Tests/Module/CheckTypeSize/CheckTypeSize.c
+++ b/Tests/Module/CheckTypeSize/CheckTypeSize.c
@@ -28,7 +28,7 @@
result = 1; \
} while (0)
-int main()
+int main(void)
{
int result = 0;
struct somestruct x;
diff --git a/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c b/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c
index 487e66d..34c373c 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c
+++ b/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c
@@ -1,7 +1,7 @@
#include "test_compiler_detection.h"
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/Module/WriteCompilerDetectionHeader/main.c b/Tests/Module/WriteCompilerDetectionHeader/main.c
index 3420c67..1253563 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/main.c
+++ b/Tests/Module/WriteCompilerDetectionHeader/main.c
@@ -24,7 +24,7 @@
# error Expect no CXX features defined
#endif
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/Module/WriteCompilerDetectionHeader/main_multi.c b/Tests/Module/WriteCompilerDetectionHeader/main_multi.c
index 28f9dae..3853671 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/main_multi.c
+++ b/Tests/Module/WriteCompilerDetectionHeader/main_multi.c
@@ -24,7 +24,7 @@
# error Expect no CXX features defined
#endif
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/NasmOnly/CMakeLists.txt b/Tests/NasmOnly/CMakeLists.txt
new file mode 100644
index 0000000..e4190c2
--- /dev/null
+++ b/Tests/NasmOnly/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.28)
+
+project(NasmOnly LANGUAGES ASM_NASM)
+
+add_library(testnasm1 STATIC libnasm1.nasm)
+add_executable(NasmOnly nasmonly.nasm)
+target_link_libraries(NasmOnly testnasm1)
diff --git a/Tests/NasmOnly/libnasm1.nasm b/Tests/NasmOnly/libnasm1.nasm
new file mode 100644
index 0000000..c72a1ad
--- /dev/null
+++ b/Tests/NasmOnly/libnasm1.nasm
@@ -0,0 +1,6 @@
+global LibNasm1Func
+
+section .text
+LibNasm1Func:
+ mov rax, 1
+ ret
diff --git a/Tests/NasmOnly/nasmonly.nasm b/Tests/NasmOnly/nasmonly.nasm
new file mode 100644
index 0000000..db9b655
--- /dev/null
+++ b/Tests/NasmOnly/nasmonly.nasm
@@ -0,0 +1,19 @@
+global _start
+
+extern LibNasm1Func
+
+section .text
+_start:
+ xor rax, rax
+ call LibNasm1Func
+ cmp rax, 1
+ jne err
+
+ mov rax, 60
+ xor rdi, rdi
+ syscall
+
+err:
+ mov rax, 60
+ mov rdi, 1
+ syscall
diff --git a/Tests/OutOfBinary/outlib.c b/Tests/OutOfBinary/outlib.c
index d309ebe..3eaedea 100644
--- a/Tests/OutOfBinary/outlib.c
+++ b/Tests/OutOfBinary/outlib.c
@@ -1,4 +1,4 @@
-int outlib()
+int outlib(void)
{
return 456;
}
diff --git a/Tests/PDBDirectoryAndName/myexe.c b/Tests/PDBDirectoryAndName/myexe.c
index fdb8b09..3d66794 100644
--- a/Tests/PDBDirectoryAndName/myexe.c
+++ b/Tests/PDBDirectoryAndName/myexe.c
@@ -1,8 +1,8 @@
-extern int mylibA();
-extern int mylibB();
-extern int mylibC();
-extern int mylibD();
-int main()
+extern int mylibA(void);
+extern int mylibB(void);
+extern int mylibC(void);
+extern int mylibD(void);
+int main(void)
{
return mylibA() + mylibB() + mylibC() + mylibD();
}
diff --git a/Tests/PDBDirectoryAndName/myexe2.c b/Tests/PDBDirectoryAndName/myexe2.c
index 250d651..b32e0b1 100644
--- a/Tests/PDBDirectoryAndName/myexe2.c
+++ b/Tests/PDBDirectoryAndName/myexe2.c
@@ -1,6 +1,6 @@
-extern int mylibA();
-extern int mylibD();
-int main()
+extern int mylibA(void);
+extern int mylibD(void);
+int main(void)
{
return mylibA() + mylibD();
}
diff --git a/Tests/PDBDirectoryAndName/mylibA.c b/Tests/PDBDirectoryAndName/mylibA.c
index 5bc279b..58ff123 100644
--- a/Tests/PDBDirectoryAndName/mylibA.c
+++ b/Tests/PDBDirectoryAndName/mylibA.c
@@ -1,4 +1,4 @@
-__declspec(dllexport) int mylibA()
+__declspec(dllexport) int mylibA(void)
{
return 1;
}
diff --git a/Tests/PDBDirectoryAndName/mylibB.c b/Tests/PDBDirectoryAndName/mylibB.c
index 3a95845..8be2aa0 100644
--- a/Tests/PDBDirectoryAndName/mylibB.c
+++ b/Tests/PDBDirectoryAndName/mylibB.c
@@ -1,4 +1,4 @@
-int mylibB()
+int mylibB(void)
{
return -1;
}
diff --git a/Tests/PDBDirectoryAndName/mylibC.c b/Tests/PDBDirectoryAndName/mylibC.c
index 8982849..64dde72 100644
--- a/Tests/PDBDirectoryAndName/mylibC.c
+++ b/Tests/PDBDirectoryAndName/mylibC.c
@@ -1,4 +1,4 @@
-__declspec(dllexport) int mylibC()
+__declspec(dllexport) int mylibC(void)
{
return 1;
}
diff --git a/Tests/PDBDirectoryAndName/mylibD.c b/Tests/PDBDirectoryAndName/mylibD.c
index a53b7a2..c9c04d8 100644
--- a/Tests/PDBDirectoryAndName/mylibD.c
+++ b/Tests/PDBDirectoryAndName/mylibD.c
@@ -1,4 +1,4 @@
-int mylibD()
+int mylibD(void)
{
return -1;
}
diff --git a/Tests/PerConfig/perconfig.c b/Tests/PerConfig/perconfig.c
index d942d45..5162ae0 100644
--- a/Tests/PerConfig/perconfig.c
+++ b/Tests/PerConfig/perconfig.c
@@ -1,6 +1,6 @@
#include "pcShared.h"
extern const char* pcStatic(void);
-int main()
+int main(void)
{
pcStatic();
pcShared();
diff --git a/Tests/PolicyScope/main.c b/Tests/PolicyScope/main.c
index f8b643a..8488f4e 100644
--- a/Tests/PolicyScope/main.c
+++ b/Tests/PolicyScope/main.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/PrecompiledHeader/foo1.c b/Tests/PrecompiledHeader/foo1.c
index fef2586..e743f8b 100644
--- a/Tests/PrecompiledHeader/foo1.c
+++ b/Tests/PrecompiledHeader/foo1.c
@@ -2,7 +2,7 @@
# error "Precompiled header foo_precompiled.h has not been loaded."
#endif
-int main()
+int main(void)
{
return foo();
}
diff --git a/Tests/PrecompiledHeader/foo2.c b/Tests/PrecompiledHeader/foo2.c
index 3ed04ed..5211f3e 100644
--- a/Tests/PrecompiledHeader/foo2.c
+++ b/Tests/PrecompiledHeader/foo2.c
@@ -3,7 +3,7 @@
# error "Precompiled header foo_precompiled.h has not been loaded."
#endif
-int foo()
+int foo(void)
{
return 0;
}
diff --git a/Tests/RunCMake/AppleTextStubs/SUBDIR/CMakeLists.txt b/Tests/RunCMake/AppleTextStubs/SUBDIR/CMakeLists.txt
new file mode 100644
index 0000000..61cfefe
--- /dev/null
+++ b/Tests/RunCMake/AppleTextStubs/SUBDIR/CMakeLists.txt
@@ -0,0 +1,5 @@
+
+add_library(foo2 SHARED ../foo.c)
+set_property(TARGET foo2 PROPERTY ENABLE_EXPORTS TRUE)
+
+install(TARGETS foo2 DESTINATION "${CMAKE_BINARY_DIR}/INSTALL")
diff --git a/Tests/RunCMake/AppleTextStubs/Simple.cmake b/Tests/RunCMake/AppleTextStubs/Simple.cmake
index 9f6318c..8491267 100644
--- a/Tests/RunCMake/AppleTextStubs/Simple.cmake
+++ b/Tests/RunCMake/AppleTextStubs/Simple.cmake
@@ -6,6 +6,7 @@ set_property(TARGET foo PROPERTY ENABLE_EXPORTS TRUE)
add_executable(main main.c)
target_link_libraries(main PRIVATE foo)
+add_subdirectory(SUBDIR)
install(TARGETS foo DESTINATION "${CMAKE_BINARY_DIR}/INSTALL")
@@ -24,15 +25,20 @@ macro (CHECK_FILE test_msg path)
endif()
endmacro()
-check_file("DYLIB file" "$<TARGET_FILE:foo>")
+check_file("foo DYLIB file" "$<TARGET_FILE:foo>")
+check_file("foo2 DYLIB file" "$<TARGET_FILE:foo2>")
check_file("executable file" "$<TARGET_FILE:main>")
+check_file("Installed foo DYLIB file" "${RunCMake_TEST_BINARY_DIR}/INSTALL/$<TARGET_FILE_NAME:foo>")
+check_file("Installed foo2 DYLIB file" "${RunCMake_TEST_BINARY_DIR}/INSTALL/$<TARGET_FILE_NAME:foo2>")
check_file("Installed DYLIB file" "${RunCMake_TEST_BINARY_DIR}/INSTALL2/lib/$<TARGET_FILE_NAME:foo>")
if (APPLE_TEXT_STUBS_SUPPORTED)
- check_file("TBD file" "$<TARGET_IMPORT_FILE:foo>")
+ check_file("foo TBD file" "$<TARGET_IMPORT_FILE:foo>")
+ check_file("foo2 TBD file" "$<TARGET_IMPORT_FILE:foo2>")
- check_file("Installed TBD file" "${RunCMake_TEST_BINARY_DIR}/INSTALL/$<TARGET_IMPORT_FILE_NAME:foo>")
+ check_file("Installed foo TBD file" "${RunCMake_TEST_BINARY_DIR}/INSTALL/$<TARGET_IMPORT_FILE_NAME:foo>")
+ check_file("Installed foo2 TBD file" "${RunCMake_TEST_BINARY_DIR}/INSTALL/$<TARGET_IMPORT_FILE_NAME:foo2>")
check_file("Installed TBD file" "${RunCMake_TEST_BINARY_DIR}/INSTALL2/dev/$<TARGET_IMPORT_FILE_NAME:foo>")
endif()
]])
diff --git a/Tests/RunCMake/AppleTextStubs/foo.c b/Tests/RunCMake/AppleTextStubs/foo.c
index 7f39d71..f669327 100644
--- a/Tests/RunCMake/AppleTextStubs/foo.c
+++ b/Tests/RunCMake/AppleTextStubs/foo.c
@@ -1,5 +1,5 @@
-int foo()
+int foo(void)
{
return 0;
}
diff --git a/Tests/RunCMake/AppleTextStubs/main.c b/Tests/RunCMake/AppleTextStubs/main.c
index dc5ce3d..390f7d1 100644
--- a/Tests/RunCMake/AppleTextStubs/main.c
+++ b/Tests/RunCMake/AppleTextStubs/main.c
@@ -1,7 +1,7 @@
extern int foo(void);
-int main()
+int main(void)
{
return foo();
}
diff --git a/Tests/RunCMake/AutoExportDll/foo.c b/Tests/RunCMake/AutoExportDll/foo.c
index d13bc3e..b4f3ae0 100644
--- a/Tests/RunCMake/AutoExportDll/foo.c
+++ b/Tests/RunCMake/AutoExportDll/foo.c
@@ -4,12 +4,12 @@
# define WINAPI
#endif
-int WINAPI foo()
+int WINAPI foo(void)
{
return 10;
}
-int bar()
+int bar(void)
{
return 5;
}
diff --git a/Tests/RunCMake/AutoExportDll/hello2.c b/Tests/RunCMake/AutoExportDll/hello2.c
index d4d6b72..66e7caf 100644
--- a/Tests/RunCMake/AutoExportDll/hello2.c
+++ b/Tests/RunCMake/AutoExportDll/hello2.c
@@ -2,7 +2,7 @@
extern int own_auto_export_function(int i);
-void hello2()
+void hello2(void)
{
printf("hello exec:%i", own_auto_export_function(41));
}
diff --git a/Tests/RunCMake/AutoExportDll/objlib.c b/Tests/RunCMake/AutoExportDll/objlib.c
index 54a9658..4e580c3 100644
--- a/Tests/RunCMake/AutoExportDll/objlib.c
+++ b/Tests/RunCMake/AutoExportDll/objlib.c
@@ -1,4 +1,4 @@
-int objlib()
+int objlib(void)
{
return 7;
}
diff --git a/Tests/RunCMake/Autogen/RccExample.cmake b/Tests/RunCMake/Autogen/RccExample.cmake
index 4554eb0..ade0fef 100644
--- a/Tests/RunCMake/Autogen/RccExample.cmake
+++ b/Tests/RunCMake/Autogen/RccExample.cmake
@@ -9,3 +9,7 @@ target_link_libraries(dummy Qt${with_qt_version}::Core
Qt${with_qt_version}::Gui)
set_target_properties(dummy PROPERTIES AUTORCC ON)
+
+if(DEFINED ZSTD_VALUE)
+ set(QT_FEATURE_zstd ${ZSTD_VALUE})
+endif()
diff --git a/Tests/RunCMake/Autogen/RunCMakeTest.cmake b/Tests/RunCMake/Autogen/RunCMakeTest.cmake
index 1a7d4f0..0036551 100644
--- a/Tests/RunCMake/Autogen/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Autogen/RunCMakeTest.cmake
@@ -128,65 +128,360 @@ if (DEFINED with_qt_version)
if(QtCore_VERSION VERSION_GREATER_EQUAL 5.15.0)
if (RunCMake_GENERATOR MATCHES "Ninja Multi-Config")
set(config_list Debug Release RelWithDebInfo)
+ set(use_better_graph_list ON OFF)
else()
set(config_list single-config)
+ set(use_better_graph_list OFF)
endif()
- foreach(config IN ITEMS ${config_list})
- block()
- if (config STREQUAL "single-config")
- set(config_suffix "")
- else()
- set(config_suffix "_${config}")
- endif()
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/QtAutoMocDeps${config_suffix}-build)
- run_cmake(QtAutoMocDeps)
- set(RunCMake_TEST_NO_CLEAN 1)
- # Build the project.
- if (config STREQUAL "single-config")
- set(config_param "")
- else()
- set(config_param "--config ${config}")
- endif()
- run_cmake_command(QtAutoMocDeps-build ${CMAKE_COMMAND} --build . --verbose ${config_param})
- # Touch just the library source file, which shouldn't cause a rerun of AUTOMOC
- # for app_with_qt target.
- file(TOUCH "${RunCMake_SOURCE_DIR}/simple_lib.cpp")
-
- # Build and assert that AUTOMOC was not run for app_with_qt, sub_exe_1 and sub_exe_2.
- run_cmake_command(QtAutoMocDeps-build ${CMAKE_COMMAND} --build . --verbose ${config_param})
- unset(RunCMake_TEST_VARIANT_DESCRIPTION)
- unset(RunCMake_TEST_NOT_EXPECT_stdout)
- macro(check_file_exists file)
- if (EXISTS "${file}")
- set(check_result "PASSED")
- set(message_type "STATUS")
+ foreach(use_better_graph IN ITEMS ${use_better_graph_list})
+ foreach(config IN ITEMS ${config_list})
+ block()
+ if (config STREQUAL "single-config")
+ set(config_suffix "")
+ else()
+ set(config_path "_${config}")
+ if (use_better_graph)
+ set(config_suffix "_${config}")
+ endif()
+ endif()
+
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/QtAutoMocDeps${config_path}-build)
+ run_cmake_with_options(QtAutoMocDeps ${RunCMake_TEST_OPTIONS} -DCMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG=${use_better_graph})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ # Build the project.
+ if (config STREQUAL "single-config")
+ set(config_param "")
else()
- set(check_result "FAILED")
- set(message_type "FATAL_ERROR")
+ set(config_param "--config ${config}")
endif()
+ run_cmake_command(QtAutoMocDeps-build ${CMAKE_COMMAND} --build . --verbose ${config_param})
+ # Touch just the library source file, which shouldn't cause a rerun of AUTOMOC
+ # for app_with_qt target.
+ file(TOUCH "${RunCMake_SOURCE_DIR}/simple_lib.cpp")
+ set(RunCMake_TEST_NOT_EXPECT_stdout "Automatic MOC for target app_with_qt|\
+Automatic MOC for target sub_exe_1|\
+Automatic MOC for target sub_exe_2")
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-Don't execute AUTOMOC for 'app_with_qt', 'sub_exe_1' and 'sub_exe_2'")
+ # Build and assert that AUTOMOC was not run for app_with_qt, sub_exe_1 and sub_exe_2.
+ run_cmake_command(QtAutoMocDeps-build ${CMAKE_COMMAND} --build . --verbose ${config_param})
+ unset(RunCMake_TEST_VARIANT_DESCRIPTION)
+ unset(RunCMake_TEST_NOT_EXPECT_stdout)
- message(${message_type} "QtAutoMocDeps-build-\"${file}\" was generated - ${check_result}")
- endmacro()
+ macro(check_file_exists file)
+ if (EXISTS "${file}")
+ set(check_result "PASSED")
+ set(message_type "STATUS")
+ else()
+ set(check_result "FAILED")
+ set(message_type "FATAL_ERROR")
+ endif()
- check_file_exists("${RunCMake_TEST_BINARY_DIR}/app_with_qt_autogen/deps")
- check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir1/sub_exe_1_autogen/deps")
- check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir2/sub_exe_2_autogen/deps")
+ message(${message_type} "QtAutoMocDeps-build-\"${file}\" was generated - ${check_result}")
+ endmacro()
- check_file_exists("${RunCMake_TEST_BINARY_DIR}/app_with_qt_autogen/timestamp")
- check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir1/sub_exe_1_autogen/timestamp")
- check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir2/sub_exe_2_autogen/timestamp")
+ check_file_exists("${RunCMake_TEST_BINARY_DIR}/app_with_qt_autogen/deps${config_suffix}")
+ check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir1/sub_exe_1_autogen/deps${config_suffix}")
+ check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir2/sub_exe_2_autogen/deps${config_suffix}")
- # Touch a header file to make sure an automoc dependency cycle is not introduced.
- file(TOUCH "${RunCMake_SOURCE_DIR}/MyWindow.h")
- set(RunCMake_TEST_VARIANT_DESCRIPTION "-First build after touch to detect dependency cycle")
- run_cmake_command(QtAutoMocDeps-build ${CMAKE_COMMAND} --build . --verbose)
- # Need to run a second time to hit the dependency cycle.
- set(RunCMake_TEST_VARIANT_DESCRIPTION "-Don't hit dependency cycle")
- run_cmake_command(QtAutoMocDeps-build ${CMAKE_COMMAND} --build . --verbose)
- endblock()
+ check_file_exists("${RunCMake_TEST_BINARY_DIR}/app_with_qt_autogen/timestamp${config_suffix}")
+ check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir1/sub_exe_1_autogen/timestamp${config_suffix}")
+ check_file_exists("${RunCMake_TEST_BINARY_DIR}/QtSubDir2/sub_exe_2_autogen/timestamp${config_suffix}")
+
+ # Touch a header file to make sure an automoc dependency cycle is not introduced.
+ file(TOUCH "${RunCMake_SOURCE_DIR}/MyWindow.h")
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-First build after touch to detect dependency cycle")
+ run_cmake_command(QtAutoMocDeps-build ${CMAKE_COMMAND} --build . --verbose)
+ # Need to run a second time to hit the dependency cycle.
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-Don't hit dependency cycle")
+ run_cmake_command(QtAutoMocDeps-build ${CMAKE_COMMAND} --build . --verbose)
+ endblock()
+ endforeach()
endforeach()
endif()
endblock()
endif()
+
+ function(run_make_program dir)
+ execute_process(
+ COMMAND "${RunCMake_MAKE_PROGRAM}" ${ARGN}
+ WORKING_DIRECTORY "${dir}"
+ OUTPUT_VARIABLE make_program_stdout
+ ERROR_VARIABLE make_program_stderr
+ RESULT_VARIABLE make_program_result
+ )
+ if (NOT DEFINED RunMakeProgram_expected_result)
+ set(RunMakeProgram_expected_result 0)
+ endif()
+ if(NOT "${make_program_result}" MATCHES "${RunMakeProgram_expected_result}")
+ message(STATUS "
+============ beginning of ${RunCMake_MAKE_PROGRAM}'s stdout ============
+${make_program_stdout}
+=============== end of ${RunCMake_MAKE_PROGRAM}'s stdout ===============
+")
+ message(STATUS "
+============ beginning of ${RunCMake_MAKE_PROGRAM}'s stderr ============
+${make_program_stderr}
+=============== end of ${RunCMake_MAKE_PROGRAM}'s stderr ===============
+")
+ message(FATAL_ERROR
+ "top ${RunCMake_MAKE_PROGRAM} build failed exited with status ${make_program_result}")
+ endif()
+ set(make_program_stdout "${make_program_stdout}" PARENT_SCOPE)
+ endfunction(run_make_program)
+
+ function(count_substring STRING SUBSTRING COUNT_VAR)
+ string(LENGTH "${STRING}" STRING_LENGTH)
+ string(LENGTH "${SUBSTRING}" SUBSTRING_LENGTH)
+ if (SUBSTRING_LENGTH EQUAL 0)
+ message(FATAL_ERROR "SUBSTRING_LENGTH is 0")
+ endif()
+
+ if (STRING_LENGTH EQUAL 0)
+ message(FATAL_ERROR "STRING_LENGTH is 0")
+ endif()
+
+ if (STRING_LENGTH LESS SUBSTRING_LENGTH)
+ message(FATAL_ERROR "STRING_LENGTH is less than SUBSTRING_LENGTH")
+ endif()
+
+ set(COUNT 0)
+ string(FIND "${STRING}" "${SUBSTRING}" SUBSTRING_START)
+ while(SUBSTRING_START GREATER_EQUAL 0)
+ math(EXPR COUNT "${COUNT} + 1")
+ math(EXPR SUBSTRING_START "${SUBSTRING_START} + ${SUBSTRING_LENGTH}")
+ string(SUBSTRING "${STRING}" ${SUBSTRING_START} -1 STRING)
+ string(FIND "${STRING}" "${SUBSTRING}" SUBSTRING_START)
+ endwhile()
+
+ set(${COUNT_VAR} ${COUNT} PARENT_SCOPE)
+ endfunction()
+
+ function(expect_only_once make_program_stdout expected_output test_name)
+ count_substring("${make_program_stdout}" "${expected_output}" count)
+ if(NOT count EQUAL 1)
+ message(STATUS "${test_name}-expect_only_once - FAILED")
+ message(FATAL_ERROR "Expected to find ${expected_output} exactly once in ${make_program_stdout} but found ${count} occurrences of ${expected_output}")
+ else()
+ message(STATUS "${test_name}-expect_only_once - PASSED")
+ endif()
+ endfunction()
+
+ function(expect_n_times string_to_check expected_output expected_count test_name)
+ count_substring("${string_to_check}" "${expected_output}" count)
+ if(NOT count EQUAL ${expected_count})
+ message(STATUS "${test_name}-expect_${expected_count}_times - FAILED")
+ message(FATAL_ERROR "Expected to find ${expected_output} exactly ${expected_count} times in ${string_to_check} but found ${count} occurrences of ${expected_output}")
+ else()
+ message(STATUS "${test_name}-expect_${expected_count}_times - PASSED")
+ endif()
+ endfunction()
+
+ function(not_expect make_program_stdout unexpected_output test_name)
+ count_substring("${make_program_stdout}" "${unexpected_output}" count)
+ if(NOT count EQUAL 0)
+ message(STATUS "${test_name}-not_expect - FAILED")
+ message(FATAL_ERROR "Expected to find ${unexpected_output} exactly 0 times in ${make_program_stdout} but found ${count} occurrences of ${unexpected_output}")
+ else()
+ message(STATUS "${test_name}-not_expect - PASSED")
+ endif()
+ endfunction()
+
+ if (QtCore_VERSION VERSION_GREATER_EQUAL 5.15.0)
+ foreach(exe IN ITEMS Moc Uic Rcc)
+ if(RunCMake_GENERATOR MATCHES "Ninja Multi-Config")
+ block()
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMake-configure")
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Auto${exe}ExecutableConfig-multi-config-build)
+ run_cmake_with_options(Auto${exe}ExecutableConfig ${RunCMake_TEST_OPTIONS} -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG=ON)
+ unset(RunCMake_TEST_VARIANT_DESCRIPTION)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ foreach(config IN ITEMS Debug Release RelWithDebInfo)
+ block()
+ set(RunCMake_TEST_EXPECT_stdout ".*running_exe_${config}*")
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-${config}-expect_running_exe_${config}")
+ run_cmake_command(Auto${exe}ExecutableConfig-multi-config-build ${CMAKE_COMMAND} --build . --config ${config})
+ endblock()
+ endforeach()
+ set(RunCMake_TEST_EXPECT_stdout "ninja: no work to do")
+ foreach(config IN ITEMS Debug Release RelWithDebInfo)
+ block()
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-${config}-expect_no_work_to_do")
+ run_cmake_command(Auto${exe}ExecutableConfig-multi-config-build ${CMAKE_COMMAND} --build . --config ${config})
+ endblock()
+ endforeach()
+ endblock()
+ block()
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Auto${exe}ExecutableConfig-build)
+ run_cmake_with_options(Auto${exe}ExecutableConfig ${RunCMake_TEST_OPTIONS} -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG=ON)
+ foreach(config IN ITEMS Debug Release RelWithDebInfo)
+ block()
+ run_make_program(${RunCMake_TEST_BINARY_DIR} --verbose -f build-${config}.ninja)
+
+ set(expected_output "running_exe_${config}")
+ expect_only_once("${make_program_stdout}" "${expected_output}" "Auto${exe}ExecutableConfig-${config}-${expected_output}")
+
+ foreach(sub_config IN ITEMS Debug Release RelWithDebInfo)
+ if(NOT sub_config STREQUAL config)
+ set(unexpected_output "running_exe_${sub_config}")
+ not_expect("${make_program_stdout}" "${unexpected_output}" "Auto${exe}ExecutableConfig-${config}-${unexpected_output}")
+ endif()
+ endforeach()
+
+ if (exe STREQUAL "Moc" OR exe STREQUAL "Uic")
+ set(expected_output "cmake_autogen")
+ else()
+ set(expected_output "cmake_autorcc")
+ endif()
+ expect_only_once("${make_program_stdout}" "${expected_output}" "Auto${exe}ExecutableConfig-${config}-${expected_output}")
+ endblock()
+ endforeach()
+ endblock()
+ block()
+ foreach(ninja_config IN ITEMS Debug Release RelWithDebInfo)
+ foreach(target_config IN ITEMS Debug Release RelWithDebInfo)
+ block()
+ set(TEST_SUFFIX "-CrossConfig-${ninja_config}-${target_config}")
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Auto${exe}ExecutableConfig${TEST_SUFFIX}-build)
+ set(RunCMake_TEST_VARIANT_DESCRIPTION ${TEST_SUFFIX})
+ run_cmake_with_options(Auto${exe}ExecutableConfig ${RunCMake_TEST_OPTIONS} -DCMAKE_CROSS_CONFIGS=all -DCMAKE_DEFAULT_BUILD_TYPE=${ninja_config} -DCMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG=ON)
+ unset(RunCMake_TEST_VARIANT_DESCRIPTION)
+
+ run_make_program(${RunCMake_TEST_BINARY_DIR} --verbose -f build-${ninja_config}.ninja dummy:${target_config})
+
+ set(expected_output "running_exe_${ninja_config}")
+ expect_only_once("${make_program_stdout}" "${expected_output}" "Auto${exe}ExecutableConfig${TEST_SUFFIX}-${expected_output}")
+
+ foreach(sub_config IN ITEMS Debug Release RelWithDebInfo)
+ if(NOT sub_config STREQUAL ninja_config)
+ set(unexpected_output "running_exe_${sub_config}")
+ not_expect("${make_program_stdout}" "${unexpected_output}" "Auto${exe}ExecutableConfig${TEST_SUFFIX}-${unexpected_output}")
+ endif()
+ endforeach()
+
+ if (exe STREQUAL "Moc" OR exe STREQUAL "Uic")
+ set(expected_output "cmake_autogen")
+ else()
+ set(expected_output "cmake_autorcc")
+ endif()
+ expect_only_once("${make_program_stdout}" "${expected_output}" "Auto${exe}ExecutableConfig${TEST_SUFFIX}-${expected_output}")
+ endblock()
+ endforeach()
+ endforeach()
+ endblock()
+ block()
+ foreach(ninja_config IN ITEMS Debug Release RelWithDebInfo)
+ set(TEST_SUFFIX "-CrossConfig-${ninja_config}-all-all")
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Auto${exe}ExecutableConfig${TEST_SUFFIX}-build)
+ set(RunCMake_TEST_VARIANT_DESCRIPTION ${TEST_SUFFIX})
+ run_cmake_with_options(Auto${exe}ExecutableConfig ${RunCMake_TEST_OPTIONS} -DCMAKE_CROSS_CONFIGS=all -DCMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG=ON)
+ unset(RunCMake_TEST_VARIANT_DESCRIPTION)
+ run_make_program(${RunCMake_TEST_BINARY_DIR} --verbose -f build-${ninja_config}.ninja all:all)
+ endforeach()
+ endblock()
+ elseif (RunCMake_GENERATOR MATCHES "Ninja|Make")
+ block()
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Auto${exe}ExecutableConfig-build)
+ foreach(config IN ITEMS Debug Release RelWithDebInfo)
+ block()
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-${config}")
+ run_cmake_with_options(Auto${exe}ExecutableConfig ${RunCMake_TEST_OPTIONS} -DCMAKE_BUILD_TYPE=${config} -DCMAKE_AUTOGEN_VERBOSE=ON)
+ unset(RunCMake_TEST_VARIANT_DESCRIPTION)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_EXPECT_stdout ".*running_exe_${config}*")
+ run_cmake_command(Auto${exe}ExecutableConfig-${config}-build ${CMAKE_COMMAND} --build .)
+ endblock()
+ endforeach()
+ endblock()
+ endif()
+ endforeach()
+ endif()
+
+ # Visual Studio specific dependency tests
+ if (RunCMake_GENERATOR MATCHES "Visual Studio")
+ foreach(exe IN ITEMS Moc Uic Rcc)
+ block()
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${exe}Example-build)
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMake-configure")
+ run_cmake_with_options(${exe}Example ${RunCMake_TEST_OPTIONS} -DCMAKE_AUTOGEN_VERBOSE=ON)
+ unset(RunCMake_TEST_VARIANT_DESCRIPTION)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ foreach(config IN ITEMS Debug Release RelWithDebInfo)
+ block()
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-${config}-first-build")
+ run_cmake_command(${exe}Example-build ${CMAKE_COMMAND} --build . --config ${config})
+ endblock()
+ endforeach()
+ foreach(config IN ITEMS Debug Release RelWithDebInfo)
+ block()
+ if (exe STREQUAL "Moc" OR exe STREQUAL "Uic")
+ set(RunCMake_TEST_NOT_EXPECT_stdout "Auto${exe}")
+ set(not_expect_descripton "Auto${exe}")
+ else ()
+ set(RunCMake_TEST_NOT_EXPECT_stdout "Auto${exe}")
+ set(not_expect_descripton "Auto${exe}")
+ endif()
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-second-build-${config}_expect_no_${not_expect_descripton}")
+ run_cmake_command(${exe}Example-build ${CMAKE_COMMAND} --build . --config ${config})
+ endblock()
+ endforeach()
+ endblock()
+ endforeach()
+ endif()
+
+ if (RunCMake_GENERATOR MATCHES "Xcode")
+ foreach(exe IN ITEMS Moc Uic Rcc)
+ block()
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${exe}Example-build)
+ set(RunCMake_TEST_VARIANT_DESCRIPTION "-CMake-configure")
+ set(RunCMake_TEST_EXPECT_stderr ".*")
+ run_cmake_with_options(${exe}Example ${RunCMake_TEST_OPTIONS} -DCMAKE_AUTOGEN_VERBOSE=ON)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_MAKE_PROGRAM ${CMAKE_COMMAND})
+ run_make_program(${RunCMake_TEST_BINARY_DIR} --build . --config Debug)
+ if (exe STREQUAL "Moc")
+ set(expected_count 16)
+ elseif (exe STREQUAL "Uic")
+ set(expected_count 4)
+ else()
+ set(expected_count 12)
+ endif()
+ expect_n_times("${make_program_stdout}" "Auto${exe}:" ${expected_count} "${exe}Example-build-Auto${exe}")
+ expect_n_times("${make_program_stdout}" "Auto${exe}:" ${expected_count} "${exe}Example-build-Auto${exe}")
+
+ if (exe STREQUAL "Moc" OR exe STREQUAL "Uic")
+ expect_n_times("${make_program_stdout}" "AutoGen:" 20 "${exe}Example-build-AutoGen:")
+ endif()
+
+ foreach(config IN ITEMS Debug Release RelWithDebInfo)
+ block()
+ run_make_program(${RunCMake_TEST_BINARY_DIR} --build . --config ${config})
+ not_expect("${make_program_stdout}" "Auto${exe}" "${exe}Example-${config}_Auto${exe}")
+ not_expect("${make_program_stdout}" "AutoGen:" "${exe}Example-${config}_AutoGen")
+ endblock()
+ endforeach()
+ endblock()
+ endforeach()
+ endif()
+
+ if (QtCore_VERSION VERSION_GREATER_EQUAL 6)
+ if (RunCMake_GENERATOR MATCHES "Make|Ninja")
+ foreach(value IN ITEMS ON OFF)
+ block()
+ set(RunCMake_TEST_BINARY_DIR
+ ${RunCMake_BINARY_DIR}/RccNoZTSD-${value}-build)
+ run_cmake_with_options(RccExample ${RunCMake_TEST_OPTIONS}
+ -DCMAKE_AUTOGEN_VERBOSE=ON -DZSTD_VALUE=${value})
+ if (value STREQUAL "OFF")
+ set(RunCMake_TEST_EXPECT_stdout "--no-zstd")
+ else()
+ set(RunCMake_TEST_NOT_EXPECT_stdout "--no-zstd")
+ endif()
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(RccNoZTSD-${value}-build ${CMAKE_COMMAND}
+ --build . --config Debug)
+ endblock()
+ endforeach()
+ endif()
+ endif()
endif ()
diff --git a/Tests/RunCMake/Autogen/data.qrc b/Tests/RunCMake/Autogen/data.qrc
new file mode 100644
index 0000000..9bd068c
--- /dev/null
+++ b/Tests/RunCMake/Autogen/data.qrc
@@ -0,0 +1,4 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/res/affine">
+</qresource>
+</RCC>
diff --git a/Tests/RunCMake/Autogen/example.cpp b/Tests/RunCMake/Autogen/example.cpp
new file mode 100644
index 0000000..7f1a781
--- /dev/null
+++ b/Tests/RunCMake/Autogen/example.cpp
@@ -0,0 +1,5 @@
+#include "example.h"
+
+Example::Example()
+{
+}
diff --git a/Tests/RunCMake/Autogen/example.h b/Tests/RunCMake/Autogen/example.h
new file mode 100644
index 0000000..e8bfa42
--- /dev/null
+++ b/Tests/RunCMake/Autogen/example.h
@@ -0,0 +1,12 @@
+#ifndef EXAMPLE_H
+#define EXAMPLE_H
+
+#include <QObject>
+
+class Example : public QObject
+{
+ Q_OBJECT
+ Example();
+};
+
+#endif
diff --git a/Tests/RunCMake/Autogen/example_ui.cpp b/Tests/RunCMake/Autogen/example_ui.cpp
new file mode 100644
index 0000000..fb97c32
--- /dev/null
+++ b/Tests/RunCMake/Autogen/example_ui.cpp
@@ -0,0 +1,5 @@
+#include "example_ui.h"
+
+Example::Example()
+{
+}
diff --git a/Tests/RunCMake/Autogen/example_ui.h b/Tests/RunCMake/Autogen/example_ui.h
new file mode 100644
index 0000000..d691133
--- /dev/null
+++ b/Tests/RunCMake/Autogen/example_ui.h
@@ -0,0 +1,14 @@
+#ifndef EXAMPLE_UI_H
+#define EXAMPLE_UI_H
+
+#include <QObject>
+
+#include "ui_uiA.h"
+
+class Example : public QObject
+{
+ Q_OBJECT
+ Example();
+};
+
+#endif
diff --git a/Tests/RunCMake/Autogen/exe.cpp b/Tests/RunCMake/Autogen/exe.cpp
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/RunCMake/Autogen/exe.cpp
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/Autogen/exe_common.h b/Tests/RunCMake/Autogen/exe_common.h
new file mode 100644
index 0000000..15311c6
--- /dev/null
+++ b/Tests/RunCMake/Autogen/exe_common.h
@@ -0,0 +1,48 @@
+#ifndef EXE_COMMON_H
+#define EXE_COMMON_H
+
+#include <cstdlib>
+#include <fstream>
+#include <string>
+#include <vector>
+
+inline int runRealExe(const int argc, char** argv)
+{
+ std::vector<std::string> args;
+ std::string realMocPath;
+ std::string const pathArg = "EXE_PATH=";
+ std::string cmd;
+ if (argc > 1) {
+ for (int i = 1; i < argc; ++i) {
+ std::string const arg = argv[i];
+ if (arg.find(pathArg) != std::string::npos) {
+ realMocPath = arg.substr(pathArg.length());
+ // if EXE_PATH contains spaces, wrap it in quotes
+ if (realMocPath.find(" ") != std::string::npos) {
+ realMocPath = "\"" + realMocPath + "\"";
+ }
+ } else {
+ args.push_back(arg);
+ }
+ }
+ }
+#ifdef _WIN32
+ cmd += "cmd /C \"";
+#endif
+ cmd += realMocPath + " ";
+ for (auto arg : args) {
+ // if arg contains spaces, wrap it in quotes
+ if (arg.find(' ') != std::string::npos) {
+ cmd += " \"" + arg + "\"";
+ } else {
+ cmd += " " + arg;
+ }
+ }
+#ifdef _WIN32
+ cmd += "\"";
+#endif
+ std::cout << "Running real exe:" << cmd << std::endl;
+ return std::system(cmd.c_str());
+}
+
+#endif
diff --git a/Tests/RunCMake/Autogen/exe_debug.cpp b/Tests/RunCMake/Autogen/exe_debug.cpp
new file mode 100644
index 0000000..ae5185b
--- /dev/null
+++ b/Tests/RunCMake/Autogen/exe_debug.cpp
@@ -0,0 +1,10 @@
+#include <fstream>
+#include <iostream>
+
+#include "exe_common.h"
+
+int main(int argc, char* argv[])
+{
+ std::cout << "running_exe_Debug\n";
+ return runRealExe(argc, argv);
+}
diff --git a/Tests/RunCMake/Autogen/exe_release.cpp b/Tests/RunCMake/Autogen/exe_release.cpp
new file mode 100644
index 0000000..384c992
--- /dev/null
+++ b/Tests/RunCMake/Autogen/exe_release.cpp
@@ -0,0 +1,10 @@
+#include <fstream>
+#include <iostream>
+
+#include "exe_common.h"
+
+int main(int argc, char* argv[])
+{
+ std::cout << "running_exe_Release\n";
+ return runRealExe(argc, argv);
+}
diff --git a/Tests/RunCMake/Autogen/exe_relwithdebinfo.cpp b/Tests/RunCMake/Autogen/exe_relwithdebinfo.cpp
new file mode 100644
index 0000000..aa6c558
--- /dev/null
+++ b/Tests/RunCMake/Autogen/exe_relwithdebinfo.cpp
@@ -0,0 +1,10 @@
+#include <fstream>
+#include <iostream>
+
+#include "exe_common.h"
+
+int main(int argc, char* argv[])
+{
+ std::cout << "running_exe_RelWithDebInfo\n";
+ return runRealExe(argc, argv);
+}
diff --git a/Tests/RunCMake/Autogen/uiA.ui b/Tests/RunCMake/Autogen/uiA.ui
new file mode 100644
index 0000000..4c5762e
--- /dev/null
+++ b/Tests/RunCMake/Autogen/uiA.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>UiA</class>
+ <widget class="QWidget" name="UiA">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/RunCMake/BuildDepends/MakeInProjectOnly.c b/Tests/RunCMake/BuildDepends/MakeInProjectOnly.c
index 0795aaa..bd54d76 100644
--- a/Tests/RunCMake/BuildDepends/MakeInProjectOnly.c
+++ b/Tests/RunCMake/BuildDepends/MakeInProjectOnly.c
@@ -1,5 +1,5 @@
#include <MakeInProjectOnly.h>
-int main()
+int main(void)
{
return MakeInProjectOnly();
}
diff --git a/Tests/RunCMake/BuiltinTargets/CMakeLists.txt b/Tests/RunCMake/BuiltinTargets/CMakeLists.txt
new file mode 100644
index 0000000..6a9ce76
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake b/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake
new file mode 100644
index 0000000..6a74f57
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake
@@ -0,0 +1,19 @@
+include(RunCMake)
+
+if(RunCMake_GENERATOR MATCHES "Make|Ninja")
+ set(test_target "test")
+else()
+ set(test_target "RUN_TESTS")
+endif()
+
+function(run_BuiltinTarget case target)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ run_cmake(${case})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config Debug --target ${${target}_target})
+endfunction()
+
+run_BuiltinTarget(TestDependsAll-Default test)
+run_BuiltinTarget(TestDependsAll-No test)
+run_BuiltinTarget(TestDependsAll-Yes test)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default-build-check.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default-build-check.cmake
new file mode 100644
index 0000000..5ef321a
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default-build-check.cmake
@@ -0,0 +1 @@
+include(${CMAKE_CURRENT_LIST_DIR}/TestDependsAll-No-build-check.cmake)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default.cmake
new file mode 100644
index 0000000..6abd56c
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default.cmake
@@ -0,0 +1 @@
+include(TestDependsAll-common.cmake)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-No-build-check.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No-build-check.cmake
new file mode 100644
index 0000000..f42244e
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No-build-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${RunCMake_TEST_BINARY_DIR}/custom-output.txt)
+ set(RunCMake_TEST_FAILED "Building 'test' target incorrectly built 'all' target.")
+endif()
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake
new file mode 100644
index 0000000..50ec3b9
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake
@@ -0,0 +1,2 @@
+include(TestDependsAll-common.cmake)
+set(CMAKE_SKIP_TEST_ALL_DEPENDENCY ON)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake
new file mode 100644
index 0000000..ed175d4
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${RunCMake_TEST_BINARY_DIR}/custom-output.txt)
+ set(RunCMake_TEST_FAILED "Building 'test' target did not build 'all' target:\n ${RunCMake_TEST_BINARY_DIR}/custom-output.txt")
+endif()
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake
new file mode 100644
index 0000000..c35c98d
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake
@@ -0,0 +1,2 @@
+include(TestDependsAll-common.cmake)
+set(CMAKE_SKIP_TEST_ALL_DEPENDENCY OFF)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-common.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-common.cmake
new file mode 100644
index 0000000..bbe7c75
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-common.cmake
@@ -0,0 +1,3 @@
+enable_testing()
+add_custom_target(custom ALL COMMAND ${CMAKE_COMMAND} -E touch custom-output.txt)
+add_test(NAME test COMMAND ${CMAKE_COMMAND} -E echo)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test16.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test16.cmake
new file mode 100644
index 0000000..909be6f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test16.cmake
@@ -0,0 +1,38 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(TARGET custom2 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+
+add_subdirectory(subdir-Common-Test16)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test1b.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test1b.cmake
new file mode 100644
index 0000000..622633f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test1b.cmake
@@ -0,0 +1,9 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+get_source_file_property(prop
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test2b.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test2b.cmake
new file mode 100644
index 0000000..5317781
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test2b.cmake
@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_source_files_properties(
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTIES GENERATED "1")
+get_source_file_property(prop
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test2c.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test2c.cmake
new file mode 100644
index 0000000..2f2d3a2
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test2c.cmake
@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_property(SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTY GENERATED "1")
+get_source_file_property(prop
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test2d.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test2d.cmake
new file mode 100644
index 0000000..67f9b8c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test2d.cmake
@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_source_files_properties(
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTIES GENERATED "1")
+get_property(prop SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTY GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake
index 27516b7..2880aec 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake
@@ -35,7 +35,7 @@ set_property(SOURCE "Generated_with_full_path2.txt"
PROPERTY GENERATED "1")
get_and_print_GENERATED_property("Generated_with_full_path2.txt")
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
PROPERTY GENERATED "1")
get_and_print_GENERATED_property("Generated_with_full_path3.txt")
@@ -61,6 +61,6 @@ set_property(SOURCE "Generated_with_full_source_path2.txt"
PROPERTY GENERATED "1")
get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
PROPERTY GENERATED "1")
get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake
index 3e03a1f..64294d9 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake
@@ -9,7 +9,7 @@ set_property(SOURCE "Generated_with_full_path2.txt"
PROPERTY GENERATED "1")
get_and_print_GENERATED_property("Generated_with_full_path2.txt")
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
PROPERTY GENERATED "1")
get_and_print_GENERATED_property("Generated_with_full_path3.txt")
@@ -35,7 +35,7 @@ set_property(SOURCE "Generated_with_full_source_path2.txt"
PROPERTY GENERATED "1")
get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
PROPERTY GENERATED "1")
get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake
index 953e26a..dbc603c 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake
@@ -35,7 +35,7 @@ set_property(SOURCE "Generated_with_full_path2.txt"
PROPERTY GENERATED "0")
get_and_print_GENERATED_property("Generated_with_full_path2.txt")
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
PROPERTY GENERATED "0")
get_and_print_GENERATED_property("Generated_with_full_path3.txt")
@@ -61,6 +61,6 @@ set_property(SOURCE "Generated_with_full_source_path2.txt"
PROPERTY GENERATED "0")
get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
PROPERTY GENERATED "0")
get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake
index 025caa8..833714c 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake
@@ -9,7 +9,7 @@ set_property(SOURCE "Generated_with_full_path2.txt"
PROPERTY GENERATED "0")
get_and_print_GENERATED_property("Generated_with_full_path2.txt")
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
PROPERTY GENERATED "0")
get_and_print_GENERATED_property("Generated_with_full_path3.txt")
@@ -35,7 +35,7 @@ set_property(SOURCE "Generated_with_full_source_path2.txt"
PROPERTY GENERATED "0")
get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
PROPERTY GENERATED "0")
get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake
index 5349bff..549ce1e 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake
@@ -65,7 +65,7 @@ set_property(SOURCE "Generated_with_relative_path3.txt"
get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
-set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
PROPERTY GENERATED "tRue")
get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
@@ -73,6 +73,6 @@ set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path
PROPERTY GENERATED "SomeVar-NOTFOUND")
get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
PROPERTY GENERATED "Junk-value")
get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake
index 5cc6e99..e6b3cce 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake
@@ -27,6 +27,7 @@ target_sources(custom6 PRIVATE
)
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
CONTENT "int func();\nint main(){ return func(); }"
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test8b.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test8b.cmake
new file mode 100644
index 0000000..704300a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test8b.cmake
@@ -0,0 +1,51 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test8b)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake
index b7d36ef..e9abf36 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake
@@ -27,6 +27,7 @@ target_sources(custom6 PRIVATE
)
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
CONTENT "int func();\nint main(){ return func(); }"
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test9b.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test9b.cmake
new file mode 100644
index 0000000..a452fdb
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test9b.cmake
@@ -0,0 +1,51 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test9b)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-stderr.txt
new file mode 100644
index 0000000..a513b83
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test16-stderr.txt
@@ -0,0 +1,27 @@
+^CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test16.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test16.cmake
new file mode 100644
index 0000000..74b05c4
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test16.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test16.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-stderr.txt
new file mode 100644
index 0000000..419c571
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `NOTFOUND`
+CMake Error at CMP0118-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test1b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b.cmake
new file mode 100644
index 0000000..30cd6cd
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test1b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b.cmake
new file mode 100644
index 0000000..27f2a2d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test2b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c.cmake
new file mode 100644
index 0000000..ade66fd
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2c.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test2c.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d.cmake
new file mode 100644
index 0000000..456760d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2d.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test2d.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt
index 929dafd..4175587 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt
@@ -12,10 +12,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -48,14 +48,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -63,7 +63,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -71,15 +71,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
-Call Stack \(most recent call first\):
- CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
- CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
- Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt
index 6a096b8..e9a1ee2 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt
@@ -12,10 +12,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -48,14 +48,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -63,7 +63,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -71,15 +71,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
-Call Stack \(most recent call first\):
- CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
- CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
- Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt
index 0e27c1d..686ba23 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt
@@ -76,12 +76,12 @@ Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
Unsetting the 'GENERATED' property is not allowed under CMP0118!
@@ -118,7 +118,7 @@ Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -126,7 +126,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -134,7 +134,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -142,7 +142,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -150,7 +150,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -158,15 +158,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
-Call Stack \(most recent call first\):
- CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
- CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
- Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b-stderr.txt
new file mode 100644
index 0000000..f9ce9be
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b.cmake
new file mode 100644
index 0000000..a39f89f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test8b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-stderr.txt
new file mode 100644
index 0000000..093f1b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-stderr.txt
@@ -0,0 +1,61 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b.cmake
new file mode 100644
index 0000000..36e30f4
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test9b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-stderr.txt
new file mode 100644
index 0000000..2ca118d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test16-stderr.txt
@@ -0,0 +1,38 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test16\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0118 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test16.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test16.cmake
new file mode 100644
index 0000000..c0e40fc
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test16.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test16.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-stderr.txt
new file mode 100644
index 0000000..ad3ea43
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-stderr.txt
@@ -0,0 +1,21 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test1b\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0118 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+prop: `NOTFOUND`
+CMake Error at CMP0118-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test1b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b.cmake
new file mode 100644
index 0000000..ad1a211
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test1b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b-stderr.txt
new file mode 100644
index 0000000..41114ba
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test2b\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0118 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b.cmake
new file mode 100644
index 0000000..5bfe045
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test2b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c-stderr.txt
new file mode 100644
index 0000000..ba36763
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test2c\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0118 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c.cmake
new file mode 100644
index 0000000..e225de4
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2c.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test2c.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d-stderr.txt
new file mode 100644
index 0000000..0a9a8b7
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test2d\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0118 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d.cmake
new file mode 100644
index 0000000..ad1c640
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2d.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test2d.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt
index cce5b19..28fe2f0 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt
@@ -23,10 +23,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -59,14 +59,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -74,7 +74,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -82,15 +82,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
-Call Stack \(most recent call first\):
- CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
- CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
- Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt
index 47eee2e..819b8c0 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt
@@ -23,10 +23,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -59,14 +59,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -74,7 +74,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -82,15 +82,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
-Call Stack \(most recent call first\):
- CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
- CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
- Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt
index 4a67fa7..e20ffee 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt
@@ -45,12 +45,12 @@ Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
@@ -66,7 +66,7 @@ Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -74,7 +74,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -82,7 +82,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -90,7 +90,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -98,7 +98,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -106,15 +106,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
-Call Stack \(most recent call first\):
- CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
- CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
- Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-stderr.txt
new file mode 100644
index 0000000..285051c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-stderr.txt
@@ -0,0 +1,56 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test8b\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0118 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test8b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test8b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b.cmake
new file mode 100644
index 0000000..6676e7c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test8b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-stderr.txt
new file mode 100644
index 0000000..9b2fdad
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-stderr.txt
@@ -0,0 +1,72 @@
+^CMake Deprecation Warning at CMP0118-OLD-Test9b\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0118 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b.cmake
new file mode 100644
index 0000000..3446063
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test9b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt
index 93d8b83..9395cd7 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt
@@ -1,6 +1,6 @@
^((CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -9,8 +9,8 @@
This warning is for project developers\. Use -Wno-dev to suppress it\.
+)+
(CMake Warning \(dev\) at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt
index 6d59cb4..957cc69 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt
@@ -8,8 +8,8 @@ CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\
TARGET 'custom[4-6]' was not created in this directory\.
+
((CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -18,8 +18,8 @@ CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\
This warning is for project developers\. Use -Wno-dev to suppress it\.
+)+
(CMake Warning \(dev\) at CMP0118-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt
index 9e6a4a5..eab051f 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt
@@ -1,6 +1,6 @@
^((CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -9,8 +9,8 @@
This warning is for project developers\. Use -Wno-dev to suppress it\.
+)+
(CMake Warning \(dev\) at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-stderr.txt
new file mode 100644
index 0000000..a513b83
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test16-stderr.txt
@@ -0,0 +1,27 @@
+^CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test16.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test16.cmake
new file mode 100644
index 0000000..f50df7f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test16.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test16.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-stderr.txt
new file mode 100644
index 0000000..86b9327
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `NOTFOUND`
+CMake Error at CMP0118-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test1b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b.cmake
new file mode 100644
index 0000000..c055570
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1b.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test1b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b.cmake
new file mode 100644
index 0000000..82a192c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2b.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test2b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c.cmake
new file mode 100644
index 0000000..ec47683
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2c.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test2c.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d.cmake
new file mode 100644
index 0000000..a5e3fd7
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2d.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test2d.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt
index 58ba793..491eab0 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt
@@ -12,10 +12,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -48,14 +48,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -63,7 +63,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -71,15 +71,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
-Call Stack \(most recent call first\):
- CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
- CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(target_sources\):
- Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt
index cdb7cb4..e170849 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt
@@ -12,10 +12,10 @@ Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
@@ -48,14 +48,14 @@ Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -63,7 +63,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -71,15 +71,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
-Call Stack \(most recent call first\):
- CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
- CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
- Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[12]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt
index 4cd401c..6340f91 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt
@@ -1,6 +1,6 @@
^CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -18,8 +18,8 @@ Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -37,8 +37,8 @@ Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -56,8 +56,8 @@ Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -75,8 +75,8 @@ Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -94,8 +94,8 @@ Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -113,8 +113,8 @@ Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -132,8 +132,8 @@ Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -151,8 +151,8 @@ Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt
index 6acd3df..a213ae5 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt
@@ -1,6 +1,6 @@
^CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -18,8 +18,8 @@ Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -37,8 +37,8 @@ Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -56,8 +56,8 @@ Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -75,8 +75,8 @@ Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -94,8 +94,8 @@ Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -113,8 +113,8 @@ Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -132,8 +132,8 @@ Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -151,8 +151,8 @@ Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt
index 2805cbf..2f7a390 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt
@@ -5,8 +5,8 @@ Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -24,8 +24,8 @@ Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -57,8 +57,8 @@ Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -76,8 +76,8 @@ Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -102,15 +102,15 @@ Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
-Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
-Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -128,8 +128,8 @@ Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -157,7 +157,7 @@ Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -165,7 +165,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -173,7 +173,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -181,7 +181,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -189,7 +189,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
@@ -197,15 +197,7 @@ Call Stack \(most recent call first\):
CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
Cannot find source file:
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
-Call Stack \(most recent call first\):
- CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
- CMakeLists\.txt:[0-9]+ \(include\)
-+
-CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(target_sources\):
- Cannot find source file:
-
-[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
Call Stack \(most recent call first\):
CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt
index cde1164..1feef65 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt
@@ -1,6 +1,6 @@
^((CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -9,8 +9,8 @@
This warning is for project developers\. Use -Wno-dev to suppress it\.
+)+
(CMake Warning \(dev\) at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-stderr.txt
new file mode 100644
index 0000000..c063326
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test8b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test8b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b.cmake
new file mode 100644
index 0000000..b44331a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8b.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test8b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt
index 547e820..cbce4ab 100644
--- a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt
@@ -1,6 +1,6 @@
^((CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
@@ -9,8 +9,8 @@
This warning is for project developers\. Use -Wno-dev to suppress it\.
+)+
(CMake Warning \(dev\) at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
- Policy CMP0118 is not set: The GENERATED source file property is now
- visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
details\. Use the cmake_policy command to set the policy and suppress this
warning\.
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-stderr.txt
new file mode 100644
index 0000000..878812d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-stderr.txt
@@ -0,0 +1,61 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b.cmake
new file mode 100644
index 0000000..9726b30
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9b.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test9b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMakeLists.txt b/Tests/RunCMake/CMP0118/CMakeLists.txt
index 957fe03..8bf7896 100644
--- a/Tests/RunCMake/CMP0118/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0118/CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.19)
-cmake_policy(SET CMP0115 NEW)
+cmake_policy(SET CMP0115 NEW) # CMP0115 is correct here (for reducing error-output)!
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/CMP0118/RunCMakeTest.cmake b/Tests/RunCMake/CMP0118/RunCMakeTest.cmake
index f7f135e..207f3d7 100644
--- a/Tests/RunCMake/CMP0118/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0118/RunCMakeTest.cmake
@@ -5,7 +5,11 @@ run_cmake(GenInSubdir-WARN)
run_cmake(GenInSubdir-NEW)
run_cmake(CMP0118-OLD-Test1)
+run_cmake(CMP0118-OLD-Test1b)
run_cmake(CMP0118-OLD-Test2)
+run_cmake(CMP0118-OLD-Test2b)
+run_cmake(CMP0118-OLD-Test2c)
+run_cmake(CMP0118-OLD-Test2d)
run_cmake(CMP0118-OLD-Test3)
run_cmake(CMP0118-OLD-Test3b)
run_cmake(CMP0118-OLD-Test4)
@@ -14,16 +18,23 @@ run_cmake(CMP0118-OLD-Test5)
run_cmake(CMP0118-OLD-Test6)
run_cmake(CMP0118-OLD-Test7)
run_cmake(CMP0118-OLD-Test8)
+run_cmake(CMP0118-OLD-Test8b)
run_cmake(CMP0118-OLD-Test9)
+run_cmake(CMP0118-OLD-Test9b)
run_cmake(CMP0118-OLD-Test10)
run_cmake(CMP0118-OLD-Test11)
run_cmake(CMP0118-OLD-Test12)
run_cmake(CMP0118-OLD-Test13)
run_cmake(CMP0118-OLD-Test14)
run_cmake(CMP0118-OLD-Test15)
+run_cmake(CMP0118-OLD-Test16)
run_cmake(CMP0118-WARN-Test1)
+run_cmake(CMP0118-WARN-Test1b)
run_cmake(CMP0118-WARN-Test2)
+run_cmake(CMP0118-WARN-Test2b)
+run_cmake(CMP0118-WARN-Test2c)
+run_cmake(CMP0118-WARN-Test2d)
run_cmake(CMP0118-WARN-Test3)
run_cmake(CMP0118-WARN-Test3b)
run_cmake(CMP0118-WARN-Test4)
@@ -32,16 +43,23 @@ run_cmake(CMP0118-WARN-Test5)
run_cmake(CMP0118-WARN-Test6)
run_cmake(CMP0118-WARN-Test7)
run_cmake(CMP0118-WARN-Test8)
+run_cmake(CMP0118-WARN-Test8b)
run_cmake(CMP0118-WARN-Test9)
+run_cmake(CMP0118-WARN-Test9b)
run_cmake(CMP0118-WARN-Test10)
run_cmake(CMP0118-WARN-Test11)
run_cmake(CMP0118-WARN-Test12)
run_cmake(CMP0118-WARN-Test13)
run_cmake(CMP0118-WARN-Test14)
run_cmake(CMP0118-WARN-Test15)
+run_cmake(CMP0118-WARN-Test16)
run_cmake(CMP0118-NEW-Test1)
+run_cmake(CMP0118-NEW-Test1b)
run_cmake(CMP0118-NEW-Test2)
+run_cmake(CMP0118-NEW-Test2b)
+run_cmake(CMP0118-NEW-Test2c)
+run_cmake(CMP0118-NEW-Test2d)
run_cmake(CMP0118-NEW-Test3)
run_cmake(CMP0118-NEW-Test3b)
run_cmake(CMP0118-NEW-Test4)
@@ -50,10 +68,13 @@ run_cmake(CMP0118-NEW-Test5)
run_cmake(CMP0118-NEW-Test6)
run_cmake(CMP0118-NEW-Test7)
run_cmake(CMP0118-NEW-Test8)
+run_cmake(CMP0118-NEW-Test8b)
run_cmake(CMP0118-NEW-Test9)
+run_cmake(CMP0118-NEW-Test9b)
run_cmake(CMP0118-NEW-Test10)
run_cmake(CMP0118-NEW-Test11)
run_cmake(CMP0118-NEW-Test12)
run_cmake(CMP0118-NEW-Test13)
run_cmake(CMP0118-NEW-Test14)
run_cmake(CMP0118-NEW-Test15)
+run_cmake(CMP0118-NEW-Test16)
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt
index f2929aa..7ad02df 100644
--- a/Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt
@@ -1,13 +1,16 @@
+# Note: Target "custom4" was not created in this directory, so setting this build-event will fail!
add_custom_command(TARGET custom4 PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
"${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
)
+# Note: Target "custom5" was not created in this directory, so setting this build-event will fail!
add_custom_command(TARGET custom5 PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
"${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
)
+# Note: Target "custom6" was not created in this directory, so setting this build-event will fail!
add_custom_command(TARGET custom6 PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
"${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test16/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test16/CMakeLists.txt
new file mode 100644
index 0000000..877c829
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test16/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+)
+add_custom_command(TARGET custom4 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt
index 55debd1..eefe18c 100644
--- a/Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt
@@ -1,3 +1,4 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
CONTENT "int func();\nint main(){ return func(); }"
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test8b/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test8b/CMakeLists.txt
new file mode 100644
index 0000000..1e4cccd
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test8b/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt
index cdb8884..99f6d73 100644
--- a/Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt
@@ -1,3 +1,4 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
CONTENT "int func();\nint main(){ return func(); }"
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test9b/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test9b/CMakeLists.txt
new file mode 100644
index 0000000..f94f36f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test9b/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
diff --git a/Tests/RunCMake/CMP0126/CMP0126-OLD-stderr.txt b/Tests/RunCMake/CMP0126/CMP0126-OLD-stderr.txt
new file mode 100644
index 0000000..7d2608b
--- /dev/null
+++ b/Tests/RunCMake/CMP0126/CMP0126-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0126-OLD\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0126 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0126/CMP0126-OLD_CL-stderr.txt b/Tests/RunCMake/CMP0126/CMP0126-OLD_CL-stderr.txt
new file mode 100644
index 0000000..1f2179c
--- /dev/null
+++ b/Tests/RunCMake/CMP0126/CMP0126-OLD_CL-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0126-OLD_CL\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0126 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0156/CMP0156-Common.cmake b/Tests/RunCMake/CMP0156/CMP0156-Common.cmake
new file mode 100644
index 0000000..a382c77
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-Common.cmake
@@ -0,0 +1,27 @@
+
+enable_language(C)
+
+# ensure link is successful in case of circular dependency
+add_library(lib1 STATIC lib1.c)
+add_library(lib2 STATIC lib2.c)
+
+target_link_libraries(lib1 PRIVATE lib2)
+target_link_libraries(lib2 PRIVATE lib1)
+
+add_executable(main main.c)
+target_link_libraries(main PRIVATE lib1)
+if (APPLE_TEST)
+ target_link_options(main PRIVATE "LINKER:-fatal_warnings")
+else()
+ target_link_options(main PRIVATE "$<$<AND:$<NOT:$<TARGET_POLICY:CMP0156>>,$<C_COMPILER_ID:AppleClang>,$<VERSION_GREATER_EQUAL:$<C_COMPILER_VERSION>,15.0>>:LINKER:-no_warn_duplicate_libraries>")
+endif()
+
+
+add_library(lib3 SHARED lib3.c)
+add_library(lib4 STATIC lib4.c)
+target_link_libraries(lib4 PRIVATE lib3)
+
+# link specifying a shared library not directly used by the target
+# on Windows, with CMP0156=NEW, lib3 is specified before lib4 on link step
+add_executable(main2 main2.c)
+target_link_libraries(main2 PRIVATE lib3 lib4)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-NEW-AppleClang.cmake b/Tests/RunCMake/CMP0156/CMP0156-NEW-AppleClang.cmake
new file mode 100644
index 0000000..59f5ecd
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-NEW-AppleClang.cmake
@@ -0,0 +1,5 @@
+
+cmake_policy(SET CMP0156 NEW)
+set(APPLE_TEST TRUE)
+
+include (CMP0156-Common.cmake)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-NEW.cmake b/Tests/RunCMake/CMP0156/CMP0156-NEW.cmake
new file mode 100644
index 0000000..4387b37
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-NEW.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0156 NEW)
+
+include (CMP0156-Common.cmake)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-result.txt b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-result.txt
new file mode 100644
index 0000000..b18168c
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-result.txt
@@ -0,0 +1 @@
+.+
diff --git a/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-stdout.txt b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-stdout.txt
new file mode 100644
index 0000000..b4afc27
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-stdout.txt
@@ -0,0 +1,3 @@
+ld: warning: ignoring duplicate libraries: '.*liblib1.a', '.*liblib2.a'
+ld: fatal warning\(s\) induced error \(-fatal_warnings\)
+clang: error: linker command failed with exit code 1 \(use -v to see invocation\)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang.cmake b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang.cmake
new file mode 100644
index 0000000..33e1287
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang.cmake
@@ -0,0 +1,5 @@
+
+cmake_policy(SET CMP0156 OLD)
+set(APPLE_TEST TRUE)
+
+include (CMP0156-Common.cmake)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-OLD.cmake b/Tests/RunCMake/CMP0156/CMP0156-OLD.cmake
new file mode 100644
index 0000000..b012a1a
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-OLD.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0156 OLD)
+
+include (CMP0156-Common.cmake)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-WARN-stderr.txt b/Tests/RunCMake/CMP0156/CMP0156-WARN-stderr.txt
new file mode 100644
index 0000000..f52d7d8
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-WARN-stderr.txt
@@ -0,0 +1,35 @@
+CMake Warning \(dev\) at CMP0156-Common.cmake:[0-9]+ \(add_library\):
+ Policy CMP0156 is not set: De-duplicate libraries on link lines based on
+ linker capabilities. Run "cmake --help-policy CMP0156" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ Since the policy is not set, legacy libraries de-duplication strategy will
+ be applied.
+Call Stack \(most recent call first\):
+ CMP0156-WARN.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at CMP0156-Common.cmake:[0-9]+ \(add_library\):
+ Policy CMP0156 is not set: De-duplicate libraries on link lines based on
+ linker capabilities. Run "cmake --help-policy CMP0156" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ Since the policy is not set, legacy libraries de-duplication strategy will
+ be applied.
+Call Stack \(most recent call first\):
+ CMP0156-WARN.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at CMP0156-Common.cmake:[0-9]+ \(add_executable\):
+ Policy CMP0156 is not set: De-duplicate libraries on link lines based on
+ linker capabilities. Run "cmake --help-policy CMP0156" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ Since the policy is not set, legacy libraries de-duplication strategy will
+ be applied.
+Call Stack \(most recent call first\):
+ CMP0156-WARN.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0156/CMP0156-WARN.cmake b/Tests/RunCMake/CMP0156/CMP0156-WARN.cmake
new file mode 100644
index 0000000..5f469ef
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-WARN.cmake
@@ -0,0 +1,4 @@
+
+set(CMAKE_POLICY_WARNING_CMP0156 TRUE)
+
+include (CMP0156-Common.cmake)
diff --git a/Tests/RunCMake/CMP0156/CMakeLists.txt b/Tests/RunCMake/CMP0156/CMakeLists.txt
new file mode 100644
index 0000000..922aad6
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.27)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0156/RunCMakeTest.cmake b/Tests/RunCMake/CMP0156/RunCMakeTest.cmake
new file mode 100644
index 0000000..bd51830
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/RunCMakeTest.cmake
@@ -0,0 +1,26 @@
+include(RunCMake)
+
+# CMP0156 control how libraries are specified for the link step
+# a sensible configuration is how circular dependency is handled
+
+macro(run_cmake_and_build test)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ run_cmake(${test})
+ set(RunCMake_TEST_NO_CLEAN TRUE)
+ run_cmake_command(${test}-build ${CMAKE_COMMAND} --build . --config Release)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
+endmacro()
+
+run_cmake(CMP0156-WARN)
+run_cmake_and_build(CMP0156-OLD)
+run_cmake_and_build(CMP0156-NEW)
+
+if (CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
+ AND CMAKE_C_COMPILER_VERSION GREATER_EQUAL "15.0")
+ # special case for Apple: with CMP0156=OLD, linker will warning on duplicate libraries
+ run_cmake_and_build(CMP0156-OLD-AppleClang)
+ run_cmake_and_build(CMP0156-NEW-AppleClang)
+endif()
diff --git a/Tests/RunCMake/CMP0156/lib1.c b/Tests/RunCMake/CMP0156/lib1.c
new file mode 100644
index 0000000..faad375
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/lib1.c
@@ -0,0 +1,7 @@
+
+extern void lib2(void);
+
+void lib1(void)
+{
+ lib2();
+}
diff --git a/Tests/RunCMake/CMP0156/lib2.c b/Tests/RunCMake/CMP0156/lib2.c
new file mode 100644
index 0000000..9db7914
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/lib2.c
@@ -0,0 +1,7 @@
+
+extern void lib1(void);
+
+void lib2(void)
+{
+ lib1();
+}
diff --git a/Tests/RunCMake/CMP0156/lib3.c b/Tests/RunCMake/CMP0156/lib3.c
new file mode 100644
index 0000000..e63e456
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/lib3.c
@@ -0,0 +1,7 @@
+
+#if defined(_WIN32)
+__declspec(dllexport)
+#endif
+ void lib3(void)
+{
+}
diff --git a/Tests/RunCMake/CMP0156/lib4.c b/Tests/RunCMake/CMP0156/lib4.c
new file mode 100644
index 0000000..a992168
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/lib4.c
@@ -0,0 +1,9 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void lib3(void);
+
+void lib4(void)
+{
+}
diff --git a/Tests/RunCMake/CMP0156/main.c b/Tests/RunCMake/CMP0156/main.c
new file mode 100644
index 0000000..06edfd5
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/main.c
@@ -0,0 +1,9 @@
+
+extern void lib1(void);
+
+int main(void)
+{
+ lib1();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/CMP0156/main2.c b/Tests/RunCMake/CMP0156/main2.c
new file mode 100644
index 0000000..9fc2838
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/main2.c
@@ -0,0 +1,9 @@
+
+extern void lib4(void);
+
+int main(void)
+{
+ lib4();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt b/Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt b/Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt
new file mode 100644
index 0000000..b52b633
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt
@@ -0,0 +1,233 @@
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ ALIAS_GLOBAL property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ BINARY_DIR property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ IMPORTED property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ LOCATION property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ LOCATION_CONFIG property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ SOURCE_DIR property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ IMPORTED_GLOBAL property can't be set on non-imported
+ targets\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for
+ target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ ALIAS_GLOBAL property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ BINARY_DIR property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ CXX_MODULE_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ IMPORTED property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_CXX_MODULE_SETS property is read-only for
+ target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ LOCATION property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ LOCATION_CONFIG property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ SOURCE_DIR property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ EXPORT_NAME property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ SOURCES property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0160/CMP0160-NEW.cmake b/Tests/RunCMake/CMP0160/CMP0160-NEW.cmake
new file mode 100644
index 0000000..ed3a256
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-NEW.cmake
@@ -0,0 +1,4 @@
+
+project(ReadOnly LANGUAGES NONE)
+cmake_policy(SET CMP0160 NEW)
+include(${CMAKE_CURRENT_LIST_DIR}/READONLY_PROPERTIES.cmake)
diff --git a/Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt b/Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt b/Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt
new file mode 100644
index 0000000..e57cd9d
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt
@@ -0,0 +1,104 @@
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ IMPORTED_GLOBAL property can't be set on non-imported
+ targets\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for
+ target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ EXPORT_NAME property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ SOURCES property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0160/CMP0160-OLD.cmake b/Tests/RunCMake/CMP0160/CMP0160-OLD.cmake
new file mode 100644
index 0000000..6c6f1f8
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-OLD.cmake
@@ -0,0 +1,4 @@
+
+project(ReadOnly LANGUAGES NONE)
+cmake_policy(SET CMP0160 OLD)
+include(${CMAKE_CURRENT_LIST_DIR}/READONLY_PROPERTIES.cmake)
diff --git a/Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt b/Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt b/Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt
new file mode 100644
index 0000000..b15104e
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt
@@ -0,0 +1,297 @@
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ ALIAS_GLOBAL property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ BINARY_DIR property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ IMPORTED property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ INTERFACE_CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ LOCATION property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ LOCATION_CONFIG property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ SOURCE_DIR property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ IMPORTED_GLOBAL property can't be set on non-imported
+ targets\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for
+ target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ ALIAS_GLOBAL property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ BINARY_DIR property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ CXX_MODULE_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ IMPORTED property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ INTERFACE_CXX_MODULE_SETS property is read-only for
+ target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ LOCATION property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ LOCATION_CONFIG property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ SOURCE_DIR property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ EXPORT_NAME property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ SOURCES property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0160/CMP0160-WARN.cmake b/Tests/RunCMake/CMP0160/CMP0160-WARN.cmake
new file mode 100644
index 0000000..e9e99bb
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-WARN.cmake
@@ -0,0 +1,3 @@
+
+project(ReadOnly LANGUAGES NONE)
+include(${CMAKE_CURRENT_LIST_DIR}/READONLY_PROPERTIES.cmake)
diff --git a/Tests/RunCMake/CMP0160/CMakeLists.txt b/Tests/RunCMake/CMP0160/CMakeLists.txt
new file mode 100644
index 0000000..6a9ce76
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake b/Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake
new file mode 100644
index 0000000..07bbe78
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake
@@ -0,0 +1,52 @@
+
+set(read_only_properties
+ "HEADER_SETS"
+ "INTERFACE_HEADER_SETS"
+ "MANUALLY_ADDED_DEPENDENCIES"
+ "NAME"
+ "TYPE"
+ )
+set(read_only_properties_imported
+ "EXPORT_NAME"
+ "SOURCES"
+ )
+set(read_only_properties_nonimported
+ "IMPORTED_GLOBAL"
+ )
+set(read_only_properties_160
+ "ALIAS_GLOBAL"
+ "BINARY_DIR"
+ "CXX_MODULE_SETS"
+ "IMPORTED"
+ "INTERFACE_CXX_MODULE_SETS"
+ "LOCATION"
+ "LOCATION_CONFIG"
+ "SOURCE_DIR"
+ )
+
+cmake_policy(GET CMP0160 policy160)
+add_library(ReadOnlyLib )
+add_library(ReadOnlyImport IMPORTED UNKNOWN)
+
+foreach(target ReadOnlyLib ReadOnlyImport)
+ get_target_property(is_imported ${target} IMPORTED)
+ set(are_read_only ${read_only_properties})
+ if(NOT policy160 STREQUAL "OLD")
+ list(APPEND are_read_only ${read_only_properties_160})
+ endif()
+ if(is_imported)
+ list(APPEND are_read_only ${read_only_properties_imported})
+ else()
+ list(APPEND are_read_only ${read_only_properties_nonimported})
+ endif()
+
+ foreach(prop IN LISTS are_read_only)
+ set_target_properties(${target} PROPERTIES ${prop} "a_value")
+ endforeach()
+
+ if(policy160 STREQUAL "OLD")
+ foreach(prop IN LISTS read_only_properties_160)
+ set_target_properties(${target} PROPERTIES ${prop} "a_value")
+ endforeach()
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/CMP0160/RunCMakeTest.cmake b/Tests/RunCMake/CMP0160/RunCMakeTest.cmake
new file mode 100644
index 0000000..60380b5
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0160-WARN)
+run_cmake(CMP0160-OLD)
+run_cmake(CMP0160-NEW)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1-stderr.txt
new file mode 100644
index 0000000..a8b3503
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `0`
+CMake Error at CMP0163-Common-Test1\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test10-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test10-stderr.txt
new file mode 100644
index 0000000..680a830
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test10-stderr.txt
@@ -0,0 +1,42 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test10.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test10.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test10.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test11-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test11-stderr.txt
new file mode 100644
index 0000000..7cdc233
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test11-stderr.txt
@@ -0,0 +1,55 @@
+^(CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test11.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test11.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test11.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12-stderr.txt
new file mode 100644
index 0000000..6133a35
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12-stderr.txt
@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test12.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13-stderr.txt
new file mode 100644
index 0000000..e65140a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13-stderr.txt
@@ -0,0 +1,64 @@
+^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+(CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test13\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test13.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test14-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test14-stderr.txt
new file mode 100644
index 0000000..680a830
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test14-stderr.txt
@@ -0,0 +1,42 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test14.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test14.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test14.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test15-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test15-stderr.txt
new file mode 100644
index 0000000..979481f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test15-stderr.txt
@@ -0,0 +1,55 @@
+^(CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test15.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test15.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test15.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16-stderr.txt
new file mode 100644
index 0000000..c18109c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16-stderr.txt
@@ -0,0 +1,27 @@
+^CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test16.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b-stderr.txt
new file mode 100644
index 0000000..fae8bc7
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `NOTFOUND`
+CMake Error at CMP0163-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test1b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b.cmake
new file mode 100644
index 0000000..e1b9d22
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test1b.cmake
@@ -0,0 +1,6 @@
+cmake_policy(SET CMP0118 NEW)
+# Extract from the current file the name of the test-case and value for CMP0163 and call the test-case.
+cmake_path(GET CMAKE_CURRENT_LIST_FILE STEM testcase)
+string(REGEX MATCH "NEW|OLD|WARN" value_for_CMP0163 "${testcase}")
+string(REGEX REPLACE "${value_for_CMP0163}" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2a.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2a.cmake
new file mode 100644
index 0000000..b1e932c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2a.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_path(GET CMAKE_CURRENT_LIST_FILE STEM CMP0163_TESTCASE)
+include(${CMAKE_CURRENT_LIST_DIR}/../Test-with-CMP0163-NEW.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2b-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2b-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2b.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2c-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2c-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2c-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2c.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2c.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2c.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2d-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2d-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2d-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2d.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2d.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test2d.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3-stderr.txt
new file mode 100644
index 0000000..2f90661
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-NEW-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-NEW-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-NEW-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b-stderr.txt
new file mode 100644
index 0000000..db40354
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-NEW-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-NEW-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-NEW-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test3b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4-stderr.txt
new file mode 100644
index 0000000..9d75891
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4-stderr.txt
@@ -0,0 +1,167 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b-stderr.txt
new file mode 100644
index 0000000..c3f35a2
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b-stderr.txt
@@ -0,0 +1,135 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+(CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-NEW-Test4b-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-NEW-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test4b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5-stderr.txt
new file mode 100644
index 0000000..779d708
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5-stderr.txt
@@ -0,0 +1,126 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0163 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0163 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0163 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+(CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*(Generated_with_relative_path[2-3]\.txt|.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-NEW-Test5-build/Generated_with_full_path[2-3]\.txt))
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test5.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test6-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test6-stderr.txt
new file mode 100644
index 0000000..ee30636
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test6-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test6.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test6.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test6.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-stderr.txt
new file mode 100644
index 0000000..9ab3d50
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-stderr.txt
@@ -0,0 +1,74 @@
+^(CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test7.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8-stderr.txt
new file mode 100644
index 0000000..ee30636
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8b-stderr.txt
new file mode 100644
index 0000000..f9ce9be
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8b-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8b.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test8b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-stderr.txt
new file mode 100644
index 0000000..02d9bd3
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-stderr.txt
@@ -0,0 +1,74 @@
+^(CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-stderr.txt
new file mode 100644
index 0000000..672d3b4
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-stderr.txt
@@ -0,0 +1,61 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-NEW-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b.cmake
new file mode 100644
index 0000000..2faf482
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-NEW-Test9b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1-stderr.txt
new file mode 100644
index 0000000..be3e906
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `0`
+CMake Error at CMP0163-Common-Test1\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test10-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test10-stderr.txt
new file mode 100644
index 0000000..2bd1cba
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test10-stderr.txt
@@ -0,0 +1,42 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test10.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test10.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test10.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test11-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test11-stderr.txt
new file mode 100644
index 0000000..02ecd50
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test11-stderr.txt
@@ -0,0 +1,55 @@
+^((CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test11.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test11.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test11.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12-stderr.txt
new file mode 100644
index 0000000..e6c429c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12-stderr.txt
@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test12.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13-stderr.txt
new file mode 100644
index 0000000..fe1ccc3
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13-stderr.txt
@@ -0,0 +1,64 @@
+^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+(CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test13\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test13.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test14-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test14-stderr.txt
new file mode 100644
index 0000000..2bd1cba
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test14-stderr.txt
@@ -0,0 +1,42 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test14.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test14.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test14.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test15-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test15-stderr.txt
new file mode 100644
index 0000000..b37461a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test15-stderr.txt
@@ -0,0 +1,55 @@
+^((CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test15.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test15.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test15.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16-stderr.txt
new file mode 100644
index 0000000..a513b83
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16-stderr.txt
@@ -0,0 +1,27 @@
+^CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test16.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b-stderr.txt
new file mode 100644
index 0000000..9232a57
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `NOTFOUND`
+CMake Error at CMP0163-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test1b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b.cmake
new file mode 100644
index 0000000..e1b9d22
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test1b.cmake
@@ -0,0 +1,6 @@
+cmake_policy(SET CMP0118 NEW)
+# Extract from the current file the name of the test-case and value for CMP0163 and call the test-case.
+cmake_path(GET CMAKE_CURRENT_LIST_FILE STEM testcase)
+string(REGEX MATCH "NEW|OLD|WARN" value_for_CMP0163 "${testcase}")
+string(REGEX REPLACE "${value_for_CMP0163}" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2a.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2a.cmake
new file mode 100644
index 0000000..60f065c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2a.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_path(GET CMAKE_CURRENT_LIST_FILE FILENAME test_file)
+include(${CMAKE_CURRENT_LIST_DIR}/../${test_file})
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2b-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2b-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2b.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2c-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2c-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2c-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2c.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2c.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2c.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2d-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2d-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2d-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2d.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2d.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test2d.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3-stderr.txt
new file mode 100644
index 0000000..085f091
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-OLD-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-OLD-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-OLD-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b-stderr.txt
new file mode 100644
index 0000000..1c5a178
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-OLD-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-OLD-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-OLD-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test3b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4-stderr.txt
new file mode 100644
index 0000000..22ae491
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4-stderr.txt
@@ -0,0 +1,167 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b-stderr.txt
new file mode 100644
index 0000000..23dc427
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b-stderr.txt
@@ -0,0 +1,135 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+(CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test4b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5-stderr.txt
new file mode 100644
index 0000000..ee3ee76
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5-stderr.txt
@@ -0,0 +1,126 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+(CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/(Generated_with_relative_path[2-3]\.txt|Generated_with_full_path[2-3]\.txt))
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test5.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test6-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test6-stderr.txt
new file mode 100644
index 0000000..0c84cfe
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test6-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test6.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test6.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test6.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-stderr.txt
new file mode 100644
index 0000000..ced4fcf
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-stderr.txt
@@ -0,0 +1,74 @@
+^(CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test7.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8-stderr.txt
new file mode 100644
index 0000000..f723875
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8b-stderr.txt
new file mode 100644
index 0000000..f9ce9be
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8b-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8b.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test8b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-stderr.txt
new file mode 100644
index 0000000..e855458
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-stderr.txt
@@ -0,0 +1,74 @@
+^(CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-stderr.txt
new file mode 100644
index 0000000..769a3f5
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-stderr.txt
@@ -0,0 +1,61 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-OLD-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b.cmake
new file mode 100644
index 0000000..9e979e8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-OLD-Test9b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1-stderr.txt
new file mode 100644
index 0000000..4e5f4ac
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `0`
+CMake Error at CMP0163-Common-Test1\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test10-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test10-stderr.txt
new file mode 100644
index 0000000..2bd1cba
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test10-stderr.txt
@@ -0,0 +1,42 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test10.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test10.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test10.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test11-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test11-stderr.txt
new file mode 100644
index 0000000..bd98012
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test11-stderr.txt
@@ -0,0 +1,55 @@
+^((CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test11.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test11.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test11.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12-stderr.txt
new file mode 100644
index 0000000..e6c429c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12-stderr.txt
@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test12.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13-stderr.txt
new file mode 100644
index 0000000..6422e36
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13-stderr.txt
@@ -0,0 +1,64 @@
+^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+(CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test13\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test13.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test14-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test14-stderr.txt
new file mode 100644
index 0000000..2bd1cba
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test14-stderr.txt
@@ -0,0 +1,42 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test14.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test14.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test14.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test15-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test15-stderr.txt
new file mode 100644
index 0000000..c34acb2
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test15-stderr.txt
@@ -0,0 +1,55 @@
+^((CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test15.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test15.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test15.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16-stderr.txt
new file mode 100644
index 0000000..a513b83
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16-stderr.txt
@@ -0,0 +1,27 @@
+^CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test16.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b-stderr.txt
new file mode 100644
index 0000000..9037f5d
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `NOTFOUND`
+CMake Error at CMP0163-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test1b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b.cmake
new file mode 100644
index 0000000..e1b9d22
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test1b.cmake
@@ -0,0 +1,6 @@
+cmake_policy(SET CMP0118 NEW)
+# Extract from the current file the name of the test-case and value for CMP0163 and call the test-case.
+cmake_path(GET CMAKE_CURRENT_LIST_FILE STEM testcase)
+string(REGEX MATCH "NEW|OLD|WARN" value_for_CMP0163 "${testcase}")
+string(REGEX REPLACE "${value_for_CMP0163}" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2a.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2a.cmake
new file mode 100644
index 0000000..60f065c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2a.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_path(GET CMAKE_CURRENT_LIST_FILE FILENAME test_file)
+include(${CMAKE_CURRENT_LIST_DIR}/../${test_file})
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2b-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2b-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2b.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2c-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2c-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2c-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2c.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2c.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2c.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2d-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2d-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2d-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2d.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2d.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test2d.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3-stderr.txt
new file mode 100644
index 0000000..212398e
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-WARN-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-WARN-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-WARN-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b-stderr.txt
new file mode 100644
index 0000000..d36919b
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-WARN-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-WARN-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-NEW/CMP0163-WARN-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test3b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4-stderr.txt
new file mode 100644
index 0000000..0b71575
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4-stderr.txt
@@ -0,0 +1,167 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b-stderr.txt
new file mode 100644
index 0000000..0640b89
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b-stderr.txt
@@ -0,0 +1,135 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+(CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW/CMP0163-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-NEW/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test4b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5-stderr.txt
new file mode 100644
index 0000000..f882081
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5-stderr.txt
@@ -0,0 +1,126 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+(CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/(Generated_with_relative_path[2-3]\.txt|Generated_with_full_path[2-3]\.txt))
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test5.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test6-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test6-stderr.txt
new file mode 100644
index 0000000..0c84cfe
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test6-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test6.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test6.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test6.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-stderr.txt
new file mode 100644
index 0000000..4b7b12e
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-stderr.txt
@@ -0,0 +1,74 @@
+^(CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test7.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8-stderr.txt
new file mode 100644
index 0000000..f723875
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8b-stderr.txt
new file mode 100644
index 0000000..f9ce9be
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8b-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8b.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test8b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-stderr.txt
new file mode 100644
index 0000000..f8795b9
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-stderr.txt
@@ -0,0 +1,74 @@
+^(CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-stderr.txt
new file mode 100644
index 0000000..e8c28d3
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-stderr.txt
@@ -0,0 +1,61 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-NEW/CMP0163-WARN-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b.cmake b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b.cmake
new file mode 100644
index 0000000..f3ec67a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-NEW/CMP0163-WARN-Test9b.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0118 NEW)
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1-stderr.txt
new file mode 100644
index 0000000..ca58b9a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `0`
+CMake Error at CMP0163-Common-Test1\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test10-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test10-stderr.txt
new file mode 100644
index 0000000..680a830
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test10-stderr.txt
@@ -0,0 +1,42 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test10.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test10.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test10.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test11-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test11-stderr.txt
new file mode 100644
index 0000000..182a43c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test11-stderr.txt
@@ -0,0 +1,55 @@
+^(CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test11.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test11.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test11.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12-stderr.txt
new file mode 100644
index 0000000..6133a35
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12-stderr.txt
@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test12.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13-stderr.txt
new file mode 100644
index 0000000..59d81ec
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13-stderr.txt
@@ -0,0 +1,64 @@
+^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+(CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test13\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test13.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test14-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test14-stderr.txt
new file mode 100644
index 0000000..680a830
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test14-stderr.txt
@@ -0,0 +1,42 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test14.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test14.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test14.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test15-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test15-stderr.txt
new file mode 100644
index 0000000..4c3be67
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test15-stderr.txt
@@ -0,0 +1,55 @@
+^(CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test15.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test15.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test15.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16-stderr.txt
new file mode 100644
index 0000000..c18109c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16-stderr.txt
@@ -0,0 +1,27 @@
+^CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test16.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b-stderr.txt
new file mode 100644
index 0000000..b2d0e65
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `NOTFOUND`
+CMake Error at CMP0163-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test1b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b.cmake
new file mode 100644
index 0000000..8dc6b3d
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test1b.cmake
@@ -0,0 +1,6 @@
+# Leave CMP0118 unset!
+# Extract from the current file the name of the test-case and value for CMP0163 and call the test-case.
+cmake_path(GET CMAKE_CURRENT_LIST_FILE STEM testcase)
+string(REGEX MATCH "NEW|OLD|WARN" value_for_CMP0163 "${testcase}")
+string(REGEX REPLACE "${value_for_CMP0163}" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2a.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2a.cmake
new file mode 100644
index 0000000..b1e932c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2a.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0118 NEW)
+cmake_path(GET CMAKE_CURRENT_LIST_FILE STEM CMP0163_TESTCASE)
+include(${CMAKE_CURRENT_LIST_DIR}/../Test-with-CMP0163-NEW.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2b-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2b-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2b.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2c-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2c-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2c-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2c.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2c.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2c.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2d-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2d-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2d-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2d.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2d.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test2d.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3-stderr.txt
new file mode 100644
index 0000000..3298fca
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-NEW-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-NEW-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-NEW-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b-stderr.txt
new file mode 100644
index 0000000..0f351ea
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-NEW-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-NEW-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-NEW-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test3b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4-stderr.txt
new file mode 100644
index 0000000..ffc7224
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4-stderr.txt
@@ -0,0 +1,126 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b-stderr.txt
new file mode 100644
index 0000000..4634ba9
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b-stderr.txt
@@ -0,0 +1,135 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+(CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-NEW-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-NEW-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test4b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5-stderr.txt
new file mode 100644
index 0000000..4b0961d
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5-stderr.txt
@@ -0,0 +1,126 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0163 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0163 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0163 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+(CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*(Generated_with_relative_path[2-3]\.txt|.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-NEW-Test5-build/Generated_with_full_path[2-3]\.txt))
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test5.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test6-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test6-stderr.txt
new file mode 100644
index 0000000..ee30636
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test6-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test6.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test6.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test6.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-stderr.txt
new file mode 100644
index 0000000..1e3bc32
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-stderr.txt
@@ -0,0 +1,74 @@
+^(CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test7.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8-stderr.txt
new file mode 100644
index 0000000..ee30636
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `1`
+Generated_source4\.txt: # 1b # GENERATED = `1`
+Generated_source4\.txt: # 2a # GENERATED = `1`
+Generated_source4\.txt: # 2b # GENERATED = `1`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8b-stderr.txt
new file mode 100644
index 0000000..f9ce9be
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8b-stderr.txt
@@ -0,0 +1,36 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8b.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test8b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-stderr.txt
new file mode 100644
index 0000000..cb63bf3
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-stderr.txt
@@ -0,0 +1,74 @@
+^(CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0163!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-stderr.txt
new file mode 100644
index 0000000..2eb755a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-stderr.txt
@@ -0,0 +1,61 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-NEW-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b.cmake
new file mode 100644
index 0000000..62e4dc6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-NEW-Test9b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 NEW)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "NEW" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1-stderr.txt
new file mode 100644
index 0000000..98b8b6a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `0`
+CMake Error at CMP0163-Common-Test1\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10-stderr.txt
new file mode 100644
index 0000000..f51de9b
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test10\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10-build/Generated_source4\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test10\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test10.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-stderr.txt
new file mode 100644
index 0000000..63be2a7
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-stderr.txt
@@ -0,0 +1,90 @@
+^((CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test11\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test11\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test11\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test11.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12-stderr.txt
new file mode 100644
index 0000000..e6c429c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12-stderr.txt
@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test12.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13-stderr.txt
new file mode 100644
index 0000000..3068eb3
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13-stderr.txt
@@ -0,0 +1,74 @@
+^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+(CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test13\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test13.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14-stderr.txt
new file mode 100644
index 0000000..c6ffe0c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14-stderr.txt
@@ -0,0 +1,51 @@
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test14\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14-build/Generated_source4\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test14\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test14.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-stderr.txt
new file mode 100644
index 0000000..7ce1d4e
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-stderr.txt
@@ -0,0 +1,90 @@
+^((CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test15\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test15\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test15\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test15.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16-stderr.txt
new file mode 100644
index 0000000..a513b83
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16-stderr.txt
@@ -0,0 +1,27 @@
+^CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test16.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b-stderr.txt
new file mode 100644
index 0000000..798641d
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `NOTFOUND`
+CMake Error at CMP0163-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test1b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b.cmake
new file mode 100644
index 0000000..8dc6b3d
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test1b.cmake
@@ -0,0 +1,6 @@
+# Leave CMP0118 unset!
+# Extract from the current file the name of the test-case and value for CMP0163 and call the test-case.
+cmake_path(GET CMAKE_CURRENT_LIST_FILE STEM testcase)
+string(REGEX MATCH "NEW|OLD|WARN" value_for_CMP0163 "${testcase}")
+string(REGEX REPLACE "${value_for_CMP0163}" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2a.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2a.cmake
new file mode 100644
index 0000000..0729939
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2a.cmake
@@ -0,0 +1,2 @@
+cmake_path(GET CMAKE_CURRENT_LIST_FILE FILENAME test_file)
+include(${CMAKE_CURRENT_LIST_DIR}/../${test_file})
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2b-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2b-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2b.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2c-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2c-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2c-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2c.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2c.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2c.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2d-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2d-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2d-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2d.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2d.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test2d.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3-stderr.txt
new file mode 100644
index 0000000..9f7d5de
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-OLD-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-OLD-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-OLD-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b-stderr.txt
new file mode 100644
index 0000000..81687a3
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-OLD-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-OLD-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-OLD-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test3b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4-stderr.txt
new file mode 100644
index 0000000..9098ddd
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4-stderr.txt
@@ -0,0 +1,212 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-OLD-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b-stderr.txt
new file mode 100644
index 0000000..6893cc9
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b-stderr.txt
@@ -0,0 +1,212 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-OLD-Test4b-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-OLD-Test4b-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-OLD-Test4b-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-OLD-Test4b-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-OLD-Test4b-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test4b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5-stderr.txt
new file mode 100644
index 0000000..7fa3ffe
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5-stderr.txt
@@ -0,0 +1,205 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Attempt to set property 'GENERATED' with the following non-boolean value
+ \(which will be interpreted as "0"\):
+
+ Junk-value
+
+ That exact value will not be retrievable\. A value of "0" will be returned
+ instead\.
+
+ This will be an error under policy CMP0118\.
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Attempt to set property 'GENERATED' with the following non-boolean value
+ \(which will be interpreted as "0"\):
+
+ Junk-value
+
+ That exact value will not be retrievable\. A value of "0" will be returned
+ instead\.
+
+ This will be an error under policy CMP0118\.
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Attempt to set property 'GENERATED' with the following non-boolean value
+ \(which will be interpreted as "0"\):
+
+ Junk-value
+
+ That exact value will not be retrievable\. A value of "0" will be returned
+ instead\.
+
+ This will be an error under policy CMP0118\.
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test5.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6-stderr.txt
new file mode 100644
index 0000000..da10641
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test6\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6-build/Generated_source4\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test6\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test6.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-stderr.txt
new file mode 100644
index 0000000..c4ae929
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-stderr.txt
@@ -0,0 +1,100 @@
+^((CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-build/Generated_source[2-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-build/Generated_source[2-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-build/Generated_source[2-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-build/Generated_source[2-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7-build/Generated_source[2-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test7.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8-stderr.txt
new file mode 100644
index 0000000..5c4014f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test8\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8-build/Generated_source4\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test8\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b-stderr.txt
new file mode 100644
index 0000000..81458aa
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test8b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test8b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test8b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-stderr.txt
new file mode 100644
index 0000000..7dbd729
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-stderr.txt
@@ -0,0 +1,84 @@
+^((CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-stderr.txt
new file mode 100644
index 0000000..a03cce0
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-stderr.txt
@@ -0,0 +1,61 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-OLD-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b.cmake
new file mode 100644
index 0000000..5069712
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-OLD-Test9b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+cmake_policy(SET CMP0163 OLD)
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "OLD" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1-stderr.txt
new file mode 100644
index 0000000..327067d
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `0`
+CMake Error at CMP0163-Common-Test1\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10-stderr.txt
new file mode 100644
index 0000000..0a5d4b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test10\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10-build/Generated_source4\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test10\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test10.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-stderr.txt
new file mode 100644
index 0000000..bffefb6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-stderr.txt
@@ -0,0 +1,90 @@
+^((CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test11\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test11\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test11\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test11.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12-stderr.txt
new file mode 100644
index 0000000..e6c429c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12-stderr.txt
@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test12.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13-stderr.txt
new file mode 100644
index 0000000..d9ea88e
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13-stderr.txt
@@ -0,0 +1,74 @@
+^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+(CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0163-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test13\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test13.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14-stderr.txt
new file mode 100644
index 0000000..451c413
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14-stderr.txt
@@ -0,0 +1,51 @@
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test14\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14-build/Generated_source4\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test14\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test14.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-stderr.txt
new file mode 100644
index 0000000..ac80737
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-stderr.txt
@@ -0,0 +1,90 @@
+^((CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test15\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test15\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test15\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test15.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16-stderr.txt
new file mode 100644
index 0000000..a513b83
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16-stderr.txt
@@ -0,0 +1,27 @@
+^CMake Error at subdir-Common-Test16/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom4' was not created in this directory\.
++
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test16.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b-stderr.txt
new file mode 100644
index 0000000..f7e6846
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `NOTFOUND`
+CMake Error at CMP0163-Common-Test1b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b-build/GeneratedMain\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test1b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b.cmake
new file mode 100644
index 0000000..8dc6b3d
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test1b.cmake
@@ -0,0 +1,6 @@
+# Leave CMP0118 unset!
+# Extract from the current file the name of the test-case and value for CMP0163 and call the test-case.
+cmake_path(GET CMAKE_CURRENT_LIST_FILE STEM testcase)
+string(REGEX MATCH "NEW|OLD|WARN" value_for_CMP0163 "${testcase}")
+string(REGEX REPLACE "${value_for_CMP0163}" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2a.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2a.cmake
new file mode 100644
index 0000000..0729939
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2a.cmake
@@ -0,0 +1,2 @@
+cmake_path(GET CMAKE_CURRENT_LIST_FILE FILENAME test_file)
+include(${CMAKE_CURRENT_LIST_DIR}/../${test_file})
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2b-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2b-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2b.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2c-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2c-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2c-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2c.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2c.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2c.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2d-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2d-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2d-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2d.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2d.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test2d.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3-stderr.txt
new file mode 100644
index 0000000..1a41192
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-WARN-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-WARN-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-WARN-Test3-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b-stderr.txt
new file mode 100644
index 0000000..005f005
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b-stderr.txt
@@ -0,0 +1,79 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `1`
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-WARN-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-WARN-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test3b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-2]\.txt|CMP0118-WARN/CMP0163-WARN-Test3b-build/Generated_with_full_path3\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test3b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4-stderr.txt
new file mode 100644
index 0000000..fbdf1da
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4-stderr.txt
@@ -0,0 +1,212 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-WARN-Test4-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b-stderr.txt
new file mode 100644
index 0000000..caf555c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b-stderr.txt
@@ -0,0 +1,212 @@
+^CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-WARN-Test4b-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-WARN-Test4b-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-WARN-Test4b-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-WARN-Test4b-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test4b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN/CMP0163-WARN-Test4b-build/Generated_with_relative_path1\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test4b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5-stderr.txt
new file mode 100644
index 0000000..83556e6
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5-stderr.txt
@@ -0,0 +1,205 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Attempt to set property 'GENERATED' with the following non-boolean value
+ \(which will be interpreted as "0"\):
+
+ Junk-value
+
+ That exact value will not be retrievable\. A value of "0" will be returned
+ instead\.
+
+ This will be an error under policy CMP0118\.
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Attempt to set property 'GENERATED' with the following non-boolean value
+ \(which will be interpreted as "0"\):
+
+ Junk-value
+
+ That exact value will not be retrievable\. A value of "0" will be returned
+ instead\.
+
+ This will be an error under policy CMP0118\.
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `1`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0163-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Attempt to set property 'GENERATED' with the following non-boolean value
+ \(which will be interpreted as "0"\):
+
+ Junk-value
+
+ That exact value will not be retrievable\. A value of "0" will be returned
+ instead\.
+
+ This will be an error under policy CMP0118\.
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test5\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/(Generated_with_full_source_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN/CMP0163-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test5.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6-stderr.txt
new file mode 100644
index 0000000..08711ab
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test6\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6-build/Generated_source4\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test6\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test6.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-stderr.txt
new file mode 100644
index 0000000..9d8af4f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-stderr.txt
@@ -0,0 +1,100 @@
+^((CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-build/Generated_source[2-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-build/Generated_source[2-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-build/Generated_source[2-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-build/Generated_source[2-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test7\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7-build/Generated_source[2-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test7.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8-stderr.txt
new file mode 100644
index 0000000..4928234
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test8\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8-build/Generated_source4\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test8\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b-stderr.txt
new file mode 100644
index 0000000..200a180
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test8b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test8b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test8b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-stderr.txt
new file mode 100644
index 0000000..4d35ef0
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-stderr.txt
@@ -0,0 +1,84 @@
+^((CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0163-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: GENERATED sources may be used across directories
+ without manual marking\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-result.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-stderr.txt b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-stderr.txt
new file mode 100644
index 0000000..ed65a7c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-stderr.txt
@@ -0,0 +1,61 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0163-Common-Test9b\.cmake:[0-9]+ \(target_sources\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b-build/Generated_source[4-6]\.txt
+Call Stack \(most recent call first\):
+ CMP0118-WARN/CMP0163-WARN-Test9b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b.cmake b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b.cmake
new file mode 100644
index 0000000..c0327b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0118-WARN/CMP0163-WARN-Test9b.cmake
@@ -0,0 +1,7 @@
+# Leave CMP0118 unset!
+# Leave CMP0163 unset!
+
+# Call the associated test.
+cmake_path(GET RunCMake_TEST STEM testcase)
+string(REGEX REPLACE "WARN" "Common" testcase "${testcase}")
+include(${CMAKE_CURRENT_LIST_DIR}/../${testcase}.cmake)
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Helper.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Helper.cmake
new file mode 100644
index 0000000..b237b7f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Helper.cmake
@@ -0,0 +1,14 @@
+macro(get_and_print_GENERATED_property filename)
+ get_property(prop SOURCE "${CMAKE_CURRENT_BINARY_DIR}/${filename}" PROPERTY GENERATED)
+ message(NOTICE "${filename}: # 1a # GENERATED = `${prop}`")
+ get_source_file_property(prop "${CMAKE_CURRENT_BINARY_DIR}/${filename}" GENERATED)
+ message(NOTICE "${filename}: # 1b # GENERATED = `${prop}`")
+ get_property(prop SOURCE "${filename}" PROPERTY GENERATED)
+ message(NOTICE "${filename}: # 2a # GENERATED = `${prop}`")
+ get_source_file_property(prop "${filename}" GENERATED)
+ message(NOTICE "${filename}: # 2b # GENERATED = `${prop}`")
+ get_property(prop SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${filename}" PROPERTY GENERATED)
+ message(NOTICE "${filename}: # 3a # GENERATED = `${prop}`")
+ get_source_file_property(prop "${CMAKE_CURRENT_SOURCE_DIR}/${filename}" GENERATED)
+ message(NOTICE "${filename}: # 3b # GENERATED = `${prop}`")
+endmacro()
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test1.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test1.cmake
new file mode 100644
index 0000000..2b66515
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test1.cmake
@@ -0,0 +1,9 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+get_property(prop SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTY GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test10.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test10.cmake
new file mode 100644
index 0000000..97984d8
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test10.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+# The sources of custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test10)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test11.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test11.cmake
new file mode 100644
index 0000000..59d92f4
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test11.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+# The sources of custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test11)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test12.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test12.cmake
new file mode 100644
index 0000000..9d514f0
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test12.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+# The sources of custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_command(TARGET custom0 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_command(TARGET custom1 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(TARGET custom2 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_command(TARGET custom3 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test12)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test13.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test13.cmake
new file mode 100644
index 0000000..b79f369
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test13.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+# The sources of custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_command(TARGET custom0 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_command(TARGET custom1 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(TARGET custom2 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_command(TARGET custom3 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test13)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test14.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test14.cmake
new file mode 100644
index 0000000..203b114
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test14.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+# The sources of custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_target(custom0_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_target(custom1_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test14)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test15.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test15.cmake
new file mode 100644
index 0000000..f66011a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test15.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+# The sources of custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_target(custom0_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_target(custom1_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test15)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test16.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test16.cmake
new file mode 100644
index 0000000..3c63277
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test16.cmake
@@ -0,0 +1,38 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(TARGET custom2 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+
+add_subdirectory(subdir-Common-Test16)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test1b.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test1b.cmake
new file mode 100644
index 0000000..622633f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test1b.cmake
@@ -0,0 +1,9 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+get_source_file_property(prop
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test2.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test2.cmake
new file mode 100644
index 0000000..1180b6b
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test2.cmake
@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_property(SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTY GENERATED "1")
+get_property(prop SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTY GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test2b.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test2b.cmake
new file mode 100644
index 0000000..5317781
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test2b.cmake
@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_source_files_properties(
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTIES GENERATED "1")
+get_source_file_property(prop
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test2c.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test2c.cmake
new file mode 100644
index 0000000..2f2d3a2
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test2c.cmake
@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_property(SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTY GENERATED "1")
+get_source_file_property(prop
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test2d.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test2d.cmake
new file mode 100644
index 0000000..67f9b8c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test2d.cmake
@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_source_files_properties(
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTIES GENERATED "1")
+get_property(prop SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTY GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test3.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test3.cmake
new file mode 100644
index 0000000..ce47460
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test3.cmake
@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "Generated_with_relative_path1.txt"
+ "Generated_with_relative_path2.txt"
+ "Generated_with_relative_path3.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path1.txt")
+
+set_property(SOURCE "Generated_with_full_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path1.txt")
+
+set_property(SOURCE "Generated_with_relative_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
+
+set_property(SOURCE "Generated_with_full_source_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test3b.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test3b.cmake
new file mode 100644
index 0000000..8dda231
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test3b.cmake
@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path1.txt")
+
+set_property(SOURCE "Generated_with_full_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path1.txt")
+
+set_property(SOURCE "Generated_with_relative_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
+
+set_property(SOURCE "Generated_with_full_source_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "Generated_with_relative_path1.txt"
+ "Generated_with_relative_path2.txt"
+ "Generated_with_relative_path3.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+)
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test4.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test4.cmake
new file mode 100644
index 0000000..8de4f04
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test4.cmake
@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "Generated_with_relative_path1.txt"
+ "Generated_with_relative_path2.txt"
+ "Generated_with_relative_path3.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path1.txt")
+
+set_property(SOURCE "Generated_with_full_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path1.txt")
+
+set_property(SOURCE "Generated_with_relative_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
+
+set_property(SOURCE "Generated_with_full_source_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test4b.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test4b.cmake
new file mode 100644
index 0000000..d218f5d
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test4b.cmake
@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path1.txt")
+
+set_property(SOURCE "Generated_with_full_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path1.txt")
+
+set_property(SOURCE "Generated_with_relative_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
+
+set_property(SOURCE "Generated_with_full_source_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "Generated_with_relative_path1.txt"
+ "Generated_with_relative_path2.txt"
+ "Generated_with_relative_path3.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+)
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test5.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test5.cmake
new file mode 100644
index 0000000..235e5e5
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test5.cmake
@@ -0,0 +1,78 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "Generated_with_relative_path1.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "Generated_with_relative_path2.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "Generated_with_relative_path3.txt"
+)
+add_custom_target(custom7)
+target_sources(custom7 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+)
+add_custom_target(custom8)
+target_sources(custom8 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+)
+add_custom_target(custom9)
+target_sources(custom9 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_full_path1.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+ PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_full_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+ PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_full_path3.txt")
+
+
+set_property(SOURCE "Generated_with_relative_path1.txt"
+ PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_relative_path1.txt")
+
+set_property(SOURCE "Generated_with_relative_path2.txt"
+ PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_relative_path2.txt")
+
+set_property(SOURCE "Generated_with_relative_path3.txt"
+ PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+ PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+ PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+ PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test6.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test6.cmake
new file mode 100644
index 0000000..b89af65
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test6.cmake
@@ -0,0 +1,44 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ PROPERTY GENERATED "1")
+
+add_subdirectory(subdir-Common-Test6)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test7.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test7.cmake
new file mode 100644
index 0000000..d1586f5
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test7.cmake
@@ -0,0 +1,44 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ PROPERTY GENERATED "1")
+
+add_subdirectory(subdir-Common-Test7)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test8.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test8.cmake
new file mode 100644
index 0000000..c2bfd03
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test8.cmake
@@ -0,0 +1,51 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test8)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test8b.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test8b.cmake
new file mode 100644
index 0000000..cba4817
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test8b.cmake
@@ -0,0 +1,51 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test8b)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test9.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test9.cmake
new file mode 100644
index 0000000..dd2e128
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test9.cmake
@@ -0,0 +1,51 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test9)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMP0163-Common-Test9b.cmake b/Tests/RunCMake/CMP0163/CMP0163-Common-Test9b.cmake
new file mode 100644
index 0000000..c7d494c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMP0163-Common-Test9b.cmake
@@ -0,0 +1,51 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0163-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test9b)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0163/CMakeLists.txt b/Tests/RunCMake/CMP0163/CMakeLists.txt
new file mode 100644
index 0000000..4ae248a
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.19) # Must be older than 3.20 in order to also not set CMP0118!
+cmake_policy(SET CMP0115 NEW) # CMP0115 is correct here (for reducing error-output)!
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/CMP0163/RunCMakeTest.cmake b/Tests/RunCMake/CMP0163/RunCMakeTest.cmake
new file mode 100644
index 0000000..edfe130
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/RunCMakeTest.cmake
@@ -0,0 +1,147 @@
+include(RunCMake)
+
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test1)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test1b)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test2)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test2b)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test2c)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test2d)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test3)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test3b)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test4)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test4b)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test5)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test6)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test7)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test8)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test8b)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test9)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test9b)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test10)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test11)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test12)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test13)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test14)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test15)
+run_cmake(CMP0118-WARN/CMP0163-OLD-Test16)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test1)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test1b)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test2)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test2b)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test2c)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test2d)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test3)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test3b)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test4)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test4b)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test5)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test6)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test7)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test8)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test8b)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test9)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test9b)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test10)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test11)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test12)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test13)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test14)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test15)
+run_cmake(CMP0118-WARN/CMP0163-WARN-Test16)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test1)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test1b)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test2)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test2b)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test2c)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test2d)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test3)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test3b)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test4)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test4b)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test5)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test6)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test7)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test8)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test8b)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test9)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test9b)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test10)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test11)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test12)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test13)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test14)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test15)
+run_cmake(CMP0118-WARN/CMP0163-NEW-Test16)
+
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test1)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test1b)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test2)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test2b)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test2c)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test2d)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test3)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test3b)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test4)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test4b)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test5)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test6)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test7)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test8)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test8b)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test9)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test9b)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test10)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test11)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test12)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test13)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test14)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test15)
+run_cmake(CMP0118-NEW/CMP0163-OLD-Test16)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test1)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test1b)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test2)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test2b)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test2c)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test2d)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test3)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test3b)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test4)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test4b)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test5)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test6)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test7)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test8)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test8b)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test9)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test9b)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test10)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test11)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test12)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test13)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test14)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test15)
+run_cmake(CMP0118-NEW/CMP0163-WARN-Test16)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test1)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test1b)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test2)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test2b)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test2c)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test2d)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test3)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test3b)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test4)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test4b)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test5)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test6)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test7)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test8)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test8b)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test9)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test9b)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test10)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test11)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test12)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test13)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test14)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test15)
+run_cmake(CMP0118-NEW/CMP0163-NEW-Test16)
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test10/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test10/CMakeLists.txt
new file mode 100644
index 0000000..6bc99cb
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test10/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test11/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test11/CMakeLists.txt
new file mode 100644
index 0000000..fbd7e6f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test11/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test12/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test12/CMakeLists.txt
new file mode 100644
index 0000000..916725c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test12/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_command(TARGET custom4 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_command(TARGET custom5 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_command(TARGET custom6 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test13/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test13/CMakeLists.txt
new file mode 100644
index 0000000..7ad02df
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test13/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Note: Target "custom4" was not created in this directory, so setting this build-event will fail!
+add_custom_command(TARGET custom4 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+# Note: Target "custom5" was not created in this directory, so setting this build-event will fail!
+add_custom_command(TARGET custom5 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+# Note: Target "custom6" was not created in this directory, so setting this build-event will fail!
+add_custom_command(TARGET custom6 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test14/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test14/CMakeLists.txt
new file mode 100644
index 0000000..7397db9
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test14/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_target(custom4_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_target(custom5_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_target(custom6_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test15/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test15/CMakeLists.txt
new file mode 100644
index 0000000..314e427
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test15/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_target(custom4_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_target(custom5_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_target(custom6_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test16/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test16/CMakeLists.txt
new file mode 100644
index 0000000..877c829
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test16/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+)
+add_custom_command(TARGET custom4 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test6/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test6/CMakeLists.txt
new file mode 100644
index 0000000..fa307d1
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test6/CMakeLists.txt
@@ -0,0 +1,16 @@
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test7/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test7/CMakeLists.txt
new file mode 100644
index 0000000..6362f78
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test7/CMakeLists.txt
@@ -0,0 +1,16 @@
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test8/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test8/CMakeLists.txt
new file mode 100644
index 0000000..eefe18c
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test8/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test8b/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test8b/CMakeLists.txt
new file mode 100644
index 0000000..1e4cccd
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test8b/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test9/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test9/CMakeLists.txt
new file mode 100644
index 0000000..99f6d73
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test9/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMP0163/subdir-Common-Test9b/CMakeLists.txt b/Tests/RunCMake/CMP0163/subdir-Common-Test9b/CMakeLists.txt
new file mode 100644
index 0000000..f94f36f
--- /dev/null
+++ b/Tests/RunCMake/CMP0163/subdir-Common-Test9b/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Note: Currently, `file(GENERATE)` does not set the `GENERATED` property!
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
diff --git a/Tests/RunCMake/CMP0165/CMP0165-NEW-result.txt b/Tests/RunCMake/CMP0165/CMP0165-NEW-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0165/CMP0165-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0165/CMP0165-NEW-stderr.txt b/Tests/RunCMake/CMP0165/CMP0165-NEW-stderr.txt
new file mode 100644
index 0000000..662d8ad
--- /dev/null
+++ b/Tests/RunCMake/CMP0165/CMP0165-NEW-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at CMP0165-NEW\.cmake:[0-9]+ \(enable_language\):
+ project\(\) must be called prior to this enable_language\(\) call\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0165/CMP0165-NEW.cmake b/Tests/RunCMake/CMP0165/CMP0165-NEW.cmake
new file mode 100644
index 0000000..8bcb3fd
--- /dev/null
+++ b/Tests/RunCMake/CMP0165/CMP0165-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0165 NEW)
+enable_language(C)
diff --git a/Tests/RunCMake/CMP0165/CMP0165-OLD.cmake b/Tests/RunCMake/CMP0165/CMP0165-OLD.cmake
new file mode 100644
index 0000000..c80ba76
--- /dev/null
+++ b/Tests/RunCMake/CMP0165/CMP0165-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0165 OLD)
+enable_language(C)
diff --git a/Tests/RunCMake/CMP0165/CMP0165-WARN-stderr.txt b/Tests/RunCMake/CMP0165/CMP0165-WARN-stderr.txt
new file mode 100644
index 0000000..32a79df
--- /dev/null
+++ b/Tests/RunCMake/CMP0165/CMP0165-WARN-stderr.txt
@@ -0,0 +1,5 @@
+CMake Warning \(dev\) at CMP0165-WARN\.cmake:[0-9]+ \(enable_language\):
+ project\(\) should be called prior to this enable_language\(\) call\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
diff --git a/Tests/RunCMake/CMP0165/CMP0165-WARN.cmake b/Tests/RunCMake/CMP0165/CMP0165-WARN.cmake
new file mode 100644
index 0000000..75149dd
--- /dev/null
+++ b/Tests/RunCMake/CMP0165/CMP0165-WARN.cmake
@@ -0,0 +1,2 @@
+# Don't touch the policy, it should warn by default
+enable_language(C)
diff --git a/Tests/RunCMake/CMP0165/CMakeLists.txt b/Tests/RunCMake/CMP0165/CMakeLists.txt
new file mode 100644
index 0000000..2fa8c4e
--- /dev/null
+++ b/Tests/RunCMake/CMP0165/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.29)
+
+# This is different to the usual RunCMake test pattern. We are specifically
+# testing the scenario where enable_language() is called before project().
+include(${RunCMake_TEST}.cmake)
+
+project(${RunCMake_TEST} NONE)
diff --git a/Tests/RunCMake/CMP0165/RunCMakeTest.cmake b/Tests/RunCMake/CMP0165/RunCMakeTest.cmake
new file mode 100644
index 0000000..f5f167c
--- /dev/null
+++ b/Tests/RunCMake/CMP0165/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0165-WARN)
+run_cmake(CMP0165-OLD)
+run_cmake(CMP0165-NEW)
diff --git a/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-OLD-stderr.txt b/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-OLD-stderr.txt
new file mode 100644
index 0000000..1953091
--- /dev/null
+++ b/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-OLD-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Deprecation Warning at [^
+]*/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-OLD\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0127 will be removed from a future version
+ of CMake\.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances\. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD\.$
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 57034e5..005bd17 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
# See adjacent README.rst for documentation of this test infrastructure.
# Note that the _isMultiConfig variable is set in the parent directory's
@@ -87,10 +90,6 @@ endfunction()
# Some tests use python for extra checks.
find_package(Python QUIET)
-if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 6.1)
- set(Swift_ARGS -DXCODE_BELOW_6_1=1)
-endif()
-
# Test MSVC for older host CMake versions, and test
# WIN32/CMAKE_C_COMPILER_ID to fix check on Intel for Windows.
if(MSVC OR (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel")
@@ -155,6 +154,7 @@ if("${CMAKE_C_COMPILER_ID}" STREQUAL "LCC" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "LCC" OR
"${CMAKE_Fortran_COMPILER_ID}" STREQUAL "LCC")
add_RunCMake_test("CMP0129")
+ set_property(TEST RunCMake.CMP0129 APPEND PROPERTY LABELS "Fortran")
endif()
add_RunCMake_test(CMP0132)
@@ -170,6 +170,11 @@ if(NOT WIN32 OR CYGWIN)
endif()
add_RunCMake_test(CMP0153)
+add_RunCMake_test(CMP0156 -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION})
+add_RunCMake_test(CMP0160)
+add_RunCMake_test(CMP0163)
+add_RunCMake_test(CMP0165)
# The test for Policy 65 requires the use of the
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
@@ -226,6 +231,7 @@ if(CMAKE_GENERATOR MATCHES "Ninja")
endif()
endif()
add_RunCMake_test(Ninja)
+ set_property(TEST RunCMake.Ninja APPEND PROPERTY LABELS "Fortran")
set(NinjaMultiConfig_ARGS
-DCYGWIN=${CYGWIN} -DMSYS=${MSYS}
)
@@ -322,10 +328,19 @@ add_RunCMake_test(BuildDepends
-DCMAKE_C_LINK_DEPENDS_USE_COMPILER=${CMAKE_C_LINK_DEPENDS_USE_COMPILER}
-DCMake_TEST_BuildDepends_GNU_AS=${CMake_TEST_BuildDepends_GNU_AS}
)
+set_property(TEST RunCMake.BuildDepends APPEND PROPERTY LABELS "Fortran")
+add_RunCMake_test(BuiltinTargets)
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(Byproducts)
endif()
add_RunCMake_test(CMakeDependentOption)
+if(APPLE # Remove these conditions when the test has non-Apple cases
+ AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
+ add_RunCMake_test(CMakePackage
+ -DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION}
+ -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ )
+endif()
add_RunCMake_test(CMakeRoleGlobalProperty)
add_RunCMake_test(CMakeRelease -DCMake_TEST_JQ=${CMake_TEST_JQ})
if(CMAKE_GENERATOR MATCHES "Make|Ninja")
@@ -339,7 +354,17 @@ if(DEFINED CMake_TEST_OBJC)
list(APPEND CompilerTest_ARGS -DCMake_TEST_OBJC=${CMake_TEST_OBJC})
endif()
if(CMAKE_Fortran_COMPILER)
- list(APPEND CompilerTest_ARGS -DCMake_TEST_Fortran=1)
+ # lfortran < 1.24 cannot handle long file names. Fortran is not
+ # enabled here, so check the C compiler version instead.
+ if(CMAKE_C_COMPILER_ID STREQUAL "LCC" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "1.24")
+ string(LENGTH "${CMAKE_CURRENT_BINARY_DIR}" _CCBD_LEN)
+ if(_CCBD_LEN LESS 35)
+ list(APPEND CompilerTest_ARGS -DCMake_TEST_Fortran=1)
+ endif()
+ unset(_CCBD_LEN)
+ else()
+ list(APPEND CompilerTest_ARGS -DCMake_TEST_Fortran=1)
+ endif()
endif()
foreach(lang IN ITEMS CUDA HIP ISPC)
if(CMake_TEST_${lang})
@@ -347,7 +372,7 @@ foreach(lang IN ITEMS CUDA HIP ISPC)
endif()
endforeach()
add_RunCMake_test(CompilerTest)
-set_property(TEST RunCMake.CompilerTest APPEND PROPERTY LABELS "CUDA" "HIP" "ISPC")
+set_property(TEST RunCMake.CompilerTest APPEND PROPERTY LABELS "CUDA" "HIP" "ISPC" "Fortran")
add_RunCMake_test(Configure -DMSVC_IDE=${MSVC_IDE})
add_RunCMake_test(DisallowedCommands)
if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
@@ -408,9 +433,23 @@ endif()
add_RunCMake_test(GeneratorToolset)
add_RunCMake_test(GetPrerequisites -DSAMPLE_EXE=$<TARGET_FILE:exit_code>)
add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME})
-add_RunCMake_test(GoogleTest) # Note: does not actually depend on Google Test
+add_RunCMake_test(GoogleTest # Note: does not actually depend on Google Test
+ -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}
+ -DCMAKE_VS_PLATFORM_NAME=${CMAKE_VS_PLATFORM_NAME}
+ )
add_RunCMake_test(Graphviz)
add_RunCMake_test(Languages)
+
+add_RunCMake_test(LanguageStandards
+ -DCMake_NO_C_STANDARD=${CMake_NO_C_STANDARD}
+ -DCMake_NO_CXX_STANDARD=${CMake_NO_CXX_STANDARD}
+ -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
+ -DCMake_TEST_HIP=${CMake_TEST_HIP}
+ -DCMake_TEST_OBJC=${CMake_TEST_OBJC}
+)
+set_property(TEST RunCMake.LanguageStandards APPEND PROPERTY LABELS "CUDA" "HIP")
+
add_RunCMake_test(LinkItemValidation)
add_RunCMake_test(LinkStatic)
if(CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IBMClang|Fujitsu|FujitsuClang)$")
@@ -428,11 +467,16 @@ endif()
add_RunCMake_test(ObjectLibrary)
add_RunCMake_test(ParseImplicitIncludeInfo)
add_RunCMake_test(ParseImplicitLinkInfo)
-if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
- add_RunCMake_test(RuntimePath)
+if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
+ add_RunCMake_test(RuntimePath
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -DCMAKE_EXECUTABLE_FORMAT=${CMAKE_EXECUTABLE_FORMAT}
+ )
endif()
add_RunCMake_test(ScriptMode)
-add_RunCMake_test(Swift -DCMAKE_Swift_COMPILER=${CMAKE_Swift_COMPILER} -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
+add_RunCMake_test(Swift -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -DCMake_TEST_Swift=${CMake_TEST_Swift}
+ -DXCODE_VERSION=${XCODE_VERSION})
add_RunCMake_test(TargetArtifacts -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
add_RunCMake_test(TargetObjects)
add_RunCMake_test(TargetProperties)
@@ -468,7 +512,8 @@ add_RunCMake_test(add_dependencies)
add_RunCMake_test(add_executable)
add_RunCMake_test(add_library)
add_RunCMake_test(add_subdirectory -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER})
-add_RunCMake_test(add_test)
+set_property(TEST RunCMake.add_subdirectory APPEND PROPERTY LABELS "Fortran")
+add_RunCMake_test(add_test -DPSEUDO_EMULATOR=$<TARGET_FILE:pseudo_emulator>)
add_RunCMake_test(build_command)
add_executable(exit_code exit_code.c)
set(execute_process_ARGS
@@ -512,6 +557,7 @@ add_RunCMake_test(ctest_skipped_test)
add_RunCMake_test(ctest_update)
add_RunCMake_test(ctest_upload)
add_RunCMake_test(ctest_environment)
+add_RunCMake_test(ctest_empty_binary_directory)
add_RunCMake_test(ctest_fixtures)
add_RunCMake_test(define_property)
add_RunCMake_test(file -DCYGWIN=${CYGWIN} -DMSYS=${MSYS})
@@ -519,15 +565,20 @@ add_RunCMake_test(file-CHMOD -DMSYS=${MSYS})
foreach(var
CMake_TEST_NO_NETWORK
CMake_TEST_TLS_VERIFY_URL
+ CMake_TEST_TLS_VERSION
)
if(DEFINED ${var})
list(APPEND file-DOWNLOAD_ARGS -D${var}=${${var}})
endif()
endforeach()
add_RunCMake_test(file-DOWNLOAD)
-add_RunCMake_test(file-RPATH -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
+add_RunCMake_test(file-RPATH
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -DCMake_TEST_ELF_LARGE=${CMake_TEST_ELF_LARGE}
+)
+add_RunCMake_test(file-STRINGS)
add_RunCMake_test(find_file -DMINGW=${MINGW})
-add_RunCMake_test(find_library -DMINGW=${MINGW} -DCYGWIN=${CYGWIN} -DMSYS=${MSYS})
+add_RunCMake_test(find_library -DMINGW=${MINGW} -DCYGWIN=${CYGWIN} -DMSYS=${MSYS} -DMSVC=${MSVC})
add_RunCMake_test(find_package -DMINGW=${MINGW} -DMSYS=${MSYS})
add_RunCMake_test(find_path -DMINGW=${MINGW})
add_RunCMake_test(find_program -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
@@ -536,7 +587,7 @@ add_RunCMake_test(function)
add_RunCMake_test(block)
add_RunCMake_test(get_filename_component)
add_RunCMake_test(get_property)
-add_RunCMake_test(if)
+add_RunCMake_test(if -DMSYS=${MSYS})
add_RunCMake_test(include)
add_RunCMake_test(include_directories)
add_RunCMake_test(include_guard)
@@ -583,8 +634,12 @@ function(add_RunCMake_test_try_compile)
endfunction()
add_RunCMake_test_try_compile()
-add_RunCMake_test(try_run -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
- -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
+if(CMAKE_Fortran_COMPILER)
+ list(APPEND try_run_ARGS -DCMake_TEST_Fortran=1)
+endif()
+add_RunCMake_test(try_run)
+set_property(TEST RunCMake.try_run APPEND PROPERTY LABELS "Fortran")
+
add_RunCMake_test(set)
add_RunCMake_test(variable_watch)
add_RunCMake_test(while)
@@ -603,7 +658,9 @@ if(CMake_TEST_CUDA)
add_RunCMake_test(CUDA_architectures)
set_property(TEST RunCMake.CUDA_architectures APPEND PROPERTY LABELS "CUDA")
endif()
+
add_RunCMake_test(DependencyGraph -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER})
+set_property(TEST RunCMake.DependencyGraph APPEND PROPERTY LABELS "Fortran")
# Add C++ Module tests.
add_RunCMake_test(CXXModules -DCMake_TEST_MODULE_COMPILATION=${CMake_TEST_MODULE_COMPILATION} -DCMake_TEST_MODULE_COMPILATION_RULES=${CMake_TEST_MODULE_COMPILATION_RULES})
@@ -690,6 +747,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^9]|9[0-9])")
-DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
-DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}
)
+ add_RunCMake_test(VS10ProjectUseDebugLibraries)
if( vs12 AND wince )
add_RunCMake_test( VS10ProjectWinCE "-DRunCMake_GENERATOR_PLATFORM=${wince_sdk}")
endif()
@@ -738,6 +796,16 @@ if((CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
endif()
endif()
+if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin|Windows)"
+ AND CMAKE_C_COMPILER_ID MATCHES "^(AppleClang|Clang|GNU|MSVC|NVIDIA)$"
+ AND NOT CMAKE_GENERATOR STREQUAL "Green Hills MULTI")
+ add_RunCMake_test(LinkerSelection -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
+ -DCMake_TEST_Swift=${CMake_TEST_Swift}
+ -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION})
+endif()
+
+add_RunCMake_test(LinkLibrariesProcessing)
add_RunCMake_test(File_Archive)
add_RunCMake_test(File_Configure)
add_RunCMake_test(File_Generate)
@@ -804,14 +872,10 @@ add_RunCMake_test(CheckSourceRuns -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
set_property(TEST RunCMake.CheckCompilerFlag
RunCMake.CheckSourceCompiles
RunCMake.CheckSourceRuns
- APPEND PROPERTY LABELS "CUDA")
+ APPEND PROPERTY LABELS "CUDA" "HIP" "Fortran")
set_property(TEST RunCMake.CheckSourceCompiles
RunCMake.CheckCompilerFlag
APPEND PROPERTY LABELS "ISPC")
-set_property(TEST RunCMake.CheckCompilerFlag
- RunCMake.CheckSourceCompiles
- RunCMake.CheckSourceRuns
- APPEND PROPERTY LABELS "HIP")
add_RunCMake_test(CheckModules)
add_RunCMake_test(CheckIPOSupported)
if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin)"
@@ -820,8 +884,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin)"
-DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID}
-DCMake_TEST_CUDA=${CMake_TEST_CUDA}
-DCMake_TEST_HIP=${CMake_TEST_HIP})
- set_property(TEST RunCMake.CheckLinkerFlag APPEND PROPERTY LABELS "CUDA")
- set_property(TEST RunCMake.CheckLinkerFlag APPEND PROPERTY LABELS "HIP")
+ set_property(TEST RunCMake.CheckLinkerFlag APPEND PROPERTY LABELS "CUDA" "HIP" "Fortran")
endif()
@@ -868,6 +931,9 @@ if(CMake_TEST_RunCMake_ExternalProject_DOWNLOAD_SERVER_TIMEOUT)
list(APPEND ExternalProject_ARGS -DDOWNLOAD_SERVER_TIMEOUT=${CMake_TEST_RunCMake_ExternalProject_DOWNLOAD_SERVER_TIMEOUT})
endif()
add_RunCMake_test(ExternalProject -DDETECT_JOBSERVER=$<TARGET_FILE:detect_jobserver>)
+if(CMake_TEST_RunCMake_ExternalProject_RUN_SERIAL)
+ set_property(TEST RunCMake.ExternalProject PROPERTY RUN_SERIAL TRUE)
+endif()
add_RunCMake_test(FetchContent)
add_RunCMake_test(FetchContent_find_package)
set(CTestCommandLine_ARGS -DPython_EXECUTABLE=${Python_EXECUTABLE})
@@ -936,6 +1002,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
-DPSEUDO_CPPLINT=$<TARGET_FILE:pseudo_cpplint>
-DPSEUDO_CPPCHECK=$<TARGET_FILE:pseudo_cppcheck>
)
+
if(DEFINED CMake_TEST_CUDA)
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
endif()
@@ -954,13 +1021,15 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
endif()
add_RunCMake_test(CompilerLauncher)
set_property(TEST RunCMake.CompilerLauncher APPEND
- PROPERTY LABELS "CUDA;HIP;ISPC")
+ PROPERTY LABELS "CUDA" "HIP" "ISPC" "Fortran")
+
add_RunCMake_test(ctest_labels_for_subprojects)
add_RunCMake_test(CompilerArgs)
add_RunCMake_test(LinkerLauncher)
endif()
set(cpack_tests
+ DEB.AUTO_SUFFIXES
DEB.CUSTOM_NAMES
DEB.DEBUGINFO
DEB.DEFAULT_PERMISSIONS
@@ -979,6 +1048,7 @@ set(cpack_tests
DEB.DEB_DESCRIPTION
DEB.PROJECT_META
+ RPM.AUTO_SUFFIXES
RPM.CUSTOM_BINARY_SPEC_FILE
RPM.CUSTOM_NAMES
RPM.DEBUGINFO
@@ -1012,7 +1082,55 @@ set(cpack_tests
if(APPLE)
list(APPEND cpack_tests DragNDrop)
endif()
+
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "e2k" AND NOT DEFINED CMake_TEST_E2K_BROKEN_LIBC)
+ # Exclude tests that fail due to a broken libc version on Elbrus.
+ find_program(DPKG_QUERY "dpkg-query" )
+ execute_process(COMMAND "${DPKG_QUERY}" "-f" "\${Version}" "-W" "glibc" OUTPUT_VARIABLE LIBC_VERSION)
+ if(LIBC_VERSION MATCHES "2.29-25.*")
+ list(REMOVE_ITEM cpack_tests
+ DEB.DEFAULT_PERMISSIONS
+ DEB.DEBUGINFO
+ DEB.MINIMAL
+ DEB.PER_COMPONENT_FIELDS
+ DEB.AUTO_SUFFIXES
+ DEB.CUSTOM_NAMES
+ DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY
+ DEB.PROJECT_META DEB.DEPENDENCIES
+ DEB.EXTRA
+ DEB.GENERATE_SHLIBS_LDCONFIG
+ DEB.LONG_FILENAMES
+ DEB.MD5SUMS
+ DEB.EMPTY_DIR
+ DEB.DEFAULT_PERMISSIONS
+ DEB.VERSION
+ DEB.TIMESTAMPS
+ RPM.PARTIALLY_RELOCATABLE_WARNING
+ RPM.PER_COMPONENT_FIELDS
+ RPM.USER_FILELIST
+ RPM.DIST
+ RPM.AUTO_SUFFIXES
+ 7Z
+ TXZ
+ TBZ2
+ TGZ
+ ZIP
+ STGZ
+ External
+ )
+ set(CMake_TEST_E2K_BROKEN_LIBC 1)
+ endif()
+endif()
+
add_RunCMake_test_group(CPack "${cpack_tests}")
+
+if(CMake_TEST_CPACK_WIX3 OR CMake_TEST_CPACK_WIX4)
+ add_RunCMake_test(CPack_WIX
+ -DCMake_TEST_CPACK_WIX3=${CMake_TEST_CPACK_WIX3}
+ -DCMake_TEST_CPACK_WIX4=${CMake_TEST_CPACK_WIX4}
+ )
+endif()
+
# add a test to make sure symbols are exported from a shared library
# for MSVC compilers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS property is used
add_RunCMake_test(AutoExportDll
@@ -1056,24 +1174,26 @@ add_RunCMake_test(PrecompileHeaders -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
-DCMAKE_C_SIMULATE_ID=${CMAKE_C_SIMULATE_ID}
-DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION})
-add_RunCMake_test("UnityBuild")
+add_RunCMake_test(UnityBuild -DCMake_TEST_OBJC=${CMake_TEST_OBJC})
add_RunCMake_test(CMakePresets
-DPython_EXECUTABLE=${Python_EXECUTABLE}
-DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}
)
-add_RunCMake_test(CMakePresetsBuild
- -DPython_EXECUTABLE=${Python_EXECUTABLE}
- -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}
- -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
- )
-add_RunCMake_test(CMakePresetsTest
- -DPython_EXECUTABLE=${Python_EXECUTABLE}
- -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}
- )
-add_RunCMake_test(CMakePresetsPackage
- -DPython_EXECUTABLE=${Python_EXECUTABLE}
- -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}
- )
+if(NOT CMake_TEST_E2K_BROKEN_LIBC)
+ add_RunCMake_test(CMakePresetsBuild
+ -DPython_EXECUTABLE=${Python_EXECUTABLE}
+ -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ )
+ add_RunCMake_test(CMakePresetsTest
+ -DPython_EXECUTABLE=${Python_EXECUTABLE}
+ -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}
+ )
+ add_RunCMake_test(CMakePresetsPackage
+ -DPython_EXECUTABLE=${Python_EXECUTABLE}
+ -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}
+ )
+endif()
add_RunCMake_test(CMakePresetsWorkflow
-DPython_EXECUTABLE=${Python_EXECUTABLE}
-DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}
@@ -1089,3 +1209,14 @@ endif()
if(WIN32)
add_RunCMake_test(Win32GenEx)
endif()
+
+if(CMake_TEST_IAR_TOOLCHAINS)
+ add_RunCMake_test(IAR -DCMake_TEST_IAR_TOOLCHAINS=${CMake_TEST_IAR_TOOLCHAINS})
+ set_property(TEST RunCMake.IAR APPEND PROPERTY LABELS "IAR")
+endif()
+if(CMake_TEST_TICLANG_TOOLCHAINS)
+ # This is necessary to preserve the LIST variable contents given by user.
+ string(REPLACE ";" "$<SEMICOLON>" TOOLCHAINS "${CMake_TEST_TICLANG_TOOLCHAINS}")
+ add_RunCMake_test(TIClang "-DCMake_TEST_TICLANG_TOOLCHAINS=${TOOLCHAINS}")
+ set_property(TEST RunCMake.TIClang APPEND PROPERTY LABELS "TIClang")
+endif()
diff --git a/Tests/RunCMake/CMakePackage/ApplePlatformGenSubdir-stdout.txt b/Tests/RunCMake/CMakePackage/ApplePlatformGenSubdir-stdout.txt
new file mode 100644
index 0000000..8821dad
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/ApplePlatformGenSubdir-stdout.txt
@@ -0,0 +1,3 @@
+(-- )?Hello from platform switch
+(-- )?Hello from arch switch
+(-- )?Hello from pkg_a
diff --git a/Tests/RunCMake/CMakePackage/ApplePlatformGenSubdir.cmake b/Tests/RunCMake/CMakePackage/ApplePlatformGenSubdir.cmake
new file mode 100644
index 0000000..e472665
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/ApplePlatformGenSubdir.cmake
@@ -0,0 +1,50 @@
+set(CMAKE_INSTALL_DATADIR share)
+set(SWITCH_DIR platform/cmake)
+
+include(CMakePackageConfigHelpers)
+
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pkg_a-config.cmake.in [[
+@PACKAGE_INIT@
+include("@PACKAGE_SWITCH_DIR@/platform-switch.cmake")
+include("@PACKAGE_CMAKE_INSTALL_DATADIR@/pkg_a_included.cmake")
+]])
+configure_package_config_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/pkg_a-config.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/install/pkg_a-config.cmake
+ INSTALL_DESTINATION .
+ PATH_VARS CMAKE_INSTALL_DATADIR SWITCH_DIR
+)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/install/${CMAKE_INSTALL_DATADIR}/pkg_a_included.cmake
+ [[message(STATUS "Hello from pkg_a")]]
+)
+
+# To expose re-using the same package prefix variable, we need to use a
+# different install prefix. This is really contrived and not representative of
+# what a package should do.
+generate_apple_platform_selection_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/install/platform/cmake/platform-switch.cmake
+ INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/platform
+ INSTALL_DESTINATION cmake
+ MACOS_INCLUDE_FILE cmake/switch_included.cmake # relative to install prefix
+)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/install/platform/cmake/switch_included.cmake
+[[
+message(STATUS "Hello from platform switch")
+include("${CMAKE_CURRENT_LIST_DIR}/../arch/cmake/arch-switch.cmake")
+]]
+)
+
+generate_apple_architecture_selection_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/install/platform/arch/cmake/arch-switch.cmake
+ INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/platform/arch
+ INSTALL_DESTINATION cmake
+ UNIVERSAL_ARCHITECTURES i386 x86_64 arm64 $(ARCHS_STANDARD)
+ UNIVERSAL_INCLUDE_FILE cmake/switch_included.cmake # relative to install prefix
+)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/install/platform/arch/cmake/switch_included.cmake
+ [[message(STATUS "Hello from arch switch")]]
+)
+
+find_package(pkg_a REQUIRED NO_DEFAULT_PATH
+ PATHS ${CMAKE_CURRENT_BINARY_DIR}/install
+)
diff --git a/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-result.txt b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-stderr.txt b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-stderr.txt
new file mode 100644
index 0000000..03be015
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at [^
+]*/Modules/CMakePackageConfigHelpers\.cmake:[0-9]+ \(message\):
+ No INSTALL_DESTINATION given to generate_apple_platform_selection_file\(\)
+Call Stack \(most recent call first\):
+ ApplePlatformMissingDest\.cmake:[0-9]+ \(generate_apple_platform_selection_file\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest.cmake b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest.cmake
new file mode 100644
index 0000000..e47b595
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest.cmake
@@ -0,0 +1,4 @@
+include(CMakePackageConfigHelpers)
+generate_apple_platform_selection_file(mylib-config-install.cmake
+ #missing: INSTALL_DESTINATION lib/cmake/mylib
+ )
diff --git a/Tests/RunCMake/CMakePackage/CMakeLists.txt b/Tests/RunCMake/CMakePackage/CMakeLists.txt
new file mode 100644
index 0000000..6a9ce76
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMakePackage/NestedConfigFile-stdout.txt b/Tests/RunCMake/CMakePackage/NestedConfigFile-stdout.txt
new file mode 100644
index 0000000..cdb3384
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/NestedConfigFile-stdout.txt
@@ -0,0 +1,6 @@
+(-- )?Before find_dependency: PACKAGE_PREFIX_DIR = .*/Tests/RunCMake/CMakePackage/NestedConfigFile-build/install_pkg_b
+(-- )?Hello from pkg_a
+(-- )?Leaving pkg_a-config\.cmake with PACKAGE_PREFIX_DIR = .*/Tests/RunCMake/CMakePackage/NestedConfigFile-build/install_pkg_a
+(-- )?After find_dependency: PACKAGE_PREFIX_DIR = .*/Tests/RunCMake/CMakePackage/NestedConfigFile-build/install_pkg_b
+(-- )?Hello from pkg_b
+(-- )?Leaving pkg_b-config\.cmake with PACKAGE_PREFIX_DIR = .*/Tests/RunCMake/CMakePackage/NestedConfigFile-build/install_pkg_b
diff --git a/Tests/RunCMake/CMakePackage/NestedConfigFile.cmake b/Tests/RunCMake/CMakePackage/NestedConfigFile.cmake
new file mode 100644
index 0000000..2eeaebb
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/NestedConfigFile.cmake
@@ -0,0 +1,43 @@
+set(CMAKE_INSTALL_DATADIR share)
+
+include(CMakePackageConfigHelpers)
+
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pkg_a-config.cmake.in [[
+@PACKAGE_INIT@
+include("@PACKAGE_CMAKE_INSTALL_DATADIR@/pkg_a_included.cmake")
+message(STATUS "Leaving pkg_a-config.cmake with PACKAGE_PREFIX_DIR = ${PACKAGE_PREFIX_DIR}")
+]])
+configure_package_config_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/pkg_a-config.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/install_pkg_a/pkg_a-config.cmake
+ INSTALL_DESTINATION .
+ PATH_VARS CMAKE_INSTALL_DATADIR
+)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/install_pkg_a/share/pkg_a_included.cmake
+ [[message(STATUS "Hello from pkg_a")]]
+)
+
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pkg_b-config.cmake.in [[
+@PACKAGE_INIT@
+include(CMakeFindDependencyMacro)
+message(STATUS "Before find_dependency: PACKAGE_PREFIX_DIR = ${PACKAGE_PREFIX_DIR}")
+find_dependency(pkg_a NO_DEFAULT_PATH
+ PATHS "@CMAKE_CURRENT_BINARY_DIR@/install_pkg_a"
+)
+message(STATUS "After find_dependency: PACKAGE_PREFIX_DIR = ${PACKAGE_PREFIX_DIR}")
+include("@PACKAGE_CMAKE_INSTALL_DATADIR@/pkg_b_included.cmake")
+message(STATUS "Leaving pkg_b-config.cmake with PACKAGE_PREFIX_DIR = ${PACKAGE_PREFIX_DIR}")
+]])
+configure_package_config_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/pkg_b-config.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/install_pkg_b/pkg_b-config.cmake
+ INSTALL_DESTINATION .
+ PATH_VARS CMAKE_INSTALL_DATADIR
+)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/install_pkg_b/share/pkg_b_included.cmake
+ [[message(STATUS "Hello from pkg_b")]]
+)
+
+find_package(pkg_b REQUIRED NO_DEFAULT_PATH
+ PATHS ${CMAKE_CURRENT_BINARY_DIR}/install_pkg_b
+)
diff --git a/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake b/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake
new file mode 100644
index 0000000..c4a05e3
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake
@@ -0,0 +1,138 @@
+include(RunCMake)
+
+if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(maybe_CMAKE_BUILD_TYPE -DCMAKE_BUILD_TYPE=Release)
+endif()
+
+run_cmake_with_options(NestedConfigFile ${maybe_CMAKE_BUILD_TYPE})
+
+function(apple_export platform system_name archs sysroot)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/apple-export-${platform}-build)
+ string(REPLACE ";" "\\;" archs "${archs}")
+ if(select_archs)
+ string(REPLACE ";" "\\\\;" maybe_IOS_SIMULATOR_SELECT_ARCHS "-DIOS_SIMULATOR_SELECT_ARCHS=${select_archs}")
+ endif()
+ run_cmake_with_options(apple-export-${platform}
+ "-DCMAKE_SYSTEM_NAME=${system_name}"
+ "-DCMAKE_OSX_ARCHITECTURES=${archs}"
+ "-DCMAKE_OSX_SYSROOT=${sysroot}"
+ "-DCMAKE_INSTALL_PREFIX=${apple_install}"
+ ${maybe_CMAKE_BUILD_TYPE}
+ ${maybe_IOS_SIMULATOR_SELECT_ARCHS}
+ )
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(apple-export-${platform}-build ${CMAKE_COMMAND} --build . --config Release)
+ run_cmake_command(apple-export-${platform}-install ${CMAKE_COMMAND} --install . --config Release)
+ file(APPEND "${apple_install}/lib/${platform}/cmake/mylib/mylib-targets.cmake" "\n"
+ "message(STATUS \"loaded: '\${CMAKE_CURRENT_LIST_FILE}'\")\n"
+ )
+endfunction()
+
+function(apple_import platform system_name archs sysroot)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/apple-import-${platform}-build)
+ string(REPLACE ";" "\\;" archs "${archs}")
+ run_cmake_with_options(apple-import-${platform}
+ "-DCMAKE_SYSTEM_NAME=${system_name}"
+ "-DCMAKE_OSX_ARCHITECTURES=${archs}"
+ "-DCMAKE_OSX_SYSROOT=${sysroot}"
+ "-DCMAKE_PREFIX_PATH=${apple_install}"
+ ${maybe_CMAKE_BUILD_TYPE}
+ )
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(apple_import_no_build)
+ return()
+ endif()
+ run_cmake_command(apple-import-${platform}-build ${CMAKE_COMMAND} --build . --config Release)
+endfunction()
+
+if(APPLE)
+ run_cmake(ApplePlatformMissingDest)
+endif()
+
+if(APPLE AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 12)
+ set(macos_archs "x86_64;arm64")
+ set(tvos_sim_archs "x86_64;arm64")
+ set(watch_sim_archs "x86_64")
+ set(select_archs "arm64;x86_64")
+ elseif(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 10)
+ set(macos_archs "x86_64")
+ set(tvos_sim_archs "x86_64")
+ set(watch_sim_archs "i386")
+ set(select_archs "")
+ else()
+ set(macos_archs "i386;x86_64")
+ set(tvos_sim_archs "x86_64")
+ set(watch_sim_archs "i386")
+ set(select_archs "")
+ endif()
+
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 9)
+ set(watch_archs "armv7k;arm64_32")
+ else()
+ set(watch_archs "armv7k")
+ endif()
+
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15.2)
+ set(enable_visionos 1)
+ endif()
+
+ string(REPLACE ";" "\\;" macos_archs_for_cmd "${macos_archs}")
+ run_cmake_with_options(ApplePlatformGenSubdir
+ "-DCMAKE_OSX_ARCHITECTURES=${macos_archs_for_cmd}"
+ ${maybe_CMAKE_BUILD_TYPE}
+ )
+ unset(macos_archs_for_cmd)
+
+ # Place all export/import steps in a single install prefix.
+ set(apple_install ${RunCMake_BINARY_DIR}/apple-install)
+ file(REMOVE_RECURSE "${apple_install}")
+
+ apple_export(macos Darwin "${macos_archs}" macosx)
+ apple_export(ios iOS "arm64" iphoneos)
+ apple_export(tvos tvOS "arm64" appletvos)
+ if(enable_visionos)
+ apple_export(visionos visionOS "arm64" xros)
+ endif()
+ apple_export(watchos watchOS "${watch_archs}" watchos)
+ apple_export(ios-simulator iOS "${macos_archs}" iphonesimulator)
+ if(select_archs)
+ foreach(arch IN LISTS macos_archs)
+ apple_export(ios-simulator-${arch} iOS "${arch}" iphonesimulator)
+ endforeach()
+ endif()
+ apple_export(tvos-simulator tvOS "${tvos_sim_archs}" appletvsimulator)
+ if(enable_visionos)
+ apple_export(visionos-simulator visionOS "${macos_archs}" xrsimulator)
+ endif()
+ apple_export(watchos-simulator watchOS "${watch_sim_archs}" watchsimulator)
+ apple_export(unsupported-capture Darwin "${macos_archs}" macosx)
+ apple_export(unsupported-fatal Darwin "${macos_archs}" macosx)
+
+ apple_import(macos Darwin "${macos_archs}" macosx)
+ apple_import(ios iOS "arm64" iphoneos)
+ apple_import(tvos tvOS "arm64" appletvos)
+ if(enable_visionos)
+ apple_import(visionos visionOS "arm64" xros)
+ endif()
+ apple_import(watchos watchOS "${watch_archs}" watchos)
+ apple_import(ios-simulator iOS "${macos_archs}" iphonesimulator)
+ if(RunCMake_GENERATOR STREQUAL "Xcode")
+ apple_import(ios-simulator-xcode iOS "$(ARCHS_STANDARD)" iphonesimulator)
+ endif()
+ if(select_archs)
+ foreach(arch IN LISTS macos_archs)
+ apple_import(ios-simulator-${arch} iOS "${arch}" iphonesimulator)
+ endforeach()
+ endif()
+ apple_import(tvos-simulator tvOS "${tvos_sim_archs}" appletvsimulator)
+ if(enable_visionos)
+ apple_import(visionos-simulator visionOS "${macos_archs}" xrsimulator)
+ endif()
+ apple_import(watchos-simulator watchOS "${watch_sim_archs}" watchsimulator)
+ set(apple_import_no_build 1)
+ apple_import(unsupported-capture Darwin "${macos_archs}" macosx)
+ apple_import(unsupported-fatal-platform Darwin "${macos_archs}" macosx)
+ apple_import(unsupported-fatal-architecture Darwin "${macos_archs}" macosx)
+ unset(apple_import_no_build)
+endif()
diff --git a/Tests/RunCMake/CMakePackage/apple-common.cmake b/Tests/RunCMake/CMakePackage/apple-common.cmake
new file mode 100644
index 0000000..f854f34
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-common.cmake
@@ -0,0 +1,15 @@
+enable_language(C)
+
+if(CMAKE_SYSTEM_NAME MATCHES "^(iOS)$")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
+ set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
+endif()
+
+if(CMAKE_SYSTEM_NAME MATCHES "^(tvOS|watchOS|visionOS)$")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
+ set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
+endif()
diff --git a/Tests/RunCMake/CMakePackage/apple-export-common.cmake b/Tests/RunCMake/CMakePackage/apple-export-common.cmake
new file mode 100644
index 0000000..2c79b7b
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-common.cmake
@@ -0,0 +1,29 @@
+include(apple-common.cmake)
+
+add_library(mylib STATIC src/mylib.c)
+target_sources(mylib PUBLIC FILE_SET HEADERS BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include FILES include/mylib.h)
+install(TARGETS mylib EXPORT mylib-targets FILE_SET HEADERS ARCHIVE DESTINATION lib/${platform_name})
+
+install(EXPORT mylib-targets DESTINATION lib/${platform_name}/cmake/mylib)
+
+if(IOS_SIMULATOR_SELECT_ARCHS)
+ set(IOS_SIMULATOR_INCLUDE_FILE lib/ios-simulator/cmake/mylib/mylib-select-arch.cmake)
+else()
+ set(IOS_SIMULATOR_INCLUDE_FILE lib/ios-simulator/cmake/mylib/mylib-targets.cmake)
+endif()
+
+include(CMakePackageConfigHelpers)
+generate_apple_platform_selection_file(mylib-config-install.cmake
+ INSTALL_DESTINATION lib/cmake/mylib
+ INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
+ MACOS_INCLUDE_FILE lib/macos/cmake/mylib/mylib-targets.cmake
+ IOS_INCLUDE_FILE lib/ios/cmake/mylib/mylib-targets.cmake
+ IOS_SIMULATOR_INCLUDE_FILE ${IOS_SIMULATOR_INCLUDE_FILE}
+ TVOS_INCLUDE_FILE lib/tvos/cmake/mylib/mylib-targets.cmake
+ TVOS_SIMULATOR_INCLUDE_FILE lib/tvos-simulator/cmake/mylib/mylib-targets.cmake
+ VISIONOS_INCLUDE_FILE lib/visionos/cmake/mylib/mylib-targets.cmake
+ VISIONOS_SIMULATOR_INCLUDE_FILE lib/visionos-simulator/cmake/mylib/mylib-targets.cmake
+ WATCHOS_INCLUDE_FILE lib/watchos/cmake/mylib/mylib-targets.cmake
+ WATCHOS_SIMULATOR_INCLUDE_FILE lib/watchos-simulator/cmake/mylib/mylib-targets.cmake
+ )
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mylib-config-install.cmake DESTINATION lib/cmake/mylib RENAME mylib-config.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-arm64.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-arm64.cmake
new file mode 100644
index 0000000..6984df2
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-arm64.cmake
@@ -0,0 +1,2 @@
+set(platform_name ios-simulator-arm64)
+include(apple-export-ios-simulator-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake
new file mode 100644
index 0000000..c935c3a
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake
@@ -0,0 +1,16 @@
+include(apple-export-common.cmake)
+
+if(IOS_SIMULATOR_SELECT_ARCHS)
+ set(IOS_SIMULATOR_SELECT_FILES "${IOS_SIMULATOR_SELECT_ARCHS}")
+ list(TRANSFORM IOS_SIMULATOR_SELECT_FILES PREPEND "lib/ios-simulator-")
+ list(TRANSFORM IOS_SIMULATOR_SELECT_FILES APPEND "/cmake/mylib/mylib-targets.cmake")
+ generate_apple_architecture_selection_file(mylib-select-arch-install.cmake
+ INSTALL_DESTINATION lib/ios-simulator/cmake/mylib
+ INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
+ SINGLE_ARCHITECTURES ${IOS_SIMULATOR_SELECT_ARCHS}
+ SINGLE_ARCHITECTURE_INCLUDE_FILES ${IOS_SIMULATOR_SELECT_FILES}
+ UNIVERSAL_ARCHITECTURES ${IOS_SIMULATOR_SELECT_ARCHS} $(ARCHS_STANDARD)
+ UNIVERSAL_INCLUDE_FILE "lib/ios-simulator/cmake/mylib/mylib-targets.cmake"
+ )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mylib-select-arch-install.cmake DESTINATION lib/ios-simulator/cmake/mylib RENAME mylib-select-arch.cmake)
+endif()
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-x86_64.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-x86_64.cmake
new file mode 100644
index 0000000..290cfa7
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-x86_64.cmake
@@ -0,0 +1,2 @@
+set(platform_name ios-simulator-x86_64)
+include(apple-export-ios-simulator-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator.cmake
new file mode 100644
index 0000000..bc3deb3
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator.cmake
@@ -0,0 +1,2 @@
+set(platform_name ios-simulator)
+include(apple-export-ios-simulator-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios.cmake
new file mode 100644
index 0000000..33daa40
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios.cmake
@@ -0,0 +1,2 @@
+set(platform_name ios)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-macos.cmake b/Tests/RunCMake/CMakePackage/apple-export-macos.cmake
new file mode 100644
index 0000000..d845d5c
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-macos.cmake
@@ -0,0 +1,2 @@
+set(platform_name macos)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-tvos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-export-tvos-simulator.cmake
new file mode 100644
index 0000000..d44d663
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-tvos-simulator.cmake
@@ -0,0 +1,2 @@
+set(platform_name tvos-simulator)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-tvos.cmake b/Tests/RunCMake/CMakePackage/apple-export-tvos.cmake
new file mode 100644
index 0000000..c58144b
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-tvos.cmake
@@ -0,0 +1,2 @@
+set(platform_name tvos)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-unsupported-capture.cmake b/Tests/RunCMake/CMakePackage/apple-export-unsupported-capture.cmake
new file mode 100644
index 0000000..e712bb2
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-unsupported-capture.cmake
@@ -0,0 +1,16 @@
+include(apple-common.cmake)
+
+include(CMakePackageConfigHelpers)
+generate_apple_platform_selection_file(bad-platform-capture-config-install.cmake
+ INSTALL_DESTINATION lib/cmake/bad-platform-capture
+ INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
+ ERROR_VARIABLE bad-platform-capture_unsupported
+ )
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bad-platform-capture-config-install.cmake DESTINATION lib/cmake/bad-platform-capture RENAME bad-platform-capture-config.cmake)
+
+generate_apple_architecture_selection_file(bad-arch-capture-config-install.cmake
+ INSTALL_DESTINATION lib/cmake/bad-arch-capture
+ INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
+ ERROR_VARIABLE bad-arch-capture_unsupported
+ )
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bad-arch-capture-config-install.cmake DESTINATION lib/cmake/bad-arch-capture RENAME bad-arch-capture-config.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-unsupported-fatal.cmake b/Tests/RunCMake/CMakePackage/apple-export-unsupported-fatal.cmake
new file mode 100644
index 0000000..f2c5802
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-unsupported-fatal.cmake
@@ -0,0 +1,14 @@
+include(apple-common.cmake)
+
+include(CMakePackageConfigHelpers)
+generate_apple_platform_selection_file(bad-platform-fatal-config-install.cmake
+ INSTALL_DESTINATION lib/cmake/bad-platform-fatal
+ INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
+ )
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bad-platform-fatal-config-install.cmake DESTINATION lib/cmake/bad-platform-fatal RENAME bad-platform-fatal-config.cmake)
+
+generate_apple_architecture_selection_file(bad-arch-fatal-config-install.cmake
+ INSTALL_DESTINATION lib/cmake/bad-arch-fatal
+ INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
+ )
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bad-arch-fatal-config-install.cmake DESTINATION lib/cmake/bad-arch-fatal RENAME bad-arch-fatal-config.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-visionos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-export-visionos-simulator.cmake
new file mode 100644
index 0000000..e783d80
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-visionos-simulator.cmake
@@ -0,0 +1,2 @@
+set(platform_name visionos-simulator)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-visionos.cmake b/Tests/RunCMake/CMakePackage/apple-export-visionos.cmake
new file mode 100644
index 0000000..73e1b2e
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-visionos.cmake
@@ -0,0 +1,2 @@
+set(platform_name visionos)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-watchos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-export-watchos-simulator.cmake
new file mode 100644
index 0000000..f4f95a6
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-watchos-simulator.cmake
@@ -0,0 +1,2 @@
+set(platform_name watchos-simulator)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-watchos.cmake b/Tests/RunCMake/CMakePackage/apple-export-watchos.cmake
new file mode 100644
index 0000000..59fc572
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-watchos.cmake
@@ -0,0 +1,2 @@
+set(platform_name watchos)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-common.cmake b/Tests/RunCMake/CMakePackage/apple-import-common.cmake
new file mode 100644
index 0000000..ce79541
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-common.cmake
@@ -0,0 +1,7 @@
+include(apple-common.cmake)
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
+find_package(mylib CONFIG REQUIRED)
+
+add_executable(myexe src/myexe.c)
+target_link_libraries(myexe PRIVATE mylib)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64-stdout.txt
new file mode 100644
index 0000000..7999474
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/ios-simulator-arm64/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64.cmake b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-stdout.txt
new file mode 100644
index 0000000..4ca925d
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/ios-simulator/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64-stdout.txt
new file mode 100644
index 0000000..ec52735
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/ios-simulator-x86_64/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64.cmake b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode-stdout.txt
new file mode 100644
index 0000000..4ca925d
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/ios-simulator/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode.cmake b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode.cmake
new file mode 100644
index 0000000..90624a0
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode.cmake
@@ -0,0 +1 @@
+include(apple-import-ios-simulator.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-ios-stdout.txt
new file mode 100644
index 0000000..eabb96a
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/ios/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios.cmake b/Tests/RunCMake/CMakePackage/apple-import-ios.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-macos-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-macos-stdout.txt
new file mode 100644
index 0000000..2c3d87d
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-macos-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/macos/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-macos.cmake b/Tests/RunCMake/CMakePackage/apple-import-macos.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-macos.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator-stdout.txt
new file mode 100644
index 0000000..544f90f
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/tvos-simulator/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-tvos-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-tvos-stdout.txt
new file mode 100644
index 0000000..eccad6a
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-tvos-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/tvos/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-tvos.cmake b/Tests/RunCMake/CMakePackage/apple-import-tvos.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-tvos.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-unsupported-capture-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-unsupported-capture-stdout.txt
new file mode 100644
index 0000000..107ad03
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-unsupported-capture-stdout.txt
@@ -0,0 +1,2 @@
+-- Platform not supported
+-- Architecture not supported
diff --git a/Tests/RunCMake/CMakePackage/apple-import-unsupported-capture.cmake b/Tests/RunCMake/CMakePackage/apple-import-unsupported-capture.cmake
new file mode 100644
index 0000000..6df5fe9
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-unsupported-capture.cmake
@@ -0,0 +1,11 @@
+include(apple-common.cmake)
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
+find_package(bad-platform-capture CONFIG REQUIRED)
+find_package(bad-arch-capture CONFIG REQUIRED)
+
+# The above packages capture their own error messages.
+# In real packages they would then set _FOUND to false.
+# For testing here, just print the messages.
+message(STATUS "${bad-platform-capture_unsupported}")
+message(STATUS "${bad-arch-capture_unsupported}")
diff --git a/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture-result.txt b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture-stderr.txt b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture-stderr.txt
new file mode 100644
index 0000000..1e84dac
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at [^
+]*/Tests/RunCMake/CMakePackage/apple-install/lib/cmake/bad-arch-fatal/bad-arch-fatal-config.cmake:[0-9]+ \(message\):
+ Architecture not supported
+Call Stack \(most recent call first\):
+ apple-import-unsupported-fatal-architecture\.cmake:[0-9]+ \(find_package\)
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture.cmake b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture.cmake
new file mode 100644
index 0000000..7a26e47
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-architecture.cmake
@@ -0,0 +1,4 @@
+include(apple-common.cmake)
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
+find_package(bad-arch-fatal CONFIG REQUIRED)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform-result.txt b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform-stderr.txt b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform-stderr.txt
new file mode 100644
index 0000000..1eedad8
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at [^
+]*/Tests/RunCMake/CMakePackage/apple-install/lib/cmake/bad-platform-fatal/bad-platform-fatal-config.cmake:[0-9]+ \(message\):
+ Platform not supported
+Call Stack \(most recent call first\):
+ apple-import-unsupported-fatal-platform\.cmake:[0-9]+ \(find_package\)
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform.cmake b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform.cmake
new file mode 100644
index 0000000..b38cd5c
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-unsupported-fatal-platform.cmake
@@ -0,0 +1,4 @@
+include(apple-common.cmake)
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
+find_package(bad-platform-fatal CONFIG REQUIRED)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator-stdout.txt
new file mode 100644
index 0000000..c4cc068
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/visionos-simulator/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-visionos-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-visionos-stdout.txt
new file mode 100644
index 0000000..410eda2
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-visionos-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/visionos/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-visionos.cmake b/Tests/RunCMake/CMakePackage/apple-import-visionos.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-visionos.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator-stdout.txt
new file mode 100644
index 0000000..752e2be
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/watchos-simulator/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-watchos-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-watchos-stdout.txt
new file mode 100644
index 0000000..5654fe8
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-watchos-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/watchos/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-watchos.cmake b/Tests/RunCMake/CMakePackage/apple-import-watchos.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-watchos.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/include/mylib.h b/Tests/RunCMake/CMakePackage/include/mylib.h
new file mode 100644
index 0000000..4955e74
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/include/mylib.h
@@ -0,0 +1,3 @@
+#pragma once
+
+extern int mylib(void);
diff --git a/Tests/RunCMake/CMakePackage/src/myexe.c b/Tests/RunCMake/CMakePackage/src/myexe.c
new file mode 100644
index 0000000..c1182a2
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/src/myexe.c
@@ -0,0 +1,6 @@
+#include <mylib.h> /* include by angle-bracket to find installed copy */
+
+int main(void)
+{
+ return mylib();
+}
diff --git a/Tests/RunCMake/CMakePackage/src/mylib.c b/Tests/RunCMake/CMakePackage/src/mylib.c
new file mode 100644
index 0000000..f4c047e
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/src/mylib.c
@@ -0,0 +1,4 @@
+int mylib(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/CMakePresets/IncludeExpansionOtherMacros-stdout.txt b/Tests/RunCMake/CMakePresets/IncludeExpansionOtherMacros-stdout.txt
new file mode 100644
index 0000000..d3f1afc
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/IncludeExpansionOtherMacros-stdout.txt
@@ -0,0 +1,5 @@
+^Not searching for unused variables given on the command line\.
+Available configure presets:
+
+ "Include"
+ "IncludeCommon"$
diff --git a/Tests/RunCMake/CMakePresets/IncludeExpansionOtherMacros.json.in b/Tests/RunCMake/CMakePresets/IncludeExpansionOtherMacros.json.in
new file mode 100644
index 0000000..c5693b5
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/IncludeExpansionOtherMacros.json.in
@@ -0,0 +1,10 @@
+{
+ "version": 9,
+ "include": ["${sourceDir}/IncludeCommon.json"],
+ "configurePresets": [
+ {
+ "name": "Include",
+ "inherits": ["IncludeCommon"]
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
index 88027fb..42a4ed9 100644
--- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
@@ -407,6 +407,7 @@ set(CMakePresets_EXTRA_FILES
set(ENV{TEST_ENV_INCLUDE_DIR} ${RunCMake_BINARY_DIR}/IncludeExpansion)
run_cmake_presets(IncludeExpansion --list-presets)
unset(ENV{TEST_ENV_INCLUDE_DIR})
+run_cmake_presets(IncludeExpansionOtherMacros --list-presets)
unset(CMakePresets_EXTRA_FILES)
run_cmake_presets(IncludeNotFound)
run_cmake_presets(IncludeCycle)
diff --git a/Tests/RunCMake/CPack/External/Prerequirements.cmake b/Tests/RunCMake/CPack/External/Prerequirements.cmake
index e69de29..dbaf682 100644
--- a/Tests/RunCMake/CPack/External/Prerequirements.cmake
+++ b/Tests/RunCMake/CPack/External/Prerequirements.cmake
@@ -0,0 +1,4 @@
+function(get_test_prerequirements found_var config_file)
+ file(WRITE "${config_file}" "")
+ set(${found_var} true PARENT_SCOPE)
+endfunction()
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index ca02b76..258f6a6 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -9,6 +9,7 @@ find_program(DEBUGEDIT debugedit)
# run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES"
run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM.CUSTOM_BINARY_SPEC_FILE" false "MONOLITHIC;COMPONENT")
run_cpack_test(CUSTOM_NAMES "RPM.CUSTOM_NAMES;DEB.CUSTOM_NAMES;TGZ;DragNDrop" true "COMPONENT")
+run_cpack_test(AUTO_SUFFIXES "RPM.AUTO_SUFFIXES;DEB.AUTO_SUFFIXES" false "MONOLITHIC")
run_cpack_test(DEBUGINFO "DEB.DEBUGINFO" true "COMPONENT")
if(NOT "${DEBUGEDIT}" STREQUAL "DEBUGEDIT-NOTFOUND")
run_cpack_test(DEBUGINFO "RPM.DEBUGINFO" true "COMPONENT")
@@ -69,3 +70,4 @@ run_cpack_test_subtests(
)
run_cpack_test(PROJECT_META "RPM.PROJECT_META;DEB.PROJECT_META" false "MONOLITHIC;COMPONENT")
run_cpack_test_package_target(PRE_POST_SCRIPTS "ZIP" false "MONOLITHIC;COMPONENT")
+run_cpack_test_subtests(DUPLICATE_FILE "success;conflict_file;conflict_symlink" "TGZ" false "COMPONENT;GROUP")
diff --git a/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake
new file mode 100644
index 0000000..1ca48d8
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake
@@ -0,0 +1,8 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE)
+set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt")
+
+if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM")
+ string(TOLOWER "${GENERATOR_TYPE}" file_extension_)
+ set(EXPECTED_FILE_1 "autosuffixpackage.${file_extension_}")
+endif()
diff --git a/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake
new file mode 100644
index 0000000..84c9bec
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake
@@ -0,0 +1,5 @@
+install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
+
+# if the filename doesn't have the expected deb/rpm suffix, test that it is appended automatically
+set(CPACK_DEBIAN_FILE_NAME "autosuffixpackage")
+set(CPACK_RPM_FILE_NAME "autosuffixpackage")
diff --git a/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/ExpectedFiles.cmake
new file mode 100644
index 0000000..5341ecd
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/ExpectedFiles.cmake
@@ -0,0 +1,16 @@
+if(RunCMake_SUBTEST_SUFFIX STREQUAL "success")
+ if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(EXPECTED_FILES_COUNT "1")
+ set(EXPECTED_FILE_CONTENT_1_LIST "/files;/files/1.txt;/files/2.txt;/files/3.txt;/files/4.txt;/files/5.txt;/files/6.txt;/files/7.txt;/files/8.txt;/files/symlink2")
+ elseif(PACKAGING_TYPE STREQUAL "GROUP")
+ set(EXPECTED_FILES_COUNT "3")
+ set(EXPECTED_FILE_1 "duplicate_file-0.1.1-*-g1.${cpack_archive_extension_}")
+ set(EXPECTED_FILE_CONTENT_1_LIST "/files;/files/1.txt;/files/2.txt;/files/3.txt;/files/4.txt;/files/5.txt;/files/6.txt;/files/symlink2")
+ set(EXPECTED_FILE_2 "duplicate_file-0.1.1-*-g2.${cpack_archive_extension_}")
+ set(EXPECTED_FILE_CONTENT_2_LIST "/files;/files/3.txt;/files/4.txt;/files/5.txt;/files/6.txt;/files/7.txt;/files/8.txt")
+ set(EXPECTED_FILE_3 "duplicate_file-0.1.1-*-c5.${cpack_archive_extension_}")
+ set(EXPECTED_FILE_CONTENT_3_LIST "/files;/files/5.txt;/files/6.txt;/files/7.txt;/files/8.txt;/files/9.txt")
+ endif ()
+else()
+ set(EXPECTED_FILES_COUNT "0")
+endif ()
diff --git a/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_file-stderr.txt b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_file-stderr.txt
new file mode 100644
index 0000000..5544885
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_file-stderr.txt
@@ -0,0 +1 @@
+CPack Error: ERROR The data in files with the same filename is different.*
diff --git a/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_symlink-stderr.txt b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_symlink-stderr.txt
new file mode 100644
index 0000000..5544885
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_symlink-stderr.txt
@@ -0,0 +1 @@
+CPack Error: ERROR The data in files with the same filename is different.*
diff --git a/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/test.cmake b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/test.cmake
new file mode 100644
index 0000000..89d6784
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/test.cmake
@@ -0,0 +1,74 @@
+# Create files named 1 to 9
+foreach(i RANGE 1 9)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${i}.txt" "This is file ${i}")
+endforeach()
+
+set(COMPONENT_NAMES c1 c2 c3 c4 c5)
+foreach(j RANGE 1 5)
+ # Select 4 file and install to the component
+ math(EXPR COMPONENT_IDX "${j} - 1")
+ list(GET COMPONENT_NAMES "${COMPONENT_IDX}" SELECTED_COMPONENT)
+ math(EXPR END_FILE "${j} + 4")
+ foreach(k RANGE ${j} ${END_FILE})
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${k}.txt" DESTINATION "files" COMPONENT ${SELECTED_COMPONENT})
+ endforeach()
+endforeach()
+
+if(RunCMake_SUBTEST_SUFFIX STREQUAL "conflict_file")
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conflict/1.txt" "This should create a conflict.")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/conflict/1.txt" DESTINATION "files" COMPONENT c2)
+endif ()
+
+# You cannot create symlink in Windows test environment. Instead mock the symlink.
+if(NOT CMAKE_HOST_WIN32)
+ file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/2.txt" "${CMAKE_CURRENT_BINARY_DIR}/symlink2" SYMBOLIC)
+else()
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/symlink2" "This is file 2")
+endif()
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/symlink2" DESTINATION "files" COMPONENT c1)
+
+if(RunCMake_SUBTEST_SUFFIX STREQUAL "conflict_symlink" AND NOT CMAKE_HOST_WIN32)
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/conflict)
+ file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/1.txt" "${CMAKE_CURRENT_BINARY_DIR}/conflict/symlink2" SYMBOLIC)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/conflict/symlink2" DESTINATION "files" COMPONENT c2)
+elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "conflict_symlink" AND CMAKE_HOST_WIN32)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conflict/symlink2" "This should create a conflict.")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/conflict/symlink2" DESTINATION "files" COMPONENT c2)
+else()
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/symlink2" DESTINATION "files" COMPONENT c2)
+endif ()
+
+
+if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
+ set(CPACK_COMPONENTS_ALL "c1;c2;c3;c4")
+elseif(PACKAGING_TYPE STREQUAL "GROUP")
+ set(CPACK_COMPONENTS_ONE_PACKAGE_PER_GROUP ON)
+ set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
+ include(CPackComponent)
+
+ cpack_add_component_group(g1 DISPLAY_NAME "Group 1")
+ cpack_add_component_group(g2 DISPLAY_NAME "Group 2")
+ cpack_add_component(c1
+ DISPLAY_NAME "Group 1"
+ DESCRIPTION "Component for Group 1"
+ GROUP g1
+ )
+ cpack_add_component(c2
+ DISPLAY_NAME "Group 1"
+ DESCRIPTION "Component for Group 1"
+ GROUP g1
+ )
+ cpack_add_component(c3
+ DISPLAY_NAME "Group 2"
+ DESCRIPTION "Component for Group 2"
+ GROUP g2
+ )
+ cpack_add_component(c4
+ DISPLAY_NAME "Group 2"
+ DESCRIPTION "Component for Group 2"
+ GROUP g2
+ )
+
+ set(CPACK_${GENERATOR_TYPE}_PACKAGE_GROUP g1 g2)
+endif ()
diff --git a/Tests/RunCMake/CPackConfig/CMP0161-NEW-check.cmake b/Tests/RunCMake/CPackConfig/CMP0161-NEW-check.cmake
new file mode 100644
index 0000000..586fcf9
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/CMP0161-NEW-check.cmake
@@ -0,0 +1,3 @@
+include(${RunCMake_SOURCE_DIR}/check.cmake)
+
+test_variable(CPACK_PRODUCTBUILD_DOMAINS "ON")
diff --git a/Tests/RunCMake/CPackConfig/CMP0161-NEW.cmake b/Tests/RunCMake/CPackConfig/CMP0161-NEW.cmake
new file mode 100644
index 0000000..cc4d34b
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/CMP0161-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0161 NEW)
+set(CPACK_BINARY_PRODUCTBUILD ON CACHE BOOL "" FORCE)
diff --git a/Tests/RunCMake/CPackConfig/CMP0161-OLD-check.cmake b/Tests/RunCMake/CPackConfig/CMP0161-OLD-check.cmake
new file mode 100644
index 0000000..e3cb854
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/CMP0161-OLD-check.cmake
@@ -0,0 +1,5 @@
+include(${RunCMake_SOURCE_DIR}/check.cmake)
+
+if(DEFINED CPACK_PRODUCTBUILD_DOMANS)
+ message(FATAL_ERROR "CPACK_PRODUCTBUILD_DOMANS was defined, but it should not have been")
+endif()
diff --git a/Tests/RunCMake/CPackConfig/CMP0161-OLD.cmake b/Tests/RunCMake/CPackConfig/CMP0161-OLD.cmake
new file mode 100644
index 0000000..4d47576
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/CMP0161-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0161 OLD)
+set(CPACK_BINARY_PRODUCTBUILD ON CACHE BOOL "" FORCE)
diff --git a/Tests/RunCMake/CPackConfig/CMP0161-WARN-check.cmake b/Tests/RunCMake/CPackConfig/CMP0161-WARN-check.cmake
new file mode 100644
index 0000000..e3cb854
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/CMP0161-WARN-check.cmake
@@ -0,0 +1,5 @@
+include(${RunCMake_SOURCE_DIR}/check.cmake)
+
+if(DEFINED CPACK_PRODUCTBUILD_DOMANS)
+ message(FATAL_ERROR "CPACK_PRODUCTBUILD_DOMANS was defined, but it should not have been")
+endif()
diff --git a/Tests/RunCMake/CPackConfig/CMP0161-WARN-stderr-darwin.txt b/Tests/RunCMake/CPackConfig/CMP0161-WARN-stderr-darwin.txt
new file mode 100644
index 0000000..5841ec7
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/CMP0161-WARN-stderr-darwin.txt
@@ -0,0 +1,12 @@
+^CMake Warning \(dev\) at [^
+]*/Modules/CPack\.cmake:[0-9]+ \(message\):
+ Policy CMP0161 is not set: CPACK_PRODUCTBUILD_DOMAINS defaults to true\.
+ Run "cmake --help-policy CMP0161" for policy details\. Use the cmake_policy
+ command to set the policy and suppress this warning\.
+
+ For compatibility, CPACK_PRODUCTBUILD_DOMAINS will remain unset\.
+ Explicitly setting CPACK_PRODUCTBUILD_DOMAINS or setting policy CMP0161 to
+ NEW will prevent this warning\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.$
diff --git a/Tests/RunCMake/CPackConfig/CMP0161-WARN.cmake b/Tests/RunCMake/CPackConfig/CMP0161-WARN.cmake
new file mode 100644
index 0000000..f387c69
--- /dev/null
+++ b/Tests/RunCMake/CPackConfig/CMP0161-WARN.cmake
@@ -0,0 +1 @@
+set(CPACK_BINARY_PRODUCTBUILD ON CACHE BOOL "" FORCE)
diff --git a/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake b/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake
index 32c7296..1de640b 100644
--- a/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPackConfig/RunCMakeTest.cmake
@@ -2,6 +2,9 @@ include(RunCMake)
run_cmake(CMP0133-NEW)
run_cmake(CMP0133-WARN)
+run_cmake(CMP0161-NEW)
+run_cmake(CMP0161-OLD)
+run_cmake(CMP0161-WARN)
run_cmake(Simple)
run_cmake(Default)
run_cmake(Special)
diff --git a/Tests/RunCMake/CPack_WIX/3-AppWiX-cpack-WIX-check.cmake b/Tests/RunCMake/CPack_WIX/3-AppWiX-cpack-WIX-check.cmake
new file mode 100644
index 0000000..a7a28ae
--- /dev/null
+++ b/Tests/RunCMake/CPack_WIX/3-AppWiX-cpack-WIX-check.cmake
@@ -0,0 +1 @@
+include(${RunCMake_SOURCE_DIR}/cpack-check-common.cmake)
diff --git a/Tests/RunCMake/CPack_WIX/3-AppWiX-cpack-WIX-stdout.txt b/Tests/RunCMake/CPack_WIX/3-AppWiX-cpack-WIX-stdout.txt
new file mode 100644
index 0000000..2998440
--- /dev/null
+++ b/Tests/RunCMake/CPack_WIX/3-AppWiX-cpack-WIX-stdout.txt
@@ -0,0 +1,11 @@
+CPack: Create package using WIX
+CPack: Install projects
+CPack: - Install project: CPackWiXGenerator \[Release\]
+CPack: - Install component: applications
+CPack: - Install component: applications2
+CPack: - Install component: extras
+CPack: - Install component: headers
+CPack: - Install component: libraries
+CPack: Create package
+CPack: - package: [^
+]*/Tests/RunCMake/CPack_WIX/3-AppWiX-build/MyLib-1\.0\.0-(win64|windows-arm64)\.msi generated\.
diff --git a/Tests/RunCMake/CPack_WIX/3-AppWiX-verify-stdout.txt b/Tests/RunCMake/CPack_WIX/3-AppWiX-verify-stdout.txt
new file mode 100644
index 0000000..4713447
--- /dev/null
+++ b/Tests/RunCMake/CPack_WIX/3-AppWiX-verify-stdout.txt
@@ -0,0 +1,33 @@
+-- MyLib-1\.0\.0-(win64|windows-arm64)\.msi
+Component: 'CM_CP_applications.bin.my_libapp.exe' 'CM_DP_applications.bin'
+Component: 'CM_SHORTCUT_applications' 'PROGRAM_MENU_FOLDER'
+Component: 'CM_SHORTCUT_DESKTOP_applications' 'DesktopFolder'
+Component: 'CM_CP_applications2.bin.my_other_app.exe' 'CM_DP_applications2.bin'
+Component: 'CM_SHORTCUT_applications2' 'PROGRAM_MENU_FOLDER'
+Component: 'CM_SHORTCUT_DESKTOP_applications2' 'DesktopFolder'
+Component: 'CM_C_EMPTY_CM_DP_extras.extras.empty' 'CM_DP_extras.extras.empty'
+Component: 'CM_CP_headers.include.file_with_spaces.h' 'CM_DP_headers.include'
+Component: 'CM_CP_headers.include.mylib.h' 'CM_DP_headers.include'
+Component: 'CM_CP_libraries.lib.mylib.lib' 'CM_DP_libraries.lib'
+Directory: 'INSTALL_ROOT' 'ProgramFiles64Folder' '[^']*\|CPack Component Example'
+Directory: 'CM_DP_applications.bin' 'INSTALL_ROOT' 'bin'
+Directory: 'PROGRAM_MENU_FOLDER' 'ProgramMenuFolder' 'MyLib'
+Directory: 'DesktopFolder' 'TARGETDIR' 'Desktop'
+Directory: 'CM_DP_applications2.bin' 'INSTALL_ROOT' 'bin'
+Directory: 'CM_DP_extras.extras.empty' 'CM_DP_extras.extras' 'empty'
+Directory: 'CM_DP_headers.include' 'INSTALL_ROOT' 'include'
+Directory: 'CM_DP_libraries.lib' 'INSTALL_ROOT' 'lib'
+Directory: 'CM_DP_extras.extras' 'INSTALL_ROOT' 'extras'
+Directory: 'ProgramFiles64Folder' 'TARGETDIR' '.'
+Directory: 'TARGETDIR' '' 'SourceDir'
+Directory: 'ProgramMenuFolder' 'TARGETDIR' '.'
+File: 'CM_FP_applications.bin.my_libapp.exe' 'CM_CP_applications.bin.my_libapp.exe' '[^']*\|my-libapp.exe'
+File: 'CM_FP_applications2.bin.my_other_app.exe' 'CM_CP_applications2.bin.my_other_app.exe' '[^']*\|my-other-app.exe'
+File: 'CM_FP_headers.include.file_with_spaces.h' 'CM_CP_headers.include.file_with_spaces.h' '[^']*\|file with spaces.h'
+File: 'CM_FP_headers.include.mylib.h' 'CM_CP_headers.include.mylib.h' 'mylib.h'
+File: 'CM_FP_libraries.lib.mylib.lib' 'CM_CP_libraries.lib.mylib.lib' 'mylib.lib'
+Shortcut: 'CM_SP_applications.bin.my_libapp.exe' 'PROGRAM_MENU_FOLDER' '[^']*\|CPack WiX Test' 'CM_SHORTCUT_applications'
+Shortcut: 'CM_DSP_applications.bin.my_libapp.exe' 'DesktopFolder' '[^']*\|CPack WiX Test' 'CM_SHORTCUT_DESKTOP_applications'
+Shortcut: 'CM_SP_applications2.bin.my_other_app.exe' 'PROGRAM_MENU_FOLDER' '[^']*\|Second CPack WiX Test' 'CM_SHORTCUT_applications2'
+Shortcut: 'CM_DSP_applications2.bin.my_other_app.exe' 'DesktopFolder' '[^']*\|Second CPack WiX Test' 'CM_SHORTCUT_DESKTOP_applications2'
+--
diff --git a/Tests/RunCMake/CPack_WIX/4-AppWiX-cpack-WIX-check.cmake b/Tests/RunCMake/CPack_WIX/4-AppWiX-cpack-WIX-check.cmake
new file mode 100644
index 0000000..a7a28ae
--- /dev/null
+++ b/Tests/RunCMake/CPack_WIX/4-AppWiX-cpack-WIX-check.cmake
@@ -0,0 +1 @@
+include(${RunCMake_SOURCE_DIR}/cpack-check-common.cmake)
diff --git a/Tests/RunCMake/CPack_WIX/4-AppWiX-cpack-WIX-stdout.txt b/Tests/RunCMake/CPack_WIX/4-AppWiX-cpack-WIX-stdout.txt
new file mode 100644
index 0000000..51f06ca
--- /dev/null
+++ b/Tests/RunCMake/CPack_WIX/4-AppWiX-cpack-WIX-stdout.txt
@@ -0,0 +1,11 @@
+CPack: Create package using WIX
+CPack: Install projects
+CPack: - Install project: CPackWiXGenerator \[Release\]
+CPack: - Install component: applications
+CPack: - Install component: applications2
+CPack: - Install component: extras
+CPack: - Install component: headers
+CPack: - Install component: libraries
+CPack: Create package
+CPack: - package: [^
+]*/Tests/RunCMake/CPack_WIX/4-AppWiX-build/MyLib-1\.0\.0-(win64|windows-arm64)\.msi generated\.
diff --git a/Tests/RunCMake/CPack_WIX/4-AppWiX-verify-stdout.txt b/Tests/RunCMake/CPack_WIX/4-AppWiX-verify-stdout.txt
new file mode 100644
index 0000000..a379859
--- /dev/null
+++ b/Tests/RunCMake/CPack_WIX/4-AppWiX-verify-stdout.txt
@@ -0,0 +1,34 @@
+-- MyLib-1\.0\.0-(win64|windows-arm64)\.msi
+Component: 'CM_CP_applications.bin.my_libapp.exe' 'CM_DP_applications.bin'
+Component: 'CM_SHORTCUT_applications' 'PROGRAM_MENU_FOLDER'
+Component: 'CM_SHORTCUT_DESKTOP_applications' 'DesktopFolder'
+Component: 'CM_CP_applications2.bin.my_other_app.exe' 'CM_DP_applications2.bin'
+Component: 'CM_SHORTCUT_applications2' 'PROGRAM_MENU_FOLDER'
+Component: 'CM_SHORTCUT_DESKTOP_applications2' 'DesktopFolder'
+Component: 'CM_C_EMPTY_CM_DP_extras.extras.empty' 'CM_DP_extras.extras.empty'
+Component: 'CM_CP_headers.include.file_with_spaces.h' 'CM_DP_headers.include'
+Component: 'CM_CP_headers.include.mylib.h' 'CM_DP_headers.include'
+Component: 'CM_CP_libraries.lib.mylib.lib' 'CM_DP_libraries.lib'
+Directory: 'INSTALL_ROOT' 'ProgramFiles6432Folder' '[^']*\|CPack Component Example'
+Directory: 'CM_DP_applications.bin' 'INSTALL_ROOT' 'bin'
+Directory: 'CM_DP_applications2.bin' 'INSTALL_ROOT' 'bin'
+Directory: 'CM_DP_extras.extras.empty' 'CM_DP_extras.extras' 'empty'
+Directory: 'CM_DP_extras.extras' 'INSTALL_ROOT' 'extras'
+Directory: 'CM_DP_headers.include' 'INSTALL_ROOT' 'include'
+Directory: 'CM_DP_libraries.lib' 'INSTALL_ROOT' 'lib'
+Directory: 'ProgramFiles6432Folder' 'ProgramFiles64Folder' '.'
+Directory: 'PROGRAM_MENU_FOLDER' 'ProgramMenuFolder' 'MyLib'
+Directory: 'ProgramMenuFolder' 'TARGETDIR' 'PMenu'
+Directory: 'ProgramFiles64Folder' 'TARGETDIR' 'PFiles64'
+Directory: 'TARGETDIR' '' 'SourceDir'
+Directory: 'DesktopFolder' 'TARGETDIR' 'Desktop'
+File: 'CM_FP_applications.bin.my_libapp.exe' 'CM_CP_applications.bin.my_libapp.exe' '[^']*\|my-libapp.exe'
+File: 'CM_FP_applications2.bin.my_other_app.exe' 'CM_CP_applications2.bin.my_other_app.exe' '[^']*\|my-other-app.exe'
+File: 'CM_FP_headers.include.file_with_spaces.h' 'CM_CP_headers.include.file_with_spaces.h' '[^']*\|file with spaces.h'
+File: 'CM_FP_headers.include.mylib.h' 'CM_CP_headers.include.mylib.h' 'mylib.h'
+File: 'CM_FP_libraries.lib.mylib.lib' 'CM_CP_libraries.lib.mylib.lib' 'mylib.lib'
+Shortcut: 'CM_SP_applications.bin.my_libapp.exe' 'PROGRAM_MENU_FOLDER' '[^']*\|CPack WiX Test' 'CM_SHORTCUT_applications'
+Shortcut: 'CM_DSP_applications.bin.my_libapp.exe' 'DesktopFolder' '[^']*\|CPack WiX Test' 'CM_SHORTCUT_DESKTOP_applications'
+Shortcut: 'CM_SP_applications2.bin.my_other_app.exe' 'PROGRAM_MENU_FOLDER' '[^']*\|Second CPack WiX Test' 'CM_SHORTCUT_applications2'
+Shortcut: 'CM_DSP_applications2.bin.my_other_app.exe' 'DesktopFolder' '[^']*\|Second CPack WiX Test' 'CM_SHORTCUT_DESKTOP_applications2'
+--
diff --git a/Tests/RunCMake/CPack_WIX/RunCMakeTest.cmake b/Tests/RunCMake/CPack_WIX/RunCMakeTest.cmake
new file mode 100644
index 0000000..816d949
--- /dev/null
+++ b/Tests/RunCMake/CPack_WIX/RunCMakeTest.cmake
@@ -0,0 +1,24 @@
+include(RunCPack)
+
+set(env_PATH "$ENV{PATH}")
+
+set(RunCPack_GENERATORS WIX)
+set(RunCPack_GLOB *.msi)
+set(RunCPack_VERIFY powershell -ExecutionPolicy Bypass -File ${CMAKE_CURRENT_LIST_DIR}/print-msi.ps1)
+
+function(run_cpack_wix v)
+ set(RunCMake_TEST_OPTIONS -DCPACK_WIX_VERSION=${v})
+ run_cpack(${v}-AppWiX SAMPLE AppWiX BUILD)
+endfunction()
+
+if(CMake_TEST_CPACK_WIX3)
+ set(ENV{PATH} "${CMake_TEST_CPACK_WIX3};${env_PATH}")
+ run_cpack_wix(3)
+endif()
+
+if(CMake_TEST_CPACK_WIX4)
+ set(ENV{PATH} "${CMake_TEST_CPACK_WIX4};${env_PATH}")
+ set(ENV{WIX_EXTENSIONS} "${CMake_TEST_CPACK_WIX4}")
+ run_cpack_wix(4)
+ unset(ENV{WIX_EXTENSIONS})
+endif()
diff --git a/Tests/RunCMake/CPack_WIX/cpack-check-common.cmake b/Tests/RunCMake/CPack_WIX/cpack-check-common.cmake
new file mode 100644
index 0000000..2f16d71
--- /dev/null
+++ b/Tests/RunCMake/CPack_WIX/cpack-check-common.cmake
@@ -0,0 +1,6 @@
+file(GLOB wix_log_file RELATIVE "${RunCMake_TEST_BINARY_DIR}" "${RunCMake_TEST_BINARY_DIR}/_CPack_Packages/*/WIX/wix.log")
+if(wix_log_file)
+ file(READ "${RunCMake_TEST_BINARY_DIR}/${wix_log_file}" wix_log)
+ string(REPLACE "\n" "\n wix-log> " wix_log " wix-log> ${wix_log}")
+ set(RunCMake_TEST_FAILURE_MESSAGE "${wix_log_file}:\n${wix_log}")
+endif()
diff --git a/Tests/RunCMake/CPack_WIX/print-msi.ps1 b/Tests/RunCMake/CPack_WIX/print-msi.ps1
new file mode 100644
index 0000000..01fdbc8
--- /dev/null
+++ b/Tests/RunCMake/CPack_WIX/print-msi.ps1
@@ -0,0 +1,29 @@
+# https://learn.microsoft.com/en-us/windows/win32/msi/database-tables
+
+param (
+ $file
+ )
+
+function printTable {
+ param (
+ $msi,
+ [string]$name,
+ [int[]]$columns = (1)
+ )
+
+ try {
+ $view = $msi.OpenView("select * from " + $name)
+ $view.Execute()
+ while ($record = $view.Fetch()) {
+ Write-Host ($name + ": " + ($columns | ForEach-Object {"'" + $record.StringData($_) + "'"}))
+ }
+ } catch {}
+}
+
+$installer = New-Object -ComObject WindowsInstaller.Installer
+$msi = $installer.OpenDatabase($file, 0)
+
+printTable -msi $msi -name "Component" -columns 1,3
+printTable -msi $msi -name "Directory" -columns 1,2,3
+printTable -msi $msi -name "File" -columns 1,2,3
+printTable -msi $msi -name "Shortcut" -columns 1,2,3,4
diff --git a/Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in b/Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in
index 5437800..e4a6f5f 100644
--- a/Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in
+++ b/Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.5)
project(CTestCommandLine@CASE_NAME@ NONE)
include(CTest)
add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
diff --git a/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-result.txt b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-stderr.txt b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-stderr.txt
new file mode 100644
index 0000000..e3df62f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-stderr.txt
@@ -0,0 +1,2 @@
+Error message was: ([Cc]ould *n.t resolve host:? '?badhostname.invalid'?|The requested URL returned error:|Protocol "https" (not supported or disabled|not supported|disabled)|.* was built with SSL disabled).*
+ Problems when submitting via HTTP
diff --git a/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-stdout.txt
new file mode 100644
index 0000000..be5d335
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake-ctest-stdout.txt
@@ -0,0 +1 @@
+ Set CURLOPT_SSL_VERIFYPEER to off
diff --git a/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake.cmake b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake.cmake
new file mode 100644
index 0000000..e0368fc
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-cmake.cmake
@@ -0,0 +1 @@
+include(FailDrop-common.cmake)
diff --git a/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-result.txt b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-stderr.txt b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-stderr.txt
new file mode 100644
index 0000000..e3df62f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-stderr.txt
@@ -0,0 +1,2 @@
+Error message was: ([Cc]ould *n.t resolve host:? '?badhostname.invalid'?|The requested URL returned error:|Protocol "https" (not supported or disabled|not supported|disabled)|.* was built with SSL disabled).*
+ Problems when submitting via HTTP
diff --git a/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/FailDrop-TLSVerify-OFF-ctest-stdout.txt
new file mode 100644