diff --git a/.gitignore b/.gitignore index 3b9e52a48cc..816dcedc8c0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,10 @@ # Common build directories /build*/ +# CI jobs that run in symlinked trees produce these artifacts. +/real_work/ +/work + # MacOS Finder files. .DS_Store diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 297afda7aa6..3c1c9cc8fb9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,10 @@ stages: - test-ext - upload +variables: + # Some jobs that place their artifacts in a different directory will override this. + CMAKE_CI_BUILD_DIR: build + ################################################################################ # Job declarations # @@ -96,9 +100,9 @@ l:codespell: - .linux_x86_64_tags - .run_automatically -l:iwyu-debian10: +l:iwyu-debian12: extends: - - .debian10_iwyu + - .debian12_iwyu - .cmake_build_linux - .linux_x86_64_tags - .run_automatically @@ -132,7 +136,7 @@ l:clang-analyzer-fedora38: # Linux builds -b:centos6-x86_64: +b:centos7-x86_64: extends: - .linux_release_x86_64 - .cmake_build_linux_release @@ -140,7 +144,7 @@ b:centos6-x86_64: - .linux_x86_64_tags - .run_manually variables: - CMAKE_CI_ARTIFACTS_NAME: "artifacts-centos6-x86_64" + CMAKE_CI_ARTIFACTS_NAME: "artifacts-centos7-x86_64" b:centos7-aarch64: extends: @@ -153,20 +157,20 @@ b:centos7-aarch64: CMAKE_CI_ARTIFACTS_NAME: "artifacts-centos7-aarch64" CMAKE_CI_NO_MR: "true" -t:debian10-ninja: +t:debian12-ninja: extends: - - .debian10_ninja + - .debian12_ninja - .cmake_test_linux_release - .linux_x86_64_tags - .cmake_junit_artifacts - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY_NINJA: "true" -t:debian10-aarch64-ninja: +t:debian12-aarch64-ninja: extends: - - .debian10_aarch64_ninja + - .debian12_aarch64_ninja - .cmake_test_linux_release - .linux_aarch64_tags - .cmake_junit_artifacts @@ -175,25 +179,57 @@ t:debian10-aarch64-ninja: variables: CMAKE_CI_NO_MR: "true" -t:debian10-ninja-clang: +t:debian12-ninja-clang: + extends: + - .debian12_ninja_clang + - .cmake_test_linux_release + - .linux_x86_64_tags + - .run_dependent + - .needs_centos7_x86_64 + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + +t:debian12-makefiles-clang: extends: - - .debian10_ninja_clang + - .debian12_makefiles_clang - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:debian10-makefiles-clang: +t:debian12-ninja-multi-symlinked: extends: - - .debian10_makefiles_clang + - .debian12_ninja_multi_symlinked - .cmake_test_linux_release - .linux_x86_64_tags + - .cmake_junit_artifacts - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_NIGHTLY_NINJA: "true" + +t:debian12-hip-radeon: + extends: + - .debian12_hip_radeon + - .cmake_test_linux_release + - .linux_x86_64_tags_radeon + - .run_dependent + - .needs_centos7_x86_64 + variables: + CMAKE_CI_NO_MR: "true" + +t:fedora38-hip-radeon: + extends: + - .fedora38_hip_radeon + - .cmake_test_linux_release + - .linux_x86_64_tags_radeon + - .run_dependent + - .needs_centos7_x86_64 + variables: + CMAKE_CI_NO_MR: "true" t:fedora38-ninja-clang: extends: @@ -201,7 +237,7 @@ t:fedora38-ninja-clang: - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -211,7 +247,7 @@ t:fedora38-ninja-multi-clang: - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -221,7 +257,7 @@ t:fedora38-makefiles-clang: - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -231,7 +267,7 @@ t:fedora38-makefiles: - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 t:fedora38-makefiles-nospace: extends: @@ -240,7 +276,7 @@ t:fedora38-makefiles-nospace: - .linux_x86_64_tags - .cmake_junit_artifacts - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake-ci" CMAKE_CI_BUILD_NAME: fedora38_makefiles_nospace @@ -252,7 +288,7 @@ t:nvhpc22.11-ninja: - .cmake_test_linux_release - .linux_x86_64_v3_tags_cuda - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -262,7 +298,7 @@ t:cuda9.2-nvidia: - .cmake_test_linux_release - .linux_x86_64_tags_cuda - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_NO_MR: "true" @@ -273,7 +309,7 @@ t:cuda10.2-nvidia: - .linux_x86_64_tags_cuda - .cmake_junit_artifacts - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 t:cuda10.2-clang: extends: @@ -281,7 +317,7 @@ t:cuda10.2-clang: - .cmake_test_linux_release - .linux_x86_64_tags_cuda - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_NO_MR: "true" @@ -292,7 +328,7 @@ t:cuda11.6-nvidia: - .linux_x86_64_tags_cuda - .cmake_junit_artifacts - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 t:cuda11.6-clang: extends: @@ -300,7 +336,7 @@ t:cuda11.6-clang: - .cmake_test_linux_release - .linux_x86_64_tags_cuda - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_NO_MR: "true" @@ -310,7 +346,27 @@ t:cuda11.8-minimal-ninja: - .cmake_test_linux_release - .linux_x86_64_tags_cuda - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 + variables: + CMAKE_CI_NO_MR: "true" + +t:cuda11.8-minimal-splayed-ninja: + extends: + - .cuda11.8_splayed_nvidia + - .cmake_test_linux_release + - .linux_x86_64_tags_cuda + - .run_dependent + - .needs_centos7_x86_64 + variables: + CMAKE_CI_NO_MR: "true" + +t:hip5.5-nvidia: + extends: + - .hip5.5_nvidia + - .cmake_test_linux_release + - .linux_x86_64_tags_cuda + - .run_dependent + - .needs_centos7_x86_64 variables: CMAKE_CI_NO_MR: "true" @@ -320,7 +376,7 @@ t:hip5.5-radeon: - .cmake_test_linux_release - .linux_x86_64_tags_radeon - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_NO_MR: "true" @@ -330,7 +386,7 @@ t:linux-gcc-cxx-modules-ninja: - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -340,7 +396,18 @@ t:linux-gcc-cxx-modules-ninja-multi: - .cmake_test_linux_release - .linux_x86_64_tags - .run_dependent - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + +t:debian10-legacy: + extends: + - .debian10_legacy + - .cmake_test_linux_release + - .linux_x86_64_tags + - .cmake_junit_artifacts + - .run_dependent + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -354,27 +421,37 @@ b:fedora38-ninja: variables: CMAKE_CI_JOB_CONTINUOUS: "true" -b:debian10-makefiles-inplace: +b:fedora38-makefiles-symlinked: extends: - - .debian10_makefiles_inplace + - .fedora38_makefiles_symlinked + - .cmake_build_linux + - .cmake_build_artifacts + - .linux_x86_64_tags + - .run_manually + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + +b:debian12-makefiles-inplace: + extends: + - .debian12_makefiles_inplace - .cmake_build_linux_standalone - .linux_x86_64_tags - .run_manually variables: CMAKE_CI_JOB_NIGHTLY: "true" -b:debian10-extdeps: +b:debian12-extdeps: extends: - - .debian10_extdeps + - .debian12_extdeps - .cmake_build_linux_standalone - .linux_x86_64_tags - .run_manually variables: CMAKE_CI_JOB_NIGHTLY: "true" -b:debian10-aarch64-extdeps: +b:debian12-aarch64-extdeps: extends: - - .debian10_aarch64_extdeps + - .debian12_aarch64_extdeps - .cmake_build_linux_standalone - .linux_aarch64_tags - .run_manually @@ -404,6 +481,20 @@ t:fedora38-ninja: variables: CMAKE_CI_JOB_CONTINUOUS: "true" +t:fedora38-makefiles-symlinked: + extends: + - .fedora38_makefiles_symlinked + - .cmake_test_linux + - .linux_x86_64_tags_x11 + - .cmake_test_artifacts + - .run_dependent + dependencies: + - b:fedora38-makefiles-symlinked + needs: + - b:fedora38-makefiles-symlinked + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + t:fedora38-ninja-multi: extends: - .fedora38_ninja_multi @@ -826,6 +917,25 @@ b:macos-arm64-ninja: variables: CMAKE_CI_JOB_CONTINUOUS: "true" +b:macos-arm64-ninja-symlinked: + extends: + - .macos_arm64_ninja_symlinked + - .cmake_build_macos + - .cmake_build_artifacts + - .macos_arm64_tags + - .run_manually + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + +b:macos-arm64-pch: + extends: + - .macos_arm64_pch + - .cmake_build_macos + - .macos_arm64_tags + - .run_manually + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + t:macos-x86_64-ninja: extends: - .macos_x86_64_ninja @@ -855,6 +965,21 @@ t:macos-arm64-ninja: CMAKE_CI_JOB_CONTINUOUS: "true" CMAKE_CI_JOB_NIGHTLY_NINJA: "true" +t:macos-arm64-ninja-symlinked: + extends: + - .macos_arm64_ninja_symlinked + - .cmake_test_macos + - .cmake_test_artifacts + - .macos_arm64_tags + - .run_dependent + dependencies: + - b:macos-arm64-ninja-symlinked + needs: + - b:macos-arm64-ninja-symlinked + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_NIGHTLY_NINJA: "true" + b:macos-x86_64-makefiles: extends: - .macos_x86_64_makefiles @@ -914,6 +1039,20 @@ t:macos-arm64-xcode: needs: - t:macos-arm64-ninja +t:macos-arm64-xcode-symlinked: + extends: + - .macos_arm64_xcode_symlinked + - .cmake_test_macos_external + - .macos_arm64_tags_ext + - .cmake_junit_artifacts + - .run_dependent + dependencies: + - t:macos-arm64-ninja + needs: + - t:macos-arm64-ninja + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + t:macos-x86_64-ninja-ub: extends: - .macos_x86_64_ninja_ub @@ -998,6 +1137,15 @@ b:windows-vs2022-x64-ninja: - .windows_x86_64_tags_nonconcurrent_vs2022 - .run_manually +b:windows-vs2022-x64-pch: + extends: + - .windows_vs2022_x64_pch + - .cmake_build_windows + - .windows_x86_64_tags_nonconcurrent_vs2022 + - .run_manually + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + t:windows-vs2022-x64-ninja: extends: - .windows_vs2022_x64_ninja @@ -1108,7 +1256,7 @@ t:windows-borland5.8: variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang16.0-cl-ninja: +t:windows-clang17.0-cl-ninja: extends: - .windows_clang_ninja - .cmake_test_windows_external @@ -1120,10 +1268,10 @@ t:windows-clang16.0-cl-ninja: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang16.0_cl_ninja + CMAKE_CI_BUILD_NAME: windows_clang17.0_cl_ninja CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang16.0-cl-nmake: +t:windows-clang17.0-cl-nmake: extends: - .windows_clang_nmake - .cmake_test_windows_external @@ -1135,10 +1283,10 @@ t:windows-clang16.0-cl-nmake: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang16.0_cl_nmake + CMAKE_CI_BUILD_NAME: windows_clang17.0_cl_nmake CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang16.0-gnu-ninja: +t:windows-clang17.0-gnu-ninja: extends: - .windows_clang_ninja - .cmake_test_windows_external @@ -1150,10 +1298,10 @@ t:windows-clang16.0-gnu-ninja: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang16.0_gnu_ninja + CMAKE_CI_BUILD_NAME: windows_clang17.0_gnu_ninja CMAKE_CI_JOB_NIGHTLY: "true" -t:windows-clang16.0-gnu-nmake: +t:windows-clang17.0-gnu-nmake: extends: - .windows_clang_nmake - .cmake_test_windows_external @@ -1165,7 +1313,7 @@ t:windows-clang16.0-gnu-nmake: needs: - t:windows-vs2022-x64-ninja variables: - CMAKE_CI_BUILD_NAME: windows_clang16.0_gnu_nmake + CMAKE_CI_BUILD_NAME: windows_clang17.0_gnu_nmake CMAKE_CI_JOB_NIGHTLY: "true" t:windows-intel2021.9.0-ninja: @@ -1254,6 +1402,20 @@ t:windows-openwatcom1.9: variables: CMAKE_CI_JOB_NIGHTLY: "true" +t:windows-orangec6.73.1: + extends: + - .windows_orangec6.73.1 + - .cmake_test_windows_external + - .windows_x86_64_tags_concurrent + - .cmake_junit_artifacts + - .run_dependent + dependencies: + - t:windows-vs2022-x64-ninja + needs: + - t:windows-vs2022-x64-ninja + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + # Windows arm64 jobs b:windows-arm64-vs2022-ninja: diff --git a/.gitlab/.gitignore b/.gitlab/.gitignore index 852dfa64d8d..19796effd2c 100644 --- a/.gitlab/.gitignore +++ b/.gitlab/.gitignore @@ -12,6 +12,7 @@ /ninja* /openmp /open-watcom* +/orangec /python* /qt* /sccache* diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml index 6c4cc0df755..d9943b87903 100644 --- a/.gitlab/artifacts.yml +++ b/.gitlab/artifacts.yml @@ -5,63 +5,63 @@ expire_in: 1d paths: # Test specifications. - - build/**/CTestTestfile.cmake + - ${CMAKE_CI_BUILD_DIR}/**/CTestTestfile.cmake # Allow CMake to find CMAKE_ROOT. - - build/CMakeFiles/CMakeSourceDir.txt + - ${CMAKE_CI_BUILD_DIR}/CMakeFiles/CMakeSourceDir.txt # Take the install tree. - - build/install/ + - ${CMAKE_CI_BUILD_DIR}/install/ # We need the main binaries. - - build/bin/ + - ${CMAKE_CI_BUILD_DIR}/bin/ # The cache is needed for the installation test. - - build/CMakeCache.txt + - ${CMAKE_CI_BUILD_DIR}/CMakeCache.txt # Test binaries. Eventually these might be better under # `Source/Tests` or the like. - - build/Tests/EnforceConfig.cmake - - build/Tests/CMakeBuildTest.cmake - - build/Tests/CMakeBuildDoubleProjectTest.cmake - - build/Tests/CMake*/runcompilecommands - - build/Tests/CMake*/runcompilecommands.exe - - build/Tests/CMake*/test* - - build/Tests/CMake*/PseudoMemcheck/valgrind - - build/Tests/CMake*/PseudoMemcheck/purify - - build/Tests/CMake*/PseudoMemcheck/memcheck_fail - - build/Tests/CMake*/PseudoMemcheck/BC - - build/Tests/CMake*/PseudoMemcheck/cuda-memcheck - - build/Tests/CMake*/PseudoMemcheck/valgrind.exe - - build/Tests/CMake*/PseudoMemcheck/purify.exe - - build/Tests/CMake*/PseudoMemcheck/memcheck_fail.exe - - build/Tests/CMake*/PseudoMemcheck/BC.exe - - build/Tests/CMake*/PseudoMemcheck/cuda-memcheck.exe - - build/Tests/CMake*/PseudoMemcheck/NoLog - - build/Tests/CMake*Lib/*LibTests - - build/Tests/CMake*Lib/*LibTests.exe - - build/Source/kwsys/cmsysTest* - - build/Source/kwsys/testConsoleBufChild.exe - - build/Utilities/cmcurl/curltest - - build/Utilities/cmcurl/curltest.exe - - build/Utilities/KWIML/test/kwiml_test - - build/Utilities/KWIML/test/kwiml_test.exe - - build/Source/kwsys/*cmsysTestDynload.* - - build/Source/kwsys/dynloaddir/cmsysTestDynloadImpl.dll - - build/Source/kwsys/dynloaddir/cmsysTestDynloadUse.dll + - ${CMAKE_CI_BUILD_DIR}/Tests/EnforceConfig.cmake + - ${CMAKE_CI_BUILD_DIR}/Tests/CMakeBuildTest.cmake + - ${CMAKE_CI_BUILD_DIR}/Tests/CMakeBuildDoubleProjectTest.cmake + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/runcompilecommands + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/runcompilecommands.exe + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/test* + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/valgrind + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/purify + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/memcheck_fail + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/BC + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/cuda-memcheck + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/valgrind.exe + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/purify.exe + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/memcheck_fail.exe + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/BC.exe + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/cuda-memcheck.exe + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*/PseudoMemcheck/NoLog + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*Lib/*LibTests + - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*Lib/*LibTests.exe + - ${CMAKE_CI_BUILD_DIR}/Source/kwsys/cmsysTest* + - ${CMAKE_CI_BUILD_DIR}/Source/kwsys/testConsoleBufChild.exe + - ${CMAKE_CI_BUILD_DIR}/Utilities/cmcurl/curltest + - ${CMAKE_CI_BUILD_DIR}/Utilities/cmcurl/curltest.exe + - ${CMAKE_CI_BUILD_DIR}/Utilities/KWIML/test/kwiml_test + - ${CMAKE_CI_BUILD_DIR}/Utilities/KWIML/test/kwiml_test.exe + - ${CMAKE_CI_BUILD_DIR}/Source/kwsys/*cmsysTestDynload.* + - ${CMAKE_CI_BUILD_DIR}/Source/kwsys/dynloaddir/cmsysTestDynloadImpl.dll + - ${CMAKE_CI_BUILD_DIR}/Source/kwsys/dynloaddir/cmsysTestDynloadUse.dll # Test directories. - - build/Tests/CTest* - - build/Tests/Find* - - build/Tests/Qt* - - build/Tests/RunCMake/ - - build/Tests/CMakeOnly/ - - build/Tests/CMakeTests/ - - build/Tests/CMakeGUI/ - - build/Tests/FortranC/ + - ${CMAKE_CI_BUILD_DIR}/Tests/CTest* + - ${CMAKE_CI_BUILD_DIR}/Tests/Find* + - ${CMAKE_CI_BUILD_DIR}/Tests/Qt* + - ${CMAKE_CI_BUILD_DIR}/Tests/RunCMake/ + - ${CMAKE_CI_BUILD_DIR}/Tests/CMakeOnly/ + - ${CMAKE_CI_BUILD_DIR}/Tests/CMakeTests/ + - ${CMAKE_CI_BUILD_DIR}/Tests/CMakeGUI/ + - ${CMAKE_CI_BUILD_DIR}/Tests/FortranC/ # CTest/CDash information. - - build/Testing/ - - build/DartConfiguation.tcl - - build/CTestCustom.cmake + - ${CMAKE_CI_BUILD_DIR}/Testing/ + - ${CMAKE_CI_BUILD_DIR}/DartConfiguation.tcl + - ${CMAKE_CI_BUILD_DIR}/CTestCustom.cmake .cmake_release_artifacts: artifacts: @@ -71,17 +71,17 @@ when: always paths: # Any packages made. - - build/cmake-*-linux-x86_64.* - - build/cmake-*-linux-aarch64.* - - build/cmake-*-macos*-universal.* - - build/cmake-*-windows-x86_64.* - - build/cmake-*-windows-i386.* - - build/cmake-*-windows-arm64.* + - ${CMAKE_CI_BUILD_DIR}/cmake-*-linux-x86_64.* + - ${CMAKE_CI_BUILD_DIR}/cmake-*-linux-aarch64.* + - ${CMAKE_CI_BUILD_DIR}/cmake-*-macos*-universal.* + - ${CMAKE_CI_BUILD_DIR}/cmake-*-windows-x86_64.* + - ${CMAKE_CI_BUILD_DIR}/cmake-*-windows-i386.* + - ${CMAKE_CI_BUILD_DIR}/cmake-*-windows-arm64.* # Any source packages made. - - build/cmake-*.tar.gz - - build/cmake-*.zip + - ${CMAKE_CI_BUILD_DIR}/cmake-*.tar.gz + - ${CMAKE_CI_BUILD_DIR}/cmake-*.zip # Any unsigned packages made. - - build/unsigned/cmake-* + - ${CMAKE_CI_BUILD_DIR}/unsigned/cmake-* .cmake_junit_artifacts: artifacts: @@ -89,7 +89,7 @@ when: always reports: junit: - - build/junit.xml + - ${CMAKE_CI_BUILD_DIR}/junit.xml .cmake_sphinx_artifacts: artifacts: @@ -97,8 +97,8 @@ when: always paths: # Take the sphinx logs. - - build/build-*.log - - build/linkcheck/output.* + - ${CMAKE_CI_BUILD_DIR}/build-*.log + - ${CMAKE_CI_BUILD_DIR}/linkcheck/output.* .cmake_test_artifacts: artifacts: @@ -107,22 +107,22 @@ when: always reports: junit: - - build/junit.xml + - ${CMAKE_CI_BUILD_DIR}/junit.xml paths: # Take the install tree. - - build/install/ + - ${CMAKE_CI_BUILD_DIR}/install/ .cmake_doc_artifacts: artifacts: expire_in: 1d paths: # Take the install tree. - - build/install-doc/ + - ${CMAKE_CI_BUILD_DIR}/install-doc/ .cmake_org_help_artifacts: artifacts: expire_in: 1d paths: - - build/html + - ${CMAKE_CI_BUILD_DIR}/html exclude: - - build/html/.buildinfo + - ${CMAKE_CI_BUILD_DIR}/html/.buildinfo diff --git a/.gitlab/ci/clang.ps1 b/.gitlab/ci/clang.ps1 index 1fc8d8e1e52..e455ebc23b3 100755 --- a/.gitlab/ci/clang.ps1 +++ b/.gitlab/ci/clang.ps1 @@ -1,10 +1,10 @@ $erroractionpreference = "stop" -if ("$env:CMAKE_CI_BUILD_NAME".Contains("clang16.0")) { - # LLVM/Clang 16.0 - # https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.0 - $filename = "llvm-16.0.0-win-x86_64-1" - $sha256sum = "13F48356BA5892A82E8BB25EB283FDDAA8F23A0F209B6BF6525D2C5E1285B950" +if ("$env:CMAKE_CI_BUILD_NAME".Contains("clang17.0")) { + # LLVM/Clang 17.0.1 + # https://github.com/llvm/llvm-project/releases/tag/llvmorg-17.0.1 + $filename = "llvm-17.0.1-win-x86_64-1" + $sha256sum = "803F5D7291219BE60D2EE69CE8882341F94A8707A214DED190614895B6996F55" } else { throw ('unknown CMAKE_CI_BUILD_NAME: ' + "$env:CMAKE_CI_BUILD_NAME") } diff --git a/.gitlab/ci/cmake.ps1 b/.gitlab/ci/cmake.ps1 index 3efb67ab713..f6b5cc74b17 100755 --- a/.gitlab/ci/cmake.ps1 +++ b/.gitlab/ci/cmake.ps1 @@ -1,12 +1,12 @@ $erroractionpreference = "stop" -$version = "3.24.1" +$version = "3.27.6" if ("$env:PROCESSOR_ARCHITECTURE" -eq "AMD64") { - $sha256sum = "C1B17431A16337D517F7BA78C7067B6F143A12686CB8087F3DD32F3FA45F5AAE" + $sha256sum = "F013A0CCA091AA953F9A60A99292EC7A20AE3F9CEB05CB5C08EBE164097C526F" $platform = "windows-x86_64" } elseif ("$env:PROCESSOR_ARCHITECTURE" -eq "ARM64") { - $sha256sum = "D94683F3B0E63F6EF194C621194F6E26F3735EDA70750395E0F2BBEE4023FB95" + $sha256sum = "980B7E532D77BFB4E5814C76403242C503019F1C0699440220CF2D527C8FF350" $platform = "windows-arm64" } else { throw ('unknown PROCESSOR_ARCHITECTURE: ' + "$env:PROCESSOR_ARCHITECTURE") diff --git a/.gitlab/ci/cmake.sh b/.gitlab/ci/cmake.sh index 137da067930..21da466b021 100755 --- a/.gitlab/ci/cmake.sh +++ b/.gitlab/ci/cmake.sh @@ -2,22 +2,22 @@ set -e -readonly version="3.24.1" +readonly version="3.27.6" case "$(uname -s)-$(uname -m)" in Linux-x86_64) shatool="sha256sum" - sha256sum="827bf068cfaa23a9fb95f990c9f8a7ed8f2caeb3af62b5c0a2fed7a8dd6dde3e" + sha256sum="26373a283daa8490d772dc8a179450cd6d391cb2a9db8d4242fe09e361efc42e" platform="linux-x86_64" ;; Linux-aarch64) shatool="sha256sum" - sha256sum="d50c40135df667ed659f8e4eb7cf7d53421250304f7b3e1a70af9cf3d0f2ab18" + sha256sum="811e5040ad7f3fb4924a875373d2a1a174a01400233a81a638a989157438a5e3" platform="linux-aarch64" ;; Darwin-*) shatool="shasum -a 256" - sha256sum="71bb8db69826d74c395a3c3bbf8b773dbe9f54a2c7331266ba70da303e9c97a1" + sha256sum="a66b497289ab8c769b601d93833448eaae985beb762993837a51a79916d12f23" platform="macos-universal" ;; *) diff --git a/.gitlab/ci/configure_common.cmake b/.gitlab/ci/configure_common.cmake index c207a741985..f03c4b8396d 100644 --- a/.gitlab/ci/configure_common.cmake +++ b/.gitlab/ci/configure_common.cmake @@ -13,6 +13,10 @@ set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY "ON" CACHE BOOL "") set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "") set(CMake_TEST_INSTALL "OFF" CACHE BOOL "") +set(CTEST_TEST_CTEST ON CACHE BOOL "") +set(CMAKE_RUN_LONG_TESTS ON CACHE BOOL "") +set(CMAKE_TESTS_CDASH_SERVER "NOTFOUND" CACHE STRING "") + if (NOT "$ENV{CMAKE_CI_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE "$ENV{CMAKE_CI_BUILD_TYPE}" CACHE STRING "") endif () diff --git a/.gitlab/ci/configure_cuda11.8_splayed_nvidia.cmake b/.gitlab/ci/configure_cuda11.8_splayed_nvidia.cmake new file mode 100644 index 00000000000..519699b0ccf --- /dev/null +++ b/.gitlab/ci/configure_cuda11.8_splayed_nvidia.cmake @@ -0,0 +1,3 @@ +set(CMake_TEST_CUDA "NVIDIA" CACHE STRING "") + +include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_debian10_legacy.cmake b/.gitlab/ci/configure_debian10_legacy.cmake new file mode 100644 index 00000000000..11a5dc0254f --- /dev/null +++ b/.gitlab/ci/configure_debian10_legacy.cmake @@ -0,0 +1,6 @@ +set(CMake_TEST_FindPython2 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_IronPython "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython2_PyPy "ON" CACHE BOOL "") + +include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_debian10_aarch64_extdeps.cmake b/.gitlab/ci/configure_debian12_aarch64_extdeps.cmake similarity index 100% rename from .gitlab/ci/configure_debian10_aarch64_extdeps.cmake rename to .gitlab/ci/configure_debian12_aarch64_extdeps.cmake diff --git a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake b/.gitlab/ci/configure_debian12_aarch64_ninja.cmake similarity index 89% rename from .gitlab/ci/configure_debian10_aarch64_ninja.cmake rename to .gitlab/ci/configure_debian12_aarch64_ninja.cmake index dff0db15687..5b97e4f4ee5 100644 --- a/.gitlab/ci/configure_debian10_aarch64_ninja.cmake +++ b/.gitlab/ci/configure_debian12_aarch64_ninja.cmake @@ -28,14 +28,14 @@ set(CMake_TEST_FindGTK2 "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5 "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_MPICH_C_COMPILER "/usr/bin/h5pcc.mpich" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_MPICH_C_COMPILER_EXPLICIT "ON" CACHE BOOL "") -# set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER "/usr/bin/h5c++.mpich" CACHE FILEPATH "") # h5c++.mpich does not exist -# set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") +set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER "/usr/bin/h5c++.mpich" CACHE FILEPATH "") +set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_MPICH_Fortran_COMPILER "/usr/bin/h5pfc.mpich" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_MPICH_Fortran_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_OpenMPI_C_COMPILER "/usr/bin/h5pcc.openmpi" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_OpenMPI_C_COMPILER_EXPLICIT "ON" CACHE BOOL "") -# set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER "/usr/bin/h5c++.openmpi" CACHE FILEPATH "") # h5c++.openmpi does not exist -# set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") +set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER "/usr/bin/h5c++.openmpi" CACHE FILEPATH "") +set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_OpenMPI_Fortran_COMPILER "/usr/bin/h5pfc.openmpi" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_OpenMPI_Fortran_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_Serial_C_COMPILER "/usr/bin/h5cc" CACHE FILEPATH "") @@ -74,9 +74,9 @@ 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_FindPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_NumPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_PyPy "ON" CACHE BOOL "") set(CMake_TEST_FindRuby "ON" CACHE BOOL "") set(CMake_TEST_FindSDL "ON" CACHE BOOL "") set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "") diff --git a/.gitlab/ci/configure_debian10_extdeps.cmake b/.gitlab/ci/configure_debian12_extdeps.cmake similarity index 100% rename from .gitlab/ci/configure_debian10_extdeps.cmake rename to .gitlab/ci/configure_debian12_extdeps.cmake diff --git a/.gitlab/ci/configure_debian12_hip_radeon.cmake b/.gitlab/ci/configure_debian12_hip_radeon.cmake new file mode 100644 index 00000000000..c7d70041013 --- /dev/null +++ b/.gitlab/ci/configure_debian12_hip_radeon.cmake @@ -0,0 +1,3 @@ +set(CMake_TEST_HIP "amd" CACHE BOOL "") + +include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_debian10_iwyu.cmake b/.gitlab/ci/configure_debian12_iwyu.cmake similarity index 56% rename from .gitlab/ci/configure_debian10_iwyu.cmake rename to .gitlab/ci/configure_debian12_iwyu.cmake index abe750d3de2..37ccbf455df 100644 --- a/.gitlab/ci/configure_debian10_iwyu.cmake +++ b/.gitlab/ci/configure_debian12_iwyu.cmake @@ -1,6 +1,7 @@ set(CMake_RUN_IWYU ON CACHE BOOL "") +set(CMake_IWYU_OPTIONS "-DCMAKE_IWYU_FORWARD_STD_HASH" CACHE STRING "") # Uncomment to diagnose IWYU problems as needed. #set(CMake_IWYU_VERBOSE ON CACHE BOOL "") -set(IWYU_COMMAND "/usr/bin/include-what-you-use-6.0" CACHE FILEPATH "") +set(IWYU_COMMAND "/usr/bin/include-what-you-use-15" CACHE FILEPATH "") include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake") diff --git a/.gitlab/ci/configure_debian10_makefiles_clang.cmake b/.gitlab/ci/configure_debian12_makefiles_clang.cmake similarity index 100% rename from .gitlab/ci/configure_debian10_makefiles_clang.cmake rename to .gitlab/ci/configure_debian12_makefiles_clang.cmake diff --git a/.gitlab/ci/configure_debian10_makefiles_inplace.cmake b/.gitlab/ci/configure_debian12_makefiles_inplace.cmake similarity index 100% rename from .gitlab/ci/configure_debian10_makefiles_inplace.cmake rename to .gitlab/ci/configure_debian12_makefiles_inplace.cmake diff --git a/.gitlab/ci/configure_debian12_ninja.cmake b/.gitlab/ci/configure_debian12_ninja.cmake new file mode 100644 index 00000000000..89c11086b4e --- /dev/null +++ b/.gitlab/ci/configure_debian12_ninja.cmake @@ -0,0 +1,2 @@ +include("${CMAKE_CURRENT_LIST_DIR}/configure_debian12_ninja_common.cmake") +set(CMake_TEST_UseSWIG "ON" CACHE BOOL "") diff --git a/.gitlab/ci/configure_debian10_ninja_clang.cmake b/.gitlab/ci/configure_debian12_ninja_clang.cmake similarity index 100% rename from .gitlab/ci/configure_debian10_ninja_clang.cmake rename to .gitlab/ci/configure_debian12_ninja_clang.cmake diff --git a/.gitlab/ci/configure_debian10_ninja.cmake b/.gitlab/ci/configure_debian12_ninja_common.cmake similarity index 88% rename from .gitlab/ci/configure_debian10_ninja.cmake rename to .gitlab/ci/configure_debian12_ninja_common.cmake index 211a2a74d9b..d4d117bf899 100644 --- a/.gitlab/ci/configure_debian10_ninja.cmake +++ b/.gitlab/ci/configure_debian12_ninja_common.cmake @@ -32,14 +32,14 @@ set(CMake_TEST_FindGTK2 "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5 "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_MPICH_C_COMPILER "/usr/bin/h5pcc.mpich" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_MPICH_C_COMPILER_EXPLICIT "ON" CACHE BOOL "") -# set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER "/usr/bin/h5c++.mpich" CACHE FILEPATH "") # h5c++.mpich does not exist -# set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") +set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER "/usr/bin/h5c++.mpich" CACHE FILEPATH "") +set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_MPICH_Fortran_COMPILER "/usr/bin/h5pfc.mpich" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_MPICH_Fortran_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_OpenMPI_C_COMPILER "/usr/bin/h5pcc.openmpi" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_OpenMPI_C_COMPILER_EXPLICIT "ON" CACHE BOOL "") -# set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER "/usr/bin/h5c++.openmpi" CACHE FILEPATH "") # h5c++.openmpi does not exist -# set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") +set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER "/usr/bin/h5c++.openmpi" CACHE FILEPATH "") +set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_OpenMPI_Fortran_COMPILER "/usr/bin/h5pfc.openmpi" CACHE FILEPATH "") set(CMake_TEST_FindHDF5_OpenMPI_Fortran_COMPILER_EXPLICIT "ON" CACHE BOOL "") set(CMake_TEST_FindHDF5_Serial_C_COMPILER "/usr/bin/h5cc" CACHE FILEPATH "") @@ -78,10 +78,9 @@ 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_FindPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_IronPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3 "ON" CACHE BOOL "") +set(CMake_TEST_FindPython3_IronPython "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 "") @@ -98,10 +97,13 @@ 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_UseSWIG "ON" CACHE BOOL "") if (NOT "$ENV{SWIFTC}" STREQUAL "") set(CMAKE_Swift_COMPILER "$ENV{SWIFTC}" CACHE FILEPATH "") endif() +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_external_test.cmake") diff --git a/.gitlab/ci/configure_debian12_ninja_multi_symlinked.cmake b/.gitlab/ci/configure_debian12_ninja_multi_symlinked.cmake new file mode 100644 index 00000000000..cf9202d66df --- /dev/null +++ b/.gitlab/ci/configure_debian12_ninja_multi_symlinked.cmake @@ -0,0 +1,3 @@ +include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_debian12_ninja_common.cmake") +set(CMake_TEST_UseSWIG "OFF" CACHE BOOL "") diff --git a/.gitlab/ci/configure_fedora38_hip_radeon.cmake b/.gitlab/ci/configure_fedora38_hip_radeon.cmake new file mode 100644 index 00000000000..c7d70041013 --- /dev/null +++ b/.gitlab/ci/configure_fedora38_hip_radeon.cmake @@ -0,0 +1,3 @@ +set(CMake_TEST_HIP "amd" CACHE BOOL "") + +include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_fedora38_makefiles.cmake b/.gitlab/ci/configure_fedora38_makefiles.cmake index c2f99822f13..a3881cf8175 100644 --- a/.gitlab/ci/configure_fedora38_makefiles.cmake +++ b/.gitlab/ci/configure_fedora38_makefiles.cmake @@ -74,9 +74,12 @@ 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_FindPython "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "") -set(CMake_TEST_FindPython_PyPy "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 "") diff --git a/.gitlab/ci/configure_fedora38_makefiles_clang.cmake b/.gitlab/ci/configure_fedora38_makefiles_clang.cmake index ff30ad95a46..3ac23bebb9a 100644 --- a/.gitlab/ci/configure_fedora38_makefiles_clang.cmake +++ b/.gitlab/ci/configure_fedora38_makefiles_clang.cmake @@ -1 +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_fedora38_common_clang.cmake") diff --git a/.gitlab/ci/configure_fedora38_makefiles_symlinked.cmake b/.gitlab/ci/configure_fedora38_makefiles_symlinked.cmake new file mode 100644 index 00000000000..177bbcf59d8 --- /dev/null +++ b/.gitlab/ci/configure_fedora38_makefiles_symlinked.cmake @@ -0,0 +1,2 @@ +include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common.cmake") diff --git a/.gitlab/ci/configure_fedora38_ninja_clang.cmake b/.gitlab/ci/configure_fedora38_ninja_clang.cmake index 44546475d73..848c5b67394 100644 --- a/.gitlab/ci/configure_fedora38_ninja_clang.cmake +++ b/.gitlab/ci/configure_fedora38_ninja_clang.cmake @@ -1,4 +1,4 @@ -set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") +set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly" CACHE STRING "") set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "") include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common_clang.cmake") diff --git a/.gitlab/ci/configure_fedora38_ninja_multi_clang.cmake b/.gitlab/ci/configure_fedora38_ninja_multi_clang.cmake index 44546475d73..848c5b67394 100644 --- a/.gitlab/ci/configure_fedora38_ninja_multi_clang.cmake +++ b/.gitlab/ci/configure_fedora38_ninja_multi_clang.cmake @@ -1,4 +1,4 @@ -set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") +set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly" CACHE STRING "") set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "") include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common_clang.cmake") diff --git a/.gitlab/ci/configure_hip5.5_nvidia.cmake b/.gitlab/ci/configure_hip5.5_nvidia.cmake new file mode 100644 index 00000000000..4b3511ac48f --- /dev/null +++ b/.gitlab/ci/configure_hip5.5_nvidia.cmake @@ -0,0 +1,3 @@ +set(CMake_TEST_HIP "nvidia" CACHE BOOL "") + +include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_hip5.5_radeon.cmake b/.gitlab/ci/configure_hip5.5_radeon.cmake index 58036b05a02..c7d70041013 100644 --- a/.gitlab/ci/configure_hip5.5_radeon.cmake +++ b/.gitlab/ci/configure_hip5.5_radeon.cmake @@ -1,3 +1,3 @@ -set(CMake_TEST_HIP "ON" CACHE BOOL "") +set(CMake_TEST_HIP "amd" CACHE BOOL "") include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake index e9121aec0fe..f0ba9ebad44 100644 --- a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake +++ b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja.cmake @@ -1,4 +1,3 @@ -set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi" CACHE STRING "") -set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_gcc.cmake" CACHE STRING "") +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 index e9121aec0fe..f0ba9ebad44 100644 --- a/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake +++ b/.gitlab/ci/configure_linux_gcc_cxx_modules_ninja_multi.cmake @@ -1,4 +1,3 @@ -set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi" CACHE STRING "") -set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_gcc.cmake" CACHE STRING "") +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_multi.cmake b/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake index b22285c65b7..5b19c60c1bc 100644 --- a/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake +++ b/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake @@ -1,6 +1,11 @@ if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "") set(CMake_TEST_ISPC "ON" CACHE STRING "") + set(CMAKE_TESTS_CDASH_SERVER "https://open.cdash.org" CACHE STRING "") endif() +# FIXME: sccache sometimes fails with "Compiler killed by signal 9". +# This job does not compile much anyway, so suppress it for now. +set(configure_no_sccache 1) + include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake") include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_macos_arm64_ninja_symlinked.cmake b/.gitlab/ci/configure_macos_arm64_ninja_symlinked.cmake new file mode 100644 index 00000000000..63d0dc73e73 --- /dev/null +++ b/.gitlab/ci/configure_macos_arm64_ninja_symlinked.cmake @@ -0,0 +1,2 @@ +include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_arm64_ninja.cmake") diff --git a/.gitlab/ci/configure_macos_arm64_pch.cmake b/.gitlab/ci/configure_macos_arm64_pch.cmake new file mode 100644 index 00000000000..e2676ba8b06 --- /dev/null +++ b/.gitlab/ci/configure_macos_arm64_pch.cmake @@ -0,0 +1,7 @@ +set(CMake_BUILD_PCH "ON" CACHE BOOL "") + +# sccache does not forward the PCH '-Xarch_arm64 "-include/..."' flag correctly. +set(configure_no_sccache 1) + +include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake") diff --git a/.gitlab/ci/configure_macos_arm64_xcode_symlinked.cmake b/.gitlab/ci/configure_macos_arm64_xcode_symlinked.cmake new file mode 100644 index 00000000000..66b18e16b26 --- /dev/null +++ b/.gitlab/ci/configure_macos_arm64_xcode_symlinked.cmake @@ -0,0 +1,2 @@ +include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_arm64_xcode.cmake") diff --git a/.gitlab/ci/configure_mingw_osdn_io_common.cmake b/.gitlab/ci/configure_mingw_osdn_io_common.cmake index 55dce1d3ed6..d3162330282 100644 --- a/.gitlab/ci/configure_mingw_osdn_io_common.cmake +++ b/.gitlab/ci/configure_mingw_osdn_io_common.cmake @@ -1,5 +1,8 @@ set(CMake_TEST_Java OFF CACHE BOOL "") +get_filename_component(mingw_dir "${CMAKE_CURRENT_LIST_DIR}/../mingw" ABSOLUTE) +set(CMake_TEST_MSYSTEM_PREFIX "${mingw_dir}" CACHE STRING "") + set(configure_no_sccache 1) include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/configure_symlinked_common.cmake b/.gitlab/ci/configure_symlinked_common.cmake new file mode 100644 index 00000000000..a5e427e422f --- /dev/null +++ b/.gitlab/ci/configure_symlinked_common.cmake @@ -0,0 +1,7 @@ +# Ensure that the symlink tree is set up correctly. +if(NOT CMAKE_SOURCE_DIR STREQUAL "$ENV{CI_PROJECT_DIR}/work/cmake") + message(FATAL_ERROR "Expected value of CMAKE_SOURCE_DIR:\n $ENV{CI_PROJECT_DIR}/work/cmake\nActual value:\n ${CMAKE_SOURCE_DIR}") +endif() +if(NOT CMAKE_BINARY_DIR STREQUAL "$ENV{CI_PROJECT_DIR}/work/build") + message(FATAL_ERROR "Expected value of CMAKE_BINARY_DIR:\n $ENV{CI_PROJECT_DIR}/work/build\nActual value:\n ${CMAKE_BINARY_DIR}") +endif() diff --git a/.gitlab/ci/configure_windows_clang_ninja.cmake b/.gitlab/ci/configure_windows_clang_ninja.cmake index d1f0f524eb2..8a65eef1560 100644 --- a/.gitlab/ci/configure_windows_clang_ninja.cmake +++ b/.gitlab/ci/configure_windows_clang_ninja.cmake @@ -1,5 +1,5 @@ if("$ENV{CMAKE_CI_BUILD_NAME}" MATCHES "(^|_)gnu(_|$)") - set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared" CACHE STRING "") + set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly" CACHE STRING "") set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "") endif() include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_clang_common.cmake") diff --git a/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake b/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake index 5f2a215c982..e378d627295 100644 --- a/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake +++ b/.gitlab/ci/configure_windows_msvc_cxx_modules_common.cmake @@ -1,2 +1 @@ -set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,shared,export_bmi,install_bmi" CACHE STRING "") -set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_msvc.cmake" CACHE STRING "") +set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,shared,export_bmi,install_bmi,bmionly" CACHE STRING "") diff --git a/.gitlab/ci/configure_windows_orangec6.73.1.cmake b/.gitlab/ci/configure_windows_orangec6.73.1.cmake new file mode 100644 index 00000000000..e667b942db5 --- /dev/null +++ b/.gitlab/ci/configure_windows_orangec6.73.1.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_orangec_common.cmake") diff --git a/.gitlab/ci/configure_windows_orangec_common.cmake b/.gitlab/ci/configure_windows_orangec_common.cmake new file mode 100644 index 00000000000..55dce1d3ed6 --- /dev/null +++ b/.gitlab/ci/configure_windows_orangec_common.cmake @@ -0,0 +1,5 @@ +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_vs2019_x64.cmake b/.gitlab/ci/configure_windows_vs2019_x64.cmake index c7d41ea1d43..b859525eb66 100644 --- a/.gitlab/ci/configure_windows_vs2019_x64.cmake +++ b/.gitlab/ci/configure_windows_vs2019_x64.cmake @@ -1 +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_windows_vs_common.cmake") diff --git a/.gitlab/ci/configure_windows_vs2022_x64_pch.cmake b/.gitlab/ci/configure_windows_vs2022_x64_pch.cmake new file mode 100644 index 00000000000..2a2eed7a0ec --- /dev/null +++ b/.gitlab/ci/configure_windows_vs2022_x64_pch.cmake @@ -0,0 +1,2 @@ +set(CMake_BUILD_PCH "ON" CACHE BOOL "") +include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_common.cmake") diff --git a/.gitlab/ci/cxx_modules_rules_clang.cmake b/.gitlab/ci/cxx_modules_rules_clang.cmake index a8e1ff68ab0..12682447b9d 100644 --- a/.gitlab/ci/cxx_modules_rules_clang.cmake +++ b/.gitlab/ci/cxx_modules_rules_clang.cmake @@ -1,5 +1,3 @@ -set(CMake_TEST_CXXModules_UUID "a246741c-d067-4019-a8fb-3d16b0c9d1d3") - # Default to C++ extensions being off. Clang's modules support have trouble # with extensions right now. set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/.gitlab/ci/cxx_modules_rules_gcc.cmake b/.gitlab/ci/cxx_modules_rules_gcc.cmake deleted file mode 100644 index 3777506602a..00000000000 --- a/.gitlab/ci/cxx_modules_rules_gcc.cmake +++ /dev/null @@ -1,9 +0,0 @@ -set(CMake_TEST_CXXModules_UUID "a246741c-d067-4019-a8fb-3d16b0c9d1d3") - -string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE - " -E -x c++ " - " -MT -MD -MF " - " -fmodules-ts -fdep-file= -fdep-output= -fdep-format=trtbd" - " -o ") -set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "gcc") -set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "-fmodules-ts -fmodule-mapper= -fdep-format=trtbd -x c++") diff --git a/.gitlab/ci/cxx_modules_rules_msvc.cmake b/.gitlab/ci/cxx_modules_rules_msvc.cmake deleted file mode 100644 index 2b09b0e26db..00000000000 --- a/.gitlab/ci/cxx_modules_rules_msvc.cmake +++ /dev/null @@ -1 +0,0 @@ -set(CMake_TEST_CXXModules_UUID "a246741c-d067-4019-a8fb-3d16b0c9d1d3") diff --git a/.gitlab/ci/docker/debian10-aarch64/Dockerfile b/.gitlab/ci/docker/debian10-x86_64/Dockerfile similarity index 97% rename from .gitlab/ci/docker/debian10-aarch64/Dockerfile rename to .gitlab/ci/docker/debian10-x86_64/Dockerfile index a0687e3e301..c39b380bc37 100644 --- a/.gitlab/ci/docker/debian10-aarch64/Dockerfile +++ b/.gitlab/ci/docker/debian10-x86_64/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -ARG BASE_IMAGE=arm64v8/debian:10 +ARG BASE_IMAGE=debian:10 FROM ${BASE_IMAGE} AS apt-cache # Populate APT cache w/ the fresh metadata and prefetch packages. @@ -12,6 +12,7 @@ RUN --mount=type=tmpfs,target=/var/log \ apt-get update \ && apt-get --download-only -y install $(grep -h '^[^#]\+$' /root/*.lst) + FROM ${BASE_IMAGE} LABEL maintainer="Brad King " diff --git a/.gitlab/ci/docker/debian10-x86_64/deps_packages.lst b/.gitlab/ci/docker/debian10-x86_64/deps_packages.lst new file mode 100644 index 00000000000..b415421645d --- /dev/null +++ b/.gitlab/ci/docker/debian10-x86_64/deps_packages.lst @@ -0,0 +1,16 @@ +# Install build requirements. +libssl-dev + +# Install development tools. +g++ +curl +git + +# Tools needed for the test suite. +jq + +# Packages needed to test find modules. +python2 python2-dev python-numpy pypy pypy-dev + +# CMake_TEST_FindPython2_IronPython +libmono-system-windows-forms4.0-cil diff --git a/.gitlab/ci/docker/debian10-aarch64/docker-clean b/.gitlab/ci/docker/debian10-x86_64/docker-clean similarity index 100% rename from .gitlab/ci/docker/debian10-aarch64/docker-clean rename to .gitlab/ci/docker/debian10-x86_64/docker-clean diff --git a/.gitlab/ci/docker/debian10-aarch64/dpkg-exclude b/.gitlab/ci/docker/debian10-x86_64/dpkg-exclude similarity index 100% rename from .gitlab/ci/docker/debian10-aarch64/dpkg-exclude rename to .gitlab/ci/docker/debian10-x86_64/dpkg-exclude diff --git a/.gitlab/ci/docker/debian10-x86_64/install_deps.sh b/.gitlab/ci/docker/debian10-x86_64/install_deps.sh new file mode 100755 index 00000000000..002f136c05e --- /dev/null +++ b/.gitlab/ci/docker/debian10-x86_64/install_deps.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +apt-get install -y $(grep '^[^#]\+$' /root/deps_packages.lst) + +curl -L -O https://github.com/IronLanguages/ironpython2/releases/download/ipy-2.7.12/ironpython_2.7.12.deb +echo 'b7b90c82cf311dd3faf290ce3f274af5128b96db884a88dd643ce141bbf12fb9 ironpython_2.7.12.deb' > ironpython.sha256sum +sha256sum --check ironpython.sha256sum +dpkg -i ironpython_2.7.12.deb +rm ironpython_2.7.12.deb ironpython.sha256sum diff --git a/.gitlab/ci/docker/debian10/install_deps.sh b/.gitlab/ci/docker/debian10/install_deps.sh deleted file mode 100755 index a00e322cd8d..00000000000 --- a/.gitlab/ci/docker/debian10/install_deps.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -e - -apt-get install -y $(grep '^[^#]\+$' /root/deps_packages.lst) - -curl -L -O https://github.com/IronLanguages/ironpython2/releases/download/ipy-2.7.10/ironpython_2.7.10.deb -echo 'e1aceec1d49ffa66e9059a52168a734999dcccc50164a60e2936649cae698f3e ironpython_2.7.10.deb' > ironpython.sha256sum -sha256sum --check ironpython.sha256sum -dpkg -i ironpython_2.7.10.deb -rm ironpython_2.7.10.deb ironpython.sha256sum - -# Perforce -curl -L https://www.perforce.com/downloads/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz -o - \ - | tar -C /usr/local/bin -xvzf - -- p4 p4d diff --git a/.gitlab/ci/docker/debian12-aarch64/Dockerfile b/.gitlab/ci/docker/debian12-aarch64/Dockerfile new file mode 100644 index 00000000000..58b5e0e9f9d --- /dev/null +++ b/.gitlab/ci/docker/debian12-aarch64/Dockerfile @@ -0,0 +1,26 @@ +# syntax=docker/dockerfile:1 + +ARG BASE_IMAGE=arm64v8/debian:12 + +FROM ${BASE_IMAGE} AS apt-cache +# Populate APT cache w/ the fresh metadata and prefetch packages. +# Use an empty `docker-clean` file to "hide" the image-provided +# file to disallow removing packages after `apt-get` operations. +RUN --mount=type=tmpfs,target=/var/log \ + --mount=type=bind,source=docker-clean,target=/etc/apt/apt.conf.d/docker-clean \ + --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \ + apt-get update \ + && apt-get --download-only -y install $(grep -h '^[^#]\+$' /root/*.lst) + +FROM ${BASE_IMAGE} +LABEL maintainer="Brad King " + +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=bind,source=dpkg-exclude,target=/etc/dpkg/dpkg.cfg.d/exclude \ + --mount=type=bind,source=docker-clean,target=/etc/apt/apt.conf.d/docker-clean \ + --mount=type=cache,from=apt-cache,source=/var/lib/apt/lists,target=/var/lib/apt/lists \ + --mount=type=cache,from=apt-cache,source=/var/cache/apt,target=/var/cache/apt,sharing=private \ + --mount=type=tmpfs,target=/var/log \ + --mount=type=tmpfs,target=/tmp \ + sh /root/install_deps.sh diff --git a/.gitlab/ci/docker/debian10-aarch64/deps_packages.lst b/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst similarity index 90% rename from .gitlab/ci/docker/debian10-aarch64/deps_packages.lst rename to .gitlab/ci/docker/debian12-aarch64/deps_packages.lst index ca833230bc0..c92c71508b4 100644 --- a/.gitlab/ci/docker/debian10-aarch64/deps_packages.lst +++ b/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst @@ -20,14 +20,14 @@ libzstd-dev zlib1g-dev # Install iwyu runtime deps. -clang-6.0 +clang-15 libncurses6 # Tools needed for the test suite. jq # Packages needed to test CTest. -bzr bzr-xmloutput +bzr cvs subversion mercurial @@ -73,20 +73,19 @@ libopenal-dev libopenmpi-dev openmpi-bin libosp-dev libpng-dev -libpq-dev postgresql-server-dev-11 +libpq-dev postgresql-server-dev-15 libprotobuf-dev libprotobuf-c-dev libprotoc-dev protobuf-compiler protobuf-compiler-grpc -libsdl-dev +libsdl1.2-dev libsqlite3-dev libtiff-dev libuv1-dev -libwxgtk3.0-dev +libwxgtk3.2-dev libx11-dev libxalan-c-dev libxerces-c-dev libxml2-dev libxml2-utils libxslt-dev xsltproc -openjdk-11-jdk -python2 python2-dev python-numpy pypy pypy-dev +openjdk-17-jdk python3 python3-dev python3-numpy pypy3 pypy3-dev python3-venv qtbase5-dev qtbase5-dev-tools ruby ruby-dev diff --git a/.gitlab/ci/docker/debian10/docker-clean b/.gitlab/ci/docker/debian12-aarch64/docker-clean similarity index 100% rename from .gitlab/ci/docker/debian10/docker-clean rename to .gitlab/ci/docker/debian12-aarch64/docker-clean diff --git a/.gitlab/ci/docker/debian10/dpkg-exclude b/.gitlab/ci/docker/debian12-aarch64/dpkg-exclude similarity index 100% rename from .gitlab/ci/docker/debian10/dpkg-exclude rename to .gitlab/ci/docker/debian12-aarch64/dpkg-exclude diff --git a/.gitlab/ci/docker/debian10-aarch64/install_deps.sh b/.gitlab/ci/docker/debian12-aarch64/install_deps.sh similarity index 100% rename from .gitlab/ci/docker/debian10-aarch64/install_deps.sh rename to .gitlab/ci/docker/debian12-aarch64/install_deps.sh diff --git a/.gitlab/ci/docker/debian10/Dockerfile b/.gitlab/ci/docker/debian12-x86_64/Dockerfile similarity index 96% rename from .gitlab/ci/docker/debian10/Dockerfile rename to .gitlab/ci/docker/debian12-x86_64/Dockerfile index d86642876ce..477e763d2da 100644 --- a/.gitlab/ci/docker/debian10/Dockerfile +++ b/.gitlab/ci/docker/debian12-x86_64/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -ARG BASE_IMAGE=debian:10 +ARG BASE_IMAGE=debian:12 FROM ${BASE_IMAGE} AS apt-cache # Populate APT cache w/ the fresh metadata and prefetch packages. @@ -56,7 +56,7 @@ RUN --mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \ RUN --mount=type=bind,from=iwyu-build,source=/root,target=/root \ tar -C / -xf /root/iwyu.tar \ - && ln -s /usr/lib/llvm-6.0/bin/include-what-you-use /usr/bin/include-what-you-use-6.0 + && ln -s /usr/lib/llvm-15/bin/include-what-you-use /usr/bin/include-what-you-use-15 RUN --mount=type=bind,from=rvm-build,source=/root,target=/root \ tar -C /usr/local -xf /root/rvm.tar diff --git a/.gitlab/ci/docker/debian10/deps_packages.lst b/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst similarity index 88% rename from .gitlab/ci/docker/debian10/deps_packages.lst rename to .gitlab/ci/docker/debian12-x86_64/deps_packages.lst index 0b79675846c..a59f2c91b59 100644 --- a/.gitlab/ci/docker/debian10/deps_packages.lst +++ b/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst @@ -20,18 +20,21 @@ libzstd-dev zlib1g-dev # Install iwyu runtime deps. -clang-6.0 +clang-15 libncurses6 # Tools needed for the test suite. jq # Packages needed to test CTest. -bzr bzr-xmloutput +bzr cvs subversion mercurial +# Install HIP language toolchain. +hipcc + # Install swift runtime deps. libncurses5 @@ -76,25 +79,24 @@ libopenal-dev libopenmpi-dev openmpi-bin libosp-dev libpng-dev -libpq-dev postgresql-server-dev-11 +libpq-dev postgresql-server-dev-15 libprotobuf-dev libprotobuf-c-dev libprotoc-dev protobuf-compiler protobuf-compiler-grpc -libsdl-dev +libsdl1.2-dev libsqlite3-dev libtiff-dev libuv1-dev -libwxgtk3.0-dev +libwxgtk3.2-dev libx11-dev libxalan-c-dev libxerces-c-dev libxml2-dev libxml2-utils libxslt-dev xsltproc -openjdk-11-jdk -python2 python2-dev python-numpy pypy pypy-dev +openjdk-17-jdk python3 python3-dev python3-numpy pypy3 pypy3-dev python3-venv qtbase5-dev qtbase5-dev-tools ruby ruby-dev swig unixodbc-dev -# CMake_TEST_FindPython_IronPython +# Packages needed to test ironpython. libmono-system-windows-forms4.0-cil diff --git a/Tests/RunCMake/CommandLine/DeprecateVS11-WARN-OFF.cmake b/.gitlab/ci/docker/debian12-x86_64/docker-clean similarity index 100% rename from Tests/RunCMake/CommandLine/DeprecateVS11-WARN-OFF.cmake rename to .gitlab/ci/docker/debian12-x86_64/docker-clean diff --git a/.gitlab/ci/docker/debian12-x86_64/dpkg-exclude b/.gitlab/ci/docker/debian12-x86_64/dpkg-exclude new file mode 100644 index 00000000000..60b656549cc --- /dev/null +++ b/.gitlab/ci/docker/debian12-x86_64/dpkg-exclude @@ -0,0 +1,21 @@ +# Drop all man pages +path-exclude=/usr/share/man/* + +# Drop all info pages +path-exclude=/usr/share/info/* + +# Drop all README files except from the some packages +path-exclude=/usr/**/*README* +path-include=/usr/share/devscripts/templates/README.mk-build-deps +path-include=/usr/share/equivs/template/debian/README.Debian.in + +# Drop all translations +path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo + +# Drop all documentation ... +path-exclude=/usr/share/doc/* +path-exclude=/usr/share/doc-base/* +path-exclude=/usr/share/gtk-doc/* + +# Per package excludes +path-exclude=/usr/share/gnupg/help.*.txt diff --git a/.gitlab/ci/docker/debian12-x86_64/install_deps.sh b/.gitlab/ci/docker/debian12-x86_64/install_deps.sh new file mode 100755 index 00000000000..7bfcacdec5e --- /dev/null +++ b/.gitlab/ci/docker/debian12-x86_64/install_deps.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +apt-get install -y $(grep '^[^#]\+$' /root/deps_packages.lst) + +curl -L -O https://github.com/IronLanguages/ironpython3/releases/download/v3.4.0/ironpython_3.4.0.deb +echo '7dcd10b7a0ec0342bd7e20eebb597a96bb15267eb797d59358a3b1cfaa3e1adc ironpython_3.4.0.deb' > ironpython.sha256sum +sha256sum --check ironpython.sha256sum +dpkg -i ironpython_3.4.0.deb +rm ironpython_3.4.0.deb ironpython.sha256sum + +# Perforce +curl -L https://www.perforce.com/downloads/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz -o - \ + | tar -C /usr/local/bin -xvzf - -- p4 p4d diff --git a/.gitlab/ci/docker/debian10/install_iwyu.sh b/.gitlab/ci/docker/debian12-x86_64/install_iwyu.sh similarity index 76% rename from .gitlab/ci/docker/debian10/install_iwyu.sh rename to .gitlab/ci/docker/debian12-x86_64/install_iwyu.sh index 4814a7161e0..bbeceb8f131 100755 --- a/.gitlab/ci/docker/debian10/install_iwyu.sh +++ b/.gitlab/ci/docker/debian12-x86_64/install_iwyu.sh @@ -8,7 +8,7 @@ apt-get install -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_version="$( clang-6.0 --version | head -n1 | cut -d' ' -f3 | cut -d. -f-2 )" +readonly llvm_version="$( clang-15 --version | head -n1 | cut -d' ' -f4 | cut -d. -f-1 )" git checkout "clang_$llvm_version" mkdir build cd build @@ -16,7 +16,6 @@ cd build cmake -GNinja \ -DCMAKE_BUILD_TYPE=Release \ "-DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$llvm_version" \ - "-DIWYU_LLVM_ROOT_PATH=/usr/lib/llvm-$llvm_version" \ .. ninja DESTDIR=/root/iwyu-destdir ninja install diff --git a/.gitlab/ci/docker/debian10/install_rvm.sh b/.gitlab/ci/docker/debian12-x86_64/install_rvm.sh similarity index 92% rename from .gitlab/ci/docker/debian10/install_rvm.sh rename to .gitlab/ci/docker/debian12-x86_64/install_rvm.sh index c6fff70d024..1ad42c4580f 100755 --- a/.gitlab/ci/docker/debian10/install_rvm.sh +++ b/.gitlab/ci/docker/debian12-x86_64/install_rvm.sh @@ -11,7 +11,7 @@ gpg2 --keyserver hkps://keyserver.ubuntu.com \ curl -sSL https://get.rvm.io | bash -s stable # keep version in sync with `env_debian*_ninja.sh` -/usr/local/rvm/bin/rvm install ruby-2.7.0 +/usr/local/rvm/bin/rvm install ruby-3.2.2 for p in archives examples gem-cache log src; do touch /usr/local/rvm/${p}/.tar_exclude diff --git a/.gitlab/ci/docker/debian10/iwyu_packages.lst b/.gitlab/ci/docker/debian12-x86_64/iwyu_packages.lst similarity index 61% rename from .gitlab/ci/docker/debian10/iwyu_packages.lst rename to .gitlab/ci/docker/debian12-x86_64/iwyu_packages.lst index 9e291c9b046..2dbddba9f84 100644 --- a/.gitlab/ci/docker/debian10/iwyu_packages.lst +++ b/.gitlab/ci/docker/debian12-x86_64/iwyu_packages.lst @@ -1,7 +1,7 @@ # Install development tools. -clang-6.0 -libclang-6.0-dev -llvm-6.0-dev +clang-15 +libclang-15-dev +llvm-15-dev libz-dev g++ cmake diff --git a/.gitlab/ci/docker/debian10/rvm_packages.lst b/.gitlab/ci/docker/debian12-x86_64/rvm_packages.lst similarity index 100% rename from .gitlab/ci/docker/debian10/rvm_packages.lst rename to .gitlab/ci/docker/debian12-x86_64/rvm_packages.lst diff --git a/.gitlab/ci/docker/fedora38/deps_packages.lst b/.gitlab/ci/docker/fedora38/deps_packages.lst index c7c13855d4e..da050d90b38 100644 --- a/.gitlab/ci/docker/fedora38/deps_packages.lst +++ b/.gitlab/ci/docker/fedora38/deps_packages.lst @@ -44,6 +44,13 @@ 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 diff --git a/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile b/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile index e0af0b9f0fb..d8e823889d3 100644 --- a/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile +++ b/.gitlab/ci/docker/gcc_cxx_modules/Dockerfile @@ -1,4 +1,4 @@ -FROM fedora:36 +FROM fedora:38 MAINTAINER Ben Boeckel # Install build dependencies for packages. diff --git a/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh b/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh index 20ea35f6f78..15cfe390701 100755 --- a/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh +++ b/.gitlab/ci/docker/gcc_cxx_modules/install_gcc.sh @@ -2,8 +2,8 @@ set -e -readonly revision="p1689r5-cmake-ci-20220614" # 3075e510e3d29583f8886b95aff044c0474c84a5 -readonly tarball="https://github.com/mathstuf/gcc/archive/$revision.tar.gz" +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" @@ -12,9 +12,8 @@ readonly njobs="$( nproc )" mkdir -p "$workdir" cd "$workdir" -curl -L "$tarball" > "gcc-$revision.tar.gz" -tar xf "gcc-$revision.tar.gz" -mv "gcc-$revision" "$srcdir" +git clone "$tarball" "$srcdir" +git -C "$srcdir" checkout "$revision" mkdir -p "$builddir" cd "$builddir" "$srcdir/configure" \ diff --git a/.gitlab/ci/docker/hip5.5/Dockerfile b/.gitlab/ci/docker/hip5.5/Dockerfile index 2deb3c69de9..3a4aa53cbd3 100644 --- a/.gitlab/ci/docker/hip5.5/Dockerfile +++ b/.gitlab/ci/docker/hip5.5/Dockerfile @@ -2,7 +2,13 @@ ARG BASE_IMAGE=rocm/dev-ubuntu-22.04:5.5 -FROM ${BASE_IMAGE} AS apt-cache +FROM ${BASE_IMAGE} AS cuda-keyring +ADD https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb /root/ +RUN --mount=type=tmpfs,target=/var/log \ + dpkg -i /root/cuda-keyring_1.1-1_all.deb \ + && rm /root/cuda-keyring_1.1-1_all.deb + +FROM cuda-keyring AS apt-cache # Populate APT cache w/ the fresh metadata and prefetch packages. # Use an empty `docker-clean` file to "hide" the image-provided # file to disallow removing packages after `apt-get` operations. @@ -12,9 +18,12 @@ RUN --mount=type=tmpfs,target=/var/log \ apt-get update \ && apt-get --download-only -y install $(grep -h '^[^#]\+$' /root/*.lst) -FROM ${BASE_IMAGE} +FROM cuda-keyring MAINTAINER Brad King +ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility +ENV NVIDIA_REQUIRE_CUDA=cuda>=11.8 +ENV NVIDIA_VISIBLE_DEVICES=all ENV PATH="/opt/rocm/bin:$PATH" RUN --mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \ diff --git a/.gitlab/ci/docker/hip5.5/deps_packages.lst b/.gitlab/ci/docker/hip5.5/deps_packages.lst index 98479250e1d..32760553f93 100644 --- a/.gitlab/ci/docker/hip5.5/deps_packages.lst +++ b/.gitlab/ci/docker/hip5.5/deps_packages.lst @@ -2,3 +2,20 @@ g++ curl git + +# NVIDIA CUDA Compiler +cuda-keyring +cuda-nvcc-11-8 +cuda-profiler-api-11-8 + +# NVIDIA CUDA Toolkit +# These are not needed for HIP, but having them in +# the environment allows us to run CUDA tests too. +cuda-nvrtc-dev-11-8 +cuda-nvtx-11-8 +libcublas-dev-11-8 +libcufft-dev-11-8 +libcurand-dev-11-8 +libcusolver-dev-11-8 +libcusparse-dev-11-8 +libnpp-dev-11-8 diff --git a/.gitlab/ci/download_qt.cmake b/.gitlab/ci/download_qt.cmake index b02ceb06574..28a3e270b25 100644 --- a/.gitlab/ci/download_qt.cmake +++ b/.gitlab/ci/download_qt.cmake @@ -15,11 +15,11 @@ if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows.*package") set(qt_url_root "https://cmake.org/files/dependencies") set(qt_url_path "") if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows_x86_64_package") - list(APPEND qt_files "qt-5.12.1-win-x86_64-msvc_v142-1.zip") - set(qt_subdir "qt-5.12.1-win-x86_64-msvc_v142-1") + list(APPEND qt_files "qt-5.15.10-win-x86_64-msvc_v142-1.zip") + set(qt_subdir "qt-5.15.10-win-x86_64-msvc_v142-1") elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows_i386_package") - list(APPEND qt_files "qt-5.12.1-win-i386-msvc_v142-1.zip") - set(qt_subdir "qt-5.12.1-win-i386-msvc_v142-1") + list(APPEND qt_files "qt-5.15.10-win-i386-msvc_v142-1.zip") + set(qt_subdir "qt-5.15.10-win-i386-msvc_v142-1") elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows_arm64_package") list(APPEND qt_files "qt-6.3.0-win-arm64-msvc_v143-1.zip") set(qt_subdir "qt-6.3.0-win-arm64-msvc_v143-1") diff --git a/.gitlab/ci/download_qt_hashes.cmake b/.gitlab/ci/download_qt_hashes.cmake index 4c48a47b268..1b9cf1473c0 100644 --- a/.gitlab/ci/download_qt_hashes.cmake +++ b/.gitlab/ci/download_qt_hashes.cmake @@ -13,8 +13,8 @@ set("5.15.1-0-202009071110qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_6 set("qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz_hash" d4449771afa0bc6a809c14f1e6d939e7732494cf059503ae451e2bfe8fc60cc1) set("qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz_hash" 7b9463a01c8beeee5bf8d01c70deff2d08561cd20aaf6f7a2f41cf8b68ce8a6b) -set("qt-5.12.1-win-i386-msvc_v142-1.zip_hash" aa78711fdaa5d9b146bf7ddcf15983f9fbb3f995462f2d043f8cca74b40ddd11) -set("qt-5.12.1-win-x86_64-msvc_v142-1.zip_hash" c2fc068b9dac40bb420e28e1ee15ce4f2ccfc866d767f3b99b6bb435b7c4f44b) +set("qt-5.15.10-win-i386-msvc_v142-1.zip_hash" c158cebc054d3f4f09733772a8a04789e2884912d45782e8c0c5e6a0b2773e92) +set("qt-5.15.10-win-x86_64-msvc_v142-1.zip_hash" d55c017aef359f6aa8c592b18ba13cc120c749417b55671548970690126cd139) set("qt-6.3.0-win-arm64-msvc_v143-1.zip_hash" f794c035fd4ff9f04468e1787a60d93d7496119c0060c3173a76d24a6b551b14) set("qt-6.3.0-win-i386-msvc_v143-1.zip_hash" 972bc707f78d11b44f360643ca4d0c898e761f7add43b96117d958c70d84a443) diff --git a/.gitlab/ci/env.sh b/.gitlab/ci/env.sh index 7634f5deeed..aa709a892e1 100644 --- a/.gitlab/ci/env.sh +++ b/.gitlab/ci/env.sh @@ -9,6 +9,16 @@ quietly() { rm -f "$log" } +if test -n "$CMAKE_CI_IN_SYMLINK_TREE"; then + mkdir -p "$CI_PROJECT_DIR/real_work/work/build" + ln -s real_work/work "$CI_PROJECT_DIR/work" + git worktree prune + git worktree add "$CI_PROJECT_DIR/work/cmake" HEAD + + # Assert that the hash matches. + test "$(git -C "$CI_PROJECT_DIR/work/cmake" rev-parse HEAD)" = "$(git -C "$CI_PROJECT_DIR" rev-parse HEAD)" +fi + if test -r ".gitlab/ci/env_${CMAKE_CONFIGURATION}.sh"; then source ".gitlab/ci/env_${CMAKE_CONFIGURATION}.sh" fi diff --git a/.gitlab/ci/env_cuda11.8_splayed_nvidia.sh b/.gitlab/ci/env_cuda11.8_splayed_nvidia.sh new file mode 100644 index 00000000000..38e788d349e --- /dev/null +++ b/.gitlab/ci/env_cuda11.8_splayed_nvidia.sh @@ -0,0 +1,36 @@ +# +# Splay the libraries and includes to emulate conda where +# things are split between the host and build prefix +# +# /usr/local/cuda/include/crt/ -> /tmp/cuda/include/crt +# /usr/local/cuda/lib64/stubs/ -> /tmp/cuda/stubs/ +# /usr/local/cuda/lib64/libcudart* -> /tmp/cuda/libs/ +# +# Also reduce to minimal subset of libraries by removing +# static libraries to emulate a minimal cuda install +mkdir -p /tmp/cuda/libs +mkdir -p /tmp/cuda/stubs +mkdir -p /tmp/cuda/include + +mv /usr/local/cuda/lib64/libcuda* /tmp/cuda/libs +mv /usr/local/cuda/lib64/stubs/ /tmp/cuda/stubs/ +mv /usr/local/cuda/include/crt/ /tmp/cuda/include/ + +# patch the nvcc.profile to handle the splayed layout +# which allows verification +mv /usr/local/cuda/bin/nvcc.profile /usr/local/cuda/bin/nvcc.profile.orig +echo " +TOP = \$(_HERE_)/.. + +NVVMIR_LIBRARY_DIR = \$(TOP)/\$(_NVVM_BRANCH_)/libdevice + +LD_LIBRARY_PATH += \$(TOP)/lib: +PATH += \$(TOP)/\$(_NVVM_BRANCH_)/bin:\$(_HERE_): + +INCLUDES += \"-I\$(TOP)/\$(_TARGET_DIR_)/include\" \$(_SPACE_) \"-I/tmp/cuda/include\" \$(_SPACE_) + +LIBRARIES =+ \$(_SPACE_) \"-L\$(TOP)/\$(_TARGET_DIR_)/lib\$(_TARGET_SIZE_)\" \"-L/tmp/cuda/stubs/\" \"-L/tmp/cuda/libs\" + +CUDAFE_FLAGS += +PTXAS_FLAGS += +" > /usr/local/cuda/bin/nvcc.profile diff --git a/.gitlab/ci/env_debian10_makefiles_clang.sh b/.gitlab/ci/env_debian10_makefiles_clang.sh deleted file mode 100644 index e0d5d6105b3..00000000000 --- a/.gitlab/ci/env_debian10_makefiles_clang.sh +++ /dev/null @@ -1,2 +0,0 @@ -export CC=/usr/bin/clang-7 -export CXX=/usr/bin/clang++-7 diff --git a/.gitlab/ci/env_debian10_ninja.sh b/.gitlab/ci/env_debian10_ninja.sh deleted file mode 100644 index ba8ad479dd1..00000000000 --- a/.gitlab/ci/env_debian10_ninja.sh +++ /dev/null @@ -1,11 +0,0 @@ -export MY_RUBY_HOME="/usr/local/rvm/rubies/ruby-2.7.0" - -if test -z "$CI_MERGE_REQUEST_ID"; then - curl -L -O "https://download.swift.org/swift-5.7.1-release/ubuntu1804/swift-5.7.1-RELEASE/swift-5.7.1-RELEASE-ubuntu18.04.tar.gz" - echo '2b30f9efc969d9e96f0836d0871130dffb369822a3823ee6f3db44c29c1698e3 swift-5.7.1-RELEASE-ubuntu18.04.tar.gz' > swift.sha256sum - sha256sum --check swift.sha256sum - mkdir /opt/swift - tar xzf swift-5.7.1-RELEASE-ubuntu18.04.tar.gz -C /opt/swift --strip-components=2 - rm swift-5.7.1-RELEASE-ubuntu18.04.tar.gz swift.sha256sum - export SWIFTC="/opt/swift/bin/swiftc" -fi diff --git a/.gitlab/ci/env_debian10_ninja_clang.sh b/.gitlab/ci/env_debian10_ninja_clang.sh deleted file mode 100644 index e0d5d6105b3..00000000000 --- a/.gitlab/ci/env_debian10_ninja_clang.sh +++ /dev/null @@ -1,2 +0,0 @@ -export CC=/usr/bin/clang-7 -export CXX=/usr/bin/clang++-7 diff --git a/.gitlab/ci/env_debian10_aarch64_extdeps.sh b/.gitlab/ci/env_debian12_aarch64_extdeps.sh similarity index 100% rename from .gitlab/ci/env_debian10_aarch64_extdeps.sh rename to .gitlab/ci/env_debian12_aarch64_extdeps.sh diff --git a/.gitlab/ci/env_debian10_extdeps.sh b/.gitlab/ci/env_debian12_extdeps.sh similarity index 100% rename from .gitlab/ci/env_debian10_extdeps.sh rename to .gitlab/ci/env_debian12_extdeps.sh diff --git a/.gitlab/ci/env_debian12_hip_radeon.sh b/.gitlab/ci/env_debian12_hip_radeon.sh new file mode 100644 index 00000000000..793c985ff7f --- /dev/null +++ b/.gitlab/ci/env_debian12_hip_radeon.sh @@ -0,0 +1,9 @@ +export HIPCXX=/usr/bin/clang++-15 +export HIPFLAGS='--rocm-path=/usr --rocm-device-lib-path=/usr/lib/x86_64-linux-gnu/amdgcn/bitcode' + +# FIXME(debian): Clang is supposed to automatically parse a HIP version file. +# The ROCm installer places it at '$prefix/bin/.hipVersion', but the package +# on Debian moves it to '$prefix/share/hip/version'. llvm-toolchain package +# version 15.0.7-4 has 'debian/patches/amdgpu/usr-search-paths.patch' for this, +# but Debian 12 currently provides version 15.0.6-4 without the patch. +export HIPFLAGS="$HIPFLAGS --hip-version=5.2" diff --git a/.gitlab/ci/env_debian12_makefiles_clang.sh b/.gitlab/ci/env_debian12_makefiles_clang.sh new file mode 100644 index 00000000000..eda7c1fa818 --- /dev/null +++ b/.gitlab/ci/env_debian12_makefiles_clang.sh @@ -0,0 +1,2 @@ +export CC=/usr/bin/clang-15 +export CXX=/usr/bin/clang++-15 diff --git a/.gitlab/ci/env_debian12_ninja.sh b/.gitlab/ci/env_debian12_ninja.sh new file mode 100644 index 00000000000..2b8ff2aa034 --- /dev/null +++ b/.gitlab/ci/env_debian12_ninja.sh @@ -0,0 +1,5 @@ +export MY_RUBY_HOME="/usr/local/rvm/rubies/ruby-3.2.2" + +if test -z "$CI_MERGE_REQUEST_ID"; then + source .gitlab/ci/swift-env.sh +fi diff --git a/.gitlab/ci/env_debian12_ninja_clang.sh b/.gitlab/ci/env_debian12_ninja_clang.sh new file mode 100644 index 00000000000..eda7c1fa818 --- /dev/null +++ b/.gitlab/ci/env_debian12_ninja_clang.sh @@ -0,0 +1,2 @@ +export CC=/usr/bin/clang-15 +export CXX=/usr/bin/clang++-15 diff --git a/.gitlab/ci/env_debian12_ninja_multi_symlinked.sh b/.gitlab/ci/env_debian12_ninja_multi_symlinked.sh new file mode 100644 index 00000000000..2b8ff2aa034 --- /dev/null +++ b/.gitlab/ci/env_debian12_ninja_multi_symlinked.sh @@ -0,0 +1,5 @@ +export MY_RUBY_HOME="/usr/local/rvm/rubies/ruby-3.2.2" + +if test -z "$CI_MERGE_REQUEST_ID"; then + source .gitlab/ci/swift-env.sh +fi diff --git a/.gitlab/ci/env_fedora38_hip_radeon.sh b/.gitlab/ci/env_fedora38_hip_radeon.sh new file mode 100644 index 00000000000..812ef5a1c73 --- /dev/null +++ b/.gitlab/ci/env_fedora38_hip_radeon.sh @@ -0,0 +1 @@ +export HIPCXX=/usr/bin/clang++-16 diff --git a/.gitlab/ci/env_fedora38_makefiles_symlinked.cmake b/.gitlab/ci/env_fedora38_makefiles_symlinked.cmake new file mode 100644 index 00000000000..2accabf54b4 --- /dev/null +++ b/.gitlab/ci/env_fedora38_makefiles_symlinked.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/env_fedora38_makefiles.cmake") diff --git a/.gitlab/ci/env_fedora38_makefiles_symlinked.sh b/.gitlab/ci/env_fedora38_makefiles_symlinked.sh new file mode 100644 index 00000000000..452d3785737 --- /dev/null +++ b/.gitlab/ci/env_fedora38_makefiles_symlinked.sh @@ -0,0 +1 @@ +. .gitlab/ci/env_fedora38_makefiles.sh diff --git a/.gitlab/ci/env_hip5.5_nvidia.sh b/.gitlab/ci/env_hip5.5_nvidia.sh new file mode 100644 index 00000000000..67d1ef262b1 --- /dev/null +++ b/.gitlab/ci/env_hip5.5_nvidia.sh @@ -0,0 +1,4 @@ +export HIP_PLATFORM=nvidia +export CUDA_PATH=/usr/local/cuda-11.8 +export PATH=/usr/local/cuda-11.8/bin:$PATH +export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64 diff --git a/.gitlab/ci/env_macos_arm64_ninja_symlinked.sh b/.gitlab/ci/env_macos_arm64_ninja_symlinked.sh new file mode 100644 index 00000000000..b78cefcb725 --- /dev/null +++ b/.gitlab/ci/env_macos_arm64_ninja_symlinked.sh @@ -0,0 +1 @@ +. .gitlab/ci/env_macos_arm64_ninja.sh diff --git a/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1 b/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1 index e2d573eb6fc..f6e1f0a3fb7 100755 --- a/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1 +++ b/.gitlab/ci/env_mingw_osdn_io_mingw_makefiles.ps1 @@ -1,3 +1 @@ -$pwdpath = $pwd.Path -& "$pwsh" -File ".gitlab/ci/mingw.ps1" -Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\mingw\bin;$env:PATH" +. .gitlab/ci/mingw-env.ps1 diff --git a/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1 b/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1 index 6eccb720a37..f6e1f0a3fb7 100755 --- a/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1 +++ b/.gitlab/ci/env_mingw_osdn_io_msys_makefiles.ps1 @@ -1,5 +1 @@ -$pwdpath = $pwd.Path -& "$pwsh" -File ".gitlab/ci/mingw.ps1" -Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\mingw\msys\1.0\bin;$pwdpath\.gitlab\mingw\bin;$env:PATH" -$env:MSYSTEM = 'MINGW32' -$env:MAKE_MODE = 'unix' +. .gitlab/ci/mingw-env.ps1 diff --git a/.gitlab/ci/env_windows_orangec6.73.1.ps1 b/.gitlab/ci/env_windows_orangec6.73.1.ps1 new file mode 100755 index 00000000000..96e36a18051 --- /dev/null +++ b/.gitlab/ci/env_windows_orangec6.73.1.ps1 @@ -0,0 +1,2 @@ +. .gitlab/ci/ninja-env.ps1 +. .gitlab/ci/orangec-env.ps1 diff --git a/.gitlab/ci/env_windows_vs2022_x64.ps1 b/.gitlab/ci/env_windows_vs2022_x64.ps1 new file mode 100755 index 00000000000..42aec1132db --- /dev/null +++ b/.gitlab/ci/env_windows_vs2022_x64.ps1 @@ -0,0 +1,4 @@ +if ("$env:CMAKE_CI_NIGHTLY" -eq "true") { + $cmake = "build\install\bin\cmake" + . ".gitlab/ci/qt-env.ps1" +} diff --git a/.gitlab/ci/gitlab_ci.cmake b/.gitlab/ci/gitlab_ci.cmake index 080c93b2e20..d0d4a59dd98 100644 --- a/.gitlab/ci/gitlab_ci.cmake +++ b/.gitlab/ci/gitlab_ci.cmake @@ -5,8 +5,13 @@ endif () # Set up the source and build paths. set(CTEST_SOURCE_DIRECTORY "$ENV{CI_PROJECT_DIR}") +if("$ENV{CMAKE_CI_IN_SYMLINK_TREE}") + set(CTEST_SOURCE_DIRECTORY "$ENV{CI_PROJECT_DIR}/work/cmake") +endif() if("$ENV{CMAKE_CI_INPLACE}") set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}") +elseif("$ENV{CMAKE_CI_IN_SYMLINK_TREE}") + set(CTEST_BINARY_DIRECTORY "$ENV{CI_PROJECT_DIR}/work/build") else() set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/build") endif() diff --git a/.gitlab/ci/ispc.sh b/.gitlab/ci/ispc.sh index 59ee200ea64..c1e379368c3 100755 --- a/.gitlab/ci/ispc.sh +++ b/.gitlab/ci/ispc.sh @@ -12,12 +12,12 @@ case "$(uname -s)-$(uname -m)" in ;; Darwin-arm64) shatool="shasum -a 256" - sha256sum="62cee043a3a4dbff8c2f6d3885a7e573901bbc1325dd93d50f92904b7ea67fec" + sha256sum="c423a5a88d7a9a6ed667e41d025801c123fa0c5fd384d4ea138fa1fcf2bc24c9" platform="macOS.arm64" ;; Darwin-x86_64) shatool="shasum -a 256" - sha256sum="da0f11a048a316081a8ad8170d48b170b2ed7efc3b140fc88b8611238809c8e4" + sha256sum="e25222d2d6f4f8e3561556ac73f88721ceb5486439d6c2a566d37407ad9a5907" platform="macOS.x86_64" ;; *) diff --git a/.gitlab/ci/mingw-env.ps1 b/.gitlab/ci/mingw-env.ps1 new file mode 100755 index 00000000000..d68a7f7d9ea --- /dev/null +++ b/.gitlab/ci/mingw-env.ps1 @@ -0,0 +1,5 @@ +$pwdpath = $pwd.Path +& "$pwsh" -File ".gitlab/ci/mingw.ps1" +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\mingw\bin;$pwdpath\.gitlab\mingw\msys\1.0\bin;$env:PATH" +$env:MSYSTEM = 'MINGW32' +$env:MAKE_MODE = 'unix' diff --git a/.gitlab/ci/ninja-nightly.sh b/.gitlab/ci/ninja-nightly.sh index b78b64e2404..739d1d58707 100755 --- a/.gitlab/ci/ninja-nightly.sh +++ b/.gitlab/ci/ninja-nightly.sh @@ -5,7 +5,7 @@ set -e cd .gitlab git clone https://github.com/ninja-build/ninja.git ninja-src -cmake -S ninja-src -B ninja-src/build -DCMAKE_BUILD_TYPE=Release +cmake -S ninja-src -B ninja-src/build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release cmake --build ninja-src/build --parallel --target ninja mv ninja-src/build/ninja . rm -rf ninja-src diff --git a/.gitlab/ci/orangec-env.ps1 b/.gitlab/ci/orangec-env.ps1 new file mode 100755 index 00000000000..3a5d23200b9 --- /dev/null +++ b/.gitlab/ci/orangec-env.ps1 @@ -0,0 +1,8 @@ +Invoke-Expression -Command .gitlab/ci/orangec.ps1 +$pwdpath = $pwd.Path +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\orangec\bin;$env:PATH" +Set-Item -Force -Path "env:ORANGEC" -Value "$pwdpath\.gitlab\orangec" + +$env:CC = "occ" +$env:CXX = "occ" +occ --version diff --git a/.gitlab/ci/orangec.ps1 b/.gitlab/ci/orangec.ps1 new file mode 100755 index 00000000000..2201e1229d3 --- /dev/null +++ b/.gitlab/ci/orangec.ps1 @@ -0,0 +1,24 @@ +$erroractionpreference = "stop" + +if ("$env:CMAKE_CONFIGURATION".Contains("orangec6.73.1")) { + # OrangeC 6.73.1 + $archive = "ZippedBinaries6738.zip" + $release = "Orange-C-v6.73.1" + $sha256sum = "29BC506AB105B2BF1002129C37826B2153DF1C8D0F22B9A2C38ACA3FB72A5B89" +} else { + throw ('unknown CMAKE_CONFIGURATION: ' + "$env:CMAKE_CONFIGURATION") +} + +$outdir = $pwd.Path +$outdir = "$outdir\.gitlab" +$ProgressPreference = 'SilentlyContinue' +Invoke-WebRequest -Uri "https://github.com/LADSoft/OrangeC/releases/download/$release/$archive" -OutFile "$outdir\$archive" +$hash = Get-FileHash "$outdir\$archive" -Algorithm SHA256 +if ($hash.Hash -ne $sha256sum) { + exit 1 +} + +Add-Type -AssemblyName System.IO.Compression.FileSystem +[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$archive", "$outdir") +# The archive contains directory 'orangec', placed at '$outdir\orangec'. +Remove-Item "$outdir\$archive" diff --git a/.gitlab/ci/qt-env.ps1 b/.gitlab/ci/qt-env.ps1 index 7eff55fc446..22b10992e0c 100755 --- a/.gitlab/ci/qt-env.ps1 +++ b/.gitlab/ci/qt-env.ps1 @@ -1,6 +1,9 @@ +if ($cmake -eq $null) { + throw ('$cmake powershell variable not set ') +} if ("$env:PROCESSOR_ARCHITECTURE" -eq "AMD64") { $pwdpath = $pwd.Path - cmake -P .gitlab/ci/download_qt.cmake + & $cmake -P .gitlab/ci/download_qt.cmake Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\qt\bin;$env:PATH" qmake -v } elseif ("$env:PROCESSOR_ARCHITECTURE" -eq "ARM64") { diff --git a/.gitlab/ci/swift-env.sh b/.gitlab/ci/swift-env.sh new file mode 100644 index 00000000000..fa0c81e175c --- /dev/null +++ b/.gitlab/ci/swift-env.sh @@ -0,0 +1,7 @@ +curl -L -O "https://download.swift.org/swift-5.7.1-release/ubuntu1804/swift-5.7.1-RELEASE/swift-5.7.1-RELEASE-ubuntu18.04.tar.gz" +echo '2b30f9efc969d9e96f0836d0871130dffb369822a3823ee6f3db44c29c1698e3 swift-5.7.1-RELEASE-ubuntu18.04.tar.gz' > swift.sha256sum +sha256sum --check swift.sha256sum +mkdir /opt/swift +tar xzf swift-5.7.1-RELEASE-ubuntu18.04.tar.gz -C /opt/swift --strip-components=2 +rm swift-5.7.1-RELEASE-ubuntu18.04.tar.gz swift.sha256sum +export SWIFTC="/opt/swift/bin/swiftc" diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 451a8e2e7a4..88940579b1f 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -11,11 +11,11 @@ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" .linux_release_x86_64: - image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157" + image: "kitware/cmake:build-linux-x86_64-deps-2023-08-16@sha256:aa0ebdbd90a51cc83d31f393c5c48ec4599a28f7ccdc288558522c6265b24fae" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" - LAUNCHER: "scl enable devtoolset-6 rh-python36 --" + LAUNCHER: "scl enable devtoolset-7 --" CMAKE_ARCH: x86_64 .linux_release_aarch64: @@ -30,11 +30,11 @@ variables: BOOTSTRAP_ARGS: '-- "-DCMake_DOC_ARTIFACT_PREFIX=$CI_PROJECT_DIR/build/install-doc"' -.needs_centos6_x86_64: +.needs_centos7_x86_64: dependencies: - - b:centos6-x86_64 + - b:centos7-x86_64 needs: - - b:centos6-x86_64 + - b:centos7-x86_64 .needs_centos7_aarch64: dependencies: @@ -44,23 +44,23 @@ ### Debian -.debian10: - image: "kitware/cmake:ci-debian10-x86_64-2023-03-29" +.debian12: + image: "kitware/cmake:ci-debian12-x86_64-2023-07-27" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" CMAKE_ARCH: x86_64 -.debian10_iwyu: - extends: .debian10 +.debian12_iwyu: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_iwyu + CMAKE_CONFIGURATION: debian12_iwyu CTEST_NO_WARNINGS_ALLOWED: 1 CMAKE_CI_NO_INSTALL: 1 -.debian10_aarch64: - image: "kitware/cmake:ci-debian10-aarch64-2023-03-29" +.debian12_aarch64: + image: "kitware/cmake:ci-debian12-aarch64-2023-07-27" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" @@ -69,7 +69,7 @@ ### Fedora .fedora38: - image: "kitware/cmake:ci-fedora38-x86_64-2023-05-22" + image: "kitware/cmake:ci-fedora38-x86_64-2023-08-07" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes" @@ -112,44 +112,54 @@ #### Build and test -.debian10_ninja: - extends: .debian10 +.debian12_ninja: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_ninja + CMAKE_CONFIGURATION: debian12_ninja CTEST_NO_WARNINGS_ALLOWED: 1 -.debian10_aarch64_ninja: - extends: .debian10_aarch64 +.debian12_aarch64_ninja: + extends: .debian12_aarch64 variables: - CMAKE_CONFIGURATION: debian10_aarch64_ninja + CMAKE_CONFIGURATION: debian12_aarch64_ninja CTEST_NO_WARNINGS_ALLOWED: 1 -.debian10_makefiles_inplace: - extends: .debian10 +.debian12_makefiles_inplace: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_makefiles_inplace + CMAKE_CONFIGURATION: debian12_makefiles_inplace CMAKE_GENERATOR: "Unix Makefiles" CMAKE_CI_BOOTSTRAP: 1 CMAKE_CI_INPLACE: 1 CMAKE_CI_NO_INSTALL: 1 CTEST_NO_WARNINGS_ALLOWED: 1 -.debian10_extdeps: - extends: .debian10 +.debian12_ninja_multi_symlinked: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_extdeps + CMAKE_CONFIGURATION: debian12_ninja_multi_symlinked + CMAKE_GENERATOR: "Ninja Multi-Config" + CTEST_NO_WARNINGS_ALLOWED: 1 + CMAKE_CI_IN_SYMLINK_TREE: 1 + CMAKE_CI_BUILD_DIR: "real_work/work/build" + +.debian12_extdeps: + extends: .debian12 + + variables: + CMAKE_CONFIGURATION: debian12_extdeps CMAKE_CI_BUILD_TYPE: Release CTEST_NO_WARNINGS_ALLOWED: 1 -.debian10_aarch64_extdeps: - extends: .debian10_aarch64 +.debian12_aarch64_extdeps: + extends: .debian12_aarch64 variables: - CMAKE_CONFIGURATION: debian10_aarch64_extdeps + CMAKE_CONFIGURATION: debian12_aarch64_extdeps CMAKE_CI_BUILD_TYPE: Release CTEST_NO_WARNINGS_ALLOWED: 1 @@ -185,20 +195,30 @@ CTEST_NO_WARNINGS_ALLOWED: 1 CMAKE_GENERATOR: "Unix Makefiles" +.fedora38_makefiles_symlinked: + extends: .fedora38 + + variables: + CMAKE_CONFIGURATION: fedora38_makefiles_symlinked + CTEST_NO_WARNINGS_ALLOWED: 1 + CMAKE_GENERATOR: "Unix Makefiles" + CMAKE_CI_IN_SYMLINK_TREE: 1 + CMAKE_CI_BUILD_DIR: "real_work/work/build" + ### Clang Compiler -.debian10_makefiles_clang: - extends: .debian10 +.debian12_makefiles_clang: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_makefiles_clang + CMAKE_CONFIGURATION: debian12_makefiles_clang CMAKE_GENERATOR: "Unix Makefiles" -.debian10_ninja_clang: - extends: .debian10 +.debian12_ninja_clang: + extends: .debian12 variables: - CMAKE_CONFIGURATION: debian10_ninja_clang + CMAKE_CONFIGURATION: debian12_ninja_clang .fedora38_makefiles_clang: extends: .fedora38 @@ -342,10 +362,16 @@ CMAKE_CONFIGURATION: cuda11.8_minimal_nvidia CTEST_NO_WARNINGS_ALLOWED: 1 +.cuda11.8_splayed_nvidia: + extends: .cuda11.8_minimal + variables: + CMAKE_CONFIGURATION: cuda11.8_splayed_nvidia + CTEST_NO_WARNINGS_ALLOWED: 1 + ### HIP builds .hip5.5: - image: "kitware/cmake:ci-hip5.5-x86_64-2023-06-01" + image: "kitware/cmake:ci-hip5.5-x86_64-2023-09-18" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" @@ -359,10 +385,31 @@ CMAKE_CONFIGURATION: hip5.5_radeon CMAKE_GENERATOR: "Ninja Multi-Config" +.debian12_hip_radeon: + extends: .debian12 + + variables: + CMAKE_CONFIGURATION: debian12_hip_radeon + CTEST_LABELS: "HIP" + +.fedora38_hip_radeon: + extends: .fedora38 + + variables: + CMAKE_CONFIGURATION: fedora38_hip_radeon + CTEST_LABELS: "HIP" + +.hip5.5_nvidia: + extends: .hip5.5 + + variables: + CMAKE_CONFIGURATION: hip5.5_nvidia + CTEST_LABELS: "HIP" + ### C++ modules .gcc_cxx_modules_x86_64: - image: "kitware/cmake:ci-gcc_cxx_modules-x86_64-2022-06-21" + image: "kitware/cmake:ci-gcc_cxx_modules-x86_64-2023-09-21" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" @@ -383,6 +430,22 @@ CMAKE_CONFIGURATION: linux_gcc_cxx_modules_ninja_multi CMAKE_GENERATOR: "Ninja Multi-Config" +### Debian 10 legacy packages + +.debian10: + image: "kitware/cmake:ci-debian10-x86_64-2023-07-31" + + variables: + GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci" + CMAKE_ARCH: x86_64 + +.debian10_legacy: + extends: .debian10 + + variables: + CMAKE_CONFIGURATION: debian10_legacy + CTEST_LABELS: "Python2" + ## Tags .linux_x86_64_tags: @@ -588,7 +651,7 @@ - .cmake_test_linux_release - .linux_x86_64_tags - .run_manually - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -598,7 +661,7 @@ - .cmake_test_linux_release - .linux_x86_64_tags - .run_manually - - .needs_centos6_x86_64 + - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index 09d75984929..b3165fa0b70 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -7,7 +7,7 @@ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID" # TODO: Factor this out so that each job selects the Xcode version to # use so that different versions can be tested in a single pipeline. - DEVELOPER_DIR: "/Applications/Xcode-14.3.app/Contents/Developer" + DEVELOPER_DIR: "/Applications/Xcode-15.0.app/Contents/Developer" # Avoid conflicting with other projects running on the same machine. SCCACHE_SERVER_PORT: 4227 @@ -38,6 +38,21 @@ CMAKE_CONFIGURATION: macos_arm64_ninja CTEST_NO_WARNINGS_ALLOWED: 1 +.macos_arm64_ninja_symlinked: + extends: .macos_build + + variables: + CMAKE_CONFIGURATION: macos_arm64_ninja_symlinked + CTEST_NO_WARNINGS_ALLOWED: 1 + CMAKE_CI_IN_SYMLINK_TREE: 1 + CMAKE_CI_BUILD_DIR: "real_work/work/build" + +.macos_arm64_pch: + extends: .macos_arm64_ninja + + variables: + CMAKE_CONFIGURATION: macos_arm64_pch + .macos_x86_64_makefiles: extends: .macos_build @@ -80,6 +95,16 @@ CMAKE_GENERATOR: Xcode CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" +.macos_arm64_xcode_symlinked: + extends: .macos + + variables: + CMAKE_CONFIGURATION: macos_arm64_xcode_symlinked + CMAKE_GENERATOR: Xcode + CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_IN_SYMLINK_TREE: 1 + CMAKE_CI_BUILD_DIR: "real_work/work/build" + .macos_arm64_xcode_ub: extends: .macos @@ -110,7 +135,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-x86_64 - shell - - xcode-14.3 + - xcode-15.0 - nonconcurrent .macos_x86_64_tags_ext: @@ -118,7 +143,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-x86_64 - shell - - xcode-14.3 + - xcode-15.0 - concurrent .macos_arm64_tags: @@ -126,7 +151,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-arm64 - shell - - xcode-14.3 + - xcode-15.0 - nonconcurrent .macos_arm64_tags_ext: @@ -134,7 +159,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-arm64 - shell - - xcode-14.3 + - xcode-15.0 - concurrent .macos_arm64_tags_package: @@ -142,7 +167,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-arm64 - shell - - xcode-14.3 + - xcode-15.0 - nonconcurrent - finder diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 026f2f44223..c449ab82531 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -55,6 +55,13 @@ VCVARSPLATFORM: "arm64" VCVARSVERSION: "14.36.32532" +.windows_vs2022_x64_pch: + extends: + - .windows_vs2022_x64_ninja + + variables: + CMAKE_CONFIGURATION: windows_vs2022_x64_pch + .windows_vs2022_x64_ninja: extends: - .windows_build_ninja @@ -254,6 +261,20 @@ variables: CMAKE_CONFIGURATION: windows_openwatcom1.9 +.windows_orangec: + extends: .windows + + variables: + CMAKE_GENERATOR: "Ninja" + CMAKE_CI_BUILD_TYPE: Release + CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + +.windows_orangec6.73.1: + extends: .windows_orangec + + variables: + CMAKE_CONFIGURATION: windows_orangec6.73.1 + .windows_arm64_vs2022: extends: .windows @@ -359,6 +380,7 @@ - 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/ninja-env.ps1 - (& "$env:WIX\bin\light.exe" -help) | Select -First 1 - cmake --version diff --git a/Auxiliary/vim/cmake.vim.in b/Auxiliary/vim/cmake.vim.in index 6edc0407354..39d7193fcd0 100644 --- a/Auxiliary/vim/cmake.vim.in +++ b/Auxiliary/vim/cmake.vim.in @@ -22,20 +22,20 @@ set cpo&vim syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell -syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" 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 syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contains=cmakeVariableValue,cmakeProperty,cmakeGeneratorExpressions,cmakeTodo -syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped +syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped,@Spell syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo,cmakeVariableValue syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo -syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo +syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo,@Spell syn case match diff --git a/Auxiliary/vim/extract-upper-case.pl b/Auxiliary/vim/extract-upper-case.pl index 11791991d77..7f40b7436d2 100755 --- a/Auxiliary/vim/extract-upper-case.pl +++ b/Auxiliary/vim/extract-upper-case.pl @@ -16,10 +16,10 @@ my %keywords; # command => keyword-list # find cmake/Modules/ | sed -rn 's/.*CMakeDetermine(.+)Compiler.cmake/\1/p' | sort -my @languages = qw(ASM ASM_MASM ASM_NASM C CSharp CUDA CXX Fortran Java RC Swift); +my @languages = qw(ASM ASM_MASM ASM_NASM C CSharp CUDA CXX Fortran Java RC Swift HIP); # unwanted upper-cases -my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR NEW); +my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR NEW GNU); # cannot remove ALL - exists for add_custom_command # control-statements @@ -30,7 +30,7 @@ my %deprecated = map { $_ => 1 } qw(build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file); # add some (popular) modules -push @modules, "ExternalProject"; +push @modules, "ExternalProject", "FetchContent"; # variables open(CMAKE, "$cmake --help-variable-list|") or die "could not run cmake"; diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index 83f13d8ef88..4bbdc65a491 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -1,13 +1,13 @@ " Vim syntax file " Program: CMake - Cross-Platform Makefile Generator -" Version: cmake version 3.19.20201028-gdab947f +" Version: cmake version 3.27.20230713-gdc88dd5 " Language: CMake " Author: Andy Cedilnik , " Nicholas Hutchinson , " Patrick Boettcher " Maintainer: Dimitri Merejkowsky " Former Maintainer: Karthik Krishnan -" Last Change: 2020 oct. 28 +" Last Change: 2023 Jul 13 " " License: The CMake license applies to this file. See " https://cmake.org/licensing @@ -22,20 +22,20 @@ set cpo&vim syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell -syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" 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 syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contains=cmakeVariableValue,cmakeProperty,cmakeGeneratorExpressions,cmakeTodo -syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped +syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped,@Spell syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo,cmakeVariableValue syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo -syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo +syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo,@Spell syn case match @@ -76,6 +76,7 @@ syn keyword cmakeProperty contained \ AUTOGEN_USE_SYSTEM_INCLUDE \ AUTOGEN_TARGETS_FOLDER \ AUTOGEN_TARGET_DEPENDS + \ AUTOGEN_USE_SYSTEM_INCLUDE \ AUTOMOC \ AUTOMOC_COMPILER_PREDEFINES \ AUTOMOC_DEPEND_FILTERS @@ -120,6 +121,7 @@ syn keyword cmakeProperty contained \ COMPILE_OPTIONS \ COMPILE_PDB_NAME \ COMPILE_PDB_OUTPUT_DIRECTORY + \ COMPILE_WARNING_AS_ERROR \ COST \ CPACK_DESKTOP_SHORTCUTS \ CPACK_NEVER_OVERWRITE @@ -140,6 +142,10 @@ syn keyword cmakeProperty contained \ CUDA_STANDARD \ CUDA_STANDARD_REQUIRED \ CXX_EXTENSIONS + \ CXX_MODULE_DIRS + \ CXX_MODULE_SET + \ CXX_MODULE_SETS + \ CXX_SCAN_FOR_MODULES \ CXX_STANDARD \ CXX_STANDARD_REQUIRED \ C_EXTENSIONS @@ -156,6 +162,7 @@ syn keyword cmakeProperty contained \ DISABLED \ DISABLED_FEATURES \ DISABLE_PRECOMPILE_HEADERS + \ DLL_NAME_WITH_SOVERSION \ DOTNET_SDK \ DOTNET_TARGET_FRAMEWORK \ DOTNET_TARGET_FRAMEWORK_VERSION @@ -168,7 +175,9 @@ syn keyword cmakeProperty contained \ ENVIRONMENT_MODIFICATION \ EXCLUDE_FROM_ALL \ EXCLUDE_FROM_DEFAULT_BUILD + \ EXPORT_COMPILE_COMMANDS \ EXPORT_NAME + \ EXPORT_NO_SYSTEM \ EXPORT_PROPERTIES \ EXTERNAL_OBJECT \ EchoString @@ -183,6 +192,7 @@ syn keyword cmakeProperty contained \ FOLDER \ FRAMEWORK \ FRAMEWORK_VERSION + \ Fortran_BUILDING_INSTRINSIC_MODULES \ Fortran_FORMAT \ Fortran_MODULE_DIRECTORY \ Fortran_PREPROCESS @@ -195,7 +205,10 @@ syn keyword cmakeProperty contained \ GLOBAL_DEPENDS_NO_CYCLES \ GNUtoMS \ HAS_CXX + \ HEADER_DIRS \ HEADER_FILE_ONLY + \ HEADER_SET + \ HEADER_SETS \ HELPSTRING \ HIP_ARCHITECTURES \ HIP_EXTENSIONS @@ -214,8 +227,10 @@ syn keyword cmakeProperty contained \ IMPORTED_LINK_INTERFACE_MULTIPLICITY \ IMPORTED_LOCATION \ IMPORTED_NO_SONAME + \ IMPORTED_NO_SYSTEM \ IMPORTED_OBJECTS \ IMPORTED_SONAME + \ IMPORTED_TARGETS \ IMPORT_PREFIX \ IMPORT_SUFFIX \ INCLUDE_DIRECTORIES @@ -224,15 +239,21 @@ syn keyword cmakeProperty contained \ INSTALL_REMOVE_ENVIRONMENT_RPATH \ INSTALL_RPATH \ INSTALL_RPATH_USE_LINK_PATH + \ INTERFACE_AUTOMOC_MACRO_NAMES \ INTERFACE_AUTOUIC_OPTIONS \ INTERFACE_AUTOMOC_MACRO_NAMES \ INTERFACE_COMPILE_DEFINITIONS \ INTERFACE_COMPILE_FEATURES \ INTERFACE_COMPILE_OPTIONS + \ INTERFACE_CXX_MODULE_SETS + \ INTERFACE_HEADER_SETS + \ INTERFACE_HEADER_SETS_TO_VERIFY \ INTERFACE_INCLUDE_DIRECTORIES \ INTERFACE_LINK_DEPENDS \ INTERFACE_LINK_DIRECTORIES \ INTERFACE_LINK_LIBRARIES + \ INTERFACE_LINK_LIBRARIES_DIRECT + \ INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE \ INTERFACE_LINK_OPTIONS \ INTERFACE_POSITION_INDEPENDENT_CODE \ INTERFACE_PRECOMPILE_HEADERS @@ -242,6 +263,7 @@ syn keyword cmakeProperty contained \ IN_TRY_COMPILE \ IOS_INSTALL_COMBINED \ ISPC_HEADER_DIRECTORY + \ ISPC_HEADER_SUFFIX \ ISPC_INSTRUCTION_SETS \ JOB_POOLS \ JOB_POOL_COMPILE @@ -260,6 +282,8 @@ syn keyword cmakeProperty contained \ LINK_INTERFACE_LIBRARIES \ LINK_INTERFACE_MULTIPLICITY \ LINK_LIBRARIES + \ LINK_LIBRARIES_ONLY_TARGETS + \ LINK_LIBRARY_OVERRIDE \ LINK_OPTIONS \ LINK_SEARCH_END_STATIC \ LINK_SEARCH_START_STATIC @@ -277,6 +301,7 @@ syn keyword cmakeProperty contained \ MANUALLY_ADDED_DEPENDENCIES \ MEASUREMENT \ MODIFIED + \ MSVC_DEBUG_INFORMATION_FORMAT \ MSVC_RUNTIME_LIBRARY \ NAME \ NO_SONAME @@ -343,6 +368,7 @@ syn keyword cmakeProperty contained \ SUBDIRECTORIES \ SUFFIX \ SYMBOLIC + \ SYSTEM \ Swift_DEPENDENCIES_FILE \ Swift_DIAGNOSTICS_FILE \ Swift_LANGUAGE_VERSION @@ -356,16 +382,20 @@ syn keyword cmakeProperty contained \ TEST_INCLUDE_FILES \ TIMEOUT \ TIMEOUT_AFTER_MATCH + \ TIMEOUT_SIGNAL_GRACE_PERIOD + \ TIMEOUT_SIGNAL_NAME \ TYPE \ UNITY_BUILD \ UNITY_BUILD_BATCH_SIZE \ UNITY_BUILD_CODE_AFTER_INCLUDE \ UNITY_BUILD_CODE_BEFORE_INCLUDE \ UNITY_BUILD_MODE + \ UNITY_BUILD_UNIQUE_ID \ UNITY_GROUP \ USE_FOLDERS \ VALUE \ VARIABLES + \ VERIFY_INTERFACE_HEADER_SETS \ VERSION \ VISIBILITY_INLINES_HIDDEN \ VS_CONFIGURATION_TYPE @@ -422,11 +452,14 @@ syn keyword cmakeProperty contained \ VS_WINRT_EXTENSIONS \ VS_WINRT_REFERENCES \ VS_XAML_TYPE + \ WATCOM_RUNTIME_LIBRARY \ WILL_FAIL \ WIN32_EXECUTABLE \ WINDOWS_EXPORT_ALL_SYMBOLS \ WORKING_DIRECTORY \ WRAP_EXCLUDE + \ XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY + \ XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY \ XCODE_EMIT_EFFECTIVE_PLATFORM_NAME \ XCODE_EXPLICIT_FILE_TYPE \ XCODE_FILE_ATTRIBUTES @@ -443,9 +476,13 @@ syn keyword cmakeProperty contained \ XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER \ XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS \ XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE + \ XCODE_SCHEME_ENABLE_GPU_API_VALIDATION + \ XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE + \ XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION \ XCODE_SCHEME_ENVIRONMENT \ XCODE_SCHEME_EXECUTABLE \ XCODE_SCHEME_GUARD_MALLOC + \ XCODE_SCHEME_LAUNCH_CONFIGURATION \ XCODE_SCHEME_LAUNCH_MODE \ XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP \ XCODE_SCHEME_MALLOC_GUARD_EDGES @@ -460,16 +497,19 @@ syn keyword cmakeProperty contained \ XCODE_SCHEME_LAUNCH_CONFIGURATION \ XCODE_SCHEME_WORKING_DIRECTORY \ XCODE_SCHEME_ZOMBIE_OBJECTS + \ XCODE_XCCONFIG \ XCTEST syn keyword cmakeVariable contained \ ANDROID \ APPLE \ BORLAND + \ BSD \ BUILD_SHARED_LIBS \ CACHE \ CMAKE_ABSOLUTE_DESTINATION_FILES \ CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY + \ CMAKE_ADSP_ROOT \ CMAKE_AIX_EXPORT_ALL_SYMBOLS \ CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS \ CMAKE_ANDROID_API @@ -479,6 +519,7 @@ syn keyword cmakeVariable contained \ CMAKE_ANDROID_ARM_MODE \ CMAKE_ANDROID_ARM_NEON \ CMAKE_ANDROID_ASSETS_DIRECTORIES + \ CMAKE_ANDROID_EXCEPTIONS \ CMAKE_ANDROID_GUI \ CMAKE_ANDROID_JAR_DEPENDENCIES \ CMAKE_ANDROID_JAR_DIRECTORIES @@ -489,14 +530,17 @@ syn keyword cmakeVariable contained \ CMAKE_ANDROID_NDK_DEPRECATED_HEADERS \ CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG \ CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION + \ CMAKE_ANDROID_NDK_VERSION \ CMAKE_ANDROID_PROCESS_MAX \ CMAKE_ANDROID_PROGUARD \ CMAKE_ANDROID_PROGUARD_CONFIG_PATH + \ CMAKE_ANDROID_RTTI \ CMAKE_ANDROID_SECURE_PROPS_PATH \ CMAKE_ANDROID_SKIP_ANT_STEP \ CMAKE_ANDROID_STANDALONE_TOOLCHAIN \ CMAKE_ANDROID_STL_TYPE \ CMAKE_APPBUNDLE_PATH + \ CMAKE_APPLE_SILICON_PROCESSOR \ CMAKE_AR \ CMAKE_ARCHIVE_OUTPUT_DIRECTORY \ CMAKE_ARGC @@ -508,12 +552,15 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_ARCHIVE_APPEND \ CMAKE_ASM_ARCHIVE_CREATE \ CMAKE_ASM_ARCHIVE_FINISH + \ CMAKE_ASM_BYTE_ORDER \ CMAKE_ASM_CLANG_TIDY + \ CMAKE_ASM_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_ASM_COMPILER \ CMAKE_ASM_COMPILER_ABI \ CMAKE_ASM_COMPILER_AR \ CMAKE_ASM_COMPILER_ARCHITECTURE_ID \ CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_ASM_COMPILER_FRONTEND_VARIANT \ CMAKE_ASM_COMPILER_ID \ CMAKE_ASM_COMPILER_LAUNCHER \ CMAKE_ASM_COMPILER_LOADED @@ -528,6 +575,8 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_CREATE_SHARED_LIBRARY \ CMAKE_ASM_CREATE_SHARED_MODULE \ CMAKE_ASM_CREATE_STATIC_LIBRARY + \ CMAKE_ASM_EXTENSIONS + \ CMAKE_ASM_EXTENSIONS_DEFAULT \ CMAKE_ASM_FLAGS \ CMAKE_ASM_FLAGS_DEBUG \ CMAKE_ASM_FLAGS_DEBUG_INIT @@ -546,6 +595,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_INCLUDE_WHAT_YOU_USE \ CMAKE_ASM_INIT \ CMAKE_ASM_LIBRARY_ARCHITECTURE + \ CMAKE_ASM_LINKER_LAUNCHER \ CMAKE_ASM_LINKER_PREFERENCE \ CMAKE_ASM_LINKER_PREFERENCE_PROPAGATES \ CMAKE_ASM_LINKER_WRAPPER_FLAG @@ -554,6 +604,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_LINK_LIBRARY_FILE_FLAG \ CMAKE_ASM_LINK_LIBRARY_FLAG \ CMAKE_ASM_LINK_LIBRARY_SUFFIX + \ CMAKE_ASM_LINK_WHAT_YOU_USE_FLAG \ CMAKE_ASM_MASM \ CMAKE_ASM_MASM_ANDROID_TOOLCHAIN_MACHINE \ CMAKE_ASM_MASM_ANDROID_TOOLCHAIN_PREFIX @@ -561,12 +612,15 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_ARCHIVE_APPEND \ CMAKE_ASM_MASM_ARCHIVE_CREATE \ CMAKE_ASM_MASM_ARCHIVE_FINISH + \ CMAKE_ASM_MASM_BYTE_ORDER \ CMAKE_ASM_MASM_CLANG_TIDY + \ CMAKE_ASM_MASM_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_ASM_MASM_COMPILER \ CMAKE_ASM_MASM_COMPILER_ABI \ CMAKE_ASM_MASM_COMPILER_AR \ CMAKE_ASM_MASM_COMPILER_ARCHITECTURE_ID \ CMAKE_ASM_MASM_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_ASM_MASM_COMPILER_FRONTEND_VARIANT \ CMAKE_ASM_MASM_COMPILER_ID \ CMAKE_ASM_MASM_COMPILER_LAUNCHER \ CMAKE_ASM_MASM_COMPILER_LOADED @@ -581,6 +635,8 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_CREATE_SHARED_LIBRARY \ CMAKE_ASM_MASM_CREATE_SHARED_MODULE \ CMAKE_ASM_MASM_CREATE_STATIC_LIBRARY + \ CMAKE_ASM_MASM_EXTENSIONS + \ CMAKE_ASM_MASM_EXTENSIONS_DEFAULT \ CMAKE_ASM_MASM_FLAGS \ CMAKE_ASM_MASM_FLAGS_DEBUG \ CMAKE_ASM_MASM_FLAGS_DEBUG_INIT @@ -599,6 +655,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_INCLUDE_WHAT_YOU_USE \ CMAKE_ASM_MASM_INIT \ CMAKE_ASM_MASM_LIBRARY_ARCHITECTURE + \ CMAKE_ASM_MASM_LINKER_LAUNCHER \ CMAKE_ASM_MASM_LINKER_PREFERENCE \ CMAKE_ASM_MASM_LINKER_PREFERENCE_PROPAGATES \ CMAKE_ASM_MASM_LINKER_WRAPPER_FLAG @@ -607,14 +664,19 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_MASM_LINK_LIBRARY_FILE_FLAG \ CMAKE_ASM_MASM_LINK_LIBRARY_FLAG \ CMAKE_ASM_MASM_LINK_LIBRARY_SUFFIX + \ CMAKE_ASM_MASM_LINK_WHAT_YOU_USE_FLAG \ CMAKE_ASM_MASM_OUTPUT_EXTENSION \ CMAKE_ASM_MASM_PLATFORM_ID \ CMAKE_ASM_MASM_SIMULATE_ID \ CMAKE_ASM_MASM_SIMULATE_VERSION \ CMAKE_ASM_MASM_SIZEOF_DATA_PTR \ CMAKE_ASM_MASM_SOURCE_FILE_EXTENSIONS + \ CMAKE_ASM_MASM_STANDARD + \ CMAKE_ASM_MASM_STANDARD_DEFAULT \ CMAKE_ASM_MASM_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_ASM_MASM_STANDARD_LIBRARIES + \ CMAKE_ASM_MASM_STANDARD_REQUIRED + \ CMAKE_ASM_MASM_SUPPORTED \ CMAKE_ASM_MASM_VISIBILITY_PRESET \ CMAKE_ASM_NASM \ CMAKE_ASM_NASM_ANDROID_TOOLCHAIN_MACHINE @@ -623,12 +685,15 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_ARCHIVE_APPEND \ CMAKE_ASM_NASM_ARCHIVE_CREATE \ CMAKE_ASM_NASM_ARCHIVE_FINISH + \ CMAKE_ASM_NASM_BYTE_ORDER \ CMAKE_ASM_NASM_CLANG_TIDY + \ CMAKE_ASM_NASM_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_ASM_NASM_COMPILER \ CMAKE_ASM_NASM_COMPILER_ABI \ CMAKE_ASM_NASM_COMPILER_AR \ CMAKE_ASM_NASM_COMPILER_ARCHITECTURE_ID \ CMAKE_ASM_NASM_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_ASM_NASM_COMPILER_FRONTEND_VARIANT \ CMAKE_ASM_NASM_COMPILER_ID \ CMAKE_ASM_NASM_COMPILER_LAUNCHER \ CMAKE_ASM_NASM_COMPILER_LOADED @@ -643,6 +708,8 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_CREATE_SHARED_LIBRARY \ CMAKE_ASM_NASM_CREATE_SHARED_MODULE \ CMAKE_ASM_NASM_CREATE_STATIC_LIBRARY + \ CMAKE_ASM_NASM_EXTENSIONS + \ CMAKE_ASM_NASM_EXTENSIONS_DEFAULT \ CMAKE_ASM_NASM_FLAGS \ CMAKE_ASM_NASM_FLAGS_DEBUG \ CMAKE_ASM_NASM_FLAGS_DEBUG_INIT @@ -661,6 +728,7 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_INCLUDE_WHAT_YOU_USE \ CMAKE_ASM_NASM_INIT \ CMAKE_ASM_NASM_LIBRARY_ARCHITECTURE + \ CMAKE_ASM_NASM_LINKER_LAUNCHER \ CMAKE_ASM_NASM_LINKER_PREFERENCE \ CMAKE_ASM_NASM_LINKER_PREFERENCE_PROPAGATES \ CMAKE_ASM_NASM_LINKER_WRAPPER_FLAG @@ -669,14 +737,19 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_NASM_LINK_LIBRARY_FILE_FLAG \ CMAKE_ASM_NASM_LINK_LIBRARY_FLAG \ CMAKE_ASM_NASM_LINK_LIBRARY_SUFFIX + \ CMAKE_ASM_NASM_LINK_WHAT_YOU_USE_FLAG \ CMAKE_ASM_NASM_OUTPUT_EXTENSION \ CMAKE_ASM_NASM_PLATFORM_ID \ CMAKE_ASM_NASM_SIMULATE_ID \ CMAKE_ASM_NASM_SIMULATE_VERSION \ CMAKE_ASM_NASM_SIZEOF_DATA_PTR \ CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS + \ CMAKE_ASM_NASM_STANDARD + \ CMAKE_ASM_NASM_STANDARD_DEFAULT \ CMAKE_ASM_NASM_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_ASM_NASM_STANDARD_LIBRARIES + \ CMAKE_ASM_NASM_STANDARD_REQUIRED + \ CMAKE_ASM_NASM_SUPPORTED \ CMAKE_ASM_NASM_VISIBILITY_PRESET \ CMAKE_ASM_OUTPUT_EXTENSION \ CMAKE_ASM_PLATFORM_ID @@ -684,8 +757,12 @@ syn keyword cmakeVariable contained \ CMAKE_ASM_SIMULATE_VERSION \ CMAKE_ASM_SIZEOF_DATA_PTR \ CMAKE_ASM_SOURCE_FILE_EXTENSIONS + \ CMAKE_ASM_STANDARD + \ CMAKE_ASM_STANDARD_DEFAULT \ CMAKE_ASM_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_ASM_STANDARD_LIBRARIES + \ CMAKE_ASM_STANDARD_REQUIRED + \ CMAKE_ASM_SUPPORTED \ CMAKE_ASM_VISIBILITY_PRESET \ CMAKE_AUTOGEN_ORIGIN_DEPENDS \ CMAKE_AUTOGEN_PARALLEL @@ -694,15 +771,18 @@ syn keyword cmakeVariable contained \ CMAKE_AUTOMOC \ CMAKE_AUTOMOC_COMPILER_PREDEFINES \ CMAKE_AUTOMOC_DEPEND_FILTERS + \ CMAKE_AUTOMOC_EXECUTABLE \ CMAKE_AUTOMOC_MACRO_NAMES \ CMAKE_AUTOMOC_MOC_OPTIONS \ CMAKE_AUTOMOC_PATH_PREFIX \ CMAKE_AUTOMOC_RELAXED_MODE \ CMAKE_AUTOMOC_EXECUTABLE \ CMAKE_AUTORCC + \ CMAKE_AUTORCC_EXECUTABLE \ CMAKE_AUTORCC_OPTIONS \ CMAKE_AUTORCC_EXECUTABLE \ CMAKE_AUTOUIC + \ CMAKE_AUTOUIC_EXECUTABLE \ CMAKE_AUTOUIC_OPTIONS \ CMAKE_AUTOUIC_SEARCH_PATHS \ CMAKE_AUTOUIC_EXECUTABLE @@ -733,6 +813,7 @@ syn keyword cmakeVariable contained \ CMAKE_COMPILER_IS_GNUCXX \ CMAKE_COMPILER_IS_GNUG77 \ CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY + \ CMAKE_COMPILE_WARNING_AS_ERROR \ CMAKE_CONFIGURATION_TYPES \ CMAKE_CPACK_COMMAND \ CMAKE_CROSSCOMPILING @@ -745,12 +826,15 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_ARCHIVE_APPEND \ CMAKE_CSharp_ARCHIVE_CREATE \ CMAKE_CSharp_ARCHIVE_FINISH + \ CMAKE_CSharp_BYTE_ORDER \ CMAKE_CSharp_CLANG_TIDY + \ CMAKE_CSharp_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_CSharp_COMPILER \ CMAKE_CSharp_COMPILER_ABI \ CMAKE_CSharp_COMPILER_AR \ CMAKE_CSharp_COMPILER_ARCHITECTURE_ID \ CMAKE_CSharp_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_CSharp_COMPILER_FRONTEND_VARIANT \ CMAKE_CSharp_COMPILER_ID \ CMAKE_CSharp_COMPILER_LAUNCHER \ CMAKE_CSharp_COMPILER_LOADED @@ -765,6 +849,8 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_CREATE_SHARED_LIBRARY \ CMAKE_CSharp_CREATE_SHARED_MODULE \ CMAKE_CSharp_CREATE_STATIC_LIBRARY + \ CMAKE_CSharp_EXTENSIONS + \ CMAKE_CSharp_EXTENSIONS_DEFAULT \ CMAKE_CSharp_FLAGS \ CMAKE_CSharp_FLAGS_DEBUG \ CMAKE_CSharp_FLAGS_DEBUG_INIT @@ -783,6 +869,7 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_INCLUDE_WHAT_YOU_USE \ CMAKE_CSharp_INIT \ CMAKE_CSharp_LIBRARY_ARCHITECTURE + \ CMAKE_CSharp_LINKER_LAUNCHER \ CMAKE_CSharp_LINKER_PREFERENCE \ CMAKE_CSharp_LINKER_PREFERENCE_PROPAGATES \ CMAKE_CSharp_LINKER_WRAPPER_FLAG @@ -791,14 +878,19 @@ syn keyword cmakeVariable contained \ CMAKE_CSharp_LINK_LIBRARY_FILE_FLAG \ CMAKE_CSharp_LINK_LIBRARY_FLAG \ CMAKE_CSharp_LINK_LIBRARY_SUFFIX + \ CMAKE_CSharp_LINK_WHAT_YOU_USE_FLAG \ CMAKE_CSharp_OUTPUT_EXTENSION \ CMAKE_CSharp_PLATFORM_ID \ CMAKE_CSharp_SIMULATE_ID \ CMAKE_CSharp_SIMULATE_VERSION \ CMAKE_CSharp_SIZEOF_DATA_PTR \ CMAKE_CSharp_SOURCE_FILE_EXTENSIONS + \ CMAKE_CSharp_STANDARD + \ CMAKE_CSharp_STANDARD_DEFAULT \ CMAKE_CSharp_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_CSharp_STANDARD_LIBRARIES + \ CMAKE_CSharp_STANDARD_REQUIRED + \ CMAKE_CSharp_SUPPORTED \ CMAKE_CSharp_VISIBILITY_PRESET \ CMAKE_CTEST_ARGUMENTS \ CMAKE_CTEST_COMMAND @@ -810,12 +902,15 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_ARCHIVE_APPEND \ CMAKE_CUDA_ARCHIVE_CREATE \ CMAKE_CUDA_ARCHIVE_FINISH + \ CMAKE_CUDA_BYTE_ORDER \ CMAKE_CUDA_CLANG_TIDY + \ CMAKE_CUDA_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_CUDA_COMPILER \ CMAKE_CUDA_COMPILER_ABI \ CMAKE_CUDA_COMPILER_AR \ CMAKE_CUDA_COMPILER_ARCHITECTURE_ID \ CMAKE_CUDA_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_CUDA_COMPILER_FRONTEND_VARIANT \ CMAKE_CUDA_COMPILER_ID \ CMAKE_CUDA_COMPILER_LAUNCHER \ CMAKE_CUDA_COMPILER_LOADED @@ -832,6 +927,7 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_CREATE_SHARED_MODULE \ CMAKE_CUDA_CREATE_STATIC_LIBRARY \ CMAKE_CUDA_EXTENSIONS + \ CMAKE_CUDA_EXTENSIONS_DEFAULT \ CMAKE_CUDA_FLAGS \ CMAKE_CUDA_FLAGS_DEBUG \ CMAKE_CUDA_FLAGS_DEBUG_INIT @@ -851,6 +947,7 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_INCLUDE_WHAT_YOU_USE \ CMAKE_CUDA_INIT \ CMAKE_CUDA_LIBRARY_ARCHITECTURE + \ CMAKE_CUDA_LINKER_LAUNCHER \ CMAKE_CUDA_LINKER_PREFERENCE \ CMAKE_CUDA_LINKER_PREFERENCE_PROPAGATES \ CMAKE_CUDA_LINKER_WRAPPER_FLAG @@ -859,6 +956,7 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_LINK_LIBRARY_FILE_FLAG \ CMAKE_CUDA_LINK_LIBRARY_FLAG \ CMAKE_CUDA_LINK_LIBRARY_SUFFIX + \ CMAKE_CUDA_LINK_WHAT_YOU_USE_FLAG \ CMAKE_CUDA_OUTPUT_EXTENSION \ CMAKE_CUDA_PLATFORM_ID \ CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS @@ -869,9 +967,11 @@ syn keyword cmakeVariable contained \ CMAKE_CUDA_SIZEOF_DATA_PTR \ CMAKE_CUDA_SOURCE_FILE_EXTENSIONS \ CMAKE_CUDA_STANDARD + \ CMAKE_CUDA_STANDARD_DEFAULT \ CMAKE_CUDA_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_CUDA_STANDARD_LIBRARIES \ CMAKE_CUDA_STANDARD_REQUIRED + \ CMAKE_CUDA_SUPPORTED \ CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES \ CMAKE_CUDA_VISIBILITY_PRESET \ CMAKE_CURRENT_BINARY_DIR @@ -890,12 +990,15 @@ syn keyword cmakeVariable contained \ CMAKE_CXX_ARCHIVE_APPEND \ CMAKE_CXX_ARCHIVE_CREATE \ CMAKE_CXX_ARCHIVE_FINISH + \ CMAKE_CXX_BYTE_ORDER \ CMAKE_CXX_CLANG_TIDY + \ CMAKE_CXX_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_CXX_COMPILER \ CMAKE_CXX_COMPILER_ABI \ CMAKE_CXX_COMPILER_AR \ CMAKE_CXX_COMPILER_ARCHITECTURE_ID \ CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_CXX_COMPILER_FRONTEND_VARIANT \ CMAKE_CXX_COMPILER_ID \ CMAKE_CXX_COMPILER_LAUNCHER \ CMAKE_CXX_COMPILER_LOADED @@ -912,6 +1015,7 @@ syn keyword cmakeVariable contained \ CMAKE_CXX_CREATE_SHARED_MODULE \ CMAKE_CXX_CREATE_STATIC_LIBRARY \ CMAKE_CXX_EXTENSIONS + \ CMAKE_CXX_EXTENSIONS_DEFAULT \ CMAKE_CXX_FLAGS \ CMAKE_CXX_FLAGS_DEBUG \ CMAKE_CXX_FLAGS_DEBUG_INIT @@ -939,16 +1043,20 @@ syn keyword cmakeVariable contained \ CMAKE_CXX_LINK_LIBRARY_FILE_FLAG \ CMAKE_CXX_LINK_LIBRARY_FLAG \ CMAKE_CXX_LINK_LIBRARY_SUFFIX + \ CMAKE_CXX_LINK_WHAT_YOU_USE_FLAG \ CMAKE_CXX_OUTPUT_EXTENSION \ CMAKE_CXX_PLATFORM_ID + \ CMAKE_CXX_SCAN_FOR_MODULES \ CMAKE_CXX_SIMULATE_ID \ CMAKE_CXX_SIMULATE_VERSION \ CMAKE_CXX_SIZEOF_DATA_PTR \ CMAKE_CXX_SOURCE_FILE_EXTENSIONS \ CMAKE_CXX_STANDARD + \ CMAKE_CXX_STANDARD_DEFAULT \ CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_CXX_STANDARD_LIBRARIES \ CMAKE_CXX_STANDARD_REQUIRED + \ CMAKE_CXX_SUPPORTED \ CMAKE_CXX_VISIBILITY_PRESET \ CMAKE_C_ANDROID_TOOLCHAIN_MACHINE \ CMAKE_C_ANDROID_TOOLCHAIN_PREFIX @@ -956,12 +1064,15 @@ syn keyword cmakeVariable contained \ CMAKE_C_ARCHIVE_APPEND \ CMAKE_C_ARCHIVE_CREATE \ CMAKE_C_ARCHIVE_FINISH + \ CMAKE_C_BYTE_ORDER \ CMAKE_C_CLANG_TIDY + \ CMAKE_C_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_C_COMPILER \ CMAKE_C_COMPILER_ABI \ CMAKE_C_COMPILER_AR \ CMAKE_C_COMPILER_ARCHITECTURE_ID \ CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_C_COMPILER_FRONTEND_VARIANT \ CMAKE_C_COMPILER_ID \ CMAKE_C_COMPILER_LAUNCHER \ CMAKE_C_COMPILER_LOADED @@ -978,6 +1089,7 @@ syn keyword cmakeVariable contained \ CMAKE_C_CREATE_SHARED_MODULE \ CMAKE_C_CREATE_STATIC_LIBRARY \ CMAKE_C_EXTENSIONS + \ CMAKE_C_EXTENSIONS_DEFAULT \ CMAKE_C_FLAGS \ CMAKE_C_FLAGS_DEBUG \ CMAKE_C_FLAGS_DEBUG_INIT @@ -1005,6 +1117,7 @@ syn keyword cmakeVariable contained \ CMAKE_C_LINK_LIBRARY_FILE_FLAG \ CMAKE_C_LINK_LIBRARY_FLAG \ CMAKE_C_LINK_LIBRARY_SUFFIX + \ CMAKE_C_LINK_WHAT_YOU_USE_FLAG \ CMAKE_C_OUTPUT_EXTENSION \ CMAKE_C_PLATFORM_ID \ CMAKE_C_SIMULATE_ID @@ -1012,17 +1125,21 @@ syn keyword cmakeVariable contained \ CMAKE_C_SIZEOF_DATA_PTR \ CMAKE_C_SOURCE_FILE_EXTENSIONS \ CMAKE_C_STANDARD + \ CMAKE_C_STANDARD_DEFAULT \ CMAKE_C_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_C_STANDARD_LIBRARIES \ CMAKE_C_STANDARD_REQUIRED + \ CMAKE_C_SUPPORTED \ CMAKE_C_VISIBILITY_PRESET \ CMAKE_DEBUG_POSTFIX \ CMAKE_DEBUG_TARGET_PROPERTIES \ CMAKE_DEFAULT_BUILD_TYPE \ CMAKE_DEFAULT_CONFIGS \ CMAKE_DEPENDS_IN_PROJECT_ONLY + \ CMAKE_DEPENDS_USE_COMPILER \ CMAKE_DIRECTORY_LABELS \ CMAKE_DISABLE_PRECOMPILE_HEADERS + \ CMAKE_DLL_NAME_WITH_SOVERSION \ CMAKE_DL_LIBS \ CMAKE_DOTNET_SDK \ CMAKE_DOTNET_TARGET_FRAMEWORK @@ -1036,7 +1153,20 @@ syn keyword cmakeVariable contained \ CMAKE_ENABLE_EXPORTS \ CMAKE_ERROR_DEPRECATED \ CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION + \ CMAKE_EXECUTABLE_ENABLE_EXPORTS \ CMAKE_EXECUTABLE_SUFFIX + \ CMAKE_EXECUTABLE_SUFFIX_ASM + \ CMAKE_EXECUTABLE_SUFFIX_ASM_MASM + \ CMAKE_EXECUTABLE_SUFFIX_ASM_NASM + \ CMAKE_EXECUTABLE_SUFFIX_C + \ CMAKE_EXECUTABLE_SUFFIX_CSharp + \ CMAKE_EXECUTABLE_SUFFIX_CUDA + \ CMAKE_EXECUTABLE_SUFFIX_CXX + \ CMAKE_EXECUTABLE_SUFFIX_Fortran + \ CMAKE_EXECUTABLE_SUFFIX_HIP + \ CMAKE_EXECUTABLE_SUFFIX_Java + \ CMAKE_EXECUTABLE_SUFFIX_RC + \ CMAKE_EXECUTABLE_SUFFIX_Swift \ CMAKE_EXECUTE_PROCESS_COMMAND_ECHO \ CMAKE_EXE_LINKER_FLAGS \ CMAKE_EXE_LINKER_FLAGS_INIT @@ -1056,9 +1186,11 @@ syn keyword cmakeVariable contained \ CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY \ CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY \ CMAKE_FIND_PACKAGE_PREFER_CONFIG + \ CMAKE_FIND_PACKAGE_REDIRECTS_DIR \ CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS \ CMAKE_FIND_PACKAGE_SORT_DIRECTION \ CMAKE_FIND_PACKAGE_SORT_ORDER + \ CMAKE_FIND_PACKAGE_TARGETS_GLOBAL \ CMAKE_FIND_PACKAGE_WARN_NO_MODULE \ CMAKE_FIND_ROOT_PATH \ CMAKE_FIND_ROOT_PATH_MODE_INCLUDE @@ -1069,6 +1201,7 @@ syn keyword cmakeVariable contained \ CMAKE_FIND_USE_INSTALL_PREFIX \ CMAKE_FIND_USE_CMAKE_PATH \ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH + \ CMAKE_FIND_USE_INSTALL_PREFIX \ CMAKE_FIND_USE_PACKAGE_REGISTRY \ CMAKE_FIND_USE_PACKAGE_ROOT_PATH \ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH @@ -1083,12 +1216,15 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_ARCHIVE_APPEND \ CMAKE_Fortran_ARCHIVE_CREATE \ CMAKE_Fortran_ARCHIVE_FINISH + \ CMAKE_Fortran_BYTE_ORDER \ CMAKE_Fortran_CLANG_TIDY + \ CMAKE_Fortran_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_Fortran_COMPILER \ CMAKE_Fortran_COMPILER_ABI \ CMAKE_Fortran_COMPILER_AR \ CMAKE_Fortran_COMPILER_ARCHITECTURE_ID \ CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_Fortran_COMPILER_FRONTEND_VARIANT \ CMAKE_Fortran_COMPILER_ID \ CMAKE_Fortran_COMPILER_LAUNCHER \ CMAKE_Fortran_COMPILER_LOADED @@ -1103,6 +1239,8 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_CREATE_SHARED_LIBRARY \ CMAKE_Fortran_CREATE_SHARED_MODULE \ CMAKE_Fortran_CREATE_STATIC_LIBRARY + \ CMAKE_Fortran_EXTENSIONS + \ CMAKE_Fortran_EXTENSIONS_DEFAULT \ CMAKE_Fortran_FLAGS \ CMAKE_Fortran_FLAGS_DEBUG \ CMAKE_Fortran_FLAGS_DEBUG_INIT @@ -1122,6 +1260,7 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_INCLUDE_WHAT_YOU_USE \ CMAKE_Fortran_INIT \ CMAKE_Fortran_LIBRARY_ARCHITECTURE + \ CMAKE_Fortran_LINKER_LAUNCHER \ CMAKE_Fortran_LINKER_PREFERENCE \ CMAKE_Fortran_LINKER_PREFERENCE_PROPAGATES \ CMAKE_Fortran_LINKER_WRAPPER_FLAG @@ -1130,6 +1269,7 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_LINK_LIBRARY_FILE_FLAG \ CMAKE_Fortran_LINK_LIBRARY_FLAG \ CMAKE_Fortran_LINK_LIBRARY_SUFFIX + \ CMAKE_Fortran_LINK_WHAT_YOU_USE_FLAG \ CMAKE_Fortran_MODDIR_DEFAULT \ CMAKE_Fortran_MODDIR_FLAG \ CMAKE_Fortran_MODOUT_FLAG @@ -1141,8 +1281,12 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_SIMULATE_VERSION \ CMAKE_Fortran_SIZEOF_DATA_PTR \ CMAKE_Fortran_SOURCE_FILE_EXTENSIONS + \ CMAKE_Fortran_STANDARD + \ CMAKE_Fortran_STANDARD_DEFAULT \ CMAKE_Fortran_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_Fortran_STANDARD_LIBRARIES + \ CMAKE_Fortran_STANDARD_REQUIRED + \ CMAKE_Fortran_SUPPORTED \ CMAKE_Fortran_VISIBILITY_PRESET \ CMAKE_GENERATOR \ CMAKE_GENERATOR_INSTANCE @@ -1162,12 +1306,15 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_ARCHIVE_APPEND \ CMAKE_HIP_ARCHIVE_CREATE \ CMAKE_HIP_ARCHIVE_FINISH + \ CMAKE_HIP_BYTE_ORDER \ CMAKE_HIP_CLANG_TIDY + \ CMAKE_HIP_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_HIP_COMPILER \ CMAKE_HIP_COMPILER_ABI \ CMAKE_HIP_COMPILER_AR \ CMAKE_HIP_COMPILER_ARCHITECTURE_ID \ CMAKE_HIP_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_HIP_COMPILER_FRONTEND_VARIANT \ CMAKE_HIP_COMPILER_ID \ CMAKE_HIP_COMPILER_LAUNCHER \ CMAKE_HIP_COMPILER_LOADED @@ -1184,6 +1331,7 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_CREATE_SHARED_MODULE \ CMAKE_HIP_CREATE_STATIC_LIBRARY \ CMAKE_HIP_EXTENSIONS + \ CMAKE_HIP_EXTENSIONS_DEFAULT \ CMAKE_HIP_FLAGS \ CMAKE_HIP_FLAGS_DEBUG \ CMAKE_HIP_FLAGS_DEBUG_INIT @@ -1211,6 +1359,7 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_LINK_LIBRARY_FILE_FLAG \ CMAKE_HIP_LINK_LIBRARY_FLAG \ CMAKE_HIP_LINK_LIBRARY_SUFFIX + \ CMAKE_HIP_LINK_WHAT_YOU_USE_FLAG \ CMAKE_HIP_OUTPUT_EXTENSION \ CMAKE_HIP_PLATFORM_ID \ CMAKE_HIP_SIMULATE_ID @@ -1218,12 +1367,16 @@ syn keyword cmakeVariable contained \ CMAKE_HIP_SIZEOF_DATA_PTR \ CMAKE_HIP_SOURCE_FILE_EXTENSIONS \ CMAKE_HIP_STANDARD + \ CMAKE_HIP_STANDARD_DEFAULT \ CMAKE_HIP_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_HIP_STANDARD_LIBRARIES \ CMAKE_HIP_STANDARD_REQUIRED + \ CMAKE_HIP_SUPPORTED \ CMAKE_HIP_VISIBILITY_PRESET \ CMAKE_HOME_DIRECTORY \ CMAKE_HOST_APPLE + \ CMAKE_HOST_BSD + \ CMAKE_HOST_LINUX \ CMAKE_HOST_SOLARIS \ CMAKE_HOST_SYSTEM \ CMAKE_HOST_SYSTEM_NAME @@ -1232,6 +1385,7 @@ syn keyword cmakeVariable contained \ CMAKE_HOST_UNIX \ CMAKE_HOST_WIN32 \ CMAKE_IGNORE_PATH + \ CMAKE_IGNORE_PREFIX_PATH \ CMAKE_IMPORT_LIBRARY_PREFIX \ CMAKE_IMPORT_LIBRARY_SUFFIX \ CMAKE_INCLUDE_CURRENT_DIR @@ -1252,6 +1406,7 @@ syn keyword cmakeVariable contained \ CMAKE_INTERPROCEDURAL_OPTIMIZATION \ CMAKE_IOS_INSTALL_COMBINED \ CMAKE_ISPC_HEADER_DIRECTORY + \ CMAKE_ISPC_HEADER_SUFFIX \ CMAKE_ISPC_INSTRUCTION_SETS \ CMAKE_JOB_POOLS \ CMAKE_JOB_POOL_COMPILE @@ -1264,12 +1419,15 @@ syn keyword cmakeVariable contained \ CMAKE_Java_ARCHIVE_APPEND \ CMAKE_Java_ARCHIVE_CREATE \ CMAKE_Java_ARCHIVE_FINISH + \ CMAKE_Java_BYTE_ORDER \ CMAKE_Java_CLANG_TIDY + \ CMAKE_Java_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_Java_COMPILER \ CMAKE_Java_COMPILER_ABI \ CMAKE_Java_COMPILER_AR \ CMAKE_Java_COMPILER_ARCHITECTURE_ID \ CMAKE_Java_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_Java_COMPILER_FRONTEND_VARIANT \ CMAKE_Java_COMPILER_ID \ CMAKE_Java_COMPILER_LAUNCHER \ CMAKE_Java_COMPILER_LOADED @@ -1284,6 +1442,8 @@ syn keyword cmakeVariable contained \ CMAKE_Java_CREATE_SHARED_LIBRARY \ CMAKE_Java_CREATE_SHARED_MODULE \ CMAKE_Java_CREATE_STATIC_LIBRARY + \ CMAKE_Java_EXTENSIONS + \ CMAKE_Java_EXTENSIONS_DEFAULT \ CMAKE_Java_FLAGS \ CMAKE_Java_FLAGS_DEBUG \ CMAKE_Java_FLAGS_DEBUG_INIT @@ -1302,6 +1462,7 @@ syn keyword cmakeVariable contained \ CMAKE_Java_INCLUDE_WHAT_YOU_USE \ CMAKE_Java_INIT \ CMAKE_Java_LIBRARY_ARCHITECTURE + \ CMAKE_Java_LINKER_LAUNCHER \ CMAKE_Java_LINKER_PREFERENCE \ CMAKE_Java_LINKER_PREFERENCE_PROPAGATES \ CMAKE_Java_LINKER_WRAPPER_FLAG @@ -1310,15 +1471,22 @@ syn keyword cmakeVariable contained \ CMAKE_Java_LINK_LIBRARY_FILE_FLAG \ CMAKE_Java_LINK_LIBRARY_FLAG \ CMAKE_Java_LINK_LIBRARY_SUFFIX + \ CMAKE_Java_LINK_WHAT_YOU_USE_FLAG \ CMAKE_Java_OUTPUT_EXTENSION \ CMAKE_Java_PLATFORM_ID \ CMAKE_Java_SIMULATE_ID \ CMAKE_Java_SIMULATE_VERSION \ CMAKE_Java_SIZEOF_DATA_PTR \ CMAKE_Java_SOURCE_FILE_EXTENSIONS + \ CMAKE_Java_STANDARD + \ CMAKE_Java_STANDARD_DEFAULT \ CMAKE_Java_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_Java_STANDARD_LIBRARIES + \ CMAKE_Java_STANDARD_REQUIRED + \ CMAKE_Java_SUPPORTED \ CMAKE_Java_VISIBILITY_PRESET + \ CMAKE_KATE_FILES_MODE + \ CMAKE_KATE_MAKE_ARGUMENTS \ CMAKE_LIBRARY_ARCHITECTURE \ CMAKE_LIBRARY_ARCHITECTURE_REGEX \ CMAKE_LIBRARY_OUTPUT_DIRECTORY @@ -1326,14 +1494,17 @@ syn keyword cmakeVariable contained \ CMAKE_LIBRARY_PATH_FLAG \ CMAKE_LINK_DEF_FILE_FLAG \ CMAKE_LINK_DEPENDS_NO_SHARED + \ CMAKE_LINK_DEPENDS_USE_LINKER \ CMAKE_LINK_DIRECTORIES_BEFORE \ CMAKE_LINK_INTERFACE_LIBRARIES + \ CMAKE_LINK_LIBRARIES_ONLY_TARGETS \ CMAKE_LINK_LIBRARY_FILE_FLAG \ CMAKE_LINK_LIBRARY_FLAG \ CMAKE_LINK_LIBRARY_SUFFIX \ CMAKE_LINK_SEARCH_END_STATIC \ CMAKE_LINK_SEARCH_START_STATIC \ CMAKE_LINK_WHAT_YOU_USE + \ CMAKE_LINK_WHAT_YOU_USE_CHECK \ CMAKE_MACOSX_BUNDLE \ CMAKE_MACOSX_RPATH \ CMAKE_MAJOR_VERSION @@ -1351,6 +1522,7 @@ syn keyword cmakeVariable contained \ CMAKE_MODULE_LINKER_FLAGS_INIT \ CMAKE_MODULE_PATH \ CMAKE_MSVCIDE_RUN_PATH + \ CMAKE_MSVC_DEBUG_INFORMATION_FORMAT \ CMAKE_MSVC_RUNTIME_LIBRARY \ CMAKE_NETRC \ CMAKE_NETRC_FILE @@ -1378,6 +1550,7 @@ syn keyword cmakeVariable contained \ CMAKE_PCH_INSTANTIATE_TEMPLATES \ CMAKE_PCH_WARN_INVALID \ CMAKE_PDB_OUTPUT_DIRECTORY + \ CMAKE_PLATFORM_NO_VERSIONED_SONAME \ CMAKE_POSITION_INDEPENDENT_CODE \ CMAKE_PREFIX_PATH \ CMAKE_PROGRAM_PATH @@ -1386,6 +1559,7 @@ syn keyword cmakeVariable contained \ CMAKE_PROJECT_INCLUDE \ CMAKE_PROJECT_INCLUDE_BEFORE \ CMAKE_PROJECT_NAME + \ CMAKE_PROJECT_TOP_LEVEL_INCLUDES \ CMAKE_PROJECT_VERSION \ CMAKE_PROJECT_VERSION_MAJOR \ CMAKE_PROJECT_VERSION_MINOR @@ -1399,12 +1573,15 @@ syn keyword cmakeVariable contained \ CMAKE_RC_ARCHIVE_APPEND \ CMAKE_RC_ARCHIVE_CREATE \ CMAKE_RC_ARCHIVE_FINISH + \ CMAKE_RC_BYTE_ORDER \ CMAKE_RC_CLANG_TIDY + \ CMAKE_RC_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_RC_COMPILER \ CMAKE_RC_COMPILER_ABI \ CMAKE_RC_COMPILER_AR \ CMAKE_RC_COMPILER_ARCHITECTURE_ID \ CMAKE_RC_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_RC_COMPILER_FRONTEND_VARIANT \ CMAKE_RC_COMPILER_ID \ CMAKE_RC_COMPILER_LAUNCHER \ CMAKE_RC_COMPILER_LOADED @@ -1419,6 +1596,8 @@ syn keyword cmakeVariable contained \ CMAKE_RC_CREATE_SHARED_LIBRARY \ CMAKE_RC_CREATE_SHARED_MODULE \ CMAKE_RC_CREATE_STATIC_LIBRARY + \ CMAKE_RC_EXTENSIONS + \ CMAKE_RC_EXTENSIONS_DEFAULT \ CMAKE_RC_FLAGS \ CMAKE_RC_FLAGS_DEBUG \ CMAKE_RC_FLAGS_DEBUG_INIT @@ -1437,6 +1616,7 @@ syn keyword cmakeVariable contained \ CMAKE_RC_INCLUDE_WHAT_YOU_USE \ CMAKE_RC_INIT \ CMAKE_RC_LIBRARY_ARCHITECTURE + \ CMAKE_RC_LINKER_LAUNCHER \ CMAKE_RC_LINKER_PREFERENCE \ CMAKE_RC_LINKER_PREFERENCE_PROPAGATES \ CMAKE_RC_LINKER_WRAPPER_FLAG @@ -1445,19 +1625,25 @@ syn keyword cmakeVariable contained \ CMAKE_RC_LINK_LIBRARY_FILE_FLAG \ CMAKE_RC_LINK_LIBRARY_FLAG \ CMAKE_RC_LINK_LIBRARY_SUFFIX + \ CMAKE_RC_LINK_WHAT_YOU_USE_FLAG \ CMAKE_RC_OUTPUT_EXTENSION \ CMAKE_RC_PLATFORM_ID \ CMAKE_RC_SIMULATE_ID \ CMAKE_RC_SIMULATE_VERSION \ CMAKE_RC_SIZEOF_DATA_PTR \ CMAKE_RC_SOURCE_FILE_EXTENSIONS + \ CMAKE_RC_STANDARD + \ CMAKE_RC_STANDARD_DEFAULT \ CMAKE_RC_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_RC_STANDARD_LIBRARIES + \ CMAKE_RC_STANDARD_REQUIRED + \ CMAKE_RC_SUPPORTED \ CMAKE_RC_VISIBILITY_PRESET \ CMAKE_ROOT \ CMAKE_RULE_MESSAGES \ CMAKE_RUNTIME_OUTPUT_DIRECTORY \ CMAKE_SCRIPT_MODE_FILE + \ CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS \ CMAKE_SHARED_LIBRARY_PREFIX \ CMAKE_SHARED_LIBRARY_SUFFIX \ CMAKE_SHARED_LINKER_FLAGS @@ -1486,6 +1672,7 @@ syn keyword cmakeVariable contained \ CMAKE_SYSTEM_APPBUNDLE_PATH \ CMAKE_SYSTEM_FRAMEWORK_PATH \ CMAKE_SYSTEM_IGNORE_PATH + \ CMAKE_SYSTEM_IGNORE_PREFIX_PATH \ CMAKE_SYSTEM_INCLUDE_PATH \ CMAKE_SYSTEM_LIBRARY_PATH \ CMAKE_SYSTEM_NAME @@ -1500,12 +1687,15 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_ARCHIVE_APPEND \ CMAKE_Swift_ARCHIVE_CREATE \ CMAKE_Swift_ARCHIVE_FINISH + \ CMAKE_Swift_BYTE_ORDER \ CMAKE_Swift_CLANG_TIDY + \ CMAKE_Swift_CLANG_TIDY_EXPORT_FIXES_DIR \ CMAKE_Swift_COMPILER \ CMAKE_Swift_COMPILER_ABI \ CMAKE_Swift_COMPILER_AR \ CMAKE_Swift_COMPILER_ARCHITECTURE_ID \ CMAKE_Swift_COMPILER_EXTERNAL_TOOLCHAIN + \ CMAKE_Swift_COMPILER_FRONTEND_VARIANT \ CMAKE_Swift_COMPILER_ID \ CMAKE_Swift_COMPILER_LAUNCHER \ CMAKE_Swift_COMPILER_LOADED @@ -1520,6 +1710,8 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_CREATE_SHARED_LIBRARY \ CMAKE_Swift_CREATE_SHARED_MODULE \ CMAKE_Swift_CREATE_STATIC_LIBRARY + \ CMAKE_Swift_EXTENSIONS + \ CMAKE_Swift_EXTENSIONS_DEFAULT \ CMAKE_Swift_FLAGS \ CMAKE_Swift_FLAGS_DEBUG \ CMAKE_Swift_FLAGS_DEBUG_INIT @@ -1539,6 +1731,7 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_INIT \ CMAKE_Swift_LANGUAGE_VERSION \ CMAKE_Swift_LIBRARY_ARCHITECTURE + \ CMAKE_Swift_LINKER_LAUNCHER \ CMAKE_Swift_LINKER_PREFERENCE \ CMAKE_Swift_LINKER_PREFERENCE_PROPAGATES \ CMAKE_Swift_LINKER_WRAPPER_FLAG @@ -1547,6 +1740,7 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_LINK_LIBRARY_FILE_FLAG \ CMAKE_Swift_LINK_LIBRARY_FLAG \ CMAKE_Swift_LINK_LIBRARY_SUFFIX + \ CMAKE_Swift_LINK_WHAT_YOU_USE_FLAG \ CMAKE_Swift_MODULE_DIRECTORY \ CMAKE_Swift_NUM_THREADS \ CMAKE_Swift_OUTPUT_EXTENSION @@ -1555,16 +1749,25 @@ syn keyword cmakeVariable contained \ CMAKE_Swift_SIMULATE_VERSION \ CMAKE_Swift_SIZEOF_DATA_PTR \ CMAKE_Swift_SOURCE_FILE_EXTENSIONS + \ CMAKE_Swift_STANDARD + \ CMAKE_Swift_STANDARD_DEFAULT \ CMAKE_Swift_STANDARD_INCLUDE_DIRECTORIES \ CMAKE_Swift_STANDARD_LIBRARIES + \ CMAKE_Swift_STANDARD_REQUIRED + \ CMAKE_Swift_SUPPORTED \ CMAKE_Swift_VISIBILITY_PRESET + \ CMAKE_TASKING_TOOLSET + \ CMAKE_TLS_CAINFO + \ CMAKE_TLS_VERIFY \ CMAKE_TOOLCHAIN_FILE \ CMAKE_TRY_COMPILE_CONFIGURATION + \ CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES \ CMAKE_TRY_COMPILE_PLATFORM_VARIABLES \ CMAKE_TRY_COMPILE_TARGET_TYPE \ CMAKE_TWEAK_VERSION \ CMAKE_UNITY_BUILD \ CMAKE_UNITY_BUILD_BATCH_SIZE + \ CMAKE_UNITY_BUILD_UNIQUE_ID \ CMAKE_USER_MAKE_RULES_OVERRIDE \ CMAKE_USER_MAKE_RULES_OVERRIDE_ASM \ CMAKE_USER_MAKE_RULES_OVERRIDE_ASM_MASM @@ -1580,8 +1783,13 @@ syn keyword cmakeVariable contained \ CMAKE_USER_MAKE_RULES_OVERRIDE_Swift \ CMAKE_USE_RELATIVE_PATHS \ CMAKE_VERBOSE_MAKEFILE + \ CMAKE_VERIFY_INTERFACE_HEADER_SETS \ CMAKE_VERSION \ CMAKE_VISIBILITY_INLINES_HIDDEN + \ CMAKE_VS_DEBUGGER_COMMAND + \ CMAKE_VS_DEBUGGER_COMMAND_ARGUMENTS + \ CMAKE_VS_DEBUGGER_ENVIRONMENT + \ CMAKE_VS_DEBUGGER_WORKING_DIRECTORY \ CMAKE_VS_DEVENV_COMMAND \ CMAKE_VS_GLOBALS \ CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD @@ -1589,6 +1797,8 @@ syn keyword cmakeVariable contained \ CMAKE_VS_INTEL_Fortran_PROJECT_VERSION \ CMAKE_VS_JUST_MY_CODE_DEBUGGING \ CMAKE_VS_MSBUILD_COMMAND + \ CMAKE_VS_NO_COMPILE_BATCHING + \ CMAKE_VS_NUGET_PACKAGE_RESTORE \ CMAKE_VS_NsightTegra_VERSION \ CMAKE_VS_PLATFORM_NAME \ CMAKE_VS_PLATFORM_NAME_DEFAULT @@ -1604,11 +1814,17 @@ syn keyword cmakeVariable contained \ CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES \ CMAKE_VS_SDK_REFERENCE_DIRECTORIES \ CMAKE_VS_SDK_SOURCE_DIRECTORIES + \ CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER + \ CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION + \ CMAKE_VS_TARGET_FRAMEWORK_VERSION + \ CMAKE_VS_VERSION_BUILD_NUMBER + \ CMAKE_VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION \ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION \ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM \ CMAKE_VS_WINRT_BY_DEFAULT \ CMAKE_WARN_DEPRECATED \ CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION + \ CMAKE_WATCOM_RUNTIME_LIBRARY \ CMAKE_WIN32_EXECUTABLE \ CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS \ CMAKE_XCODE_BUILD_SYSTEM @@ -1623,8 +1839,12 @@ syn keyword cmakeVariable contained \ CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER \ CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS \ CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE + \ CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION + \ CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE + \ CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION \ CMAKE_XCODE_SCHEME_ENVIRONMENT \ CMAKE_XCODE_SCHEME_GUARD_MALLOC + \ CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION \ CMAKE_XCODE_SCHEME_LAUNCH_MODE \ CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP \ CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES @@ -1639,8 +1859,10 @@ syn keyword cmakeVariable contained \ CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION \ CMAKE_XCODE_SCHEME_WORKING_DIRECTORY \ CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS + \ CMAKE_XCODE_XCCONFIG \ CPACK_ABSOLUTE_DESTINATION_FILES \ CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY + \ CPACK_CUSTOM_INSTALL_VARIABLES \ CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION \ CPACK_INCLUDE_TOPLEVEL_DIRECTORY \ CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS @@ -1675,6 +1897,7 @@ syn keyword cmakeVariable contained \ CTEST_CUSTOM_PRE_MEMCHECK \ CTEST_CUSTOM_PRE_TEST \ CTEST_CUSTOM_TESTS_IGNORE + \ CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION \ CTEST_CUSTOM_WARNING_EXCEPTION \ CTEST_CUSTOM_WARNING_MATCH \ CTEST_CVS_CHECKOUT @@ -1707,6 +1930,7 @@ syn keyword cmakeVariable contained \ CTEST_RESOURCE_SPEC_FILE \ CTEST_RUN_CURRENT_SCRIPT \ CTEST_SCP_COMMAND + \ CTEST_SCRIPT_DIRECTORY \ CTEST_SITE \ CTEST_SOURCE_DIRECTORY \ CTEST_SUBMIT_INACTIVITY_TIMEOUT @@ -2005,6 +2229,7 @@ syn keyword cmakeVariable contained \ GHSMULTI \ IOS \ LIBRARY_OUTPUT_PATH + \ LINUX \ MINGW \ MSVC \ MSVC10 @@ -2023,6 +2248,7 @@ syn keyword cmakeVariable contained \ PROJECT_BINARY_DIR \ PROJECT_DESCRIPTION \ PROJECT_HOMEPAGE_URL + \ PROJECT_IS_TOP_LEVEL \ PROJECT_NAME \ PROJECT_SOURCE_DIR \ PROJECT_VERSION @@ -2040,6 +2266,7 @@ syn keyword cmakeVariable contained syn keyword cmakeModule contained \ ExternalProject + \ FetchContent syn keyword cmakeKWExternalProject contained \ AWS @@ -2053,10 +2280,10 @@ syn keyword cmakeKWExternalProject contained \ CMAKE_CACHE_ARGS \ CMAKE_CACHE_DEFAULT_ARGS \ CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY - \ CMAKE_TLS_CAINFO - \ CMAKE_TLS_VERIFY + \ CMAKE_INSTALL_MODE \ COMMENT \ CONFIGURE_COMMAND + \ CONFIGURE_HANDLED_BY_BUILD \ CVS \ CVSROOT \ CVS_MODULE @@ -2068,6 +2295,7 @@ syn keyword cmakeKWExternalProject contained \ DOWNLOADED_FILE \ DOWNLOAD_COMMAND \ DOWNLOAD_DIR + \ DOWNLOAD_EXTRACT_TIMESTAMP \ DOWNLOAD_NAME \ DOWNLOAD_NO_EXTRACT \ DOWNLOAD_NO_PROGRESS @@ -2159,24 +2387,90 @@ syn keyword cmakeKWExternalProject contained \ USES_TERMINAL_UPDATE \ WORKING_DIRECTORY +syn keyword cmakeKWFetchContent contained + \ ALWAYS + \ BINARY_DIR + \ BUILD_COMMAND + \ BYPASS_PROVIDER + \ CMAKE_PROJECT_ + \ CONFIGURE_COMMAND + \ COPY + \ CORRECT + \ DCMAKE_TOOLCHAIN_FILE + \ DESTINATION + \ DOWNLOAD_NO_EXTRACT + \ EXISTS + \ FETCHCONTENT_BASE_DIR + \ FETCHCONTENT_FULLY_DISCONNECTED + \ FETCHCONTENT_MAKEAVAILABLE_SERIAL + \ FETCHCONTENT_QUIET + \ FETCHCONTENT_SOURCE_DIR_ + \ FETCHCONTENT_TRY_FIND_PACKAGE_MODE + \ FETCHCONTENT_UPDATES_DISCONNECTED + \ FETCHCONTENT_UPDATES_DISCONNECTED_ + \ FIND_PACKAGE_ARGS + \ GIT_REPOSITORY + \ GIT_TAG + \ GLOBAL + \ GTEST_BOTH_LIBRARIES + \ GTEST_LIBRARIES + \ GTEST_MAIN_LIBRARIES + \ INSTALL_COMMAND + \ INTERNAL + \ NAME + \ NAMES + \ NEVER + \ NOTE + \ OFF + \ OPTIONAL + \ OPT_IN + \ OVERRIDE_FIND_PACKAGE + \ PACKAGE_VERSION_COMPATIBLE + \ PACKAGE_VERSION_EXACT + \ QUIET + \ SOURCE_SUBDIR + \ STREQUAL + \ SUBBUILD_DIR + \ SVN_REPOSITORY + \ SVN_REVISION + \ SYSTEM + \ TARGET + \ TEST_COMMAND + \ TRUE + \ URL + \ URL_HASH + \ VERIFY_INTERFACE_HEADER_SETS + \ WRITE + \ WRONG + \ _BINARY_DIR + \ _INCLUDE + \ _POPULATED + \ _SOURCE_DIR + syn keyword cmakeKWadd_compile_definitions contained \ COMPILE_DEFINITIONS \ VAR syn keyword cmakeKWadd_compile_options contained + \ CMAKE_ + \ COMPILE_LANGUAGE \ COMPILE_OPTIONS + \ CONFIG \ SHELL \ UNIX_COMMAND - \ WX + \ _FLAGS + \ _FLAGS_ syn keyword cmakeKWadd_custom_command contained \ APPEND \ ARGS + \ BNF \ BYPRODUCTS \ CC \ COMMAND \ COMMAND_EXPAND_LISTS \ COMMENT + \ CONFIG \ CROSSCOMPILING_EMULATOR \ DEPENDS \ DEPENDS_EXPLICIT_ONLY @@ -2188,6 +2482,7 @@ syn keyword cmakeKWadd_custom_command contained \ JOB_POOLS \ JOIN \ MAIN_DEPENDENCY + \ MODULE \ NOT \ OUTPUT \ PATH @@ -2263,17 +2558,21 @@ syn keyword cmakeKWadd_library contained \ FRAMEWORK \ GLOBAL \ HEADER_FILE_ONLY + \ HEADER_SETS \ IMPORTED \ IMPORTED_ \ IMPORTED_IMPLIB \ IMPORTED_IMPLIB_ \ IMPORTED_LOCATION \ IMPORTED_LOCATION_ + \ IMPORTED_NO_SONAME \ IMPORTED_OBJECTS \ IMPORTED_OBJECTS_ + \ IMPORTED_SONAME \ INTERFACE \ INTERFACE_ \ INTERFACE_SOURCES + \ LC_ID_DYLIB \ LIBRARY_OUTPUT_DIRECTORY \ MODULE \ OBJECT @@ -2283,22 +2582,25 @@ syn keyword cmakeKWadd_library contained \ POST_BUILD \ PRE_BUILD \ PRE_LINK - \ PRIVATE - \ PUBLIC + \ PRIVATE_HEADER + \ PUBLIC_HEADER \ RUNTIME_OUTPUT_DIRECTORY \ SHARED + \ SONAME \ SOURCES \ STATIC + \ TARGETS \ TARGET_OBJECTS + \ TARGET_RUNTIME_DLLS \ UNKNOWN syn keyword cmakeKWadd_link_options contained \ CMAKE_ + \ CONFIG \ CUDA_RESOLVE_DEVICE_SYMBOLS \ CUDA_SEPARABLE_COMPILATION \ DEVICE_LINK \ GCC - \ GNU \ HOST_LINK \ LANG \ LINKER @@ -2306,11 +2608,14 @@ syn keyword cmakeKWadd_link_options contained \ SHELL \ STATIC_LIBRARY_OPTIONS \ UNIX_COMMAND + \ _FLAGS + \ _FLAGS_ \ _LINKER_WRAPPER_FLAG \ _LINKER_WRAPPER_FLAG_SEP syn keyword cmakeKWadd_subdirectory contained \ EXCLUDE_FROM_ALL + \ SYSTEM syn keyword cmakeKWadd_test contained \ BUILD_TESTING @@ -2324,15 +2629,64 @@ syn keyword cmakeKWadd_test contained \ SKIP_REGULAR_EXPRESSION \ TARGET_FILE \ WILL_FAIL + \ WILL_FALL \ WORKING_DIRECTORY +syn keyword cmakeKWblock contained + \ PARENT_SCOPE + \ POLICIES + \ PROPAGATE + \ PUSH + \ SCOPE_FOR + \ TRUE + \ VARIABLES + syn keyword cmakeKWbuild_command contained \ CONFIGURATION + \ PARALLEL_LEVEL \ TARGET +syn keyword cmakeKWcmake_file_api contained + \ API + \ API_VERSION + \ BUILD_DIR + \ CMAKEFILES + \ CODEMODEL + \ COMMAND + \ CONFIG + \ QUERY + \ TOOLCHAINS + syn keyword cmakeKWcmake_host_system_information contained + \ APPEND \ AVAILABLE_PHYSICAL_MEMORY \ AVAILABLE_VIRTUAL_MEMORY + \ BOTH + \ CMAKE_GET_OS_RELEASE_FALLBACK_CONTENT + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_ + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_ID + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_NAME + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_PRETTY_NAME + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_VERSION + \ CMAKE_GET_OS_RELEASE_FALLBACK_RESULT_VERSION_ID + \ CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS + \ DISTRIB_INFO + \ DISTRIB_PRETTY_NAME + \ DISTRO + \ DISTRO_BUG_REPORT_URL + \ DISTRO_HOME_URL + \ DISTRO_ID + \ DISTRO_ID_LIKE + \ DISTRO_NAME + \ DISTRO_PRETTY_NAME + \ DISTRO_PRIVACY_POLICY_URL + \ DISTRO_SUPPORT_URL + \ DISTRO_UBUNTU_CODENAME + \ DISTRO_VERSION + \ DISTRO_VERSION_CODENAME + \ DISTRO_VERSION_ID + \ ERROR_VARIABLE + \ EXISTS \ FQDN \ HAS_FPU \ HAS_MMX @@ -2341,38 +2695,101 @@ syn keyword cmakeKWcmake_host_system_information contained \ HAS_SSE \ HAS_SSE_FP \ HAS_SSE_MMX + \ HKCC + \ HKCR + \ HKCU + \ HKEY_CLASSES_ROOT + \ HKEY_CURRENT_CONFIG + \ HKEY_CURRENT_USER + \ HKEY_LOCAL_MACHINE + \ HKEY_USERS + \ HKLM + \ HKU \ HOSTNAME \ ID + \ LIMIT_COUNT + \ LISTS + \ LTS + \ MATCHES + \ NNN + \ NOT \ NUMBER_OF_LOGICAL_CORES \ NUMBER_OF_PHYSICAL_CORES \ OS_NAME \ OS_PLATFORM \ OS_RELEASE \ OS_VERSION + \ PRETTY_NAME \ PROCESSOR_DESCRIPTION \ PROCESSOR_NAME \ PROCESSOR_SERIAL_NUMBER \ QUERY + \ REG_DWORD + \ REG_EXPAND_SZ + \ REG_MULTI_SZ + \ REG_QWORD + \ REG_SZ \ RESULT + \ SEPARATOR + \ SOFTWARE + \ STATUS + \ STRINGS + \ SUBKEYS + \ TARGET \ TOTAL_PHYSICAL_MEMORY \ TOTAL_VIRTUAL_MEMORY + \ VALUE_NAMES + \ VAR + \ VIEW + \ WINDOWS_REGISTRY syn keyword cmakeKWcmake_language contained \ AND + \ ANY + \ APPEND + \ ARGN + \ BINARY_DIR + \ BYPASS_PROVIDER \ CALL \ CANCEL_CALL \ CODE + \ COMMAND + \ COMMAND_ERROR_IS_FATAL + \ DCMAKE_PROJECT_TOP_LEVEL_INCLUDES \ DEFER \ DIRECTORY \ EVAL \ FALSE + \ FETCHCONTENT_MAKEAVAILABE_SERIAL + \ FETCHCONTENT_MAKEAVAILABLE_SERIAL + \ FETCHCONTENT_SOURCE_DIR_ + \ FETCHCONTENT_TRY_FIND_PACKAGE_MODE + \ FIND_PACKAGE + \ FIND_PACKAGE_ARGS \ GET_CALL_IDS - \ ID + \ GET_MESSAGE_LOG_LEVEL + \ GIT_REPOSITORY + \ GIT_SUBMODULES + \ GIT_TAG \ ID_VAR - \ OR + \ MATCHES + \ MYCOMP_PROVIDER_INSTALL_DIR + \ NEVER + \ NOT + \ OVERRIDE_FIND_PACKAGE + \ PATH + \ POP_BACK + \ QUIET + \ SET_DEPENDENCY_PROVIDER + \ SOURCE_DIR \ STATUS + \ STREQUAL + \ SUPPORTED_METHODS \ TRUE + \ VERSION \ WRITE + \ _FOUND + \ _PATH syn keyword cmakeKWcmake_minimum_required contained \ FATAL_ERROR @@ -2407,22 +2824,21 @@ syn keyword cmakeKWcmake_path contained \ ABSOLUTE_PATH \ AND \ APPEND + \ APPEND_STRING \ BASE_DIRECTORY - \ CMAKE_PATH \ COMPARE - \ CONCAT \ CONVERT - \ ELSEIF - \ ENDIF + \ EQUAL \ EXTENSION \ EXTENSION_DEF \ FALSE + \ FILENAME \ FILENAME_DEF \ GET \ GET_EXTENSION \ GET_FILENAME \ GET_PARENT_PATH - \ GET_RELATIVE_PATH + \ GET_RELATIVE_PART \ GET_ROOT_DIRECTORY \ GET_ROOT_NAME \ GET_ROOT_PATH @@ -2431,12 +2847,11 @@ syn keyword cmakeKWcmake_path contained \ HAS_EXTENSION \ HAS_FILENAME \ HAS_PARENT_PATH - \ HAS_RELATIVE_PATH + \ HAS_RELATIVE_PART \ HAS_ROOT_DIRECTORY \ HAS_ROOT_NAME \ HAS_ROOT_PATH \ HAS_STEM - \ IF \ IS_ABSOLUTE \ IS_PREFIX \ IS_RELATIVE @@ -2445,23 +2860,21 @@ syn keyword cmakeKWcmake_path contained \ NATIVE_PATH \ NORMALIZE \ NORMAL_PATH - \ NOT \ NOT_EQUAL \ OP - \ OS \ OUTPUT_VARIABLE \ PARENT_PATH - \ PROXIMATE_PATH \ REAL_PATH + \ RELATIVE_PART \ RELATIVE_PATH \ REMOVE_EXTENSION \ REMOVE_FILENAME \ REPLACE_EXTENSION \ REPLACE_FILENAME - \ RETURN \ ROOT_DIRECTORY \ ROOT_NAME \ ROOT_PATH + \ SET \ STEM \ STREQUAL \ TO_CMAKE_PATH_LIST @@ -2476,8 +2889,10 @@ syn keyword cmakeKWcmake_policy contained \ NNNN \ NO_POLICY_SCOPE \ OLD + \ POLICIES \ POP \ PUSH + \ SCOPE_FOR \ SET \ VERSION @@ -2489,9 +2904,14 @@ syn keyword cmakeKWconfigure_file contained \ FILE_PERMISSIONS \ FOO_ENABLE \ FOO_STRING + \ GENERATE + \ INTERFACE \ LF \ NEWLINE_STYLE \ NO_SOURCE_PERMISSIONS + \ PRIVATE + \ PUBLIC + \ SYSTEM \ USE_SOURCE_PERMISSIONS \ VAR @@ -2506,6 +2926,7 @@ syn keyword cmakeKWctest_build contained \ APPEND \ BUILD \ CAPTURE_CMAKE_ERROR + \ CMAKE_BUILD_PARALLEL_LEVEL \ CONFIGURATION \ CTEST_BUILD_CONFIGURATION \ CTEST_BUILD_FLAGS @@ -2513,6 +2934,7 @@ syn keyword cmakeKWctest_build contained \ FLAGS \ NUMBER_ERRORS \ NUMBER_WARNINGS + \ PARALLEL_LEVEL \ QUIET \ RETURN_VALUE \ TARGET @@ -2537,6 +2959,7 @@ syn keyword cmakeKWctest_coverage contained syn keyword cmakeKWctest_memcheck contained \ APPEND \ BUILD + \ CAPTURE_CMAKE_ERROR \ DEFECT_COUNT \ EXCLUDE \ EXCLUDE_FIXTURE @@ -2547,11 +2970,15 @@ syn keyword cmakeKWctest_memcheck contained \ INCLUDE_LABEL \ OFF \ ON + \ OUTPUT_JUNIT \ PARALLEL_LEVEL \ QUIET + \ REPEAT + \ RESOURCE_SPEC_FILE \ RETURN_VALUE \ SCHEDULE_RANDOM \ START + \ STOP_ON_FAILURE \ STOP_TIME \ STRIDE \ TEST_LOAD @@ -2587,6 +3014,8 @@ syn keyword cmakeKWctest_submit contained syn keyword cmakeKWctest_test contained \ AFTER_TIMEOUT \ APPEND + \ ATTACHED_FILES + \ ATTACHED_FILES_ON_FAIL \ BUILD \ CAPTURE_CMAKE_ERROR \ CPU @@ -2597,8 +3026,10 @@ syn keyword cmakeKWctest_test contained \ EXCLUDE_LABEL \ INCLUDE \ INCLUDE_LABEL + \ LABELS \ OFF \ ON + \ OUTPUT_JUNIT \ PARALLEL_LEVEL \ QUIET \ REPEAT @@ -2612,6 +3043,8 @@ syn keyword cmakeKWctest_test contained \ TEST_LOAD \ UNTIL_FAIL \ UNTIL_PASS + \ URL + \ XML syn keyword cmakeKWctest_update contained \ CAPTURE_CMAKE_ERROR @@ -2629,15 +3062,18 @@ syn keyword cmakeKWdefine_property contained \ APPEND_STRING \ BRIEF_DOCS \ CACHED_VARIABLE + \ CMAKE_ \ DIRECTORY \ FULL_DOCS \ GLOBAL \ INHERITED + \ INITIALIZE_FROM_VARIABLE \ PROPERTY \ SOURCE \ TARGET \ TEST \ VARIABLE + \ _CMAKE_ syn keyword cmakeKWdoxygen_add_docs contained \ ALL @@ -2647,6 +3083,10 @@ syn keyword cmakeKWdoxygen_add_docs contained syn keyword cmakeKWenable_language contained \ ASM + \ ASM_MARMASM + \ ASM_MASM + \ ASM_NASM + \ ATT \ CUDA \ HIP \ ISPC @@ -2684,6 +3124,7 @@ syn keyword cmakeKWexecute_process contained \ OUTPUT_QUIET \ OUTPUT_STRIP_TRAILING_WHITESPACE \ OUTPUT_VARIABLE + \ POSIX \ RESULTS_VARIABLE \ RESULT_VARIABLE \ RFC @@ -2691,17 +3132,16 @@ syn keyword cmakeKWexecute_process contained \ STDOUT \ TIMEOUT \ UTF - \ VERBATIM \ WORKING_DIRECTORY syn keyword cmakeKWexport contained \ ANDROID_MK \ APPEND \ CONFIG + \ CXX_MODULES_DIRECTORY \ EXPORT \ EXPORT_LINK_INTERFACE_LIBRARIES \ FILE - \ IMPORTED \ IMPORTED_ \ NAMESPACE \ NDK @@ -2717,7 +3157,6 @@ syn keyword cmakeKWexport_library_dependencies contained \ SET syn keyword cmakeKWfile contained - \ ALGO \ APPEND \ ARCHIVE_CREATE \ ARCHIVE_EXTRACT @@ -2729,9 +3168,8 @@ syn keyword cmakeKWfile contained \ CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND \ CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM \ CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL + \ CMAKE_INSTALL_MODE \ CMAKE_OBJDUMP - \ CMAKE_TLS_CAINFO - \ CMAKE_TLS_VERIFY \ CODE \ COMPILE_FEATURES \ COMPRESSION @@ -2742,7 +3180,8 @@ syn keyword cmakeKWfile contained \ CONFLICTING_DEPENDENCIES_PREFIX \ CONTENT \ CONVERT - \ COPY + \ COPYONLY + \ COPY_FILE \ COPY_ON_ERROR \ CREATE_LINK \ CRLF @@ -2755,6 +3194,7 @@ syn keyword cmakeKWfile contained \ ENCODING \ ESCAPE_QUOTES \ EXECUTABLES + \ EXPAND_TILDE \ EXPECTED_HASH \ FILES_MATCHING \ FILE_PERMISSIONS @@ -2772,10 +3212,12 @@ syn keyword cmakeKWfile contained \ GUARD \ HASH \ HEX + \ HOME \ HTTPHEADER \ IGNORED \ INACTIVITY_TIMEOUT \ INPUT + \ INPUT_MAY_BE_RECENT \ INSTALL \ IS_ABSOLUTE \ LENGTH_MAXIMUM @@ -2800,9 +3242,11 @@ syn keyword cmakeKWfile contained \ NEWLINE_STYLE \ NOT \ NO_HEX_CONVERSION + \ NO_REPLACE \ NO_SOURCE_PERMISSIONS \ OFFSET \ ONLY + \ ONLY_IF_DIFFERENT \ OPTIONAL \ OUTPUT \ OWNER_EXECUTE @@ -2812,11 +3256,15 @@ syn keyword cmakeKWfile contained \ PATTERN \ PATTERNS \ PERMISSIONS + \ POST_EXCLUDE_FILES \ POST_EXCLUDE_REGEXES + \ POST_INCLUDE_FILES \ POST_INCLUDE_REGEXES \ PRE_EXCLUDE_REGEXES \ PRE_INCLUDE_REGEXES \ PROCESS + \ RANGE_END + \ RANGE_START \ READ \ READ_SYMLINK \ REAL_PATH @@ -2833,7 +3281,10 @@ syn keyword cmakeKWfile contained \ RESULT_VARIABLE \ RPATH \ RUNPATH + \ RUNTIME_DEPENDENCY_SET \ SCRIPT + \ SETGID + \ SETUID \ SHARED \ SHOW_PROGRESS \ SIZE @@ -2856,6 +3307,7 @@ syn keyword cmakeKWfile contained \ UNRESOLVED_DEPENDENCIES_VAR \ UPLOAD \ URL + \ USERPROFILE \ USERPWD \ USE_SOURCE_PERMISSIONS \ UTC @@ -2869,54 +3321,87 @@ syn keyword cmakeKWfile contained \ _FILENAMES syn keyword cmakeKWfind_file contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS + \ HOST \ INCLUDE + \ MATCHES \ NAMES + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfind_library contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS - \ INCLUDE + \ HOST + \ LIB + \ MATCHES \ NAMES \ NAMES_PER_DIR + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfind_package contained \ ABI + \ BOTH \ BUNDLE + \ BYPASS_PROVIDER + \ CATEGORY \ CMAKE_DISABLE_FIND_PACKAGE_ \ CMAKE_REQUIRE_FIND_PACKAGE_ \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ + \ CMAKE_REQUIRE_FIND_PACKAGE_ \ COMPONENTS \ CONFIG \ CONFIGS @@ -2927,7 +3412,9 @@ syn keyword cmakeKWfind_package contained \ FALSE \ FIND_PACKAGE_VERSION_FORMAT \ FRAMEWORK + \ GLOBAL \ HINTS + \ HOST \ INCLUDE \ MODULE \ NAMES @@ -2935,6 +3422,7 @@ syn keyword cmakeKWfind_package contained \ NO_CMAKE_BUILDS_PATH \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PACKAGE_REGISTRY \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PACKAGE_REGISTRY @@ -2944,8 +3432,10 @@ syn keyword cmakeKWfind_package contained \ NO_PACKAGE_ROOT_PATH \ NO_POLICY_SCOPE \ NO_SYSTEM_ENVIRONMENT_PATH + \ OLD \ ONLY_CMAKE_FIND_ROOT_PATH \ OPTIONAL_COMPONENTS + \ PACKAGENAME \ PACKAGE_FIND_NAME \ PACKAGE_FIND_VERSION \ PACKAGE_FIND_VERSION_COMPLETE @@ -2974,60 +3464,92 @@ syn keyword cmakeKWfind_package contained \ PATHS \ PATH_SUFFIXES \ QUIET + \ REGISTRY_VIEW \ REQUIRED \ SET + \ TARGET \ TRUE + \ VALUE \ _CONFIG \ _CONSIDERED_CONFIGS \ _CONSIDERED_VERSIONS \ _DIR \ _FIND_COMPONENTS \ _FIND_QUIETLY + \ _FIND_REGISTRY_VIEW \ _FIND_REQUIRED \ _FIND_REQUIRED_ \ _FIND_VERSION_EXACT \ _FOUND syn keyword cmakeKWfind_path contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS + \ HOST \ INCLUDE + \ MATCHES \ NAMES + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfind_program contained + \ BOTH + \ CATEGORY \ CMAKE_FIND_ROOT_PATH_BOTH + \ CMAKE_FIND_USE_ \ DOC \ DVAR \ FALSE + \ FIND_XXX_REGISTRY_VIEW \ HINTS + \ HOST + \ MATCHES \ NAMES \ NAMES_PER_DIR + \ NOT + \ NO_CACHE \ NO_CMAKE_ENVIRONMENT_PATH \ NO_CMAKE_FIND_ROOT_PATH + \ NO_CMAKE_INSTALL_PREFIX \ NO_CMAKE_PATH \ NO_CMAKE_SYSTEM_PATH \ NO_DEFAULT_PATH \ NO_PACKAGE_ROOT_PATH \ NO_SYSTEM_ENVIRONMENT_PATH \ ONLY_CMAKE_FIND_ROOT_PATH + \ PACKAGENAME + \ PARENT_SCOPE \ PATHS \ PATH_SUFFIXES + \ REGISTRY_VIEW \ REQUIRED + \ TARGET + \ VALIDATOR \ VAR syn keyword cmakeKWfltk_wrap_ui contained @@ -3070,17 +3592,19 @@ syn keyword cmakeKWget_filename_component contained \ NAME \ NAME_WE \ NAME_WLE - \ PATH \ PROGRAM \ PROGRAM_ARGS + \ QUERY \ REALPATH \ REAL_PATH + \ WINDOWS_REGISTRY syn keyword cmakeKWget_property contained \ BRIEF_DOCS \ DEFINED \ DIRECTORY \ FULL_DOCS + \ GENERATED \ GLOBAL \ INSTALL \ PROPERTY @@ -3093,6 +3617,7 @@ syn keyword cmakeKWget_property contained syn keyword cmakeKWget_source_file_property contained \ DIRECTORY + \ GENERATED \ INHERITED \ LOCATION \ TARGET_DIRECTORY @@ -3109,6 +3634,7 @@ syn keyword cmakeKWif contained \ CMAKE_MATCH_ \ CMP \ COMMAND + \ COMPARE \ DEFINED \ EQUAL \ EXISTS @@ -3128,6 +3654,7 @@ syn keyword cmakeKWif contained \ NOT \ OFF \ OR + \ PATH_EQUAL \ POLICY \ STREQUAL \ STRGREATER @@ -3172,11 +3699,13 @@ syn keyword cmakeKWinclude_guard contained syn keyword cmakeKWinstall contained \ AFTER \ AIX + \ ALL_COMPONENTS \ APT \ ARCHIVE \ BEFORE \ BUILD_TYPE \ BUNDLE + \ BUNDLE_EXECUTABLE \ CMAKE_INSTALL_BINDIR \ CMAKE_INSTALL_DATADIR \ CMAKE_INSTALL_DATAROOTDIR @@ -3187,6 +3716,7 @@ syn keyword cmakeKWinstall contained \ CMAKE_INSTALL_LOCALEDIR \ CMAKE_INSTALL_LOCALSTATEDIR \ CMAKE_INSTALL_MANDIR + \ CMAKE_INSTALL_MODE \ CMAKE_INSTALL_RUNSTATEDIR \ CMAKE_INSTALL_SBINDIR \ CMAKE_INSTALL_SHARESTATEDIR @@ -3195,6 +3725,8 @@ syn keyword cmakeKWinstall contained \ COMPONENT \ CONFIGURATIONS \ CVS + \ CXX_MODULES_BMI + \ CXX_MODULES_DIRECTORY \ DATA \ DATAROOT \ DBUILD_TYPE @@ -3207,6 +3739,7 @@ syn keyword cmakeKWinstall contained \ DOC \ ENABLE_EXPORTS \ EXCLUDE_FROM_ALL + \ EXECUTABLES \ EXPORT \ EXPORT_ANDROID_MK \ EXPORT_LINK_INTERFACE_LIBRARIES @@ -3214,14 +3747,18 @@ syn keyword cmakeKWinstall contained \ FILES \ FILES_MATCHING \ FILE_PERMISSIONS + \ FILE_SET \ FRAMEWORK + \ GET_RUNTIME_DEPENDENCIES \ GROUP_EXECUTE \ GROUP_READ \ GROUP_WRITE - \ IMPORTED_ + \ HEADERS + \ IMPORTED_RUNTIME_ARTIFACTS \ INCLUDES \ INFO \ INSTALL_PREFIX + \ INTERFACE \ INTERFACE_INCLUDE_DIRECTORIES \ LIBRARY \ LOCALE @@ -3241,18 +3778,24 @@ syn keyword cmakeKWinstall contained \ OWNER_WRITE \ PATTERN \ PERMISSIONS + \ POST_EXCLUDE_FILES + \ POST_EXCLUDE_REGEXES + \ POST_INCLUDE_FILES + \ POST_INCLUDE_REGEXES \ POST_INSTALL_SCRIPT + \ PRE_EXCLUDE_REGEXES + \ PRE_INCLUDE_REGEXES \ PRE_INSTALL_SCRIPT \ PRIVATE_HEADER \ PROGRAMS \ PROPERTIES \ PUBLIC_HEADER - \ REGEX \ RENAME \ RESOURCE \ RPM \ RUNSTATE - \ RUNTIME + \ RUNTIME_DEPENDENCIES + \ RUNTIME_DEPENDENCY_SET \ SBIN \ SCRIPT \ SETGID @@ -3333,6 +3876,11 @@ syn keyword cmakeKWlist contained \ TOLOWER \ TOUPPER \ TRANSFORM + \ TRANSFORM_APPEND + \ TRANSFORM_GENEX_STRIP + \ TRANSFORM_REPLACE + \ TRANSFORM_STRIP + \ TRANSFORM_TOLOWER syn keyword cmakeKWload_cache contained \ EXCLUDE @@ -3370,10 +3918,15 @@ syn keyword cmakeKWmessage contained \ CHECK_FAIL \ CHECK_PASS \ CHECK_START + \ CONFIGURE_LOG \ DEBUG + \ DEFINED \ DEPRECATION \ FATAL_ERROR + \ GET_MESSAGE_LOG_LEVEL \ GUI + \ INTERNAL + \ MY_CHECK_RESULT \ NOTICE \ POP_BACK \ SEND_ERROR @@ -3384,10 +3937,13 @@ syn keyword cmakeKWmessage contained syn keyword cmakeKWoption contained \ OFF - \ ON syn keyword cmakeKWproject contained \ ASM + \ ASM_MARMASM + \ ASM_MASM + \ ASM_NASM + \ ATT \ CMAKE_PROJECT_ \ CUDA \ DESCRIPTION @@ -3405,6 +3961,7 @@ syn keyword cmakeKWproject contained \ _DESCRIPTION \ _HOMEPAGE_URL \ _INCLUDE_BEFORE + \ _IS_TOP_LEVEL \ _SOURCE_DIR \ _VERSION \ _VERSION_MAJOR @@ -3424,6 +3981,11 @@ syn keyword cmakeKWremove contained syn keyword cmakeKWreturn contained \ DEFER + \ PARENT_SCOPE + \ PROPAGATE + \ SCOPE_FOR + \ VARIABLES + \ VERSION syn keyword cmakeKWseparate_arguments contained \ MSDN @@ -3439,10 +4001,13 @@ syn keyword cmakeKWset contained \ FORCE \ INTERNAL \ OFF + \ OLD \ ON \ PARENT_SCOPE + \ PROPAGATE \ STRING \ STRINGS + \ VAR syn keyword cmakeKWset_directory_properties contained \ DIRECTORY @@ -3452,9 +4017,11 @@ syn keyword cmakeKWset_property contained \ APPEND \ APPEND_STRING \ DIRECTORY + \ GENERATED \ GLOBAL \ INHERITED \ INSTALL + \ NAME \ PROPERTY \ SOURCE \ TARGET @@ -3464,17 +4031,17 @@ syn keyword cmakeKWset_property contained syn keyword cmakeKWset_source_files_properties contained \ DIRECTORY + \ GENERATED \ PROPERTIES \ SOURCE \ TARGET_DIRECTORY syn keyword cmakeKWset_target_properties contained \ PROPERTIES - \ TARGET syn keyword cmakeKWset_tests_properties contained + \ NAME \ PROPERTIES - \ TEST syn keyword cmakeKWsite_name contained \ HOSTNAME @@ -3506,9 +4073,9 @@ syn keyword cmakeKWstring contained \ GUID \ HASH \ HEX + \ ISO \ JOIN \ JSON - \ JSONLENGTH \ LENGTH \ LESS \ LESS_EQUAL @@ -3573,7 +4140,10 @@ syn keyword cmakeKWtarget_compile_features contained syn keyword cmakeKWtarget_compile_options contained \ ALIAS \ BEFORE + \ CMAKE_ + \ COMPILE_LANGUAGE \ COMPILE_OPTIONS + \ CONFIG \ IMPORTED \ INTERFACE \ INTERFACE_COMPILE_OPTIONS @@ -3581,8 +4151,11 @@ syn keyword cmakeKWtarget_compile_options contained \ PUBLIC \ SHELL \ UNIX_COMMAND + \ _FLAGS + \ _FLAGS_ syn keyword cmakeKWtarget_include_directories contained + \ AFTER \ ALIAS \ BEFORE \ BUILD_INTERFACE @@ -3619,6 +4192,7 @@ syn keyword cmakeKWtarget_link_libraries contained \ IMPORTED_NO_SONAME \ INTERFACE \ INTERFACE_LINK_LIBRARIES + \ LINK_FLAGS \ LINK_INTERFACE_LIBRARIES \ LINK_INTERFACE_LIBRARIES_DEBUG \ LINK_INTERFACE_MULTIPLICITY @@ -3631,16 +4205,17 @@ syn keyword cmakeKWtarget_link_libraries contained \ PUBLIC \ SHARED \ STATIC + \ TARGET_OBJECTS syn keyword cmakeKWtarget_link_options contained \ ALIAS \ BEFORE \ CMAKE_ + \ CONFIG \ CUDA_RESOLVE_DEVICE_SYMBOLS \ CUDA_SEPARABLE_COMPILATION \ DEVICE_LINK \ GCC - \ GNU \ HOST_LINK \ IMPORTED \ INTERFACE @@ -3653,6 +4228,8 @@ syn keyword cmakeKWtarget_link_options contained \ SHELL \ STATIC_LIBRARY_OPTIONS \ UNIX_COMMAND + \ _FLAGS + \ _FLAGS_ \ _LINKER_WRAPPER_FLAG \ _LINKER_WRAPPER_FLAG_SEP @@ -3677,15 +4254,45 @@ syn keyword cmakeKWtarget_precompile_headers contained syn keyword cmakeKWtarget_sources contained \ ALIAS + \ BASE_DIRS + \ BUILD_INTERFACE + \ CONFIG + \ CORRECT + \ CXX_MODULES + \ CXX_MODULE_DIRS + \ CXX_MODULE_DIRS_ + \ CXX_MODULE_SETS + \ CXX_MODULE_SET_ + \ EXPORT + \ FILES + \ FILE_SET + \ FRAMEWORK + \ HEADERS + \ HEADER_DIRS + \ HEADER_DIRS_ + \ HEADER_FILE_ONLY + \ HEADER_SETS + \ HEADER_SET_ \ IMPORTED + \ INCLUDE_DIRECTORIES \ INTERFACE + \ INTERFACE_CXX_MODULE_SETS + \ INTERFACE_HEADER_SETS + \ INTERFACE_INCLUDE_DIRECTORIES \ INTERFACE_SOURCES + \ NAME \ PRIVATE \ PUBLIC \ SOURCES + \ SOURCE_DIR + \ TARGETS + \ TRUE + \ TYPE + \ WRONG syn keyword cmakeKWtry_compile contained \ ALL_BUILD + \ BINARY_DIR \ CMAKE_FLAGS \ COMPILE_DEFINITIONS \ COPY_FILE @@ -3713,8 +4320,11 @@ syn keyword cmakeKWtry_compile contained \ LINK_DIRECTORIES \ LINK_LIBRARIES \ LINK_OPTIONS + \ LOG_DESCRIPTION \ MULTI \ NOT + \ NO_CACHE + \ NO_LOG \ OBJCXX_EXTENSIONS \ OBJCXX_STANDARD \ OBJCXX_STANDARD_REQUIRED @@ -3723,9 +4333,16 @@ syn keyword cmakeKWtry_compile contained \ OBJC_STANDARD_REQUIRED \ OUTPUT_VARIABLE \ PRIVATE + \ PROJECT + \ RESULTVAR \ SOURCES + \ SOURCE_DIR + \ SOURCE_FROM_CONTENT + \ SOURCE_FROM_FILE + \ SOURCE_FROM_VAR \ STATIC_LIBRARY \ STATIC_LIBRARY_OPTIONS + \ TARGET \ TRUE \ TYPE \ VALUE @@ -3738,18 +4355,28 @@ syn keyword cmakeKWtry_run contained \ CMAKE_FLAGS \ COMPILE_DEFINITIONS \ COMPILE_OUTPUT_VARIABLE - \ DLINK_LIBRARIES - \ DVAR + \ COPY_FILE + \ COPY_FILE_ERROR \ FAILED_TO_RUN \ FALSE - \ INCLUDE_DIRECTORIES - \ LINK_DIRECTORIES + \ LANG \ LINK_LIBRARIES \ LINK_OPTIONS + \ LOG_DESCRIPTION + \ NO_CACHE + \ NO_LOG + \ RUN_OUTPUT_STDERR_VARIABLE + \ RUN_OUTPUT_STDOUT_VARIABLE \ RUN_OUTPUT_VARIABLE + \ SOURCES + \ SOURCE_FROM_CONTENT + \ SOURCE_FROM_FILE + \ SOURCE_FROM_VAR \ TRUE - \ TYPE - \ VALUE + \ WORKING_DIRECTORY + \ _EXTENSIONS + \ _STANDARD + \ _STANDARD_REQUIRED \ __TRYRUN_OUTPUT syn keyword cmakeKWunset contained @@ -3783,26 +4410,38 @@ syn keyword cmakeKWwrite_file contained syn keyword cmakeGeneratorExpressions contained - \ AND + \ ABSOLUTE_PATH + \ ACTION + \ AIX \ ANGLE + \ APPEND \ ARCHIVE_OUTPUT_NAME \ ARCHIVE_OUTPUT_NAME_ + \ ASCENDING \ BAR \ BOOL \ BUILD_INTERFACE - \ CMAKE_ - \ COMMA - \ COMMAND + \ BUILD_LOCAL_INTERFACE + \ CMAKE_LINK_GROUP_USING_ + \ CMAKE_LINK_LIBRARY_USING_ + \ CMAKE_PATH + \ CODE + \ COMMAND_CONFIG + \ COMMAND_EXPAND_LISTS + \ COMPARE \ COMPILE_DEFINITIONS \ COMPILE_FEATURES \ COMPILE_LANGUAGE \ COMPILE_LANG_AND_ID + \ COMPILE_ONLY \ COMPILING_CUDA + \ COMPILING_CXX \ COMPILING_CXX_WITH_CLANG \ COMPILING_CXX_WITH_INTEL \ COMPILING_C_WITH_CLANG \ CONFIG \ CONFIGURATION + \ CONTENT \ CUDA_COMPILER_ID \ CUDA_COMPILER_VERSION \ CUDA_RESOLVE_DEVICE_SYMBOLS @@ -3817,71 +4456,146 @@ syn keyword cmakeGeneratorExpressions contained \ C_STANDARD \ DEBUG_MODE \ DEBUG_POSTFIX + \ DENABLE_SOME_FEATURE + \ DESCENDING \ DEVICE_LINK \ DLL + \ ENABLE_EXPORTS \ EXCLUDE \ EXPORT + \ EXTENSION_DEF \ FALSE + \ FILENAME_DEF + \ FILE_BASENAME \ FILTER + \ FIND \ FOO_EXTRA_THINGS \ GENERATE \ GENEX_EVAL - \ GNU + \ GET_EXTENSION + \ GET_FILENAME + \ GET_PARENT_PATH + \ GET_RELATIVE_PART + \ GET_ROOT_DIRECTORY + \ GET_ROOT_NAME + \ GET_ROOT_PATH + \ GET_STEM + \ HAS_ + \ HAS_EXTENSION + \ HAS_FILENAME + \ HAS_PARENT_PATH + \ HAS_RELATIVE_PART + \ HAS_ROOT_DIRECTORY + \ HAS_ROOT_NAME + \ HAS_ROOT_PATH + \ HAS_STEM + \ HAVE_SOME_FEATURE \ HIP_COMPILER_ID \ HIP_COMPILER_VERSION \ HIP_STANDARD \ HOST_LINK \ IF \ IGNORE + \ IMPORTED_LOCATION \ IMPORT_PREFIX \ IMPORT_SUFFIX \ INCLUDE_DIRECTORIES + \ INSENSITIVE + \ INSERT \ INSTALL_INTERFACE \ INSTALL_NAME_DIR \ INSTALL_PREFIX - \ INTERFACE + \ INSTALL_RPATH \ INTERFACE_LINK_LIBRARIES + \ INTERFACE_LINK_LIBRARIES_DIRECT \ IN_LIST \ ISPC_COMPILER_ID \ ISPC_COMPILER_VERSION + \ IS_ABSOLUTE + \ IS_PREFIX + \ IS_RELATIVE \ JOIN \ LANG \ LANG_COMPILER_ID + \ LAST_ONLY + \ LENGTH \ LIBRARY_OUTPUT_NAME \ LIBRARY_OUTPUT_NAME_ + \ LINK_GROUP + \ LINK_GROUP_PREDEFINED_FEATURES \ LINK_LANGUAGE \ LINK_LANG_AND_ID \ LINK_LIBRARIES + \ LINK_LIBRARY + \ LINK_LIBRARY_OVERRIDE + \ LINK_LIBRARY_OVERRIDE_ + \ LINK_LIBRARY_PREDEFINED_FEATURES \ LINK_ONLY \ LOWER_CASE \ MAKE_C_IDENTIFIER \ MAP_IMPORTED_CONFIG_ + \ MODULE + \ NATURAL \ NO + \ NORMALIZE + \ NORMAL_PATH \ NOT \ OBJCXX_COMPILER_ID \ OBJCXX_COMPILER_VERSION \ OBJC_COMPILER_ID \ OBJC_COMPILER_VERSION + \ OBJECT \ OFF \ OLD_COMPILER + \ ORDER + \ OUTPUT + \ OUTPUT_CONFIG \ OUTPUT_NAME \ OUTPUT_NAME_ + \ PATH + \ PATH_EQUAL \ PDB_NAME \ PDB_NAME_ \ PDB_OUTPUT_DIRECTORY \ PDB_OUTPUT_DIRECTORY_ \ PLATFORM_ID + \ POP_BACK + \ POP_FRONT \ POSIX + \ POST_BUILD + \ PREPEND \ PRIVATE \ PUBLIC + \ REGEX + \ RELATIVE_PATH + \ REMOVE_AT \ REMOVE_DUPLICATES + \ REMOVE_EXTENSION + \ REMOVE_FILENAME + \ REMOVE_ITEM + \ REPLACE + \ REPLACE_EXTENSION + \ REPLACE_FILENAME + \ REQUIRED + \ RESCAN + \ REVERSE + \ RPATH + \ RUNTIME_DEPENDENCY_SET \ RUNTIME_OUTPUT_NAME \ RUNTIME_OUTPUT_NAME_ + \ SCRIPT \ SDK + \ SELECTOR \ SEMICOLON + \ SENSITIVE + \ SHARED \ SHELL_PATH + \ SORT \ STATIC \ STREQUAL + \ STRING + \ STRIP + \ SUBLIST \ TARGET_BUNDLE_CONTENT_DIR \ TARGET_BUNDLE_DIR \ TARGET_BUNDLE_DIR_NAME @@ -3893,12 +4607,30 @@ syn keyword cmakeGeneratorExpressions contained \ TARGET_FILE_PREFIX \ TARGET_FILE_SUFFIX \ TARGET_GENEX_EVAL + \ TARGET_IMPORT_FILE + \ TARGET_IMPORT_FILE_BASE_NAME + \ TARGET_IMPORT_FILE_DIR + \ TARGET_IMPORT_FILE_NAME + \ TARGET_IMPORT_FILE_PREFIX + \ TARGET_IMPORT_FILE_SUFFIX \ TARGET_LINKER_FILE \ TARGET_LINKER_FILE_BASE_NAME \ TARGET_LINKER_FILE_DIR \ TARGET_LINKER_FILE_NAME \ TARGET_LINKER_FILE_PREFIX \ TARGET_LINKER_FILE_SUFFIX + \ TARGET_LINKER_IMPORT_FILE + \ TARGET_LINKER_IMPORT_FILE_BASE_NAME + \ TARGET_LINKER_IMPORT_FILE_DIR + \ TARGET_LINKER_IMPORT_FILE_NAME + \ TARGET_LINKER_IMPORT_FILE_PREFIX + \ TARGET_LINKER_IMPORT_FILE_SUFFIX + \ TARGET_LINKER_LIBRARY_FILE + \ TARGET_LINKER_LIBRARY_FILE_BASE_NAME + \ TARGET_LINKER_LIBRARY_FILE_DIR + \ TARGET_LINKER_LIBRARY_FILE_NAME + \ TARGET_LINKER_LIBRARY_FILE_PREFIX + \ TARGET_LINKER_LIBRARY_FILE_SUFFIX \ TARGET_NAME_IF_EXISTS \ TARGET_OBJECTS \ TARGET_PDB_FILE @@ -3907,16 +4639,34 @@ syn keyword cmakeGeneratorExpressions contained \ TARGET_PDB_FILE_NAME \ TARGET_POLICY \ TARGET_PROPERTY + \ TARGET_RUNTIME_DLLS + \ TARGET_RUNTIME_DLL_DIRS \ TARGET_SONAME_FILE \ TARGET_SONAME_FILE_DIR \ TARGET_SONAME_FILE_NAME + \ TARGET_SONAME_IMPORT_FILE + \ TARGET_SONAME_IMPORT_FILE_DIR + \ TARGET_SONAME_IMPORT_FILE_NAME + \ TOLOWER + \ TOUPPER + \ TRANSFORM + \ TRANSFORM_APPEND + \ TRANSFORM_REPLACE + \ TRANSFORM_STRIP + \ TRANSFORM_TOLOWER + \ UNKNOWN \ UPPER_CASE + \ VERBATIM \ VERSION_EQUAL - \ VERSION_GREATER \ VERSION_GREATER_EQUAL \ VERSION_LESS \ VERSION_LESS_EQUAL + \ WHOLE_ARCHIVE + \ WRONG + \ _LINK_GROUP_USING_ + \ _LINK_LIBRARY_USING_ \ _POSTFIX + \ _SUPPORTED syn case ignore @@ -3936,6 +4686,7 @@ syn keyword cmakeCommand \ block \ break \ build_command + \ cmake_file_api \ cmake_host_system_information \ cmake_language \ cmake_minimum_required @@ -4085,6 +4836,7 @@ hi def link cmakeVariableValue Type hi def link cmakeVariable Identifier hi def link cmakeKWExternalProject ModeMsg +hi def link cmakeKWFetchContent ModeMsg hi def link cmakeKWadd_compile_definitions ModeMsg hi def link cmakeKWadd_compile_options ModeMsg hi def link cmakeKWadd_custom_command ModeMsg @@ -4096,7 +4848,9 @@ hi def link cmakeKWadd_library ModeMsg hi def link cmakeKWadd_link_options ModeMsg hi def link cmakeKWadd_subdirectory ModeMsg hi def link cmakeKWadd_test ModeMsg +hi def link cmakeKWblock ModeMsg hi def link cmakeKWbuild_command ModeMsg +hi def link cmakeKWcmake_file_api ModeMsg hi def link cmakeKWcmake_host_system_information ModeMsg hi def link cmakeKWcmake_language ModeMsg hi def link cmakeKWcmake_minimum_required ModeMsg diff --git a/CMakeLists.txt b/CMakeLists.txt index d559c085511..2823ca4fcc6 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.25 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13...3.26 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) @@ -131,6 +131,8 @@ if(CMake_BUILD_LTO) endif() endif() +option(CMake_BUILD_PCH "Compile CMake with precompiled headers" OFF) + # Check whether to build support for the debugger mode. if(NOT CMake_TEST_EXTERNAL_CMAKE) if(NOT DEFINED CMake_ENABLE_DEBUGGER) @@ -153,7 +155,6 @@ endif() # simply to improve readability of the main script #----------------------------------------------------------------------- macro(CMAKE_HANDLE_SYSTEM_LIBRARIES) - # Options have dependencies. include(CMakeDependentOption) # Allow the user to enable/disable all system utility library options by @@ -324,6 +325,9 @@ configure_file(.clang-tidy .clang-tidy COPYONLY) option(CMake_RUN_IWYU "Run include-what-you-use with the compiler." OFF) if(CMake_RUN_IWYU) + if(CMake_BUILD_PCH) + message(FATAL_ERROR "CMake_RUN_IWYU and CMake_BUILD_PCH are ON, but they are incompatible!") + endif() find_program(IWYU_COMMAND NAMES include-what-you-use iwyu) if(NOT IWYU_COMMAND) message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!") diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt index 8c6af6d798d..ffde8140e78 100644 --- a/Help/command/FIND_XXX.txt +++ b/Help/command/FIND_XXX.txt @@ -208,7 +208,8 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: setting the :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` to ``FALSE``. * |SYSTEM_ENVIRONMENT_PATH_XXX| - * |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| + + |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| 6. Search cmake variables defined in the Platform files for the current system. The searching of ``CMAKE_INSTALL_PREFIX`` and diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst index 740d85316d4..c9a51baf9aa 100644 --- a/Help/command/add_custom_command.rst +++ b/Help/command/add_custom_command.rst @@ -24,6 +24,7 @@ The first signature is for adding a custom command to produce an output: [COMMENT comment] [DEPFILE depfile] [JOB_POOL job_pool] + [JOB_SERVER_AWARE ] [VERBATIM] [APPEND] [USES_TERMINAL] [COMMAND_EXPAND_LISTS] [DEPENDS_EXPLICIT_ONLY]) @@ -86,6 +87,11 @@ The options are: :ref:`Target-dependent expressions ` are not permitted. + .. versionchanged:: 3.28 + In targets using :ref:`file sets`, custom command byproducts are now + considered private unless they are listed in a non-private file set. + See policy :policy:`CMP0154`. + ``COMMAND`` Specify the command-line(s) to execute at build time. If more than one ``COMMAND`` is specified they will be executed in order, @@ -221,6 +227,19 @@ The options are: Using a pool that is not defined by :prop_gbl:`JOB_POOLS` causes an error by ninja at build time. +``JOB_SERVER_AWARE`` + .. versionadded:: 3.28 + + Specify that the command is GNU Make job server aware. + + For the :generator:`Unix Makefiles`, :generator:`MSYS Makefiles`, and + :generator:`MinGW Makefiles` generators this will add the ``+`` prefix to the + recipe line. See the `GNU Make Documentation`_ for more information. + + This option is silently ignored by other generators. + +.. _`GNU Make Documentation`: https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html + ``MAIN_DEPENDENCY`` Specify the primary input source file to the command. This is treated just like any value given to the ``DEPENDS`` option @@ -256,6 +275,11 @@ The options are: :ref:`Target-dependent expressions ` are not permitted. + .. versionchanged:: 3.28 + In targets using :ref:`file sets`, custom command outputs are now + considered private unless they are listed in a non-private file set. + See policy :policy:`CMP0154`. + ``USES_TERMINAL`` .. versionadded:: 3.2 @@ -516,7 +540,7 @@ one of the keywords to make clear the behavior they expect. Because generator expressions can be used in custom commands, it is possible to define ``COMMAND`` lines or whole custom commands which evaluate to empty strings for certain configurations. - For **Visual Studio 11 2012 (and newer)** generators these command + For **Visual Studio 12 2013 (and newer)** generators these command lines or custom commands will be omitted for the specific configuration and no "empty-string-command" will be added. diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst index 5cf6326dec6..32b85a56a90 100644 --- a/Help/command/add_custom_target.rst +++ b/Help/command/add_custom_target.rst @@ -12,6 +12,7 @@ add_custom_target [WORKING_DIRECTORY dir] [COMMENT comment] [JOB_POOL job_pool] + [JOB_SERVER_AWARE ] [VERBATIM] [USES_TERMINAL] [COMMAND_EXPAND_LISTS] [SOURCES src1 [src2...]]) @@ -62,6 +63,11 @@ The options are: :ref:`Target-dependent expressions ` are not permitted. + .. versionchanged:: 3.28 + In custom targets using :ref:`file sets`, byproducts are now + considered private unless they are listed in a non-private file set. + See policy :policy:`CMP0154`. + ``COMMAND`` Specify the command-line(s) to execute at build time. If more than one ``COMMAND`` is specified they will be executed in order, @@ -146,6 +152,19 @@ The options are: Using a pool that is not defined by :prop_gbl:`JOB_POOLS` causes an error by ninja at build time. +``JOB_SERVER_AWARE`` + .. versionadded:: 3.28 + + Specify that the command is GNU Make job server aware. + + For the :generator:`Unix Makefiles`, :generator:`MSYS Makefiles`, and + :generator:`MinGW Makefiles` generators this will add the ``+`` prefix to the + recipe line. See the `GNU Make Documentation`_ for more information. + + This option is silently ignored by other generators. + +.. _`GNU Make Documentation`: https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html + ``SOURCES`` Specify additional source files to be included in the custom target. Specified source files will be added to IDE project files for diff --git a/Help/command/block.rst b/Help/command/block.rst index 1f2f149002d..686a2a420fd 100644 --- a/Help/command/block.rst +++ b/Help/command/block.rst @@ -21,7 +21,8 @@ scopes created by the ``block()`` command are removed. ``POLICIES`` Create a new policy scope. This is equivalent to - :command:`cmake_policy(PUSH)`. + :command:`cmake_policy(PUSH)` with an automatic + :command:`cmake_policy(POP)` when leaving the block scope. ``VARIABLES`` Create a new variable scope. diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst index 4a6926577d4..ff2803aeac9 100644 --- a/Help/command/cmake_host_system_information.rst +++ b/Help/command/cmake_host_system_information.rst @@ -146,6 +146,13 @@ queried. The list of queried values is stored in ````. See :variable:`CMAKE_HOST_SYSTEM_PROCESSOR` +``MSYSTEM_PREFIX`` + .. versionadded:: 3.28 + + Available only on Windows hosts. In a MSYS or MinGW development + environment that sets the ``MSYSTEM`` environment variable, this + is its installation prefix. Otherwise, this is the empty string. + ``DISTRIB_INFO`` .. versionadded:: 3.22 diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst index 07c0d48184c..d8f0f2a2efd 100644 --- a/Help/command/cmake_policy.rst +++ b/Help/command/cmake_policy.rst @@ -23,9 +23,8 @@ The ``cmake_policy`` command is used to set policies to ``OLD`` or ``NEW`` behavior. While setting policies individually is supported, we encourage projects to set policies based on CMake versions: -.. code-block:: cmake - - cmake_policy(VERSION [...]) +.. signature:: cmake_policy(VERSION [...]) + :target: VERSION .. versionadded:: 3.12 The optional ```` version. @@ -56,10 +55,8 @@ command implicitly calls ``cmake_policy(VERSION)`` too. Setting Policies Explicitly ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. code-block:: cmake - - cmake_policy(SET CMP NEW) - cmake_policy(SET CMP OLD) +.. signature:: cmake_policy(SET CMP NEW|OLD) + :target: SET Tell CMake to use the ``OLD`` or ``NEW`` behavior for a given policy. Projects depending on the old behavior of a given policy may silence a @@ -72,9 +69,8 @@ policy state to ``NEW``. Checking Policy Settings ^^^^^^^^^^^^^^^^^^^^^^^^ -.. code-block:: cmake - - cmake_policy(GET CMP ) +.. signature:: cmake_policy(GET CMP ) + :target: GET Check whether a given policy is set to ``OLD`` or ``NEW`` behavior. The output ```` value will be ``OLD`` or ``NEW`` if the @@ -93,23 +89,27 @@ except when invoked with the ``NO_POLICY_SCOPE`` option The ``cmake_policy`` command provides an interface to manage custom entries on the policy stack: -.. code-block:: cmake +.. signature:: cmake_policy(PUSH) + :target: PUSH + + Create a new entry on the policy stack. + +.. signature:: cmake_policy(POP) + :target: POP - cmake_policy(PUSH) - cmake_policy(POP) + Remove the last policy stack entry created with ``cmake_policy(PUSH)``. Each ``PUSH`` must have a matching ``POP`` to erase any changes. This is useful to make temporary changes to policy settings. Calls to the :command:`cmake_minimum_required(VERSION)`, -``cmake_policy(VERSION)``, or ``cmake_policy(SET)`` commands +:command:`cmake_policy(VERSION)`, or :command:`cmake_policy(SET)` commands influence only the current top of the policy stack. .. versionadded:: 3.25 - The :command:`block` and :command:`endblock` commands offer a more flexible + The :command:`block(SCOPE_FOR POLICIES)` command offers a more flexible and more secure way to manage the policy stack. The pop action is done - automatically when the :command:`endblock` command is executed, so it avoid - to call the :command:`cmake_policy(POP)` command before each - :command:`return` command. + automatically when leaving the block scope, so there is no need to + precede each :command:`return` with a call to :command:`cmake_policy(POP)`. .. code-block:: cmake diff --git a/Help/command/exec_program.rst b/Help/command/exec_program.rst index 983a6df9e53..60101764117 100644 --- a/Help/command/exec_program.rst +++ b/Help/command/exec_program.rst @@ -1,6 +1,10 @@ exec_program ------------ +.. versionchanged:: 3.28 + This command is available only if policy :policy:`CMP0153` is not set to ``NEW``. + Port projects to the :command:`execute_process` command. + .. deprecated:: 3.0 Use the :command:`execute_process` command instead. diff --git a/Help/command/export.rst b/Help/command/export.rst index 9f439531b4c..bd21124a9fd 100644 --- a/Help/command/export.rst +++ b/Help/command/export.rst @@ -53,10 +53,7 @@ The options are: to support consumers using CMake versions older than 2.8.12. ``CXX_MODULES_DIRECTORY `` - - .. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` + .. versionadded:: 3.28 Export C++ module properties to files under the given directory. Each file will be named according to the target's export name (without any namespace). diff --git a/Help/command/file.rst b/Help/command/file.rst index 64a7c88c108..a4a1af53948 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -981,6 +981,11 @@ Path Conversion if ``USERPROFILE`` is not defined. On all other platforms, only ``HOME`` is used. + .. versionchanged:: 3.28 + + All symlinks are resolved before collapsing ``../`` components. + See policy :policy:`CMP0152`. + .. signature:: file(RELATIVE_PATH ) diff --git a/Help/command/find_file.rst b/Help/command/find_file.rst index b1e41370386..f52d3c0db81 100644 --- a/Help/command/find_file.rst +++ b/Help/command/find_file.rst @@ -28,9 +28,11 @@ find_file .. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``INCLUDE`` and ``PATH``. -.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts: - ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` - is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|. +.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: + On Windows hosts, CMake 3.3 through 3.27 searched additional paths: + ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` + is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|. + This behavior was removed by CMake 3.28. .. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace:: ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst index dcb5b1f4b8f..9ab7961796b 100644 --- a/Help/command/find_library.rst +++ b/Help/command/find_library.rst @@ -27,9 +27,11 @@ find_library .. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``LIB`` and ``PATH``. -.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts: - ``/lib/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` - is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|. +.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: + On Windows hosts, CMake 3.3 through 3.27 searched additional paths: + ``/lib/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` + is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|. + This behavior was removed by CMake 3.28. .. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace:: ``/lib/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set, @@ -60,6 +62,10 @@ path to the framework ``/A.framework``. When a full path to a framework is used as a library, CMake will use a ``-framework A``, and a ``-F`` to link the framework to the target. +.. versionadded:: 3.28 + + The library found can now be a ``.xcframework`` folder. + If the :variable:`CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variable is set all search paths will be tested as normal, with the suffix appended, and with all matches of ``lib/`` replaced with diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst index 4c908da11f4..33eb57f8c68 100644 --- a/Help/command/find_package.rst +++ b/Help/command/find_package.rst @@ -320,18 +320,27 @@ containing a configuration file: In all cases the ```` is treated as case-insensitive and corresponds to any of the names specified (```` or names given by ``NAMES``). -Paths with ``lib/`` are enabled if the -:variable:`CMAKE_LIBRARY_ARCHITECTURE` variable is set. ``lib*`` includes one -or more of the values ``lib64``, ``lib32``, ``libx32`` or ``lib`` (searched in -that order). +If at least one compiled language has been enabled, the architecture-specific +``lib/`` and ``lib*`` directories may be searched based on the compiler's +target architecture, in the following order: -* Paths with ``lib64`` are searched on 64 bit platforms if the +``lib/`` + Searched if the :variable:`CMAKE_LIBRARY_ARCHITECTURE` variable is set. + +``lib64`` + Searched on 64 bit platforms (:variable:`CMAKE_SIZEOF_VOID_P` is 8) and the :prop_gbl:`FIND_LIBRARY_USE_LIB64_PATHS` property is set to ``TRUE``. -* Paths with ``lib32`` are searched on 32 bit platforms if the + +``lib32`` + Searched on 32 bit platforms (:variable:`CMAKE_SIZEOF_VOID_P` is 4) and the :prop_gbl:`FIND_LIBRARY_USE_LIB32_PATHS` property is set to ``TRUE``. -* Paths with ``libx32`` are searched on platforms using the x32 ABI + +``libx32`` + Searched on platforms using the x32 ABI if the :prop_gbl:`FIND_LIBRARY_USE_LIBX32_PATHS` property is set to ``TRUE``. -* The ``lib`` path is always searched. + +``lib`` + Always searched. .. versionchanged:: 3.24 On ``Windows`` platform, it is possible to include registry queries as part @@ -343,7 +352,7 @@ that order). ``REGISTRY_VIEW`` can be specified to manage ``Windows`` registry queries specified as part of ``PATHS`` and ``HINTS``. -.. include:: FIND_XXX_REGISTRY_VIEW.txt + .. include:: FIND_XXX_REGISTRY_VIEW.txt If ``PATH_SUFFIXES`` is specified, the suffixes are appended to each (``W``) or (``U``) directory entry one-by-one. diff --git a/Help/command/find_path.rst b/Help/command/find_path.rst index 5917b6652d0..8581f6d391e 100644 --- a/Help/command/find_path.rst +++ b/Help/command/find_path.rst @@ -27,9 +27,11 @@ find_path .. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``INCLUDE`` and ``PATH``. -.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts: - ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` - is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|. +.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: + On Windows hosts, CMake 3.3 through 3.27 searched additional paths: + ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` + is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|. + This behavior was removed by CMake 3.28. .. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace:: ``/include/`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` diff --git a/Help/command/find_program.rst b/Help/command/find_program.rst index c3c6fe5df5c..1a6fd67ad2e 100644 --- a/Help/command/find_program.rst +++ b/Help/command/find_program.rst @@ -23,7 +23,7 @@ find_program .. |ENV_CMAKE_XXX_MAC_PATH| replace:: :envvar:`CMAKE_APPBUNDLE_PATH` .. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: The directories in ``PATH`` itself. -.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: On Windows hosts no extra search paths are included +.. |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| replace:: \ .. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace:: |CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR| diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst index 80ab5e6f960..cbb77cbae83 100644 --- a/Help/command/get_property.rst +++ b/Help/command/get_property.rst @@ -12,7 +12,8 @@ get_property SOURCE [DIRECTORY | TARGET_DIRECTORY ] | INSTALL | - TEST | + TEST + [DIRECTORY ] | CACHE | VARIABLE > PROPERTY @@ -73,6 +74,16 @@ It must be one of the following: Scope must name one existing test. See also the :command:`get_test_property` command. + .. versionadded:: 3.28 + Directory scope can be overridden with the following sub-option: + + ``DIRECTORY `` + The test property will be read from the ```` directory's + scope. CMake must already know about the directory, either by having added + it through a call to :command:`add_subdirectory` or ```` being the top + level directory. Relative paths are treated as relative to the current + source directory. ```` may reference a binary directory. + ``CACHE`` Scope must name one cache entry. diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst index e4cd9960d7b..b176fed4bcd 100644 --- a/Help/command/get_test_property.rst +++ b/Help/command/get_test_property.rst @@ -5,7 +5,7 @@ get_test_property .. code-block:: cmake - get_test_property(test property VAR) + get_test_property(test property [DIRECTORY ] VAR) Get a property from the test. The value of the property is stored in the variable ``VAR``. If the test property is not found, the behavior @@ -19,6 +19,17 @@ an empty string. For a list of standard properties you can type :option:`cmake --help-property-list`. +.. versionadded:: 3.28 + Directory scope can be overridden with the following sub-option: + + ``DIRECTORY `` + The test property will be read from the ```` directory's + scope. CMake must already know about that source directory, either by + having added it through a call to :command:`add_subdirectory` or ```` + being the top level source directory. Relative paths are treated as + relative to the current source directory. ```` may reference a binary + directory. + See Also ^^^^^^^^ diff --git a/Help/command/if.rst b/Help/command/if.rst index ae5d4e4b9b3..8bbb7c17f55 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -228,36 +228,36 @@ Comparisons .. signature:: if( LESS ) :target: LESS - True if the given string or variable's value is a valid number and less - than that on the right. + True if the given string or variable's value parses as a real number + (like a C ``double``) and less than that on the right. .. signature:: if( GREATER ) :target: GREATER - True if the given string or variable's value is a valid number and greater - than that on the right. + True if the given string or variable's value parses as a real number + (like a C ``double``) and greater than that on the right. .. signature:: if( EQUAL ) :target: EQUAL - True if the given string or variable's value is a valid number and equal - to that on the right. + True if the given string or variable's value parses as a real number + (like a C ``double``) and equal to that on the right. .. signature:: if( LESS_EQUAL ) :target: LESS_EQUAL .. versionadded:: 3.7 - True if the given string or variable's value is a valid number and less - than or equal to that on the right. + True if the given string or variable's value parses as a real number + (like a C ``double``) and less than or equal to that on the right. .. signature:: if( GREATER_EQUAL ) :target: GREATER_EQUAL .. versionadded:: 3.7 - True if the given string or variable's value is a valid number and greater - than or equal to that on the right. + True if the given string or variable's value parses as a real number + (like a C ``double``) and greater than or equal to that on the right. .. signature:: if( STRLESS ) :target: STRLESS diff --git a/Help/command/install.rst b/Help/command/install.rst index 16e522397a9..ece5ba4a316 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -1,6 +1,10 @@ install ------- +.. only:: html + + .. contents:: + 指定安装时运行的规则。 Synopsis @@ -34,12 +38,14 @@ are executed in order during installation. The environment variable :envvar:`CMAKE_INSTALL_MODE` can override the default copying behavior of ``install()``. +.. _`common options`: + There are multiple signatures for this command. Some of them define installation options for files and targets. Options common to multiple signatures are covered here but they are valid only for signatures that specify them. The common options are: -``DESTINATION`` +``DESTINATION `` Specify the directory on disk to which a file will be installed. Arguments can be relative or absolute paths. @@ -58,32 +64,28 @@ signatures that specify them. The common options are: :variable:`CMAKE_INSTALL_PREFIX`; this prefix is used by default if the DESTINATION is a relative path. -``PERMISSIONS`` +``PERMISSIONS ...`` Specify permissions for installed files. Valid permissions are ``OWNER_READ``, ``OWNER_WRITE``, ``OWNER_EXECUTE``, ``GROUP_READ``, ``GROUP_WRITE``, ``GROUP_EXECUTE``, ``WORLD_READ``, ``WORLD_WRITE``, ``WORLD_EXECUTE``, ``SETUID``, and ``SETGID``. Permissions that do not make sense on certain platforms are ignored on those platforms. -``CONFIGURATIONS`` - Specify a list of build configurations for which the install rule - applies (Debug, Release, etc.). Note that the values specified for - this option only apply to options listed AFTER the ``CONFIGURATIONS`` - option. For example, to set separate install paths for the Debug and - Release configurations, do the following: - - .. code-block:: cmake + If this option is used multiple times in a single call, its list + of permissions accumulates. If an :command:`install(TARGETS)` call + uses `\`_ arguments, a separate list of permissions + is accumulated for each kind of artifact. - install(TARGETS target - CONFIGURATIONS Debug - RUNTIME DESTINATION Debug/bin) - install(TARGETS target - CONFIGURATIONS Release - RUNTIME DESTINATION Release/bin) +``CONFIGURATIONS ...`` + Specify a list of build configurations for which the install rule + applies (Debug, Release, etc.). - Note that ``CONFIGURATIONS`` appears BEFORE ``RUNTIME DESTINATION``. + If this option is used multiple times in a single call, its list + of configurations accumulates. If an :command:`install(TARGETS)` + call uses `\`_ arguments, a separate list of + configurations is accumulated for each kind of artifact. -``COMPONENT`` +``COMPONENT `` Specify an installation component name with which the install rule is associated, such as ``Runtime`` or ``Development``. During component-specific installation only install rules associated with @@ -99,7 +101,7 @@ signatures that specify them. The common options are: Specify that the file is excluded from a full installation and only installed as part of a component-specific installation -``RENAME`` +``RENAME `` Specify a name for an installed file that may be different from the original file. Renaming is allowed only when a single file is installed by the command. @@ -121,861 +123,911 @@ signatures that specify them. The common options are: they will be created according to the uname rules on Unix-like platforms. Windows platforms are unaffected. -Installing Targets -^^^^^^^^^^^^^^^^^^ - -.. _`install(TARGETS)`: -.. _TARGETS: - -.. code-block:: cmake - - install(TARGETS targets... [EXPORT ] - [RUNTIME_DEPENDENCIES args...|RUNTIME_DEPENDENCY_SET ] - [[ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE| - PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE|FILE_SET |CXX_MODULES_BMI] - [DESTINATION ] - [PERMISSIONS permissions...] - [CONFIGURATIONS [Debug|Release|...]] - [COMPONENT ] - [NAMELINK_COMPONENT ] - [OPTIONAL] [EXCLUDE_FROM_ALL] - [NAMELINK_ONLY|NAMELINK_SKIP] - ] [...] - [INCLUDES DESTINATION [ ...]] - ) - -The ``TARGETS`` form specifies rules for installing targets from a -project. There are several kinds of target :ref:`Output Artifacts` -that may be installed: - -``ARCHIVE`` - Target artifacts of this kind include: - - * *Static libraries* - (except on macOS when marked as ``FRAMEWORK``, see below); - * *DLL import libraries* - (on all Windows-based systems including Cygwin; they have extension - ``.lib``, in contrast to the ``.dll`` libraries that go to ``RUNTIME``); - * On AIX, the *linker import file* created for executables with - :prop_tgt:`ENABLE_EXPORTS` enabled. - * On macOS, the *linker import file* created for shared libraries with - :prop_tgt:`ENABLE_EXPORTS` enabled (except when marked as ``FRAMEWORK``, - see below). - -``LIBRARY`` - Target artifacts of this kind include: - - * *Shared libraries*, except - - - DLLs (these go to ``RUNTIME``, see below), - - on macOS when marked as ``FRAMEWORK`` (see below). - -``RUNTIME`` - Target artifacts of this kind include: - - * *Executables* - (except on macOS when marked as ``MACOSX_BUNDLE``, see ``BUNDLE`` below); - * DLLs (on all Windows-based systems including Cygwin; note that the - accompanying import libraries are of kind ``ARCHIVE``). - -``OBJECTS`` - .. versionadded:: 3.9 - - Object files associated with *object libraries*. - -``FRAMEWORK`` - Both static and shared libraries marked with the ``FRAMEWORK`` - property are treated as ``FRAMEWORK`` targets on macOS. - -``BUNDLE`` - Executables marked with the :prop_tgt:`MACOSX_BUNDLE` property are treated as - ``BUNDLE`` targets on macOS. - -``PUBLIC_HEADER`` - Any :prop_tgt:`PUBLIC_HEADER` files associated with a library are installed in - the destination specified by the ``PUBLIC_HEADER`` argument on non-Apple - platforms. Rules defined by this argument are ignored for :prop_tgt:`FRAMEWORK` - libraries on Apple platforms because the associated files are installed - into the appropriate locations inside the framework folder. See - :prop_tgt:`PUBLIC_HEADER` for details. - -``PRIVATE_HEADER`` - Similar to ``PUBLIC_HEADER``, but for ``PRIVATE_HEADER`` files. See - :prop_tgt:`PRIVATE_HEADER` for details. - -``RESOURCE`` - Similar to ``PUBLIC_HEADER`` and ``PRIVATE_HEADER``, but for - ``RESOURCE`` files. See :prop_tgt:`RESOURCE` for details. - -``FILE_SET `` - .. versionadded:: 3.23 - - File sets are defined by the :command:`target_sources(FILE_SET)` command. - If the file set ```` exists and is ``PUBLIC`` or ``INTERFACE``, any - files in the set are installed under the destination (see below). - The directory structure relative to the file set's base directories is - preserved. For example, a file added to the file set as - ``/blah/include/myproj/here.h`` with a base directory ``/blah/include`` - would be installed to ``myproj/here.h`` below the destination. - -``CXX_MODULES_BMI`` - - .. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` - - Any module files from C++ modules from ``PUBLIC`` sources in a file set of - type ``CXX_MODULES`` will be installed to the given ``DESTINATION``. All - modules are placed directly in the destination as no directory structure is - derived from the names of the modules. An empty ``DESTINATION`` may be used - to suppress installing these files (for use in generic code). - -For each of these arguments given, the arguments following them only apply -to the target or file type specified in the argument. If none is given, the -installation properties apply to all target types. - -For regular executables, static libraries and shared libraries, the -``DESTINATION`` argument is not required. For these target types, when -``DESTINATION`` is omitted, a default destination will be taken from the -appropriate variable from :module:`GNUInstallDirs`, or set to a built-in -default value if that variable is not defined. The same is true for file -sets, and the public and private headers associated with the installed -targets through the :prop_tgt:`PUBLIC_HEADER` and :prop_tgt:`PRIVATE_HEADER` -target properties. A destination must always be provided for module libraries, -Apple bundles and frameworks. A destination can be omitted for interface and -object libraries, but they are handled differently (see the discussion of this -topic toward the end of this section). - -For shared libraries on DLL platforms, if neither ``RUNTIME`` nor ``ARCHIVE`` -destinations are specified, both the ``RUNTIME`` and ``ARCHIVE`` components are -installed to their default destinations. If either a ``RUNTIME`` or ``ARCHIVE`` -destination is specified, the component is installed to that destination, and -the other component is not installed. If both ``RUNTIME`` and ``ARCHIVE`` -destinations are specified, then both components are installed to their -respective destinations. - -The following table shows the target types with their associated variables and -built-in defaults that apply when no destination is given: - -=============================== =============================== ====================== - Target Type GNUInstallDirs Variable Built-In Default -=============================== =============================== ====================== -``RUNTIME`` ``${CMAKE_INSTALL_BINDIR}`` ``bin`` -``LIBRARY`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib`` -``ARCHIVE`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib`` -``PRIVATE_HEADER`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include`` -``PUBLIC_HEADER`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include`` -``FILE_SET`` (type ``HEADERS``) ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include`` -=============================== =============================== ====================== - -Projects wishing to follow the common practice of installing headers into a -project-specific subdirectory may prefer using file sets with appropriate -paths and base directories. Otherwise, they must provide a ``DESTINATION`` -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. -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 -:module:`GNUInstallDirs`, but with its headers installed to a project-specific -subdirectory without using file sets: - -.. code-block:: cmake - - add_library(mylib STATIC ...) - set_target_properties(mylib PROPERTIES PUBLIC_HEADER mylib.h) - include(GNUInstallDirs) - install(TARGETS mylib - PUBLIC_HEADER - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/myproj - ) +Signatures +^^^^^^^^^^ -In addition to the common options listed above, each target can accept -the following additional arguments: +.. signature:: + install(TARGETS ... [...]) -``NAMELINK_COMPONENT`` - .. versionadded:: 3.12 + Install target :ref:`Output Artifacts` and associated files: - On some platforms a versioned shared library has a symbolic link such - as:: + .. code-block:: cmake - lib.so -> lib.so.1 + install(TARGETS ... [EXPORT ] + [RUNTIME_DEPENDENCIES ...|RUNTIME_DEPENDENCY_SET ] + [...] + [ ...]... + [INCLUDES DESTINATION [ ...]] + ) - where ``lib.so.1`` is the soname of the library and ``lib.so`` - is a "namelink" allowing linkers to find the library when given - ``-l``. The ``NAMELINK_COMPONENT`` option is similar to the - ``COMPONENT`` option, but it changes the installation component of a shared - library namelink if one is generated. If not specified, this defaults to the - value of ``COMPONENT``. It is an error to use this parameter outside of a - ``LIBRARY`` block. + where ``...`` group may contain: - .. versionchanged:: 3.27 - This parameter is also usable for an ``ARCHIVE`` block to manage - the linker import file created, on macOS, for shared libraries with - :prop_tgt:`ENABLE_EXPORTS` enabled. + .. code-block:: cmake - Consider the following example: + [DESTINATION ] + [PERMISSIONS ...] + [CONFIGURATIONS ...] + [COMPONENT ] + [NAMELINK_COMPONENT ] + [OPTIONAL] [EXCLUDE_FROM_ALL] + [NAMELINK_ONLY|NAMELINK_SKIP] + + The first ``...`` group applies to target + :ref:`Output Artifacts` that do not have a dedicated group specified + later in the same call. + + .. _``: + + Each `` ...`` group applies to + :ref:`Output Artifacts` of the specified artifact kind: + + ``ARCHIVE`` + Target artifacts of this kind include: + + * *Static libraries* + (except on macOS when marked as ``FRAMEWORK``, see below); + * *DLL import libraries* + (on all Windows-based systems including Cygwin; they have extension + ``.lib``, in contrast to the ``.dll`` libraries that go to ``RUNTIME``); + * On AIX, the *linker import file* created for executables with + :prop_tgt:`ENABLE_EXPORTS` enabled. + * On macOS, the *linker import file* created for shared libraries with + :prop_tgt:`ENABLE_EXPORTS` enabled (except when marked as ``FRAMEWORK``, + see below). + + ``LIBRARY`` + Target artifacts of this kind include: + + * *Shared libraries*, except + + - DLLs (these go to ``RUNTIME``, see below), + - on macOS when marked as ``FRAMEWORK`` (see below). + + ``RUNTIME`` + Target artifacts of this kind include: + + * *Executables* + (except on macOS when marked as ``MACOSX_BUNDLE``, see ``BUNDLE`` below); + * DLLs (on all Windows-based systems including Cygwin; note that the + accompanying import libraries are of kind ``ARCHIVE``). + + ``OBJECTS`` + .. versionadded:: 3.9 + + Object files associated with *object libraries*. + + ``FRAMEWORK`` + Both static and shared libraries marked with the ``FRAMEWORK`` + property are treated as ``FRAMEWORK`` targets on macOS. + + ``BUNDLE`` + Executables marked with the :prop_tgt:`MACOSX_BUNDLE` property are treated as + ``BUNDLE`` targets on macOS. + + ``PUBLIC_HEADER`` + Any :prop_tgt:`PUBLIC_HEADER` files associated with a library are installed in + the destination specified by the ``PUBLIC_HEADER`` argument on non-Apple + platforms. Rules defined by this argument are ignored for :prop_tgt:`FRAMEWORK` + libraries on Apple platforms because the associated files are installed + into the appropriate locations inside the framework folder. See + :prop_tgt:`PUBLIC_HEADER` for details. + + ``PRIVATE_HEADER`` + Similar to ``PUBLIC_HEADER``, but for ``PRIVATE_HEADER`` files. See + :prop_tgt:`PRIVATE_HEADER` for details. + + ``RESOURCE`` + Similar to ``PUBLIC_HEADER`` and ``PRIVATE_HEADER``, but for + ``RESOURCE`` files. See :prop_tgt:`RESOURCE` for details. + + ``FILE_SET `` + .. versionadded:: 3.23 + + File sets are defined by the :command:`target_sources(FILE_SET)` command. + If the file set ```` exists and is ``PUBLIC`` or ``INTERFACE``, + any files in the set are installed under the destination (see below). + The directory structure relative to the file set's base directories is + preserved. For example, a file added to the file set as + ``/blah/include/myproj/here.h`` with a base directory ``/blah/include`` + would be installed to ``myproj/here.h`` below the destination. + + ``CXX_MODULES_BMI`` + .. versionadded:: 3.28 + + Any module files from C++ modules from ``PUBLIC`` sources in a file set of + type ``CXX_MODULES`` will be installed to the given ``DESTINATION``. All + modules are placed directly in the destination as no directory structure is + derived from the names of the modules. An empty ``DESTINATION`` may be used + to suppress installing these files (for use in generic code). + + For regular executables, static libraries and shared libraries, the + ``DESTINATION`` argument is not required. For these target types, when + ``DESTINATION`` is omitted, a default destination will be taken from the + appropriate variable from :module:`GNUInstallDirs`, or set to a built-in + default value if that variable is not defined. The same is true for file + sets, and the public and private headers associated with the installed + targets through the :prop_tgt:`PUBLIC_HEADER` and :prop_tgt:`PRIVATE_HEADER` + target properties. A destination must always be provided for module libraries, + Apple bundles and frameworks. A destination can be omitted for interface and + object libraries, but they are handled differently (see the discussion of this + topic toward the end of this section). + + For shared libraries on DLL platforms, if neither ``RUNTIME`` nor ``ARCHIVE`` + destinations are specified, both the ``RUNTIME`` and ``ARCHIVE`` components are + installed to their default destinations. If either a ``RUNTIME`` or ``ARCHIVE`` + destination is specified, the component is installed to that destination, and + the other component is not installed. If both ``RUNTIME`` and ``ARCHIVE`` + destinations are specified, then both components are installed to their + respective destinations. + + The following table shows the target types with their associated variables and + built-in defaults that apply when no destination is given: + + =============================== =============================== ====================== + Target Type GNUInstallDirs Variable Built-In Default + =============================== =============================== ====================== + ``RUNTIME`` ``${CMAKE_INSTALL_BINDIR}`` ``bin`` + ``LIBRARY`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib`` + ``ARCHIVE`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib`` + ``PRIVATE_HEADER`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include`` + ``PUBLIC_HEADER`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include`` + ``FILE_SET`` (type ``HEADERS``) ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include`` + =============================== =============================== ====================== + + Projects wishing to follow the common practice of installing headers into a + project-specific subdirectory may prefer using file sets with appropriate + paths and base directories. Otherwise, they must provide a ``DESTINATION`` + 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. + 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 + :module:`GNUInstallDirs`, but with its headers installed to a project-specific + subdirectory without using file sets: .. code-block:: cmake + add_library(mylib STATIC ...) + set_target_properties(mylib PROPERTIES PUBLIC_HEADER mylib.h) + include(GNUInstallDirs) install(TARGETS mylib - LIBRARY - COMPONENT Libraries - NAMELINK_COMPONENT Development PUBLIC_HEADER - COMPONENT Development - ) - - In this scenario, if you choose to install only the ``Development`` - component, both the headers and namelink will be installed without the - library. (If you don't also install the ``Libraries`` component, the - namelink will be a dangling symlink, and projects that link to the library - will have build errors.) If you install only the ``Libraries`` component, - only the library will be installed, without the headers and namelink. - - This option is typically used for package managers that have separate - runtime and development packages. For example, on Debian systems, the - library is expected to be in the runtime package, and the headers and - namelink are expected to be in the development package. - - See the :prop_tgt:`VERSION` and :prop_tgt:`SOVERSION` target properties for - details on creating versioned shared libraries. - -``NAMELINK_ONLY`` - This option causes the installation of only the namelink when a library - target is installed. On platforms where versioned shared libraries do not - have namelinks or when a library is not versioned, the ``NAMELINK_ONLY`` - option installs nothing. It is an error to use this parameter outside of a - ``LIBRARY`` block. - - .. versionchanged:: 3.27 - This parameter is also usable for an ``ARCHIVE`` block to manage - the linker import file created, on macOS, for shared libraries with - :prop_tgt:`ENABLE_EXPORTS` enabled. - - When ``NAMELINK_ONLY`` is given, either ``NAMELINK_COMPONENT`` or - ``COMPONENT`` may be used to specify the installation component of the - namelink, but ``COMPONENT`` should generally be preferred. - -``NAMELINK_SKIP`` - Similar to ``NAMELINK_ONLY``, but it has the opposite effect: it causes the - installation of library files other than the namelink when a library target - is installed. When neither ``NAMELINK_ONLY`` or ``NAMELINK_SKIP`` are given, - both portions are installed. On platforms where versioned shared libraries - do not have symlinks or when a library is not versioned, ``NAMELINK_SKIP`` - installs the library. It is an error to use this parameter outside of a - ``LIBRARY`` block. - - .. versionchanged:: 3.27 - This parameter is also usable for an ``ARCHIVE`` block to manage - the linker import file created, on macOS, for shared libraries with - :prop_tgt:`ENABLE_EXPORTS` enabled. - - If ``NAMELINK_SKIP`` is specified, ``NAMELINK_COMPONENT`` has no effect. It - is not recommended to use ``NAMELINK_SKIP`` in conjunction with - ``NAMELINK_COMPONENT``. - -The `install(TARGETS)`_ command can also accept the following options at the -top level: - -``EXPORT`` - This option associates the installed target files with an export called - ````. It must appear before any target options. To actually - install the export file itself, call `install(EXPORT)`_, documented below. - See documentation of the :prop_tgt:`EXPORT_NAME` target property to change - the name of the exported target. - - If ``EXPORT`` is used and the targets include ``PUBLIC`` or ``INTERFACE`` - file sets, all of them must be specified with ``FILE_SET`` arguments. All - ``PUBLIC`` or ``INTERFACE`` file sets associated with a target are included - in the export. - -``INCLUDES DESTINATION`` - This option specifies a list of directories which will be added to the - :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target property of the - ```` when exported by the `install(EXPORT)`_ command. If a - relative path is specified, it is treated as relative to the - :genex:`$`. - -``RUNTIME_DEPENDENCY_SET`` - .. versionadded:: 3.21 + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/myproj + ) + + In addition to the `common options`_ listed above, each target can accept + the following additional arguments: + + ``NAMELINK_COMPONENT`` + .. versionadded:: 3.12 + + On some platforms a versioned shared library has a symbolic link such + as:: + + lib.so -> lib.so.1 + + where ``lib.so.1`` is the soname of the library and ``lib.so`` + is a "namelink" allowing linkers to find the library when given + ``-l``. The ``NAMELINK_COMPONENT`` option is similar to the + ``COMPONENT`` option, but it changes the installation component of a shared + library namelink if one is generated. If not specified, this defaults to the + value of ``COMPONENT``. It is an error to use this parameter outside of a + ``LIBRARY`` block. + + .. versionchanged:: 3.27 + This parameter is also usable for an ``ARCHIVE`` block to manage + the linker import file created, on macOS, for shared libraries with + :prop_tgt:`ENABLE_EXPORTS` enabled. + + See the `Example: Install Targets with Per-Artifact Components`_ + for an example using ``NAMELINK_COMPONENT``. + + This option is typically used for package managers that have separate + runtime and development packages. For example, on Debian systems, the + library is expected to be in the runtime package, and the headers and + namelink are expected to be in the development package. + + See the :prop_tgt:`VERSION` and :prop_tgt:`SOVERSION` target properties for + details on creating versioned shared libraries. + + ``NAMELINK_ONLY`` + This option causes the installation of only the namelink when a library + target is installed. On platforms where versioned shared libraries do not + have namelinks or when a library is not versioned, the ``NAMELINK_ONLY`` + option installs nothing. It is an error to use this parameter outside of a + ``LIBRARY`` block. + + .. versionchanged:: 3.27 + This parameter is also usable for an ``ARCHIVE`` block to manage + the linker import file created, on macOS, for shared libraries with + :prop_tgt:`ENABLE_EXPORTS` enabled. + + When ``NAMELINK_ONLY`` is given, either ``NAMELINK_COMPONENT`` or + ``COMPONENT`` may be used to specify the installation component of the + namelink, but ``COMPONENT`` should generally be preferred. + + ``NAMELINK_SKIP`` + Similar to ``NAMELINK_ONLY``, but it has the opposite effect: it causes the + installation of library files other than the namelink when a library target + is installed. When neither ``NAMELINK_ONLY`` or ``NAMELINK_SKIP`` are given, + both portions are installed. On platforms where versioned shared libraries + do not have symlinks or when a library is not versioned, ``NAMELINK_SKIP`` + installs the library. It is an error to use this parameter outside of a + ``LIBRARY`` block. + + .. versionchanged:: 3.27 + This parameter is also usable for an ``ARCHIVE`` block to manage + the linker import file created, on macOS, for shared libraries with + :prop_tgt:`ENABLE_EXPORTS` enabled. + + If ``NAMELINK_SKIP`` is specified, ``NAMELINK_COMPONENT`` has no effect. It + is not recommended to use ``NAMELINK_SKIP`` in conjunction with + ``NAMELINK_COMPONENT``. + + The :command:`install(TARGETS)` command can also accept the following + options at the top level: + + ``EXPORT`` + This option associates the installed target files with an export called + ````. It must appear before any target options. + To actually install the export file itself, call + :command:`install(EXPORT)`, documented below. + See documentation of the :prop_tgt:`EXPORT_NAME` target property to change + the name of the exported target. + + If ``EXPORT`` is used and the targets include ``PUBLIC`` or ``INTERFACE`` + file sets, all of them must be specified with ``FILE_SET`` arguments. All + ``PUBLIC`` or ``INTERFACE`` file sets associated with a target are included + in the export. + + ``INCLUDES DESTINATION`` + This option specifies a list of directories which will be added to the + :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target property of the + ```` when exported by the :command:`install(EXPORT)` command. + If a relative path is specified, it is treated as relative to the + :genex:`$`. + + ``RUNTIME_DEPENDENCY_SET `` + .. versionadded:: 3.21 + + This option causes all runtime dependencies of installed executable, shared + library, and module targets to be added to the specified runtime dependency + set. This set can then be installed with an + :command:`install(RUNTIME_DEPENDENCY_SET)` command. + + This keyword and the ``RUNTIME_DEPENDENCIES`` keyword are mutually + exclusive. + + ``RUNTIME_DEPENDENCIES ...`` + .. versionadded:: 3.21 + + This option causes all runtime dependencies of installed executable, shared + library, and module targets to be installed along with the targets + themselves. The ``RUNTIME``, ``LIBRARY``, ``FRAMEWORK``, and generic + arguments are used to determine the properties (``DESTINATION``, + ``COMPONENT``, etc.) of the installation of these dependencies. + + ``RUNTIME_DEPENDENCIES`` is semantically equivalent to the following pair + of calls: + + .. code-block:: cmake + + install(TARGETS ... RUNTIME_DEPENDENCY_SET ) + install(RUNTIME_DEPENDENCY_SET ...) + + where ```` will be a randomly generated set name. + ``...`` may include any of the following keywords supported by + the :command:`install(RUNTIME_DEPENDENCY_SET)` command: + + * ``DIRECTORIES`` + * ``PRE_INCLUDE_REGEXES`` + * ``PRE_EXCLUDE_REGEXES`` + * ``POST_INCLUDE_REGEXES`` + * ``POST_EXCLUDE_REGEXES`` + * ``POST_INCLUDE_FILES`` + * ``POST_EXCLUDE_FILES`` + + The ``RUNTIME_DEPENDENCIES`` and ``RUNTIME_DEPENDENCY_SET`` keywords are + mutually exclusive. + + :ref:`Interface Libraries` may be listed among the targets to install. + They install no artifacts but will be included in an associated ``EXPORT``. + If :ref:`Object Libraries` are listed but given no destination for their + object files, they will be exported as :ref:`Interface Libraries`. + This is sufficient to satisfy transitive usage requirements of other + targets that link to the object libraries in their implementation. + + Installing a target with the :prop_tgt:`EXCLUDE_FROM_ALL` target property + set to ``TRUE`` has undefined behavior. + + .. versionadded:: 3.3 + An install destination given as a ``DESTINATION`` argument may + use "generator expressions" with the syntax ``$<...>``. See the + :manual:`cmake-generator-expressions(7)` manual for available expressions. + + .. versionadded:: 3.13 + :command:`install(TARGETS)` can install targets that were created in + other directories. When using such cross-directory install rules, running + ``make install`` (or similar) from a subdirectory will not guarantee that + targets from other directories are up-to-date. You can use + :command:`target_link_libraries` or :command:`add_dependencies` + to ensure that such out-of-directory targets are built before the + subdirectory-specific install rules are run. + +.. signature:: + install(IMPORTED_RUNTIME_ARTIFACTS ... [...]) - This option causes all runtime dependencies of installed executable, shared - library, and module targets to be added to the specified runtime dependency - set. This set can then be installed with an - `install(RUNTIME_DEPENDENCY_SET)`_ command. - - This keyword and the ``RUNTIME_DEPENDENCIES`` keyword are mutually - exclusive. - -``RUNTIME_DEPENDENCIES`` .. versionadded:: 3.21 - This option causes all runtime dependencies of installed executable, shared - library, and module targets to be installed along with the targets - themselves. The ``RUNTIME``, ``LIBRARY``, ``FRAMEWORK``, and generic - arguments are used to determine the properties (``DESTINATION``, - ``COMPONENT``, etc.) of the installation of these dependencies. - - ``RUNTIME_DEPENDENCIES`` is semantically equivalent to the following pair - of calls: + Install runtime artifacts of imported targets: .. code-block:: cmake - install(TARGETS ... RUNTIME_DEPENDENCY_SET ) - install(RUNTIME_DEPENDENCY_SET args...) - - where ```` will be a randomly generated set name. - The ``args...`` may include any of the following keywords supported by - the `install(RUNTIME_DEPENDENCY_SET)`_ command: + install(IMPORTED_RUNTIME_ARTIFACTS ... + [RUNTIME_DEPENDENCY_SET ] + [[LIBRARY|RUNTIME|FRAMEWORK|BUNDLE] + [DESTINATION ] + [PERMISSIONS ...] + [CONFIGURATIONS ...] + [COMPONENT ] + [OPTIONAL] [EXCLUDE_FROM_ALL] + ] [...] + ) + + The ``IMPORTED_RUNTIME_ARTIFACTS`` form specifies rules for installing the + runtime artifacts of imported targets. Projects may do this if they want to + bundle outside executables or modules inside their installation. The + ``LIBRARY``, ``RUNTIME``, ``FRAMEWORK``, and ``BUNDLE`` arguments have the + same semantics that they do in the `TARGETS`_ mode. Only the runtime artifacts + of imported targets are installed (except in the case of :prop_tgt:`FRAMEWORK` + libraries, :prop_tgt:`MACOSX_BUNDLE` executables, and :prop_tgt:`BUNDLE` + CFBundles.) For example, headers and import libraries associated with DLLs are + not installed. In the case of :prop_tgt:`FRAMEWORK` libraries, + :prop_tgt:`MACOSX_BUNDLE` executables, and :prop_tgt:`BUNDLE` CFBundles, the + entire directory is installed. + + The ``RUNTIME_DEPENDENCY_SET`` option causes the runtime artifacts of the + imported executable, shared library, and module library ``targets`` to be + added to the ```` runtime dependency set. This set can then be + installed with an :command:`install(RUNTIME_DEPENDENCY_SET)` command. + +.. signature:: + install(FILES ... [...]) + install(PROGRAMS ... [...]) + + .. note:: + + If installing header files, consider using file sets defined by + :command:`target_sources(FILE_SET)` instead. File sets associate + headers with a target and they install as part of the target. + + Install files or programs: - * ``DIRECTORIES`` - * ``PRE_INCLUDE_REGEXES`` - * ``PRE_EXCLUDE_REGEXES`` - * ``POST_INCLUDE_REGEXES`` - * ``POST_EXCLUDE_REGEXES`` - * ``POST_INCLUDE_FILES`` - * ``POST_EXCLUDE_FILES`` - - The ``RUNTIME_DEPENDENCIES`` and ``RUNTIME_DEPENDENCY_SET`` keywords are - mutually exclusive. + .. code-block:: cmake -One or more groups of properties may be specified in a single call to -the ``TARGETS`` form of this command. A target may be installed more than -once to different locations. Consider hypothetical targets ``myExe``, -``mySharedLib``, and ``myStaticLib``. The code: + install( ... + TYPE | DESTINATION + [PERMISSIONS ...] + [CONFIGURATIONS ...] + [COMPONENT ] + [RENAME ] [OPTIONAL] [EXCLUDE_FROM_ALL]) + + The ``FILES`` form specifies rules for installing files for a project. + File names given as relative paths are interpreted with respect to the + current source directory. Files installed by this form are by default + given permissions ``OWNER_WRITE``, ``OWNER_READ``, ``GROUP_READ``, and + ``WORLD_READ`` if no ``PERMISSIONS`` argument is given. + + The ``PROGRAMS`` form is identical to the ``FILES`` form except that the + default permissions for the installed file also include ``OWNER_EXECUTE``, + ``GROUP_EXECUTE``, and ``WORLD_EXECUTE``. This form is intended to install + programs that are not targets, such as shell scripts. Use the ``TARGETS`` + form to install targets built within the project. + + The list of ``files...`` given to ``FILES`` or ``PROGRAMS`` may use + "generator expressions" with the syntax ``$<...>``. See the + :manual:`cmake-generator-expressions(7)` manual for available expressions. + However, if any item begins in a generator expression it must evaluate + to a full path. + + Either a ``TYPE`` or a ``DESTINATION`` must be provided, but not both. + A ``TYPE`` argument specifies the generic file type of the files being + installed. A destination will then be set automatically by taking the + corresponding variable from :module:`GNUInstallDirs`, or by using a + built-in default if that variable is not defined. See the table below for + the supported file types and their corresponding variables and built-in + defaults. Projects can provide a ``DESTINATION`` argument instead of a + file type if they wish to explicitly define the install destination. + + ======================= ================================== ========================= + ``TYPE`` Argument GNUInstallDirs Variable Built-In Default + ======================= ================================== ========================= + ``BIN`` ``${CMAKE_INSTALL_BINDIR}`` ``bin`` + ``SBIN`` ``${CMAKE_INSTALL_SBINDIR}`` ``sbin`` + ``LIB`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib`` + ``INCLUDE`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include`` + ``SYSCONF`` ``${CMAKE_INSTALL_SYSCONFDIR}`` ``etc`` + ``SHAREDSTATE`` ``${CMAKE_INSTALL_SHARESTATEDIR}`` ``com`` + ``LOCALSTATE`` ``${CMAKE_INSTALL_LOCALSTATEDIR}`` ``var`` + ``RUNSTATE`` ``${CMAKE_INSTALL_RUNSTATEDIR}`` ``/run`` + ``DATA`` ``${CMAKE_INSTALL_DATADIR}`` ```` + ``INFO`` ``${CMAKE_INSTALL_INFODIR}`` ``/info`` + ``LOCALE`` ``${CMAKE_INSTALL_LOCALEDIR}`` ``/locale`` + ``MAN`` ``${CMAKE_INSTALL_MANDIR}`` ``/man`` + ``DOC`` ``${CMAKE_INSTALL_DOCDIR}`` ``/doc`` + ======================= ================================== ========================= + + Projects wishing to follow the common practice of installing headers into a + project-specific subdirectory will need to provide a destination rather than + rely on the above. Using file sets for headers instead of ``install(FILES)`` + would be even better (see :command:`target_sources(FILE_SET)`). + + Note that some of the types' built-in defaults use the ``DATAROOT`` directory as + a prefix. The ``DATAROOT`` prefix is calculated similarly to the types, with + ``CMAKE_INSTALL_DATAROOTDIR`` as the variable and ``share`` as the built-in + default. You cannot use ``DATAROOT`` as a ``TYPE`` parameter; please use + ``DATA`` instead. + + 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. + 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 + subdirectory: -.. code-block:: cmake + .. code-block:: cmake - install(TARGETS myExe mySharedLib myStaticLib - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib/static) - install(TARGETS mySharedLib DESTINATION /some/full/path) - -will install ``myExe`` to ``/bin`` and ``myStaticLib`` to -``/lib/static``. On non-DLL platforms ``mySharedLib`` will be -installed to ``/lib`` and ``/some/full/path``. On DLL platforms -the ``mySharedLib`` DLL will be installed to ``/bin`` and -``/some/full/path`` and its import library will be installed to -``/lib/static`` and ``/some/full/path``. - -:ref:`Interface Libraries` may be listed among the targets to install. -They install no artifacts but will be included in an associated ``EXPORT``. -If :ref:`Object Libraries` are listed but given no destination for their -object files, they will be exported as :ref:`Interface Libraries`. -This is sufficient to satisfy transitive usage requirements of other -targets that link to the object libraries in their implementation. - -Installing a target with the :prop_tgt:`EXCLUDE_FROM_ALL` target property -set to ``TRUE`` has undefined behavior. - -.. versionadded:: 3.3 - An install destination given as a ``DESTINATION`` argument may - use "generator expressions" with the syntax ``$<...>``. See the - :manual:`cmake-generator-expressions(7)` manual for available expressions. + include(GNUInstallDirs) + install(FILES logo.png + DESTINATION ${CMAKE_INSTALL_DOCDIR}/myproj + ) -.. versionadded:: 3.13 - `install(TARGETS)`_ can install targets that were created in - other directories. When using such cross-directory install rules, running - ``make install`` (or similar) from a subdirectory will not guarantee that - targets from other directories are up-to-date. You can use - :command:`target_link_libraries` or :command:`add_dependencies` - to ensure that such out-of-directory targets are built before the - subdirectory-specific install rules are run. + .. versionadded:: 3.4 + An install destination given as a ``DESTINATION`` argument may + use "generator expressions" with the syntax ``$<...>``. See the + :manual:`cmake-generator-expressions(7)` manual for available expressions. -Installing Imported Runtime Artifacts -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + .. versionadded:: 3.20 + An install rename given as a ``RENAME`` argument may + use "generator expressions" with the syntax ``$<...>``. See the + :manual:`cmake-generator-expressions(7)` manual for available expressions. -.. _`install(IMPORTED_RUNTIME_ARTIFACTS)`: -.. _IMPORTED_RUNTIME_ARTIFACTS: +.. signature:: + install(DIRECTORY ... [...]) -.. versionadded:: 3.21 + .. note:: -.. code-block:: cmake + To install a directory sub-tree of headers, consider using file sets + defined by :command:`target_sources(FILE_SET)` instead. File sets not only + preserve directory structure, they also associate headers with a target + and install as part of the target. - install(IMPORTED_RUNTIME_ARTIFACTS targets... - [RUNTIME_DEPENDENCY_SET ] - [[LIBRARY|RUNTIME|FRAMEWORK|BUNDLE] - [DESTINATION ] - [PERMISSIONS permissions...] - [CONFIGURATIONS [Debug|Release|...]] - [COMPONENT ] - [OPTIONAL] [EXCLUDE_FROM_ALL] - ] [...] - ) + Install the contents of one or more directories: -The ``IMPORTED_RUNTIME_ARTIFACTS`` form specifies rules for installing the -runtime artifacts of imported targets. Projects may do this if they want to -bundle outside executables or modules inside their installation. The -``LIBRARY``, ``RUNTIME``, ``FRAMEWORK``, and ``BUNDLE`` arguments have the -same semantics that they do in the `TARGETS`_ mode. Only the runtime artifacts -of imported targets are installed (except in the case of :prop_tgt:`FRAMEWORK` -libraries, :prop_tgt:`MACOSX_BUNDLE` executables, and :prop_tgt:`BUNDLE` -CFBundles.) For example, headers and import libraries associated with DLLs are -not installed. In the case of :prop_tgt:`FRAMEWORK` libraries, -:prop_tgt:`MACOSX_BUNDLE` executables, and :prop_tgt:`BUNDLE` CFBundles, the -entire directory is installed. - -The ``RUNTIME_DEPENDENCY_SET`` option causes the runtime artifacts of the -imported executable, shared library, and module library ``targets`` to be -added to the ```` runtime dependency set. This set can then be -installed with an `install(RUNTIME_DEPENDENCY_SET)`_ command. - -Installing Files -^^^^^^^^^^^^^^^^ - -.. _`install(FILES)`: -.. _`install(PROGRAMS)`: -.. _FILES: -.. _PROGRAMS: + .. code-block:: cmake -.. note:: + install(DIRECTORY dirs... + TYPE | DESTINATION + [FILE_PERMISSIONS ...] + [DIRECTORY_PERMISSIONS ...] + [USE_SOURCE_PERMISSIONS] [OPTIONAL] [MESSAGE_NEVER] + [CONFIGURATIONS ...] + [COMPONENT ] [EXCLUDE_FROM_ALL] + [FILES_MATCHING] + [[PATTERN | REGEX ] + [EXCLUDE] [PERMISSIONS ...]] [...]) + + The ``DIRECTORY`` form installs contents of one or more directories to a + given destination. The directory structure is copied verbatim to the + destination. The last component of each directory name is appended to + the destination directory but a trailing slash may be used to avoid + this because it leaves the last component empty. Directory names + given as relative paths are interpreted with respect to the current + source directory. If no input directory names are given the + destination directory will be created but nothing will be installed + into it. The ``FILE_PERMISSIONS`` and ``DIRECTORY_PERMISSIONS`` options + specify permissions given to files and directories in the destination. + If ``USE_SOURCE_PERMISSIONS`` is specified and ``FILE_PERMISSIONS`` is not, + file permissions will be copied from the source directory structure. + If no permissions are specified files will be given the default + permissions specified in the ``FILES`` form of the command, and the + directories will be given the default permissions specified in the + ``PROGRAMS`` form of the command. + + .. versionadded:: 3.1 + The ``MESSAGE_NEVER`` option disables file installation status output. + + Installation of directories may be controlled with fine granularity + using the ``PATTERN`` or ``REGEX`` options. These "match" options specify a + globbing pattern or regular expression to match directories or files + encountered within input directories. They may be used to apply + certain options (see below) to a subset of the files and directories + encountered. The full path to each input file or directory (with + forward slashes) is matched against the expression. A ``PATTERN`` will + match only complete file names: the portion of the full path matching + the pattern must occur at the end of the file name and be preceded by + a slash. A ``REGEX`` will match any portion of the full path but it may + use ``/`` and ``$`` to simulate the ``PATTERN`` behavior. By default all + files and directories are installed whether or not they are matched. + The ``FILES_MATCHING`` option may be given before the first match option + to disable installation of files (but not directories) not matched by + any expression. For example, the code - If installing header files, consider using file sets defined by - :command:`target_sources(FILE_SET)` instead. File sets associate - headers with a target and they install as part of the target. + .. code-block:: cmake -.. code-block:: cmake + install(DIRECTORY src/ DESTINATION doc/myproj + FILES_MATCHING PATTERN "*.png") - install( files... - TYPE | DESTINATION - [PERMISSIONS permissions...] - [CONFIGURATIONS [Debug|Release|...]] - [COMPONENT ] - [RENAME ] [OPTIONAL] [EXCLUDE_FROM_ALL]) - -The ``FILES`` form specifies rules for installing files for a project. -File names given as relative paths are interpreted with respect to the -current source directory. Files installed by this form are by default -given permissions ``OWNER_WRITE``, ``OWNER_READ``, ``GROUP_READ``, and -``WORLD_READ`` if no ``PERMISSIONS`` argument is given. - -The ``PROGRAMS`` form is identical to the ``FILES`` form except that the -default permissions for the installed file also include ``OWNER_EXECUTE``, -``GROUP_EXECUTE``, and ``WORLD_EXECUTE``. This form is intended to install -programs that are not targets, such as shell scripts. Use the ``TARGETS`` -form to install targets built within the project. - -The list of ``files...`` given to ``FILES`` or ``PROGRAMS`` may use -"generator expressions" with the syntax ``$<...>``. See the -:manual:`cmake-generator-expressions(7)` manual for available expressions. -However, if any item begins in a generator expression it must evaluate -to a full path. - -Either a ``TYPE`` or a ``DESTINATION`` must be provided, but not both. -A ``TYPE`` argument specifies the generic file type of the files being -installed. A destination will then be set automatically by taking the -corresponding variable from :module:`GNUInstallDirs`, or by using a -built-in default if that variable is not defined. See the table below for -the supported file types and their corresponding variables and built-in -defaults. Projects can provide a ``DESTINATION`` argument instead of a -file type if they wish to explicitly define the install destination. - -======================= ================================== ========================= - ``TYPE`` Argument GNUInstallDirs Variable Built-In Default -======================= ================================== ========================= -``BIN`` ``${CMAKE_INSTALL_BINDIR}`` ``bin`` -``SBIN`` ``${CMAKE_INSTALL_SBINDIR}`` ``sbin`` -``LIB`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib`` -``INCLUDE`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include`` -``SYSCONF`` ``${CMAKE_INSTALL_SYSCONFDIR}`` ``etc`` -``SHAREDSTATE`` ``${CMAKE_INSTALL_SHARESTATEDIR}`` ``com`` -``LOCALSTATE`` ``${CMAKE_INSTALL_LOCALSTATEDIR}`` ``var`` -``RUNSTATE`` ``${CMAKE_INSTALL_RUNSTATEDIR}`` ``/run`` -``DATA`` ``${CMAKE_INSTALL_DATADIR}`` ```` -``INFO`` ``${CMAKE_INSTALL_INFODIR}`` ``/info`` -``LOCALE`` ``${CMAKE_INSTALL_LOCALEDIR}`` ``/locale`` -``MAN`` ``${CMAKE_INSTALL_MANDIR}`` ``/man`` -``DOC`` ``${CMAKE_INSTALL_DOCDIR}`` ``/doc`` -======================= ================================== ========================= - -Projects wishing to follow the common practice of installing headers into a -project-specific subdirectory will need to provide a destination rather than -rely on the above. Using file sets for headers instead of ``install(FILES)`` -would be even better (see :command:`target_sources(FILE_SET)`). - -Note that some of the types' built-in defaults use the ``DATAROOT`` directory as -a prefix. The ``DATAROOT`` prefix is calculated similarly to the types, with -``CMAKE_INSTALL_DATAROOTDIR`` as the variable and ``share`` as the built-in -default. You cannot use ``DATAROOT`` as a ``TYPE`` parameter; please use -``DATA`` instead. - -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. -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 -subdirectory: + will extract and install images from a source tree. -.. code-block:: cmake + Some options may follow a ``PATTERN`` or ``REGEX`` expression as described + under :ref:`string(REGEX) ` and are applied + only to files or directories matching them. The ``EXCLUDE`` option will + skip the matched file or directory. The ``PERMISSIONS`` option overrides + the permissions setting for the matched file or directory. For + example the code - include(GNUInstallDirs) - install(FILES logo.png - DESTINATION ${CMAKE_INSTALL_DOCDIR}/myproj - ) + .. code-block:: cmake -.. versionadded:: 3.4 - An install destination given as a ``DESTINATION`` argument may - use "generator expressions" with the syntax ``$<...>``. See the - :manual:`cmake-generator-expressions(7)` manual for available expressions. + install(DIRECTORY icons scripts/ DESTINATION share/myproj + PATTERN "CVS" EXCLUDE + PATTERN "scripts/*" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ) + + will install the ``icons`` directory to ``share/myproj/icons`` and the + ``scripts`` directory to ``share/myproj``. The icons will get default + file permissions, the scripts will be given specific permissions, and any + ``CVS`` directories will be excluded. + + Either a ``TYPE`` or a ``DESTINATION`` must be provided, but not both. + A ``TYPE`` argument specifies the generic file type of the files within the + listed directories being installed. A destination will then be set + automatically by taking the corresponding variable from + :module:`GNUInstallDirs`, or by using a built-in default if that variable + is not defined. See the table below for the supported file types and their + corresponding variables and built-in defaults. Projects can provide a + ``DESTINATION`` argument instead of a file type if they wish to explicitly + define the install destination. + + ======================= ================================== ========================= + ``TYPE`` Argument GNUInstallDirs Variable Built-In Default + ======================= ================================== ========================= + ``BIN`` ``${CMAKE_INSTALL_BINDIR}`` ``bin`` + ``SBIN`` ``${CMAKE_INSTALL_SBINDIR}`` ``sbin`` + ``LIB`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib`` + ``INCLUDE`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include`` + ``SYSCONF`` ``${CMAKE_INSTALL_SYSCONFDIR}`` ``etc`` + ``SHAREDSTATE`` ``${CMAKE_INSTALL_SHARESTATEDIR}`` ``com`` + ``LOCALSTATE`` ``${CMAKE_INSTALL_LOCALSTATEDIR}`` ``var`` + ``RUNSTATE`` ``${CMAKE_INSTALL_RUNSTATEDIR}`` ``/run`` + ``DATA`` ``${CMAKE_INSTALL_DATADIR}`` ```` + ``INFO`` ``${CMAKE_INSTALL_INFODIR}`` ``/info`` + ``LOCALE`` ``${CMAKE_INSTALL_LOCALEDIR}`` ``/locale`` + ``MAN`` ``${CMAKE_INSTALL_MANDIR}`` ``/man`` + ``DOC`` ``${CMAKE_INSTALL_DOCDIR}`` ``/doc`` + ======================= ================================== ========================= + + Note that some of the types' built-in defaults use the ``DATAROOT`` directory as + a prefix. The ``DATAROOT`` prefix is calculated similarly to the types, with + ``CMAKE_INSTALL_DATAROOTDIR`` as the variable and ``share`` as the built-in + default. You cannot use ``DATAROOT`` as a ``TYPE`` parameter; please use + ``DATA`` instead. + + 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. + This allows package maintainers to control the install destination by setting + the appropriate cache variables. + + .. versionadded:: 3.4 + An install destination given as a ``DESTINATION`` argument may + use "generator expressions" with the syntax ``$<...>``. See the + :manual:`cmake-generator-expressions(7)` manual for available expressions. + + .. versionadded:: 3.5 + The list of ``dirs...`` given to ``DIRECTORY`` may use + "generator expressions" too. + +.. signature:: + install(SCRIPT [...]) + install(CODE [...]) + + Invoke CMake scripts or code during installation: -.. versionadded:: 3.20 - An install rename given as a ``RENAME`` argument may - use "generator expressions" with the syntax ``$<...>``. See the - :manual:`cmake-generator-expressions(7)` manual for available expressions. + .. code-block:: cmake -Installing Directories -^^^^^^^^^^^^^^^^^^^^^^ + install([[SCRIPT ] [CODE ]] + [ALL_COMPONENTS | COMPONENT ] + [EXCLUDE_FROM_ALL] [...]) -.. _`install(DIRECTORY)`: -.. _DIRECTORY: + The ``SCRIPT`` form will invoke the given CMake script files during + installation. If the script file name is a relative path it will be + interpreted with respect to the current source directory. The ``CODE`` + form will invoke the given CMake code during installation. Code is + specified as a single argument inside a double-quoted string. For + example, the code -.. note:: + .. code-block:: cmake - To install a directory sub-tree of headers, consider using file sets - defined by :command:`target_sources(FILE_SET)` instead. File sets not only - preserve directory structure, they also associate headers with a target - and install as part of the target. + install(CODE "MESSAGE(\"Sample install message.\")") -.. code-block:: cmake + will print a message during installation. - install(DIRECTORY dirs... - TYPE | DESTINATION - [FILE_PERMISSIONS permissions...] - [DIRECTORY_PERMISSIONS permissions...] - [USE_SOURCE_PERMISSIONS] [OPTIONAL] [MESSAGE_NEVER] - [CONFIGURATIONS [Debug|Release|...]] - [COMPONENT ] [EXCLUDE_FROM_ALL] - [FILES_MATCHING] - [[PATTERN | REGEX ] - [EXCLUDE] [PERMISSIONS permissions...]] [...]) - -The ``DIRECTORY`` form installs contents of one or more directories to a -given destination. The directory structure is copied verbatim to the -destination. The last component of each directory name is appended to -the destination directory but a trailing slash may be used to avoid -this because it leaves the last component empty. Directory names -given as relative paths are interpreted with respect to the current -source directory. If no input directory names are given the -destination directory will be created but nothing will be installed -into it. The ``FILE_PERMISSIONS`` and ``DIRECTORY_PERMISSIONS`` options -specify permissions given to files and directories in the destination. -If ``USE_SOURCE_PERMISSIONS`` is specified and ``FILE_PERMISSIONS`` is not, -file permissions will be copied from the source directory structure. -If no permissions are specified files will be given the default -permissions specified in the ``FILES`` form of the command, and the -directories will be given the default permissions specified in the -``PROGRAMS`` form of the command. + .. versionadded:: 3.21 + When the ``ALL_COMPONENTS`` option is given, the custom installation + script code will be executed for every component of a component-specific + installation. This option is mutually exclusive with the ``COMPONENT`` + option. -.. versionadded:: 3.1 - The ``MESSAGE_NEVER`` option disables file installation status output. - -Installation of directories may be controlled with fine granularity -using the ``PATTERN`` or ``REGEX`` options. These "match" options specify a -globbing pattern or regular expression to match directories or files -encountered within input directories. They may be used to apply -certain options (see below) to a subset of the files and directories -encountered. The full path to each input file or directory (with -forward slashes) is matched against the expression. A ``PATTERN`` will -match only complete file names: the portion of the full path matching -the pattern must occur at the end of the file name and be preceded by -a slash. A ``REGEX`` will match any portion of the full path but it may -use ``/`` and ``$`` to simulate the ``PATTERN`` behavior. By default all -files and directories are installed whether or not they are matched. -The ``FILES_MATCHING`` option may be given before the first match option -to disable installation of files (but not directories) not matched by -any expression. For example, the code + .. versionadded:: 3.14 + ```` or ```` may use "generator expressions" with the syntax + ``$<...>`` (in the case of ````, this refers to their use in the file + name, not the file's contents). See the + :manual:`cmake-generator-expressions(7)` manual for available expressions. -.. code-block:: cmake +.. signature:: + install(EXPORT [...]) - install(DIRECTORY src/ DESTINATION doc/myproj - FILES_MATCHING PATTERN "*.png") + Install a CMake file exporting targets for dependent projects: -will extract and install images from a source tree. + .. code-block:: cmake -Some options may follow a ``PATTERN`` or ``REGEX`` expression as described -under :ref:`string(REGEX) ` and are applied -only to files or directories matching them. The ``EXCLUDE`` option will -skip the matched file or directory. The ``PERMISSIONS`` option overrides -the permissions setting for the matched file or directory. For -example the code + install(EXPORT DESTINATION + [NAMESPACE ] [FILE .cmake] + [PERMISSIONS ...] + [CONFIGURATIONS ...] + [CXX_MODULES_DIRECTORY ] + [EXPORT_LINK_INTERFACE_LIBRARIES] + [COMPONENT ] + [EXCLUDE_FROM_ALL]) + install(EXPORT_ANDROID_MK DESTINATION [...]) + + The ``EXPORT`` form generates and installs a CMake file containing code to + import targets from the installation tree into another project. + Target installations are associated with the export ```` + using the ``EXPORT`` option of the :command:`install(TARGETS)` signature + documented above. The ``NAMESPACE`` option will prepend ```` to + the target names as they are written to the import file. By default + the generated file will be called ``.cmake`` but the ``FILE`` + option may be used to specify a different name. The value given to + the ``FILE`` option must be a file name with the ``.cmake`` extension. + If a ``CONFIGURATIONS`` option is given then the file will only be installed + when one of the named configurations is installed. Additionally, the + generated import file will reference only the matching target + configurations. See the :variable:`CMAKE_MAP_IMPORTED_CONFIG_` + variable to map configurations of dependent projects to the installed + configurations. The ``EXPORT_LINK_INTERFACE_LIBRARIES`` keyword, if + present, causes the contents of the properties matching + ``(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_)?`` to be exported, when + policy :policy:`CMP0022` is ``NEW``. + + .. note:: + The installed ``.cmake`` file may come with additional + per-configuration ``-*.cmake`` files to be loaded by + globbing. Do not use an export name that is the same as the package + name in combination with installing a ``-config.cmake`` + file or the latter may be incorrectly matched by the glob and loaded. + + When a ``COMPONENT`` option is given, the listed ```` implicitly + depends on all components mentioned in the export set. The exported + ``.cmake`` file will require each of the exported components to be + present in order for dependent projects to build properly. For example, a + project may define components ``Runtime`` and ``Development``, with shared + libraries going into the ``Runtime`` component and static libraries and + headers going into the ``Development`` component. The export set would also + typically be part of the ``Development`` component, but it would export + targets from both the ``Runtime`` and ``Development`` components. Therefore, + the ``Runtime`` component would need to be installed if the ``Development`` + component was installed, but not vice versa. If the ``Development`` component + was installed without the ``Runtime`` component, dependent projects that try + to link against it would have build errors. Package managers, such as APT and + RPM, typically handle this by listing the ``Runtime`` component as a dependency + of the ``Development`` component in the package metadata, ensuring that the + library is always installed if the headers and CMake export file are present. + + .. versionadded:: 3.7 + In addition to cmake language files, the ``EXPORT_ANDROID_MK`` mode may be + used to specify an export to the android ndk build system. This mode + accepts the same options as the normal export mode. The Android + NDK supports the use of prebuilt libraries, both static and shared. This + allows cmake to build the libraries of a project and make them available + to an ndk build system complete with transitive dependencies, include flags + and defines required to use the libraries. + + ``CXX_MODULES_DIRECTORY`` + .. versionadded:: 3.28 + + Specify a subdirectory to store C++ module information for targets in the + export set. This directory will be populated with files which add the + necessary target property information to the relevant targets. Note that + 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. + + The ``EXPORT`` form is useful to help outside projects use targets built + and installed by the current project. For example, the code -.. code-block:: cmake + .. code-block:: cmake - install(DIRECTORY icons scripts/ DESTINATION share/myproj - PATTERN "CVS" EXCLUDE - PATTERN "scripts/*" - PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ - GROUP_EXECUTE GROUP_READ) - -will install the ``icons`` directory to ``share/myproj/icons`` and the -``scripts`` directory to ``share/myproj``. The icons will get default -file permissions, the scripts will be given specific permissions, and any -``CVS`` directories will be excluded. - -Either a ``TYPE`` or a ``DESTINATION`` must be provided, but not both. -A ``TYPE`` argument specifies the generic file type of the files within the -listed directories being installed. A destination will then be set -automatically by taking the corresponding variable from -:module:`GNUInstallDirs`, or by using a built-in default if that variable -is not defined. See the table below for the supported file types and their -corresponding variables and built-in defaults. Projects can provide a -``DESTINATION`` argument instead of a file type if they wish to explicitly -define the install destination. - -======================= ================================== ========================= - ``TYPE`` Argument GNUInstallDirs Variable Built-In Default -======================= ================================== ========================= -``BIN`` ``${CMAKE_INSTALL_BINDIR}`` ``bin`` -``SBIN`` ``${CMAKE_INSTALL_SBINDIR}`` ``sbin`` -``LIB`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib`` -``INCLUDE`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include`` -``SYSCONF`` ``${CMAKE_INSTALL_SYSCONFDIR}`` ``etc`` -``SHAREDSTATE`` ``${CMAKE_INSTALL_SHARESTATEDIR}`` ``com`` -``LOCALSTATE`` ``${CMAKE_INSTALL_LOCALSTATEDIR}`` ``var`` -``RUNSTATE`` ``${CMAKE_INSTALL_RUNSTATEDIR}`` ``/run`` -``DATA`` ``${CMAKE_INSTALL_DATADIR}`` ```` -``INFO`` ``${CMAKE_INSTALL_INFODIR}`` ``/info`` -``LOCALE`` ``${CMAKE_INSTALL_LOCALEDIR}`` ``/locale`` -``MAN`` ``${CMAKE_INSTALL_MANDIR}`` ``/man`` -``DOC`` ``${CMAKE_INSTALL_DOCDIR}`` ``/doc`` -======================= ================================== ========================= - -Note that some of the types' built-in defaults use the ``DATAROOT`` directory as -a prefix. The ``DATAROOT`` prefix is calculated similarly to the types, with -``CMAKE_INSTALL_DATAROOTDIR`` as the variable and ``share`` as the built-in -default. You cannot use ``DATAROOT`` as a ``TYPE`` parameter; please use -``DATA`` instead. - -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. -This allows package maintainers to control the install destination by setting -the appropriate cache variables. - -.. versionadded:: 3.4 - An install destination given as a ``DESTINATION`` argument may - use "generator expressions" with the syntax ``$<...>``. See the - :manual:`cmake-generator-expressions(7)` manual for available expressions. + install(TARGETS myexe EXPORT myproj DESTINATION bin) + install(EXPORT myproj NAMESPACE mp_ DESTINATION lib/myproj) + install(EXPORT_ANDROID_MK myproj DESTINATION share/ndk-modules) + + will install the executable ``myexe`` to ``/bin`` and code to import + it in the file ``/lib/myproj/myproj.cmake`` and + ``/share/ndk-modules/Android.mk``. An outside project + may load this file with the include command and reference the ``myexe`` + 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 [...]) -.. versionadded:: 3.5 - The list of ``dirs...`` given to ``DIRECTORY`` may use - "generator expressions" too. + .. versionadded:: 3.21 -Custom Installation Logic -^^^^^^^^^^^^^^^^^^^^^^^^^ + Installs a runtime dependency set: -.. _`install(CODE)`: -.. _`install(SCRIPT)`: -.. _CODE: -.. _SCRIPT: + .. code-block:: cmake -.. code-block:: cmake + install(RUNTIME_DEPENDENCY_SET + [[LIBRARY|RUNTIME|FRAMEWORK] + [DESTINATION ] + [PERMISSIONS ...] + [CONFIGURATIONS ...] + [COMPONENT ] + [NAMELINK_COMPONENT ] + [OPTIONAL] [EXCLUDE_FROM_ALL] + ] [...] + [PRE_INCLUDE_REGEXES ...] + [PRE_EXCLUDE_REGEXES ...] + [POST_INCLUDE_REGEXES ...] + [POST_EXCLUDE_REGEXES ...] + [POST_INCLUDE_FILES ...] + [POST_EXCLUDE_FILES ...] + [DIRECTORIES ...] + ) + + Installs a runtime dependency set previously created by one or more + :command:`install(TARGETS)` or :command:`install(IMPORTED_RUNTIME_ARTIFACTS)` + commands. The dependencies of targets belonging to a runtime dependency set + are installed in the ``RUNTIME`` destination and component on DLL platforms, + and in the ``LIBRARY`` destination and component on non-DLL platforms. + macOS frameworks are installed in the ``FRAMEWORK`` destination and component. + Targets built within the build tree will never be installed as runtime + dependencies, nor will their own dependencies, unless the targets themselves + are installed with :command:`install(TARGETS)`. + + The generated install script calls :command:`file(GET_RUNTIME_DEPENDENCIES)` + on the build-tree files to calculate the runtime dependencies. The build-tree + executable files are passed as the ``EXECUTABLES`` argument, the build-tree + shared libraries as the ``LIBRARIES`` argument, and the build-tree modules as + the ``MODULES`` argument. On macOS, if one of the executables is a + :prop_tgt:`MACOSX_BUNDLE`, that executable is passed as the + ``BUNDLE_EXECUTABLE`` argument. At most one such bundle executable may be in + the runtime dependency set on macOS. The :prop_tgt:`MACOSX_BUNDLE` property + has no effect on other platforms. Note that + :command:`file(GET_RUNTIME_DEPENDENCIES)` only supports collecting the runtime + dependencies for Windows, Linux and macOS platforms, so + ``install(RUNTIME_DEPENDENCY_SET)`` has the same limitation. + + The following sub-arguments are forwarded through as the corresponding + arguments to :command:`file(GET_RUNTIME_DEPENDENCIES)` (for those that provide + a non-empty list of directories, regular expressions or files). They all + support :manual:`generator expressions `. + + * ``DIRECTORIES ...`` + * ``PRE_INCLUDE_REGEXES ...`` + * ``PRE_EXCLUDE_REGEXES ...`` + * ``POST_INCLUDE_REGEXES ...`` + * ``POST_EXCLUDE_REGEXES ...`` + * ``POST_INCLUDE_FILES ...`` + * ``POST_EXCLUDE_FILES ...`` + +Examples +^^^^^^^^ - install([[SCRIPT ] [CODE ]] - [ALL_COMPONENTS | COMPONENT ] - [EXCLUDE_FROM_ALL] [...]) +Example: Install Targets with Per-Artifact Components +""""""""""""""""""""""""""""""""""""""""""""""""""""" -The ``SCRIPT`` form will invoke the given CMake script files during -installation. If the script file name is a relative path it will be -interpreted with respect to the current source directory. The ``CODE`` -form will invoke the given CMake code during installation. Code is -specified as a single argument inside a double-quoted string. For -example, the code +Consider a project that defines targets with different artifact kinds: .. code-block:: cmake - install(CODE "MESSAGE(\"Sample install message.\")") + add_executable(myExe myExe.c) + add_library(myStaticLib STATIC myStaticLib.c) + target_sources(myStaticLib PUBLIC FILE_SET HEADERS FILES myStaticLib.h) + add_library(mySharedLib SHARED mySharedLib.c) + target_sources(mySharedLib PUBLIC FILE_SET HEADERS FILES mySharedLib.h) + set_property(TARGET mySharedLib PROPERTY SOVERSION 1) -will print a message during installation. +We may call :command:`install(TARGETS)` with `\`_ arguments +to specify different options for each kind of artifact: -.. versionadded:: 3.21 - When the ``ALL_COMPONENTS`` option is given, the custom installation - script code will be executed for every component of a component-specific - installation. This option is mutually exclusive with the ``COMPONENT`` - option. +.. code-block:: cmake -.. versionadded:: 3.14 - ```` or ```` may use "generator expressions" with the syntax - ``$<...>`` (in the case of ````, this refers to their use in the file - name, not the file's contents). See the - :manual:`cmake-generator-expressions(7)` manual for available expressions. + install(TARGETS + myExe + mySharedLib + myStaticLib + RUNTIME # Following options apply to runtime artifacts. + COMPONENT Runtime + LIBRARY # Following options apply to library artifacts. + COMPONENT Runtime + NAMELINK_COMPONENT Development + ARCHIVE # Following options apply to archive artifacts. + COMPONENT Development + DESTINATION lib/static + FILE_SET HEADERS # Following options apply to file set HEADERS. + COMPONENT Development + ) -Installing Exports -^^^^^^^^^^^^^^^^^^ +This will: -.. _`install(EXPORT)`: -.. _EXPORT: +* Install ``myExe`` to ``/bin``, the default RUNTIME artifact + destination, as part of the ``Runtime`` component. -.. code-block:: cmake +* On non-DLL platforms: - install(EXPORT DESTINATION - [NAMESPACE ] [FILE .cmake] - [PERMISSIONS permissions...] - [CONFIGURATIONS [Debug|Release|...] - [CXX_MODULES_DIRECTORY ] - [EXPORT_LINK_INTERFACE_LIBRARIES] - [COMPONENT ] - [EXCLUDE_FROM_ALL]) - install(EXPORT_ANDROID_MK DESTINATION [...]) - -The ``EXPORT`` form generates and installs a CMake file containing code to -import targets from the installation tree into another project. -Target installations are associated with the export ```` -using the ``EXPORT`` option of the `install(TARGETS)`_ signature -documented above. The ``NAMESPACE`` option will prepend ```` to -the target names as they are written to the import file. By default -the generated file will be called ``.cmake`` but the ``FILE`` -option may be used to specify a different name. The value given to -the ``FILE`` option must be a file name with the ``.cmake`` extension. -If a ``CONFIGURATIONS`` option is given then the file will only be installed -when one of the named configurations is installed. Additionally, the -generated import file will reference only the matching target -configurations. See the :variable:`CMAKE_MAP_IMPORTED_CONFIG_` -variable to map configurations of dependent projects to the installed -configurations. The ``EXPORT_LINK_INTERFACE_LIBRARIES`` keyword, if -present, causes the contents of the properties matching -``(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_)?`` to be exported, when -policy :policy:`CMP0022` is ``NEW``. + * Install ``libmySharedLib.so.1`` to ``/lib``, the default + LIBRARY artifact destination, as part of the ``Runtime`` component. -.. note:: - The installed ``.cmake`` file may come with additional - per-configuration ``-*.cmake`` files to be loaded by - globbing. Do not use an export name that is the same as the package - name in combination with installing a ``-config.cmake`` - file or the latter may be incorrectly matched by the glob and loaded. - -When a ``COMPONENT`` option is given, the listed ```` implicitly -depends on all components mentioned in the export set. The exported -``.cmake`` file will require each of the exported components to be -present in order for dependent projects to build properly. For example, a -project may define components ``Runtime`` and ``Development``, with shared -libraries going into the ``Runtime`` component and static libraries and -headers going into the ``Development`` component. The export set would also -typically be part of the ``Development`` component, but it would export -targets from both the ``Runtime`` and ``Development`` components. Therefore, -the ``Runtime`` component would need to be installed if the ``Development`` -component was installed, but not vice versa. If the ``Development`` component -was installed without the ``Runtime`` component, dependent projects that try -to link against it would have build errors. Package managers, such as APT and -RPM, typically handle this by listing the ``Runtime`` component as a dependency -of the ``Development`` component in the package metadata, ensuring that the -library is always installed if the headers and CMake export file are present. - -.. versionadded:: 3.7 - In addition to cmake language files, the ``EXPORT_ANDROID_MK`` mode may be - used to specify an export to the android ndk build system. This mode - accepts the same options as the normal export mode. The Android - NDK supports the use of prebuilt libraries, both static and shared. This - allows cmake to build the libraries of a project and make them available - to an ndk build system complete with transitive dependencies, include flags - and defines required to use the libraries. - -``CXX_MODULES_DIRECTORY`` - - .. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` - - Specify a subdirectory to store C++ module information for targets in the - export set. This directory will be populated with files which add the - necessary target property information to the relevant targets. Note that - 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. - -The ``EXPORT`` form is useful to help outside projects use targets built -and installed by the current project. For example, the code + * Install the ``libmySharedLib.so`` "namelink" (symbolic link) to + ``/lib``, the default LIBRARY artifact destination, as part + of the ``Development`` component. -.. code-block:: cmake +* On DLL platforms: - install(TARGETS myexe EXPORT myproj DESTINATION bin) - install(EXPORT myproj NAMESPACE mp_ DESTINATION lib/myproj) - install(EXPORT_ANDROID_MK myproj DESTINATION share/ndk-modules) + * Install ``mySharedLib.dll`` to ``/bin``, the default RUNTIME + artifact destination, as part of the ``Runtime`` component. -will install the executable ``myexe`` to ``/bin`` and code to import -it in the file ``/lib/myproj/myproj.cmake`` and -``/share/ndk-modules/Android.mk``. An outside project -may load this file with the include command and reference the ``myexe`` -executable from the installation tree using the imported target name -``mp_myexe`` as if the target were built in its own tree. + * Install ``mySharedLib.lib`` to ``/lib/static``, the specified + ARCHIVE artifact destination, as part of the ``Development`` component. -.. 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. +* Install ``myStaticLib`` to ``/lib/static``, the specified + ARCHIVE artifact destination, as part of the ``Development`` component. -Installing Runtime Dependencies -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +* Install ``mySharedLib.h`` and ``myStaticLib.h`` to ``/include``, + the default destination for a file set of type HEADERS, as part of the + ``Development`` component. -.. _`install(RUNTIME_DEPENDENCY_SET)`: -.. _RUNTIME_DEPENDENCY_SET: +Example: Install Targets to Per-Config Destinations +""""""""""""""""""""""""""""""""""""""""""""""""""" -.. versionadded:: 3.21 +Each :command:`install(TARGETS)` call installs a given target +:ref:`output artifact ` to at most one ``DESTINATION``, +but the install rule itself may be filtered by the ``CONFIGURATIONS`` option. +In order to install to a different destination for each configuration, one +call per configuration is needed. For example, the code: .. code-block:: cmake - install(RUNTIME_DEPENDENCY_SET - [[LIBRARY|RUNTIME|FRAMEWORK] - [DESTINATION ] - [PERMISSIONS permissions...] - [CONFIGURATIONS [Debug|Release|...]] - [COMPONENT ] - [NAMELINK_COMPONENT ] - [OPTIONAL] [EXCLUDE_FROM_ALL] - ] [...] - [PRE_INCLUDE_REGEXES regexes...] - [PRE_EXCLUDE_REGEXES regexes...] - [POST_INCLUDE_REGEXES regexes...] - [POST_EXCLUDE_REGEXES regexes...] - [POST_INCLUDE_FILES files...] - [POST_EXCLUDE_FILES files...] - [DIRECTORIES directories...] + install(TARGETS myExe + CONFIGURATIONS Debug + RUNTIME + DESTINATION Debug/bin + ) + install(TARGETS myExe + CONFIGURATIONS Release + RUNTIME + DESTINATION Release/bin ) -Installs a runtime dependency set previously created by one or more -`install(TARGETS)`_ or `install(IMPORTED_RUNTIME_ARTIFACTS)`_ commands. The -dependencies of targets belonging to a runtime dependency set are installed in -the ``RUNTIME`` destination and component on DLL platforms, and in the -``LIBRARY`` destination and component on non-DLL platforms. macOS frameworks -are installed in the ``FRAMEWORK`` destination and component. -Targets built within the build tree will never be installed as runtime -dependencies, nor will their own dependencies, unless the targets themselves -are installed with `install(TARGETS)`_. - -The generated install script calls :command:`file(GET_RUNTIME_DEPENDENCIES)` -on the build-tree files to calculate the runtime dependencies. The build-tree -executable files are passed as the ``EXECUTABLES`` argument, the build-tree -shared libraries as the ``LIBRARIES`` argument, and the build-tree modules as -the ``MODULES`` argument. On macOS, if one of the executables is a -:prop_tgt:`MACOSX_BUNDLE`, that executable is passed as the -``BUNDLE_EXECUTABLE`` argument. At most one such bundle executable may be in -the runtime dependency set on macOS. The :prop_tgt:`MACOSX_BUNDLE` property -has no effect on other platforms. Note that -:command:`file(GET_RUNTIME_DEPENDENCIES)` only supports collecting the runtime -dependencies for Windows, Linux and macOS platforms, so -``install(RUNTIME_DEPENDENCY_SET)`` has the same limitation. - -The following sub-arguments are forwarded through as the corresponding -arguments to :command:`file(GET_RUNTIME_DEPENDENCIES)` (for those that provide -a non-empty list of directories, regular expressions or files). They all -support :manual:`generator expressions `. - -* ``DIRECTORIES `` -* ``PRE_INCLUDE_REGEXES `` -* ``PRE_EXCLUDE_REGEXES `` -* ``POST_INCLUDE_REGEXES `` -* ``POST_EXCLUDE_REGEXES `` -* ``POST_INCLUDE_FILES `` -* ``POST_EXCLUDE_FILES `` +will install ``myExe`` to ``/Debug/bin`` in the Debug configuration, +and to ``/Release/bin`` in the Release configuration. Generated Installation Script ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Help/command/set.rst b/Help/command/set.rst index f7fca3c0ab3..ee0fef30467 100644 --- a/Help/command/set.rst +++ b/Help/command/set.rst @@ -26,11 +26,12 @@ Set Normal Variable If the ``PARENT_SCOPE`` option is given the variable will be set in the scope above the current scope. Each new directory or :command:`function` command creates a new scope. A scope can also be created with the - :command:`block` command. This command will set the value of a variable into - the parent directory, calling function or encompassing scope (whichever is - applicable to the case at hand). The previous state of the variable's value - stays the same in the current scope (e.g., if it was undefined before, it is - still undefined and if it had a value, it is still that value). + :command:`block` command. ``set(PARENT_SCOPE)`` will set the value + of a variable into the parent directory, calling function, or + encompassing scope (whichever is applicable to the case at hand). + The previous state of the variable's value stays the same in the + current scope (e.g., if it was undefined before, it is still undefined + and if it had a value, it is still that value). The :command:`block(PROPAGATE)` and :command:`return(PROPAGATE)` commands can be used as an alternate method to the :command:`set(PARENT_SCOPE)` diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst index 7c723a61544..655dbc47d84 100644 --- a/Help/command/set_property.rst +++ b/Help/command/set_property.rst @@ -12,7 +12,8 @@ set_property [DIRECTORY ...] [TARGET_DIRECTORY ...] | INSTALL [ ...] | - TEST [ ...] | + TEST [ ...] + [DIRECTORY ] | CACHE [ ...] > [APPEND] [APPEND_STRING] PROPERTY [ ...]) @@ -91,6 +92,17 @@ It must be one of the following: :manual:`generator expressions ` for tests created by the :command:`add_test(NAME)` signature. + .. versionadded:: 3.28 + + Visibility can be set in other directory scopes using the following sub-option: + + ``DIRECTORY `` + The test property will be set in the ```` directory's scope. CMake must + already know about this directory, either by having added it through a call + to :command:`add_subdirectory` or it being the top level source directory. + Relative paths are treated as relative to the current source directory. + ```` may reference a binary directory. + ``CACHE`` Scope must name zero or more existing cache entries. diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index 5f04e96ca46..40dda6b73cf 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -14,10 +14,20 @@ Test property values may be specified using :manual:`generator expressions ` for tests created by the :command:`add_test(NAME)` signature. +.. versionadded:: 3.28 + Visibility can be set in other directory scopes using the following option: + + ``DIRECTORY `` + The test properties will be set in the ```` directory's scope. + CMake must already know about this directory, either by having added it + through a call to :command:`add_subdirectory` or it being the top level + source directory. Relative paths are treated as relative to the current + source directory. ```` may reference a binary directory. + See Also ^^^^^^^^ * :command:`add_test` * :command:`define_property` * the more general :command:`set_property` command -* :ref:`Target Properties` for the list of properties known to CMake +* :ref:`Test Properties` for the list of properties known to CMake diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst index c1d030c71cc..d196f1937d4 100644 --- a/Help/command/target_link_libraries.rst +++ b/Help/command/target_link_libraries.rst @@ -65,6 +65,12 @@ Each ```` may be: :ref:`usage requirement `. This has the same effect as passing the framework directory as an include directory. + .. versionadded:: 3.28 + + The library file may point to a ``.xcframework`` folder on macOS. If it + does, the target will get the selected library's ``Headers`` directory as + a usage requirement. + .. versionadded:: 3.8 On :ref:`Visual Studio Generators` for VS 2010 and above, library files ending in ``.targets`` will be treated as MSBuild targets files and diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst index 76f12a1d809..042028c4e30 100644 --- a/Help/command/target_precompile_headers.rst +++ b/Help/command/target_precompile_headers.rst @@ -33,7 +33,7 @@ property of ````. ``PUBLIC`` and ``INTERFACE`` items will populate the Repeated calls for the same ```` will append items in the order called. Projects should generally avoid using ``PUBLIC`` or ``INTERFACE`` for targets -that will be :ref:`exported `, or they should at least use +that will be :command:`exported `, or they should at least use the :genex:`$` generator expression to prevent precompile headers from appearing in an installed exported target. Consumers of a target should typically be in control of what precompile headers they use, not have diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst index 64eda15993c..97e10366b0a 100644 --- a/Help/command/target_sources.rst +++ b/Help/command/target_sources.rst @@ -60,6 +60,8 @@ expressions to ensure the sources are correctly assigned to the target. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. +.. _`File Sets`: + File Sets ^^^^^^^^^ @@ -82,10 +84,7 @@ files within those directories. The acceptable types include: Sources intended to be used via a language's ``#include`` mechanism. ``CXX_MODULES`` - - .. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` + .. versionadded:: 3.28 Sources which contain C++ interface module or partition units (i.e., those using the ``export`` keyword). This file set type may not have an diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index 186c62f1423..6fd94f04a69 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -65,6 +65,7 @@ Try Compiling Source Files .. code-block:: cmake try_compile( + [SOURCES_TYPE ] | SOURCE_FROM_CONTENT | SOURCE_FROM_VAR | @@ -143,7 +144,12 @@ single output directory, such that you can only debug one such ``try_compile`` call at a time. Use of the newer signature is recommended to simplify debugging of multiple ``try_compile`` operations. -The options are: +.. _`try_compile Options`: + +Options +^^^^^^^ + +The options for the above signatures are: ``CMAKE_FLAGS ...`` Specify flags of the form :option:`-DVAR:TYPE=VALUE ` to be passed @@ -244,6 +250,24 @@ The options are: ``SOURCE_FROM_VAR`` may be specified multiple times. +``SOURCES_TYPE `` + .. versionadded:: 3.28 + + Sources may be classified using the ``SOURCES_TYPE`` argument. Once + specified, all subsequent sources specified will be treated as that type + until another ``SOURCES_TYPE`` is given. Available types are: + + ``NORMAL`` + Sources are not added to any ``FILE_SET`` in the generated project. + + ``CXX_MODULE`` + .. versionadded:: 3.28 + + Sources are added to a ``FILE_SET`` of type ``CXX_MODULES`` in the + generated project. + + The default type of sources is ``NORMAL``. + ``_STANDARD `` .. versionadded:: 3.8 diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst index dc12f8beb81..7e1ba332a13 100644 --- a/Help/command/try_run.rst +++ b/Help/command/try_run.rst @@ -13,6 +13,7 @@ Try Compiling and Running Source Files .. code-block:: cmake try_run( + [SOURCES_TYPE ] | SOURCE_FROM_CONTENT | SOURCE_FROM_VAR | @@ -77,6 +78,11 @@ The signature above is recommended for clarity. [ARGS ...] ) +.. _`try_run Options`: + +Options +^^^^^^^ + The options specific to ``try_run`` are: ``COMPILE_OUTPUT_VARIABLE `` diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst index c6fb7a653ca..65c0ccf619a 100644 --- a/Help/dev/documentation.rst +++ b/Help/dev/documentation.rst @@ -431,6 +431,7 @@ The section header underline character hierarchy is * ``-``: Subsection or `CMake Domain`_ object document title * ``^``: Subsubsection or `CMake Domain`_ object document section * ``"``: Paragraph or `CMake Domain`_ object document subsection +* ``~``: `CMake Domain`_ object document subsubsection Style: Whitespace ^^^^^^^^^^^^^^^^^ diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst index eac86ab04b6..87ac031f10f 100644 --- a/Help/dev/experimental.rst +++ b/Help/dev/experimental.rst @@ -13,127 +13,3 @@ 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. - -C++20 Module APIs -================= - -Variable: ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` -Value: ``aa1f7df0-828a-4fcd-9afc-2dc80491aca7`` - -In order to support C++20 modules, there are a number of behaviors that have -CMake APIs to provide the required features to build and export them from a -project. - -Limitations ------------ - -There are a number of known limitations of the current C++20 module support in -CMake. This does not document known limitations or bugs in compilers as these -can change over time. - -For all generators: - -- Only in-project modules may be used. While there is some support for - exporting module information, there is no mechanism for using it at the - moment. - -For the Ninja Generators: - -- ``ninja`` 1.10 or newer is required. - -For the Visual Studio Generators: - -- Only Visual Studio 2022 and toolchains newer than 19.34 (Visual Studio - 17.4). -- No support for exporting or installing BMI or module information. -- No diagnosis of using modules provided by ``PRIVATE`` sources from - ``PUBLIC`` module sources. - -C++20 Module Dependencies -========================= - -The Ninja generator has experimental infrastructure supporting C++20 module -dependency scanning. This is similar to the Fortran modules support, but -relies on external tools to scan C++20 translation units for module -dependencies. The approach is described by Kitware's `D1483r1`_ paper. - -In order to activate CMake's experimental support for C++20 module -dependencies, set the following variables: - -``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` - Set this to the UUID documented above. - -Some compilers already have support for module dependency scanning: - -* MSVC 19.34 and newer (provided with Visual Studio 17.4 and newer) -* LLVM/Clang 16.0 and newer - -For those, only the above variables need to be set by project code. -For compilers with in-development support, additional variables must -be set as follows. - -``CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE`` - Set this to tell CMake how to invoke the C++20 module dependency - scanning tool. - -``CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT`` - Set this for compilers that generate module maps. See below. - -``CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG`` - Set this for compilers that generate module maps. See below. - -For example, add code like the following to a test project: - -.. code-block:: cmake - - string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE - " " - " -MT -MD -MF " - " ${flags_to_scan_deps} -fdep-file= -fdep-output=" - ) - -The tool specified by ``CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE`` is -expected to process the translation unit, write preprocessor dependencies -to the file specified by the ```` placeholder, and write module -dependencies to the file specified by the ```` placeholder. The -``CMAKE_EXPERIMENTAL_CXX_SCANDEP_DEPFILE_FORMAT`` file may be set to ``msvc`` -for scandep rules which use ``msvc``-style dependency reporting. - -The module dependencies should be written in the format described -by the `P1689r5`_ paper. - -Compiler writers may try out their scanning functionality using -the `cxx-modules-sandbox`_ test project, modified to set variables -as above for their compiler. - -For compilers that generate module maps, tell CMake as follows: - -.. code-block:: cmake - - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "gcc") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG - "${compiler_flags_for_module_map} -fmodule-mapper=") - -Currently, the only supported formats are, ``clang``, ``gcc``, and ``msvc``. -The ``gcc`` format is described in the GCC documentation, but the relevant -section for the purposes of CMake is: - - A mapping file consisting of space-separated module-name, filename - pairs, one per line. Only the mappings for the direct imports and any - module export name need be provided. If other mappings are provided, - they override those stored in any imported CMI files. A repository - root may be specified in the mapping file by using ``$root`` as the - module name in the first active line. - - -- GCC module mapper documentation - -The ``msvc`` format is a response file containing flags required to compile -any module interfaces properly as well as find any required files to satisfy -``import`` statements as required for Microsoft's Visual Studio toolchains. - -Similarly, the ``clang`` format is a response file containing flags using -Clang's module flags. - -.. _`D1483r1`: https://mathstuf.fedorapeople.org/fortran-modules/fortran-modules.html -.. _`P1689r5`: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html -.. _`cxx-modules-sandbox`: https://github.com/mathstuf/cxx-modules-sandbox diff --git a/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst new file mode 100644 index 00000000000..3e397d85bbb --- /dev/null +++ b/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -0,0 +1,11 @@ +CMAKE_CROSSCOMPILING_EMULATOR +----------------------------- + +.. versionadded:: 3.28 + +.. include:: ENV_VAR.txt + +The default value for :variable:`CMAKE_CROSSCOMPILING_EMULATOR` 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_CROSSCOMPILING_EMULATOR`. diff --git a/Help/envvar/CUDAHOSTCXX.rst b/Help/envvar/CUDAHOSTCXX.rst index 57464c93a24..fe06ef33cd3 100644 --- a/Help/envvar/CUDAHOSTCXX.rst +++ b/Help/envvar/CUDAHOSTCXX.rst @@ -7,8 +7,8 @@ CUDAHOSTCXX 编译\ ``CUDA``\ 语言文件时编译主机代码的首选可执行文件。将仅由CMake在第一次配置中使用,以\ 确定\ ``CUDA``\ 主机编译器,之后\ ``CUDAHOSTCXX``\ 的值存储在缓存中为\ -:variable:`CMAKE_CUDA_HOST_COMPILER`。此环境变量优先于\ -:variable:`CMAKE_CUDA_HOST_COMPILER`。 +:variable:`CMAKE_CUDA_HOST_COMPILER _HOST_COMPILER>`。此环境变量优先于\ +:variable:`CMAKE_CUDA_HOST_COMPILER _HOST_COMPILER>`。 This environment variable is primarily meant for use with projects that enable ``CUDA`` as a first-class language. diff --git a/Help/envvar/HIPHOSTCXX.rst b/Help/envvar/HIPHOSTCXX.rst new file mode 100644 index 00000000000..871fbfb1ebf --- /dev/null +++ b/Help/envvar/HIPHOSTCXX.rst @@ -0,0 +1,19 @@ +HIPHOSTCXX +----------- + +.. versionadded:: 3.28 + +.. include:: ENV_VAR.txt + +Preferred executable for compiling host code when compiling ``HIP`` +language files with the NVIDIA CUDA Compiler. Will only be used by CMake +on the first configuration to determine ``HIP`` host compiler, after which +the value for ``HIPHOSTCXX`` is stored in the cache as +:variable:`CMAKE_HIP_HOST_COMPILER _HOST_COMPILER>`. + +This environment variable is primarily meant for use with projects that +enable ``HIP`` as a first-class language. + +.. note:: + + Ignored when using :ref:`Visual Studio Generators`. diff --git a/Help/generator/Visual Studio 10 2010.rst b/Help/generator/Visual Studio 10 2010.rst index 165b7f680a6..e7ef357e732 100644 --- a/Help/generator/Visual Studio 10 2010.rst +++ b/Help/generator/Visual Studio 10 2010.rst @@ -2,6 +2,6 @@ Visual Studio 10 2010 --------------------- 移除。这个生成器曾经生成过Visual Studio 10 2010项目文件,但是从CMake 3.25开始,这个生成\ -器就被删除了。使用\ :generator:`Visual Studio 12 2013`\ (或更高版本)生成器,将\ +器就被删除了。使用\ :generator:`Visual Studio 14 2015`\ (或更高版本)生成器,将\ :variable:`CMAKE_GENERATOR_TOOLSET`\ 设置为\ ``v100``,或者使用\ :generator:`NMake Makefiles`\ 生成器,仍然可以构建VS 10 2010工具。 diff --git a/Help/generator/Visual Studio 11 2012.rst b/Help/generator/Visual Studio 11 2012.rst index 2405c363a31..5ded24c8603 100644 --- a/Help/generator/Visual Studio 11 2012.rst +++ b/Help/generator/Visual Studio 11 2012.rst @@ -1,57 +1,8 @@ Visual Studio 11 2012 --------------------- -弃用。生成Visual Studio 11(VS 2012)项目文件。 - -.. note:: - This generator is deprecated and will be removed in a future version - of CMake. It will still be possible to build with VS 11 2012 tools - using the :generator:`Visual Studio 12 2013` (or above) generator - with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v110``, or by - using the :generator:`NMake Makefiles` generator. - -For compatibility with CMake versions prior to 3.0, one may specify this -generator using the name "Visual Studio 11" without the year component. - -Project Types -^^^^^^^^^^^^^ - -Only Visual C++ and C# projects may be generated (and Fortran with -Intel compiler integration). Other types of projects (JavaScript, -Database, Website, etc.) are not supported. - -Platform Selection -^^^^^^^^^^^^^^^^^^ - -The default target platform name (architecture) is ``Win32``. - -.. versionadded:: 3.1 - The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps - via the :option:`cmake -A` option, to specify a target platform - name (architecture). For example: - - * ``cmake -G "Visual Studio 11 2012" -A Win32`` - * ``cmake -G "Visual Studio 11 2012" -A x64`` - * ``cmake -G "Visual Studio 11 2012" -A ARM`` - * ``cmake -G "Visual Studio 11 2012" -A `` - (Specify a target platform matching a Windows CE SDK name.) - -For compatibility with CMake versions prior to 3.1, one may specify -a target platform name optionally at the end of the generator name. -This is supported only for: - -``Visual Studio 11 2012 Win64`` - Specify target platform ``x64``. - -``Visual Studio 11 2012 ARM`` - Specify target platform ``ARM``. - -``Visual Studio 11 2012 `` - Specify target platform matching a Windows CE SDK name. - -Toolset Selection -^^^^^^^^^^^^^^^^^ - -The ``v110`` toolset that comes with Visual Studio 11 2012 is selected by -default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps -via the :option:`cmake -T` option, to specify another toolset. +Removed. This once generated Visual Studio 11 2012 project files, but +the generator has been removed since CMake 3.28. It is still possible +to build with VS 11 2012 tools using the :generator:`Visual Studio 14 2015` +(or above) generator with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v110``, +or by using the :generator:`NMake Makefiles` generator. diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst index f73fb345b1e..62e7cd92041 100644 --- a/Help/generator/Visual Studio 12 2013.rst +++ b/Help/generator/Visual Studio 12 2013.rst @@ -1,7 +1,14 @@ Visual Studio 12 2013 --------------------- -生成Visual Studio 12(VS 2013)项目文件。 +Deprecated. 生成Visual Studio 12(VS 2013)项目文件。 + +.. note:: + This generator is deprecated and will be removed in a future version + of CMake. It will still be possible to build with VS 12 2013 tools + using the :generator:`Visual Studio 14 2015` (or above) generator + with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v120``, or by + using the :generator:`NMake Makefiles` generator. For compatibility with CMake versions prior to 3.0, one may specify this generator using the name "Visual Studio 12" without the year component. diff --git a/Help/generator/Visual Studio 9 2008.rst b/Help/generator/Visual Studio 9 2008.rst index 8756b727779..2145b294d97 100644 --- a/Help/generator/Visual Studio 9 2008.rst +++ b/Help/generator/Visual Studio 9 2008.rst @@ -6,7 +6,7 @@ Visual Studio 9 2008 .. note:: This generator is deprecated and will be removed in a future version of CMake. It will still be possible to build with VS 9 2008 tools - using the :generator:`Visual Studio 12 2013` generator (or above, + using the :generator:`Visual Studio 14 2015` generator (or above, and with VS 10 2010 also installed) with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v90``, or by using the :generator:`NMake Makefiles` generator. diff --git a/Help/guide/tutorial/A Basic Starting Point.rst b/Help/guide/tutorial/A Basic Starting Point.rst index 91b72a69914..1f1231dbe01 100644 --- a/Help/guide/tutorial/A Basic Starting Point.rst +++ b/Help/guide/tutorial/A Basic Starting Point.rst @@ -79,7 +79,14 @@ cmake --build . -最后,试着用以下命令来使用新构建的\ ``Tutorial``: +For multi-config generators (e.g. Visual Studio), first navigate to the +appropriate subdirectory, for example: + +.. code-block:: console + + cd Debug + +Finally, try to use the newly built ``Tutorial``: .. code-block:: console @@ -87,6 +94,11 @@ Tutorial 10 Tutorial + +**Note:** Depending on the shell, the correct syntax may be ``Tutorial``, +``./Tutorial`` or ``.\Tutorial``. For simplicity, the exercises will use +``Tutorial`` throughout. + 解决方案 -------- diff --git a/Help/guide/tutorial/Adding Generator Expressions.rst b/Help/guide/tutorial/Adding Generator Expressions.rst index bb447fb35bc..2a890f260d5 100644 --- a/Help/guide/tutorial/Adding Generator Expressions.rst +++ b/Help/guide/tutorial/Adding Generator Expressions.rst @@ -129,9 +129,10 @@ -最后,我们只希望在构建期间使用这些警告标志。已安装项目的使用者不应该继承我们的警告标志。为了\ -指定这一点,我们使用\ ``BUILD_INTERFACE``\ 条件将标记包装在生成器表达式中。生成的完整代码\ -如下所示: +Lastly, we only want these warning flags to be used during builds. Consumers +of our installed project should not inherit our warning flags. To specify +this, we wrap our flags from TODO 3 in a generator expression using the +``BUILD_INTERFACE`` condition. The resulting full code looks like the following: .. raw:: html diff --git a/Help/guide/tutorial/Adding Usage Requirements for a Library.rst b/Help/guide/tutorial/Adding Usage Requirements for a Library.rst index 4b54540cac3..79c9104cb11 100644 --- a/Help/guide/tutorial/Adding Usage Requirements for a Library.rst +++ b/Help/guide/tutorial/Adding Usage Requirements for a Library.rst @@ -111,7 +111,7 @@ -和这几行: +And remove ``EXTRA_INCLUDES`` from ``target_include_directories``: .. raw:: html @@ -127,27 +127,12 @@ -剩下的代码如下: +Notice that with this technique, the only thing our executable target does to +use our library is call :command:`target_link_libraries` with the name +of the library target. In larger projects, the classic method of specifying +library dependencies manually becomes very complicated very quickly. -.. raw:: html - -
点击显示/隐藏答案 - -.. literalinclude:: Step4/CMakeLists.txt - :caption: Remaining code after removing EXTRA_INCLUDES - :name: CMakeLists.txt-after-removing-EXTRA_INCLUDES - :language: cmake - :start-after: add_subdirectory(MathFunctions) - -.. raw:: html - -
- - -注意,使用这种技术,我们的可执行目标要使用库所做的唯一一件事就是调用\ :command:`target_link_libraries`,\ -并指定库目标的名称。在大型项目中,手动指定库依赖关系的经典方法很快就会变得非常复杂。 - -练习2 - 用接口库设置C++标准 +Exercise 2 - Setting the C++ Standard with Interface Libraries ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 既然我们已经将代码转换为更现代的方法,那么让我们演示一种为多个目标设置属性的现代技术。 @@ -234,10 +219,9 @@ Finally, with our interface library set up, we need to link our -executable ``Target``, our ``MathFunctions`` library, and our ``SqrtLibrary`` -library to our new -``tutorial_compiler_flags`` library. Respectively, the code will look like -this: +executable ``Tutorial``, our ``SqrtLibrary`` library and our ``MathFunctions`` +library to our new ``tutorial_compiler_flags`` library. Respectively, the code +will look like this: 最后,在设置好接口库之后,我们需要将可执行的\ ``Target``、\ ``MathFunctions``\ 库和\ ``SqrtLibrary``\ 库链接到新的\ ``tutorial_compiler_flags``\ 库。代码分别如下: @@ -267,7 +251,7 @@ this: :caption: TODO 6: MathFunctions/CMakeLists.txt :name: MathFunctions-CMakeLists.txt-target_link_libraries-step4 :language: cmake - :start-after: # link our compiler flags interface library + :start-after: # link SqrtLibrary to tutorial_compiler_flags :end-before: target_link_libraries(MathFunctions .. raw:: html @@ -284,8 +268,7 @@ this: :caption: TODO 7: MathFunctions/CMakeLists.txt :name: MathFunctions-SqrtLibrary-target_link_libraries-step4 :language: cmake - :start-after: target_link_libraries(SqrtLibrary - :end-before: endif() + :start-after: # link MathFunctions to tutorial_compiler_flags .. raw:: html diff --git a/Help/guide/tutorial/Adding a Library.rst b/Help/guide/tutorial/Adding a Library.rst index f375fcf1fe8..10366e239bf 100644 --- a/Help/guide/tutorial/Adding a Library.rst +++ b/Help/guide/tutorial/Adding a Library.rst @@ -82,7 +82,7 @@ :command:`add_library`\ 创建了一个名为\ ``MathFunctions``\ 的库目标。库的源文件作为参\ 数传递给\ :command:`add_library`。这看起来像下面这行: -.. raw:: html/ +.. raw:: html
TODO 1: 点击显示/隐藏答案 @@ -166,7 +166,7 @@
-最后,用库函数\ ``mathfunctions::mysqrt``\ 替换\ ``sqrt``。 +Lastly, replace ``sqrt`` with the wrapper function ``mathfunctions::sqrt``. .. raw:: html diff --git a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt index b22150643fd..16545649851 100644 --- a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt @@ -33,10 +33,13 @@ if(USE_MYMATH) POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # define the symbol stating we are using the declspec(dllexport) when diff --git a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst index 7c7808092c5..14f90c3779d 100644 --- a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst +++ b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst @@ -39,7 +39,18 @@ :caption: MathFunctions/CMakeLists.txt :name: MathFunctions/CMakeLists.txt-POSITION_INDEPENDENT_CODE :language: cmake - :lines: 37-42 + :start-at: # state that SqrtLibrary need PIC when the default is shared libraries + :end-at: ) + +Define ``EXPORTING_MYMATH`` stating we are using ``declspec(dllexport)`` when +building on Windows. + +.. literalinclude:: Step11/MathFunctions/CMakeLists.txt + :caption: MathFunctions/CMakeLists.txt + :name: MathFunctions/CMakeLists.txt-dll-export + :language: cmake + :start-at: # define the symbol stating we are using the declspec(dllexport) when + :end-at: target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") **练习**:我们修改了\ ``MathFunctions.h``\ 以使用dll导出的定义。使用CMake文档你能找到一\ 个帮助模块来简化这个吗? diff --git a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt index 36b3fe10a57..210563a6930 100644 --- a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt @@ -26,10 +26,13 @@ if(USE_MYMATH) ${CMAKE_CURRENT_BINARY_DIR} ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # install libs diff --git a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt index 992016acb1a..8f3dc7c12ed 100644 --- a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt @@ -31,10 +31,13 @@ if(USE_MYMATH) POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # 定义当用declspec(dllexport)声明的符号 diff --git a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt index ed09a7fd750..f8e1e9dfd09 100644 --- a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt @@ -33,10 +33,13 @@ if(USE_MYMATH) POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # 定义当用declspec(dllexport)声明的符号 diff --git a/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt index 0ffb9e1f5b2..ffb2f35a4b4 100644 --- a/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt @@ -16,7 +16,7 @@ if (USE_MYMATH) # TODO 7: Link SqrtLibrary to tutorial_compiler_flags - target_link_libraries(MathFunctions PUBLIC SqrtLibrary) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() # TODO 6: Link MathFunctions to tutorial_compiler_flags diff --git a/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt index c607aae16c6..ffafb54d021 100644 --- a/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt @@ -17,10 +17,11 @@ if (USE_MYMATH) mysqrt.cxx ) - # link our compiler flags interface library + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) - target_link_libraries(MathFunctions PUBLIC SqrtLibrary) + + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() -# link our compiler flags interface library +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) diff --git a/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt index caaac113ce2..f502c95cd56 100644 --- a/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt @@ -16,12 +16,13 @@ if (USE_MYMATH) mysqrt.cxx ) - # link our compiler flags interface library + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() -# link our compiler flags interface library +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # TODO 1: Create a variable called installable_libs that is a list of all diff --git a/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt index 01485038749..f340c53799c 100644 --- a/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt @@ -16,11 +16,13 @@ if (USE_MYMATH) mysqrt.cxx ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() -# link our compiler flags interface library +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # install libs diff --git a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt index 897ec0e6442..a0b3037b09d 100644 --- a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt @@ -16,6 +16,7 @@ if (USE_MYMATH) mysqrt.cxx ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) # TODO 1: Include CheckCXXSourceCompiles @@ -41,7 +42,7 @@ if (USE_MYMATH) target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() -# link our compiler flags interface library +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # install libs diff --git a/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt index 783b7e242a1..ad9a128da4c 100644 --- a/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt @@ -10,6 +10,7 @@ if (USE_MYMATH) mysqrt.cxx ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) # does this system provide the log and exp functions? @@ -45,7 +46,7 @@ target_include_directories(MathFunctions INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -# link our compiler flags interface library +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # install libs diff --git a/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt index 313bf9748a4..978e8e220f5 100644 --- a/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt @@ -25,10 +25,13 @@ if (USE_MYMATH) ${CMAKE_CURRENT_BINARY_DIR} ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # install libs diff --git a/Help/index.rst b/Help/index.rst index b319577a88a..fe50deac852 100644 --- a/Help/index.rst +++ b/Help/index.rst @@ -49,6 +49,7 @@ CMake被广泛用于C和C++,但它也可以用于构建其他语言的源代 cmake-commands(7) cmake-compile-features(7) cmake-configure-log(7) + /manual/cmake-cxxmodules.7 cmake-developer(7) cmake-env-variables(7) cmake-file-api(7) diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt index 4db91f7a46b..20f153f2229 100644 --- a/Help/manual/OPTIONS_BUILD.txt +++ b/Help/manual/OPTIONS_BUILD.txt @@ -84,11 +84,17 @@ .. option:: --toolchain - 指定交叉编译工具链文件,相当于设置\ :variable:`CMAKE_TOOLCHAIN_FILE`\ 变量。 + .. versionadded:: 3.21 + + Specify the cross compiling toolchain file, equivalent to setting + :variable:`CMAKE_TOOLCHAIN_FILE` variable. .. option:: --install-prefix - 指定安装目录,由\ :variable:`CMAKE_INSTALL_PREFIX`\ 变量使用。必须是绝对路径。 + .. versionadded:: 3.21 + + Specify the installation directory, used by the + :variable:`CMAKE_INSTALL_PREFIX` variable. Must be an absolute path. .. option:: -Wno-dev diff --git a/Help/manual/OPTIONS_HELP.txt b/Help/manual/OPTIONS_HELP.txt index 2388a8a983b..6b358554c42 100644 --- a/Help/manual/OPTIONS_HELP.txt +++ b/Help/manual/OPTIONS_HELP.txt @@ -11,6 +11,21 @@ 用例描述了基本的命令行接口及其选项。 +.. option:: --help [] + + Print help for one CMake keyword. + + ```` can be a property, variable, command, policy, generator + or module. + + The relevant manual entry for ```` is + printed in a human-readable text format. + |file| + + .. versionchanged:: 3.28 + + Prior to CMake 3.28, this option supported command names only. + .. option:: --help-full [] 打印所有帮助手册并退出。 diff --git a/Help/manual/cmake-cxxmodules.7.rst b/Help/manual/cmake-cxxmodules.7.rst new file mode 100644 index 00000000000..57764217671 --- /dev/null +++ b/Help/manual/cmake-cxxmodules.7.rst @@ -0,0 +1,72 @@ +.. cmake-manual-description: CMake C++ Modules Support Reference + +cmake-cxxmodules(7) +******************* + +.. versionadded:: 3.28 + +C++ 20 introduced the concept of "modules" to the language. The design +requires build systems to order compilations among each other to satisfy +``import`` statements reliably. CMake's implementation asks the compiler +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. + +Scanning Control +================ + +Whether or not sources get scanned for C++ module usage is dependent on the +following queries. The first query that provides a yes/no answer is used. + +- If the source file belongs to a file set of type ``CXX_MODULES``, it will + be scanned. +- If the target does not use at least C++ 20, it will not be scanned. +- If the source file is not the language ``CXX``, it will not be scanned. +- If the :prop_sf:`CXX_SCAN_FOR_MODULES` source file property is set, its + value will be used. +- If the :prop_tgt:`CXX_SCAN_FOR_MODULES` target property is set, its value + will be used. Set the :variable:`CMAKE_CXX_SCAN_FOR_MODULES` variable + to initialize this property on all targets as they are created. +- Otherwise, the source file will be scanned. See policy :policy:`CMP0155`. + +Compiler Support +================ + +Compilers which CMake natively supports module dependency scanning include: + +* MSVC toolset 14.34 and newer (provided with Visual Studio 17.4 and newer) +* LLVM/Clang 16.0 and newer +* GCC 14 (for the in-development branch, after 2023-09-20) and newer + +Generator Support +================= + +The list of generators which support scanning sources for C++ modules include: + +- :generator:`Ninja` +- :generator:`Ninja Multi-Config` +- :generator:`Visual Studio 17 2022` + +Limitations +----------- + +There are a number of known limitations of the current C++ module support in +CMake. This does not document known limitations or bugs in compilers as these +can change over time. + +For all generators: + +- Header units are not supported. +- No builtin support for ``import std;`` or other compiler-provided modules. + +For the Ninja Generators: + +- ``ninja`` 1.11 or newer is required. + +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 diagnosis of using modules provided by ``PRIVATE`` sources from + ``PUBLIC`` module sources. diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst index afa18246796..0ebe4eb7465 100644 --- a/Help/manual/cmake-env-variables.7.rst +++ b/Help/manual/cmake-env-variables.7.rst @@ -41,6 +41,7 @@ cmake-env-variables(7) /envvar/CMAKE_COLOR_DIAGNOSTICS /envvar/CMAKE_CONFIGURATION_TYPES /envvar/CMAKE_CONFIG_TYPE + /envvar/CMAKE_CROSSCOMPILING_EMULATOR /envvar/CMAKE_EXPORT_COMPILE_COMMANDS /envvar/CMAKE_GENERATOR /envvar/CMAKE_GENERATOR_INSTANCE @@ -81,6 +82,7 @@ cmake-env-variables(7) /envvar/FFLAGS /envvar/HIPCXX /envvar/HIPFLAGS + /envvar/HIPHOSTCXX /envvar/ISPC /envvar/ISPCFLAGS /envvar/OBJC diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index d67a619022f..3eeda099ab7 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -173,6 +173,12 @@ cmake-generator-expressions(7) 如果\ ``condition``\ 为\ ``1``,则返回\ ``true_string``;如果\ ``condition``\ 为\ ``0``,则返回\ ``false_string``。\ ``condition``\ 的任何其他值都会导致错误。 + .. versionadded:: 3.28 + + This generator expression short-circuits such that generator expressions in + ``false_string`` will not evaluate when ``condition`` is ``1``, and generator + expressions in ``true_string`` will not evaluate when condition is ``0``. + 通常,\ ``condition``\ 本身就是一个生成器表达式。例如,当使用\ ``Debug``\ 配置时,\ 下面的表达式展开为\ ``DEBUG_MODE``,对于所有其他配置则为空字符串: @@ -222,8 +228,13 @@ cmake-generator-expressions(7) .. genex:: $ - ``condition``\ 必须为\ ``0``\ 或\ ``1``。如果\ ``condition``\ 为\ ``1``,\ - 表达式的结果为\ ``0``,否则为\ ``1``。 + ``condition`` must be ``0`` or ``1``. The result of the expression is + ``0`` if ``condition`` is ``1``, else ``1``. + +.. versionadded:: 3.28 + + Logical operators short-circuit such that generator expressions in the + arguments list will not be evaluated once a return value can be determined. .. _`Comparison Expressions`: diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 5d0085b4be5..ced7ab9921e 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -40,6 +40,17 @@ CMake中的策略用于保持跨多个版本的向后兼容行为。当引入新 :variable:`CMAKE_MINIMUM_REQUIRED_VERSION`\ 变量也可以用来决定是否报告在使用弃用宏或\ 函数时的错误。 +Policies Introduced by CMake 3.28 +================================= + +.. toctree:: + :maxdepth: 1 + + CMP0155: C++ sources in targets with at least C++20 are scanned for imports. + CMP0154: Generated files are private by default in targets using file sets. + CMP0153: The exec_program command should not be called. + CMP0152: file(REAL_PATH) resolves symlinks before collapsing ../ components. + Policies Introduced by CMake 3.27 ================================= diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst index 518b9853e13..3c14e3344f4 100644 --- a/Help/manual/cmake-presets.7.rst +++ b/Help/manual/cmake-presets.7.rst @@ -36,6 +36,15 @@ CMake用户经常面临的一个问题是与其他人共享配置项目的常用 根对象识别以下字段: +``$schema`` + An optional string that provides a URI to the JSON schema that describes the + structure of this JSON document. This field is used for validation and + autocompletion in editors that support JSON schema. It doesn't affect the + behavior of the document itself. If this field is not specified, the JSON + document will still be valid, but tools that use JSON schema for validation + and autocompletion may not function correctly. + This is allowed in preset files specifying version ``8`` or above. + ``version`` 必需的整数,表示JSON模式的版本。支持的版本有: diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 307cc4f9cf1..f494ec33cb6 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -240,6 +240,11 @@ cmake-properties(7) /prop_tgt/IMPORTED /prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME /prop_tgt/IMPORTED_CONFIGURATIONS + /prop_tgt/IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS + /prop_tgt/IMPORTED_CXX_MODULES_COMPILE_FEATURES + /prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS + /prop_tgt/IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES + /prop_tgt/IMPORTED_CXX_MODULES_LINK_LIBRARIES /prop_tgt/IMPORTED_GLOBAL /prop_tgt/IMPORTED_IMPLIB /prop_tgt/IMPORTED_IMPLIB_CONFIG @@ -503,6 +508,7 @@ cmake-properties(7) /prop_test/FIXTURES_CLEANUP /prop_test/FIXTURES_REQUIRED /prop_test/FIXTURES_SETUP + /prop_test/GENERATED_RESOURCE_SPEC_FILE /prop_test/LABELS /prop_test/MEASUREMENT /prop_test/PASS_REGULAR_EXPRESSION diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index d3a024eb9b9..1b951cbcf5c 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -13,7 +13,7 @@ cmake-qt(7) CMake可以找到并使用Qt 4和Qt 5库。Qt4库可以通过CMake自带的\ :module:`FindQt4`\ 搜寻模块\ 找到,而Qt 5库可以通过Qt 5自带的“配置文件包”找到。有关CMake包的更多信息,请参见\ :manual:`cmake-packages(7)`,并查看你所用Qt版本的\ -`Qt cmake手册 `_。 +`Qt cmake手册 `_。 Qt 4和Qt 5可以在同一个\ :manual:`CMake buildsystem `\ 中一起使用: diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst index 447475ab797..880c87aad4c 100644 --- a/Help/manual/cmake-toolchains.7.rst +++ b/Help/manual/cmake-toolchains.7.rst @@ -488,28 +488,32 @@ Android为目标,使用独立的工具链进行交叉编译。 * :prop_tgt:`ANDROID_SKIP_ANT_STEP` * :prop_tgt:`ANDROID_STL_TYPE` -.. _`Cross Compiling for iOS, tvOS, or watchOS`: - -iOS、tvOS或者watchOS交叉编译 ------------------------------------------ - -对于交叉编译到iOS、tvOS或watchOS,建议使用\ :generator:`Xcode`\ 生成器。也可以使用\ -:generator:`Unix Makefiles`\ 或\ :generator:`Ninja`\ 生成器,但它们要求项目处理更多的\ -领域,如目标CPU选择和代码签名。 - -通过将\ :variable:`CMAKE_SYSTEM_NAME`\ 变量设置为下表中的值,可以将这三个系统中的任何一\ -个作为目标。默认情况下,选择最新的Device SDK。对于所有的Apple平台,可以通过设置\ -:variable:`CMAKE_OSX_SYSROOT`\ 变量来选择不同的SDK(例如模拟器),尽管不是很必要(参见下\ -面的\ :ref:`Switching Between Device and Simulator`)。一个可用SDK的列表可以通过运行\ -``xcodebuild -showsdks``\ 获得。 - -======= ================= ==================== ================ -OS CMAKE_SYSTEM_NAME Device SDK (default) Simulator SDK -======= ================= ==================== ================ -iOS iOS iphoneos iphonesimulator -tvOS tvOS appletvos appletvsimulator -watchOS watchOS watchos watchsimulator -======= ================= ==================== ================ +.. _`Cross Compiling for iOS, tvOS, visionOS, or watchOS`: + +Cross Compiling for iOS, tvOS, visionOS, or watchOS +--------------------------------------------------- + +For cross-compiling to iOS, tvOS, visionOS, or watchOS, the :generator:`Xcode` +generator is recommended. The :generator:`Unix Makefiles` or +:generator:`Ninja` generators can also be used, but they require the +project to handle more areas like target CPU selection and code signing. + +Any of the three systems can be targeted by setting the +:variable:`CMAKE_SYSTEM_NAME` variable to a value from the table below. +By default, the latest Device SDK is chosen. As for all Apple platforms, +a different SDK (e.g. a simulator) can be selected by setting the +:variable:`CMAKE_OSX_SYSROOT` variable, although this should rarely be +necessary (see :ref:`Switching Between Device and Simulator` below). +A list of available SDKs can be obtained by running ``xcodebuild -showsdks``. + +======== ================= ==================== ================ +OS CMAKE_SYSTEM_NAME Device SDK (default) Simulator SDK +======== ================= ==================== ================ +iOS iOS iphoneos iphonesimulator +tvOS tvOS appletvos appletvsimulator +visionOS visionOS xros xrsimulator +watchOS watchOS watchos watchsimulator +======== ================= ==================== ================ 例如,要为iOS创建CMake配置,以下命令就足够了: @@ -518,7 +522,7 @@ watchOS watchOS watchos watchsimulator cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS 变量\ :variable:`CMAKE_OSX_ARCHITECTURES`\ 可用于设置设备和模拟器的体系结构。变量\ -:variable:`CMAKE_OSX_DEPLOYMENT_TARGET`\ 用于设置iOS/tvOS/watchOS的部署目标。 +:variable:`CMAKE_OSX_DEPLOYMENT_TARGET`\ 用于设置iOS/tvOS/visionOS/watchOS的部署目标。 下一个配置将安装fat 5架构的iOS库,并在编译器中添加\ ``-miphoneos-version-min=9.3``/\ ``-mios-simulator-version-min=9.3``\ 标志: diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 1a6bebb87c5..7cab21e8155 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -588,6 +588,7 @@ cmake-variables(7) /variable/CMAKE_Fortran_MODOUT_FLAG /variable/CMAKE_HIP_ARCHITECTURES /variable/CMAKE_HIP_EXTENSIONS + /variable/CMAKE_HIP_PLATFORM /variable/CMAKE_HIP_STANDARD /variable/CMAKE_HIP_STANDARD_REQUIRED /variable/CMAKE_ISPC_HEADER_DIRECTORY @@ -625,6 +626,7 @@ cmake-variables(7) /variable/CMAKE_LANG_FLAGS_RELEASE_INIT /variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO /variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT + /variable/CMAKE_LANG_HOST_COMPILER /variable/CMAKE_LANG_IGNORE_EXTENSIONS /variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES /variable/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index d6b6a93fd4d..3ee0fb078df 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -257,22 +257,34 @@ CMake通过一个称为\ *生成器*\ 的后端为每个用户在本地生成一 .. option:: --debug-find - 将cmake find命令置于调试模式。 + .. versionadded:: 3.17 - 在cmake运行到标准错误时打印额外的find调用信息。输出是为人们使用而设计的,而不是为解析设计的。\ - 请参阅\ :variable:`CMAKE_FIND_DEBUG_MODE`\ 变量来调试项目中更局部的部分。 + Put cmake find commands in a debug mode. + + Print extra find call information during the cmake run to standard + error. Output is designed for human consumption and not for parsing. + See also the :variable:`CMAKE_FIND_DEBUG_MODE` variable for debugging + a more local part of the project. .. option:: --debug-find-pkg=[,...] - 在调用\ :command:`find_package(\) `\ 时,将cmake find命令置于\ - 调试模式,其中\ ````\ 是给定的逗号分隔的区分大小写的包名列表中的条目。 + .. versionadded:: 3.23 + + Put cmake find commands in a debug mode when running under calls + to :command:`find_package(\) `, where ```` + is an entry in the given comma-separated list of case-sensitive package + names. - 类似于\ :option:`--debug-find `,但将作用域限制为指定的包。 + Like :option:`--debug-find `, but limiting scope + to the specified packages. .. option:: --debug-find-var=[,...] - 当使用\ ````\ 作为结果变量调用cmake find命令时,将其置于调试模式,其中\ ````\ - 是给定逗号分隔列表中的条目。 + .. versionadded:: 3.23 + + Put cmake find commands in a debug mode when called with ```` + as the result variable, where ```` is an entry in the given + comma-separated list. 类似于\ :option:`--debug-find `,但将作用域限制为指定的变量名。 @@ -290,9 +302,11 @@ CMake通过一个称为\ *生成器*\ 的后端为每个用户在本地生成一 .. option:: --trace-format= - 将cmake置于跟踪模式并设置跟踪输出格式。 + .. versionadded:: 3.17 + + Put cmake in trace mode and sets the trace output format. - ````\ 可以是下列值之一。 + ```` can be one of the following values. ``human`` 以人类可读的格式打印每个跟踪行。这是默认格式。 @@ -398,12 +412,19 @@ CMake通过一个称为\ *生成器*\ 的后端为每个用户在本地生成一 .. option:: --compile-no-warning-as-error - 忽略目标属性\ :prop_tgt:`COMPILE_WARNING_AS_ERROR`\ - 和变量\ :variable:`CMAKE_COMPILE_WARNING_AS_ERROR`,防止警告在编译时被视为错误。 + .. versionadded:: 3.24 + + Ignore target property :prop_tgt:`COMPILE_WARNING_AS_ERROR` and variable + :variable:`CMAKE_COMPILE_WARNING_AS_ERROR`, preventing warnings from being + treated as errors on compile. .. option:: --profiling-output= - 与\ :option:`--profiling-format `\ 一起使用,输出到给定的路径。 + .. versionadded:: 3.18 + + Used in conjunction with + :option:`--profiling-format ` to output to a + given path. .. option:: --profiling-format= @@ -1160,6 +1181,8 @@ pkg-config在普通的基于Makefile的项目或基于autoconf的项目中找到 运行工作流预设 ===================== +.. versionadded:: 3.25 + .. program:: cmake :manual:`CMake预设 `\ 提供了一种按顺序执行多个构建步骤的方法: diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index 10dc7137520..ea15c5ec0d1 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -1545,17 +1545,41 @@ GPU 3默认有1个槽位。还有一个带4插槽的密码芯片。 在本例中,组0从GPU ``0``\ 获得2个插槽,组1从GPU ``2``\ 获得2个插槽,组2从GPU ``1``\ 获得4个插槽,从GPU ``3``\ 获得1个插槽,从加密芯片\ ``card0``\ 获得2个插槽。 - ````\ 是一个从零到\ ``CTEST_RESOURCE_GROUP_COUNT``\ 减一的数字。\ - ````\ 是资源类型的名称,转换为大写。\ - ``CTEST_RESOURCE_GROUP__``\ 是为上面列出的范围中的每个\ - ````\ 和\ ``CTEST_RESOURCE_GROUP_``\ 中列出的每个资源类型的乘积定义的。 - - 由于某些平台对环境变量具有不区分大小写的名称,因此资源类型的名称在不区分大小写的环境中可能\ - 不会冲突。因此,为了简单起见,在\ :ref:`资源规范文件 `\ - 和\ :prop_test:`RESOURCE_GROUPS`\ 属性中,所有资源类型必须全部小写,并且在\ - ``CTEST_RESOURCE_GROUP__``\ 环境变量中将它们转换为全部大写。 - -另请参阅 + ```` is a number from zero to ``CTEST_RESOURCE_GROUP_COUNT`` minus one. + ```` is the name of a resource type, converted to uppercase. + ``CTEST_RESOURCE_GROUP__`` is defined for the product + of each ```` in the range listed above and each resource type listed in + ``CTEST_RESOURCE_GROUP_``. + + Because some platforms have case-insensitive names for environment variables, + the names of resource types may not clash in a case-insensitive environment. + Because of this, for the sake of simplicity, all resource types must be + listed in all lowercase in the + :ref:`resource specification file ` and + in the :prop_test:`RESOURCE_GROUPS` property, and they are converted to all + uppercase in the ``CTEST_RESOURCE_GROUP__`` environment + variable. + +.. _`ctest-resource-dynamically-generated-spec-file`: + +Dynamically-Generated Resource Specification File +------------------------------------------------- + +.. versionadded:: 3.28 + +A project may optionally specify a single test which will be used to +dynamically generate the resource specification file that CTest will use for +scheduling tests that use resources. The test that generates the file must +have the :prop_test:`GENERATED_RESOURCE_SPEC_FILE` property set, and must have +exactly one fixture in its :prop_test:`FIXTURES_SETUP` property. This fixture +is considered by CTest to have special meaning: it's the fixture that generates +the resource spec file. The fixture may have any name. If such a fixture +exists, all tests that have :prop_test:`RESOURCE_GROUPS` set must have the +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. + +See Also ======== .. include:: LINKS.txt diff --git a/Help/manual/presets/schema.json b/Help/manual/presets/schema.json index adfb1cb135f..d27faa12a3f 100644 --- a/Help/manual/presets/schema.json +++ b/Help/manual/presets/schema.json @@ -9,9 +9,9 @@ "const": 1, "description": "A required integer representing the version of the JSON schema." }, - "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"}, + "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired" }, "vendor": { "$ref": "#/definitions/vendor" }, - "configurePresets": { "$ref": "#/definitions/configurePresetsV1"} + "configurePresets": { "$ref": "#/definitions/configurePresetsV1" } }, "additionalProperties": false }, @@ -21,11 +21,11 @@ "const": 2, "description": "A required integer representing the version of the JSON schema." }, - "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"}, + "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired" }, "vendor": { "$ref": "#/definitions/vendor" }, - "configurePresets": { "$ref": "#/definitions/configurePresetsV1"}, - "buildPresets": { "$ref": "#/definitions/buildPresetsV2"}, - "testPresets": { "$ref": "#/definitions/testPresetsV2"} + "configurePresets": { "$ref": "#/definitions/configurePresetsV1" }, + "buildPresets": { "$ref": "#/definitions/buildPresetsV2" }, + "testPresets": { "$ref": "#/definitions/testPresetsV2" } }, "additionalProperties": false }, @@ -35,11 +35,11 @@ "const": 3, "description": "A required integer representing the version of the JSON schema." }, - "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"}, + "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired" }, "vendor": { "$ref": "#/definitions/vendor" }, - "configurePresets": { "$ref": "#/definitions/configurePresetsV3"}, - "buildPresets": { "$ref": "#/definitions/buildPresetsV3"}, - "testPresets": { "$ref": "#/definitions/testPresetsV3"} + "configurePresets": { "$ref": "#/definitions/configurePresetsV3" }, + "buildPresets": { "$ref": "#/definitions/buildPresetsV3" }, + "testPresets": { "$ref": "#/definitions/testPresetsV3" } }, "additionalProperties": false }, @@ -49,12 +49,12 @@ "const": 4, "description": "A required integer representing the version of the JSON schema." }, - "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"}, + "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired" }, "vendor": { "$ref": "#/definitions/vendor" }, - "configurePresets": { "$ref": "#/definitions/configurePresetsV3"}, - "buildPresets": { "$ref": "#/definitions/buildPresetsV4"}, - "testPresets": { "$ref": "#/definitions/testPresetsV3"}, - "include": { "$ref": "#/definitions/include"} + "configurePresets": { "$ref": "#/definitions/configurePresetsV3" }, + "buildPresets": { "$ref": "#/definitions/buildPresetsV4" }, + "testPresets": { "$ref": "#/definitions/testPresetsV3" }, + "include": { "$ref": "#/definitions/include" } }, "additionalProperties": false }, @@ -64,12 +64,12 @@ "const": 5, "description": "A required integer representing the version of the JSON schema." }, - "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"}, + "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired" }, "vendor": { "$ref": "#/definitions/vendor" }, - "configurePresets": { "$ref": "#/definitions/configurePresetsV3"}, - "buildPresets": { "$ref": "#/definitions/buildPresetsV4"}, - "testPresets": { "$ref": "#/definitions/testPresetsV5"}, - "include": { "$ref": "#/definitions/include"} + "configurePresets": { "$ref": "#/definitions/configurePresetsV3" }, + "buildPresets": { "$ref": "#/definitions/buildPresetsV4" }, + "testPresets": { "$ref": "#/definitions/testPresetsV5" }, + "include": { "$ref": "#/definitions/include" } }, "additionalProperties": false }, @@ -79,14 +79,14 @@ "const": 6, "description": "A required integer representing the version of the JSON schema." }, - "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"}, + "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired" }, "vendor": { "$ref": "#/definitions/vendor" }, - "configurePresets": { "$ref": "#/definitions/configurePresetsV3"}, - "buildPresets": { "$ref": "#/definitions/buildPresetsV4"}, - "testPresets": { "$ref": "#/definitions/testPresetsV6"}, - "packagePresets": { "$ref": "#/definitions/packagePresetsV6"}, + "configurePresets": { "$ref": "#/definitions/configurePresetsV3" }, + "buildPresets": { "$ref": "#/definitions/buildPresetsV4" }, + "testPresets": { "$ref": "#/definitions/testPresetsV6" }, + "packagePresets": { "$ref": "#/definitions/packagePresetsV6" }, "workflowPresets": { "$ref": "#/definitions/workflowPresetsV6" }, - "include": { "$ref": "#/definitions/include"} + "include": { "$ref": "#/definitions/include" } }, "additionalProperties": false }, @@ -96,14 +96,32 @@ "const": 7, "description": "A required integer representing the version of the JSON schema." }, - "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"}, + "cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired" }, "vendor": { "$ref": "#/definitions/vendor" }, - "configurePresets": { "$ref": "#/definitions/configurePresetsV7"}, - "buildPresets": { "$ref": "#/definitions/buildPresetsV4"}, - "testPresets": { "$ref": "#/definitions/testPresetsV6"}, - "packagePresets": { "$ref": "#/definitions/packagePresetsV6"}, + "configurePresets": { "$ref": "#/definitions/configurePresetsV7" }, + "buildPresets": { "$ref": "#/definitions/buildPresetsV4" }, + "testPresets": { "$ref": "#/definitions/testPresetsV6" }, + "packagePresets": { "$ref": "#/definitions/packagePresetsV6" }, "workflowPresets": { "$ref": "#/definitions/workflowPresetsV6" }, - "include": { "$ref": "#/definitions/include"} + "include": { "$ref": "#/definitions/include" } + }, + "additionalProperties": false + }, + { + "properties": { + "$schema": { "$ref": "#/definitions/$schema" }, + "version": { + "const": 8, + "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 } @@ -112,6 +130,11 @@ "version" ], "definitions": { + "$schema": { + "type": "string", + "description": "The schema against which to verify this document.", + "format": "uri-reference" + }, "cmakeMinimumRequired": { "type": "object", "description": "An optional object representing the minimum version of CMake needed to build this project.", diff --git a/Help/policy/CMP0152.rst b/Help/policy/CMP0152.rst new file mode 100644 index 00000000000..d7e8692f8cc --- /dev/null +++ b/Help/policy/CMP0152.rst @@ -0,0 +1,20 @@ +CMP0152 +------- + +.. versionadded:: 3.28 + +:command:`file(REAL_PATH)` resolves symlinks before collapsing ../ components. + +In CMake 3.27 and below, :command:`file(REAL_PATH)` collapsed any ``../`` +components in a path before resolving symlinks. This produced incorrect +results when the ``../`` collapsed away a symlink. + +The ``OLD`` behavior for this policy is to collapse ``../`` components before +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. + +.. include:: DEPRECATED.txt diff --git a/Help/policy/CMP0153.rst b/Help/policy/CMP0153.rst new file mode 100644 index 00000000000..838f0824404 --- /dev/null +++ b/Help/policy/CMP0153.rst @@ -0,0 +1,14 @@ +CMP0153 +------- + +.. versionadded:: 3.28 + +The :command:`exec_program` command should not be called. + +This command has long been superseded by the :command:`execute_process` +command and has been deprecated since CMake 3.0. + +.. |disallowed_version| replace:: 3.28 +.. include:: DISALLOWED_COMMAND.txt + +.. include:: DEPRECATED.txt diff --git a/Help/policy/CMP0154.rst b/Help/policy/CMP0154.rst new file mode 100644 index 00000000000..cb93d416741 --- /dev/null +++ b/Help/policy/CMP0154.rst @@ -0,0 +1,53 @@ +CMP0154 +------- + +.. versionadded:: 3.28 + +Generated files are private by default in targets using :ref:`file sets`. + +CMake 3.27 and below assume that any file generated as an output or byproduct +of :command:`add_custom_command` or :command:`add_custom_target` may be a +public header file meant for inclusion by dependents' source files. This +requires :ref:`Ninja Generators` to add conservative order-only dependencies +that prevent a target's source files from compiling before custom commands +from the target's dependencies are finished, even if those custom commands +only produce sources private to their own target. + +:ref:`File Sets`, introduced by CMake 3.23, provide a way to express the +visibility of generated header files. CMake 3.28 and above prefer to +assume that, in targets using file sets, generated files are private to +their own target by default. Generated public headers must be specified +as members of a ``PUBLIC`` (or ``INTERFACE``) ``FILE_SET``, typically of +type ``HEADERS``. With this information, :ref:`Ninja Generators` may omit +the above-mentioned conservative dependencies and produce more efficient +build graphs. + +This policy provides compatibility for projects using file sets in targets +with generated header files that have not been updated. Such projects +should be updated to express generated public headers in a file set. +For example: + +.. code-block:: cmake + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/foo.h + ... + ) + target_sources(foo + PUBLIC FILE_SET HEADERS + BASE_DIRS ${CMAKE_CURRENT_BINARY_DIR} + FILES ${CMAKE_CURRENT_BINARY_DIR}/foo.h + ) + +The ``OLD`` behavior for this policy is to assume generated files are +public, even in targets using file sets, and for :ref:`Ninja Generators` +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. + +.. include:: DEPRECATED.txt diff --git a/Help/policy/CMP0155.rst b/Help/policy/CMP0155.rst new file mode 100644 index 00000000000..2dafadf3dd6 --- /dev/null +++ b/Help/policy/CMP0155.rst @@ -0,0 +1,26 @@ +CMP0155 +------- + +.. versionadded:: 3.28 + +C++ sources in targets with at least C++20 are scanned for imports. + +CMake 3.27 and below assume that C++ sources do not ``import`` modules. +CMake 3.28 and above prefer to assume that C++ sources in targets using C++20 +or higher might ``import`` modules, and must be scanned before compiling, +unless explicitly disabled. This policy provides compatibility for projects +that use C++20 or higher, without modules, that have not been updated to turn +off scanning, e.g., via the :variable:`CMAKE_CXX_SCAN_FOR_MODULES` variable. +See the :manual:`cmake-cxxmodules(7)` manual for more details on C++ module +support. + +The ``OLD`` behavior for this policy is to assume that C++ 20 and newer +sources do not import modules. The ``NEW`` behavior for this policy is to +assume that C++ 20 and newer files may import modules, 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. + +.. include:: DEPRECATED.txt diff --git a/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst b/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst index 31c3cc0f74b..4a9cb02c572 100644 --- a/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst +++ b/Help/prop_gbl/XCODE_EMIT_EFFECTIVE_PLATFORM_NAME.rst @@ -15,8 +15,8 @@ generator emits the ``EFFECTIVE_PLATFORM_NAME`` variable: - If set to ``ON`` it will always be emitted - If set to ``OFF`` it will never be emitted - If unset (the default) it will only be emitted when the project was - configured for an embedded Xcode SDK like iOS, tvOS, watchOS or any - of the simulators. + configured for an embedded Xcode SDK like iOS, tvOS, visionOS, watchOS + or any of the simulators. .. note:: diff --git a/Help/prop_sf/CXX_SCAN_FOR_MODULES.rst b/Help/prop_sf/CXX_SCAN_FOR_MODULES.rst index 5b704dccbdd..d10969a0431 100644 --- a/Help/prop_sf/CXX_SCAN_FOR_MODULES.rst +++ b/Help/prop_sf/CXX_SCAN_FOR_MODULES.rst @@ -1,7 +1,7 @@ CXX_SCAN_FOR_MODULES -------------------- -.. versionadded:: 3.26 +.. versionadded:: 3.28 ``CXX_SCAN_FOR_MODULES`` is a boolean specifying whether CMake will scan the source for C++ module dependencies. See also the @@ -16,8 +16,3 @@ consulted. Note that scanning is only performed if C++20 or higher is enabled for the target and the source uses the ``CXX`` language. Scanning for modules in sources belonging to file sets of type ``CXX_MODULES`` is always performed. - -.. note :: - - This setting is meaningful only when experimental support for C++ modules - has been enabled by the ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` gate. diff --git a/Help/prop_test/GENERATED_RESOURCE_SPEC_FILE.rst b/Help/prop_test/GENERATED_RESOURCE_SPEC_FILE.rst new file mode 100644 index 00000000000..89596acb6f6 --- /dev/null +++ b/Help/prop_test/GENERATED_RESOURCE_SPEC_FILE.rst @@ -0,0 +1,7 @@ +GENERATED_RESOURCE_SPEC_FILE +---------------------------- + +.. versionadded:: 3.28 + +Path to the :ref:`dynamically-generated resource spec file +` generated by this test. diff --git a/Help/prop_tgt/COMPATIBLE_INTERFACE_NUMBER_MIN.rst b/Help/prop_tgt/COMPATIBLE_INTERFACE_NUMBER_MIN.rst index 294e38ae8ba..9255d8eb61a 100644 --- a/Help/prop_tgt/COMPATIBLE_INTERFACE_NUMBER_MIN.rst +++ b/Help/prop_tgt/COMPATIBLE_INTERFACE_NUMBER_MIN.rst @@ -1,7 +1,7 @@ COMPATIBLE_INTERFACE_NUMBER_MIN ------------------------------- -将使用来自链接接口的最小值的属性。 +Properties whose minimum value from the link interface will be used. The ``COMPATIBLE_INTERFACE_NUMBER_MIN`` property may contain a list of properties for this target whose minimum value may be read at generate diff --git a/Help/prop_tgt/CXX_MODULE_DIRS.rst b/Help/prop_tgt/CXX_MODULE_DIRS.rst index a32b5b178ac..6c5dd3a4986 100644 --- a/Help/prop_tgt/CXX_MODULE_DIRS.rst +++ b/Help/prop_tgt/CXX_MODULE_DIRS.rst @@ -1,11 +1,7 @@ CXX_MODULE_DIRS --------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Semicolon-separated list of base directories of the target's default C++ module set (i.e. the file set with name and type ``CXX_MODULES``). The diff --git a/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst b/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst index 91909910500..8b6e4dd20e3 100644 --- a/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst +++ b/Help/prop_tgt/CXX_MODULE_DIRS_NAME.rst @@ -1,11 +1,7 @@ CXX_MODULE_DIRS_ ---------------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Semicolon-separated list of base directories of the target's ```` C++ module set, which has the set type ``CXX_MODULES``. The property supports diff --git a/Help/prop_tgt/CXX_MODULE_SET.rst b/Help/prop_tgt/CXX_MODULE_SET.rst index f5cd8b2c26b..851de86ebee 100644 --- a/Help/prop_tgt/CXX_MODULE_SET.rst +++ b/Help/prop_tgt/CXX_MODULE_SET.rst @@ -1,11 +1,7 @@ CXX_MODULE_SET -------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Semicolon-separated list of files in the target's default C++ module set, (i.e. the file set with name and type ``CXX_MODULES``). If any of the paths diff --git a/Help/prop_tgt/CXX_MODULE_SETS.rst b/Help/prop_tgt/CXX_MODULE_SETS.rst index 0e8945ad09c..21650271864 100644 --- a/Help/prop_tgt/CXX_MODULE_SETS.rst +++ b/Help/prop_tgt/CXX_MODULE_SETS.rst @@ -1,11 +1,7 @@ CXX_MODULE_SETS --------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Read-only list of the target's ``PRIVATE`` and ``PUBLIC`` C++ module sets (i.e. all file sets with the type ``CXX_MODULES``). Files listed in these file sets diff --git a/Help/prop_tgt/CXX_MODULE_SET_NAME.rst b/Help/prop_tgt/CXX_MODULE_SET_NAME.rst index 5674c99809c..e73e28ae98a 100644 --- a/Help/prop_tgt/CXX_MODULE_SET_NAME.rst +++ b/Help/prop_tgt/CXX_MODULE_SET_NAME.rst @@ -1,11 +1,7 @@ CXX_MODULE_SET_ --------------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Semicolon-separated list of files in the target's ```` C++ module set, which has the set type ``CXX_MODULES``. If any of the paths are relative, they diff --git a/Help/prop_tgt/CXX_SCAN_FOR_MODULES.rst b/Help/prop_tgt/CXX_SCAN_FOR_MODULES.rst index 93a1b73dbbf..791914e316b 100644 --- a/Help/prop_tgt/CXX_SCAN_FOR_MODULES.rst +++ b/Help/prop_tgt/CXX_SCAN_FOR_MODULES.rst @@ -1,7 +1,7 @@ CXX_SCAN_FOR_MODULES -------------------- -.. versionadded:: 3.26 +.. versionadded:: 3.28 ``CXX_SCAN_FOR_MODULES`` is a boolean specifying whether CMake will scan C++ sources in the target for module dependencies. See also the @@ -20,8 +20,3 @@ scan the target's ``CXX`` sources at build time. Note that scanning is only performed if C++20 or higher is enabled for the target. Scanning for modules in the target's sources belonging to file sets of type ``CXX_MODULES`` is always performed. - -.. note :: - - This setting is meaningful only when experimental support for C++ modules - has been enabled by the ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` gate. diff --git a/Help/prop_tgt/DLL_NAME_WITH_SOVERSION.rst b/Help/prop_tgt/DLL_NAME_WITH_SOVERSION.rst index 59ef00f0a1e..c86b218eb0e 100644 --- a/Help/prop_tgt/DLL_NAME_WITH_SOVERSION.rst +++ b/Help/prop_tgt/DLL_NAME_WITH_SOVERSION.rst @@ -3,8 +3,8 @@ DLL_NAME_WITH_SOVERSION .. versionadded:: 3.27 -This property control whether the :prop_tgt:`SOVERSION` target -property are added to the filename of generated DLL filenames +This property controls whether the :prop_tgt:`SOVERSION` target +property is added to the filename of generated DLL filenames for the Windows platform, which is selected when the :variable:`WIN32` variable is set. diff --git a/Help/prop_tgt/HIP_ARCHITECTURES.rst b/Help/prop_tgt/HIP_ARCHITECTURES.rst index 06f956b18e6..58a813d52f1 100644 --- a/Help/prop_tgt/HIP_ARCHITECTURES.rst +++ b/Help/prop_tgt/HIP_ARCHITECTURES.rst @@ -3,7 +3,8 @@ HIP_ARCHITECTURES .. versionadded:: 3.21 -List of AMD GPU architectures to generate device code for. +List of GPU architectures to for which to generate device code. +Architecture names are interpreted based on :variable:`CMAKE_HIP_PLATFORM`. A non-empty false value (e.g. ``OFF``) disables adding architectures. This is intended to support packagers and rare cases where full control diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS.rst new file mode 100644 index 00000000000..b0681914d41 --- /dev/null +++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS.rst @@ -0,0 +1,10 @@ +IMPORTED_CXX_MODULES_COMPILE_DEFINITIONS +---------------------------------------- + +.. versionadded:: 3.28 + +Preprocessor definitions for compiling an ``IMPORTED`` target's C++ module +sources. + +CMake will automatically drop some definitions that are not supported +by the native build tool. diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_FEATURES.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_FEATURES.rst new file mode 100644 index 00000000000..cea359f5b09 --- /dev/null +++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_FEATURES.rst @@ -0,0 +1,9 @@ +IMPORTED_CXX_MODULES_COMPILE_FEATURES +------------------------------------- + +.. versionadded:: 3.28 + +Compiler features enabled for this ``IMPORTED`` target's C++ modules. + +The value of this property is used by the generators to set the include +paths for the compiler. diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst new file mode 100644 index 00000000000..cf7bc5b238c --- /dev/null +++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst @@ -0,0 +1,9 @@ +IMPORTED_CXX_MODULES_COMPILE_OPTIONS +------------------------------------ + +.. versionadded:: 3.28 + +List of options to pass to the compiler for this ``IMPORTED`` target's C++ +modules. + +.. include:: ../command/OPTIONS_SHELL.txt diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES.rst new file mode 100644 index 00000000000..46d74ea27fc --- /dev/null +++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES.rst @@ -0,0 +1,10 @@ +IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES +---------------------------------------- + +.. versionadded:: 3.28 + +List of preprocessor include file search directories when compiling C++ +modules for ``IMPORTED`` targets. + +The value of this property is used by the generators to set the include +paths for the compiler. diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_LINK_LIBRARIES.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_LINK_LIBRARIES.rst new file mode 100644 index 00000000000..ff5cec87364 --- /dev/null +++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_LINK_LIBRARIES.rst @@ -0,0 +1,7 @@ +IMPORTED_CXX_MODULES_LINK_LIBRARIES +----------------------------------- + +.. versionadded:: 3.28 + +List of direct dependencies to use for usage requirements for C++ modules in +the target's C++ modules. diff --git a/Help/prop_tgt/IMPORTED_IMPLIB.rst b/Help/prop_tgt/IMPORTED_IMPLIB.rst index e67acbaa546..27601d2efec 100644 --- a/Help/prop_tgt/IMPORTED_IMPLIB.rst +++ b/Help/prop_tgt/IMPORTED_IMPLIB.rst @@ -11,6 +11,12 @@ This property may be set: * On macOS, to an import file (e.g. ``.tbd``) created for shared libraries (see the :prop_tgt:`ENABLE_EXPORTS` target property). For frameworks this is the location of the ``.tbd`` file symlink just inside the framework folder. +* .. versionadded:: 3.28 + On non-DLL platforms, to the location of a shared library. + When set without also specifying an :prop_tgt:`IMPORTED_LOCATION`, + the library is considered to be a stub, and its location will not + be added as a runtime search path to dependents that link it. + The ``IMPORTED_IMPLIB`` target property may be overridden for a given configuration ```` by the configuration-specific diff --git a/Help/prop_tgt/IMPORTED_LOCATION.rst b/Help/prop_tgt/IMPORTED_LOCATION.rst index a7207d845be..915085b0f6c 100644 --- a/Help/prop_tgt/IMPORTED_LOCATION.rst +++ b/Help/prop_tgt/IMPORTED_LOCATION.rst @@ -15,6 +15,17 @@ is the location of the ``.dll`` part of the library. For ``UNKNOWN`` libraries this is the location of the file to be linked. Ignored for non-imported targets. +.. versionadded:: 3.28 + + For frameworks on macOS, this may be the location of the framework folder + itself. + +.. versionadded:: 3.28 + + This may be the location of a ``.xcframework`` folder on macOS. If it is, + any target that links against it will get the selected library's ``Headers`` + directory as a usage requirement. + The ``IMPORTED_LOCATION`` target property may be overridden for a given configuration ```` by the configuration-specific :prop_tgt:`IMPORTED_LOCATION_` target property. Furthermore, diff --git a/Help/prop_tgt/IMPORTED_OBJECTS.rst b/Help/prop_tgt/IMPORTED_OBJECTS.rst index d71c2199952..9aacea7454b 100644 --- a/Help/prop_tgt/IMPORTED_OBJECTS.rst +++ b/Help/prop_tgt/IMPORTED_OBJECTS.rst @@ -31,7 +31,7 @@ once per architecture for each source file. Unlike the other generators, it does not generate universal object file binaries. A further complication with the :generator:`Xcode` generator is that when -targeting device platforms (iOS, tvOS or watchOS), the :generator:`Xcode` +targeting device platforms (iOS, tvOS, visionOS or watchOS), the :generator:`Xcode` generator has the ability to use either the device or simulator SDK without needing CMake to be re-run. The SDK can be selected at build time. But since some architectures can be supported by both the device and the diff --git a/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst b/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst index c7ed46d6984..fd6e34bb043 100644 --- a/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst +++ b/Help/prop_tgt/INTERFACE_CXX_MODULE_SETS.rst @@ -1,11 +1,7 @@ INTERFACE_CXX_MODULE_SETS ------------------------- -.. versionadded:: 3.25 - -.. note :: - - Experimental. Gated by ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` +.. versionadded:: 3.28 Read-only list of the target's ``PUBLIC`` C++ module sets (i.e. all file sets with the type ``CXX_MODULES``). Files listed in these C++ module sets can be diff --git a/Help/prop_tgt/IOS_INSTALL_COMBINED.rst b/Help/prop_tgt/IOS_INSTALL_COMBINED.rst index 92d60dcf705..c296691e0b1 100644 --- a/Help/prop_tgt/IOS_INSTALL_COMBINED.rst +++ b/Help/prop_tgt/IOS_INSTALL_COMBINED.rst @@ -2,18 +2,27 @@ IOS_INSTALL_COMBINED -------------------- .. versionadded:: 3.5 +.. deprecated:: 3.28 + + :prop_tgt:`IOS_INSTALL_COMBINED` was designed to make universal binaries + containing iOS/arm* device code paired with iOS Simulator/x86_64 code + (or similar for other Apple embedded platforms). Universal binaries can only + differentiate code based on CPU type, so this only made sense before the + days of arm64 macOS machines (i.e. iOS Simulator/arm64). Apple now + recommends xcframeworks, which contain multiple binaries for different + platforms, for this use case. Build a combined (device and simulator) target when installing. -When this property is set to set to false (which is the default) then it will +When this property is set to false, which is the default, then it will either be built with the device SDK or the simulator SDK depending on the SDK set. But if this property is set to true then the target will at install time -also be built for the corresponding SDK and combined into one library. +also be built for the other SDK and combined into one library. .. note:: - If a selected architecture is available for both: device SDK and simulator + If a selected architecture is available for both device SDK and simulator SDK it will be built for the SDK selected by :variable:`CMAKE_OSX_SYSROOT` - and removed from the corresponding SDK. + and removed from the other SDK. This feature requires at least Xcode version 6. diff --git a/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst b/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst index afc6b312536..d1d80a86e58 100644 --- a/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst +++ b/Help/prop_tgt/Swift_LANGUAGE_VERSION.rst @@ -4,5 +4,6 @@ Swift_LANGUAGE_VERSION .. versionadded:: 3.16 This property sets the language version for the Swift sources in the target. If -one is not specified, it will default to ```` if -specified, otherwise it is the latest version supported by the compiler. +one is not specified, it will default to +:variable:`CMAKE_Swift_LANGUAGE_VERSION` if specified, otherwise it is the +latest version supported by the compiler. diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst index 5bf47a38a9b..8c136f24cb0 100644 --- a/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst +++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_COMMAND` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst index 4b9dff71555..2656826aa52 100644 --- a/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst +++ b/Help/prop_tgt/VS_DEBUGGER_COMMAND_ARGUMENTS.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_COMMAND_ARGUMENTS` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst index 8373dbb5c8b..d78d594ef3a 100644 --- a/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst +++ b/Help/prop_tgt/VS_DEBUGGER_ENVIRONMENT.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_ENVIRONMENT` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst index 39420475bd5..1026dfae8ac 100644 --- a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst +++ b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst @@ -11,5 +11,5 @@ project file. This property is initialized by the value of the variable :variable:`CMAKE_VS_DEBUGGER_WORKING_DIRECTORY` if it is set when a target is created. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. diff --git a/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst b/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst index 8a85ba489e8..eeb7ddad2cf 100644 --- a/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst +++ b/Help/prop_tgt/VS_DOTNET_STARTUP_OBJECT.rst @@ -12,7 +12,7 @@ If the property is unset, Visual Studio uses the first matching than one ``Main()`` method is available in the current project, the property becomes mandatory for building the project. -This property only works for Visual Studio 11 2012 and above; +This property only works for Visual Studio 12 2013 and above; it is ignored on other generators. .. code-block:: cmake diff --git a/Help/prop_tgt/VS_KEYWORD.rst b/Help/prop_tgt/VS_KEYWORD.rst index 221b986ac32..f04d1091b26 100644 --- a/Help/prop_tgt/VS_KEYWORD.rst +++ b/Help/prop_tgt/VS_KEYWORD.rst @@ -7,4 +7,4 @@ Can be set to change the visual studio keyword, for example Qt integration works better if this is set to Qt4VSv1.0. Use the :prop_tgt:`VS_GLOBAL_KEYWORD` target property to set the -keyword for Visual Studio 11 (2012) and newer. +keyword for Visual Studio 12 (2013) and newer. diff --git a/Help/prop_tgt/XCODE_EMBED_type.rst b/Help/prop_tgt/XCODE_EMBED_type.rst index da744c2e106..76b0e3dcc7b 100644 --- a/Help/prop_tgt/XCODE_EMBED_type.rst +++ b/Help/prop_tgt/XCODE_EMBED_type.rst @@ -37,6 +37,12 @@ The supported values for ```` are: The specified items will be added to the ``Embed PlugIns`` build phase. They must be CMake target names. +``RESOURCES`` + .. versionadded:: 3.28 + + The specified items will be added to the ``Embed Resources`` build phase. + They must be CMake target names. + See also :prop_tgt:`XCODE_EMBED__PATH`, :prop_tgt:`XCODE_EMBED__REMOVE_HEADERS_ON_COPY` and :prop_tgt:`XCODE_EMBED__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 5a5c65f30f5..ef04d14e61c 100644 --- a/Help/prop_tgt/XCODE_EMBED_type_PATH.rst +++ b/Help/prop_tgt/XCODE_EMBED_type_PATH.rst @@ -22,3 +22,6 @@ The supported values for ```` are: ``PLUGINS`` .. versionadded:: 3.23 + +``RESOURCES`` + .. versionadded:: 3.28 diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst index 8a9738c84d2..5fedf7d2a58 100644 --- a/Help/release/3.14.rst +++ b/Help/release/3.14.rst @@ -63,7 +63,8 @@ File-Based API Platforms --------- -* CMake now supports :ref:`Cross Compiling for iOS, tvOS, or watchOS` +* CMake now supports + :ref:`Cross Compiling for iOS, tvOS, or watchOS ` using simple toolchain files. Command-Line diff --git a/Help/release/3.28.rst b/Help/release/3.28.rst new file mode 100644 index 00000000000..200c0a30c15 --- /dev/null +++ b/Help/release/3.28.rst @@ -0,0 +1,203 @@ +CMake 3.28 Release Notes +************************ + +.. only:: html + + .. contents:: + +Changes made since CMake 3.27 include the following. + +New Features +============ + +Languages +--------- + +* C++ 20 named modules are now supported by :ref:`Ninja Generators` + and :ref:`Visual Studio Generators` for VS 2022 and newer, in combination + with the MSVC 14.34 toolset (provided with VS 17.4) and newer, LLVM/Clang + 16.0 and newer, and GCC 14 (after the 2023-09-20 daily bump) and newer. + See :manual:`cmake-cxxmodules(7)` for details. + +* ``HIP`` language code may now be compiled for NVIDIA GPUs + using the NVIDIA CUDA Compiler (NVCC). + See the :variable:`CMAKE_HIP_PLATFORM` variable. + +Platforms +--------- + +* On Apple platforms, ``.xcframework`` folders are now supported: + + * The :command:`find_library` command now finds ``.xcframework`` folders. + + * The :command:`target_link_libraries` command now supports + linking against a ``.xcframework`` folder. + + * The :prop_tgt:`IMPORTED_LOCATION` target property of an imported + library target may now be the path to a ``.xcframework`` folder. + +* Apple visionOS and its ``xros`` and ``xrsimulator`` SDKs are now supported. + Compiling for Apple visionOS can be requested by setting + :variable:`CMAKE_SYSTEM_NAME` to ``visionOS``. + See :ref:`Cross Compiling for iOS, tvOS, visionOS, or watchOS` + for more information. + +Presets +------- + +* :manual:`cmake-presets(7)` files now support schema version ``8``. + It adds support for a ``$schema`` field. + +Compilers +--------- + +* Cray Clang-based compilers are now supported with + :variable:`compiler id _COMPILER_ID>` ``CrayClang``. + +* The OrangeC compiler is now supported with + :variable:`compiler id _COMPILER_ID>` ``OrangeC``. + +Commands +-------- + +* The :command:`add_custom_command` and :command:`add_custom_target` + commands gained a ``JOB_SERVER_AWARE`` option. + +* The :command:`cmake_host_system_information` command gained a + ``MSYSTEM_PREFIX`` query for the installation prefix of a MSYS + or MinGW development environment on Windows hosts. + +* The :command:`set_property` command ``TEST`` mode gained a ``DIRECTORY`` + option to set properties on tests in other directories. + +* The :command:`set_tests_properties` command gained a ``DIRECTORY`` + option to set properties on tests in other directories. + +* The :command:`get_property` command ``TEST`` mode gained a ``DIRECTORY`` + option to get properties on tests in other directories. + +* The :command:`get_test_property` command gained a ``DIRECTORY`` + option to get properties on tests in other directories. + +Variables +--------- + +* The :envvar:`CMAKE_CROSSCOMPILING_EMULATOR` environment variable + was added to initialize the :variable:`CMAKE_CROSSCOMPILING_EMULATOR` + cache variable. + +* The :variable:`CMAKE_HIP_PLATFORM` variable was added to specify + the GPU platform for which HIP language sources are to be compiled + (``amd`` or ``nvidia``). + +Properties +---------- + +* On imported shared libraries, the :prop_tgt:`IMPORTED_IMPLIB` target + property may now be used without :prop_tgt:`IMPORTED_LOCATION`. + This can be used to represent a stub library whose location should not + be added as a runtime search path to dependents that link it. + +* The :prop_tgt:`IMPORTED_LOCATION` property of a macOS framework + may now be a path to the ``.framework`` folder itself. + +* The :prop_tgt:`XCODE_EMBED_RESOURCES >` target property + was added to tell the :generator:`Xcode` generator what targets to put in + the ``Embed Resources`` build phase. + +Modules +------- + +* The :module:`ExternalProject` module now includes the + ``BUILD_JOB_SERVER_AWARE`` option for the + :command:`ExternalProject_Add` command. This option enables + the integration of the GNU Make job server when using an + explicit ``BUILD_COMMAND`` with certain :ref:`Makefile Generators`. + Additionally, the :command:`ExternalProject_Add_Step` command + has been updated to support the new ``JOB_SERVER_AWARE`` option. + +* The :module:`ExternalProject` module now declares ``BYPRODUCTS`` for the + downloaded file for generated ``download`` steps. Previously, if multiple + external projects downloaded to the same file, hash verification could fail. + Now, when using the :ref:`Ninja Generators`, this scenario is detected and + Ninja will raise an error stating that multiple rules generate the same file. + +* The :module:`FetchContent` module's :command:`FetchContent_Declare` command + gained an ``EXCLUDE_FROM_ALL`` option, which propagates through to the + :command:`add_subdirectory` call made by + :command:`FetchContent_MakeAvailable` for the dependency. + +* The :module:`FindCURL` module gained a ``CURL_USE_STATIC_LIBS`` hint + to select static libraries. + +* The :module:`FindEXPAT` module gained an ``EXPAT_USE_STATIC_LIBS`` hint + to select static libraries. + +* The :module:`FindPkgConfig` module :command:`pkg_get_variable` command + gained a ``DEFINE_VARIABLES`` option to pass variables to ``pkg-config``. + +Generator Expressions +--------------------- + +* The :manual:`generator expressions ` + :genex:`$`, :genex:`$`, and :genex:`$` + short-circuit to avoid unnecessary evaluation of parameters. + +CTest +----- + +* CTest may now take a :ref:`dynamically-generated resource spec file + `, which can be specified by the + :prop_test:`GENERATED_RESOURCE_SPEC_FILE` test property. + +Deprecated and Removed Features +=============================== + +* The :command:`exec_program` command, which has been deprecated + since CMake 3.0, has been removed by policy :policy:`CMP0153`. + Use the :command:`execute_process` command instead. + +* The :generator:`Visual Studio 11 2012` generator has been removed. + +* The :generator:`Visual Studio 12 2013` generator is now deprecated + and will be removed in a future version of CMake. + +* The :prop_tgt:`IOS_INSTALL_COMBINED` target property and corresponding + :variable:`CMAKE_IOS_INSTALL_COMBINED` variable have been deprecated. + Their functionality does not make sense on Apple Silicon hosts. + +* The :generator:`Xcode` generator will now issue a fatal error if + the Legacy Build System has been selected for Xcode 14 and + newer. Those Xcode versions dropped support for the Legacy Build + System and expect the project to be set-up for their current + Build System. + +Other Changes +============= + +* Generated files, in targets using :ref:`file sets`, are now considered + private by default. Generated public headers must be specified using + file sets. This allows :ref:`Ninja Generators` to produce more + efficient build graphs. See policy :policy:`CMP0154`. + +* The :command:`find_library`, :command:`find_path`, and :command:`find_file` + commands no longer search in installation prefixes derived from the ``PATH`` + environment variable. This behavior was added in CMake 3.3 to support + MSYS and MinGW (``MSYSTEM``) development environments on Windows, but + it can search undesired prefixes that happen to be in the ``PATH`` for + unrelated reasons. Users who keep some ``/bin`` directories in + the ``PATH`` just for their tools do not necessarily want any corresponding + ``/lib`` or ``/include`` directories searched. + The behavior was reverted for non-Windows platforms by CMake 3.6. + Now it has been reverted on Windows platforms too. + + One may set the ``CMAKE_PREFIX_PATH`` environment variable with a + :ref:`semicolon-separated list ` of prefixes + that are to be searched. + +* When using MinGW tools in a ``MSYSTEM`` environment on Windows, + the ``$MSYSTEM_PREFIX/local`` and ``$MSYSTEM_PREFIX`` prefixes are + now added to :variable:`CMAKE_SYSTEM_PREFIX_PATH`. + +* The precompiled Linux ``x86_64`` binaries provided on + `cmake.org `_ now require GLIBC 2.17 or higher. diff --git a/Help/release/index.rst b/Help/release/index.rst index b598a1acdc7..9c3f73a10bd 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -13,6 +13,7 @@ Releases .. toctree:: :maxdepth: 1 + 3.28 <3.28> 3.27 <3.27> 3.26 <3.26> 3.25 <3.25> diff --git a/Help/variable/APPLE.rst b/Help/variable/APPLE.rst index 810d5fc3a33..e79939753b2 100644 --- a/Help/variable/APPLE.rst +++ b/Help/variable/APPLE.rst @@ -2,4 +2,4 @@ APPLE ----- Set to ``True`` when the target system is an Apple platform -(macOS, iOS, tvOS or watchOS). +(macOS, iOS, tvOS, visionOS or watchOS). diff --git a/Help/variable/CMAKE_CFG_INTDIR.rst b/Help/variable/CMAKE_CFG_INTDIR.rst index 3a57659c05e..3045d914a78 100644 --- a/Help/variable/CMAKE_CFG_INTDIR.rst +++ b/Help/variable/CMAKE_CFG_INTDIR.rst @@ -19,7 +19,7 @@ Example values: :: $(ConfigurationName) = Visual Studio 9 - $(Configuration) = Visual Studio 11 and above + $(Configuration) = Visual Studio 12 and above $(CONFIGURATION) = Xcode . = Make-based tools . = Ninja diff --git a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst index e21b35d619c..1c3a26c1865 100644 --- a/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst +++ b/Help/variable/CMAKE_CROSSCOMPILING_EMULATOR.rst @@ -12,6 +12,10 @@ for the target system. Lists>`, then the first value is the command and remaining values are its arguments. +.. versionadded:: 3.28 + This variable can be initialized via an + :envvar:`CMAKE_CROSSCOMPILING_EMULATOR` environment variable. + The command will be used to run :command:`try_run` generated executables, which avoids manual population of the ``TryRunResults.cmake`` file. diff --git a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst index 9817b1a1207..498e2e5a39a 100644 --- a/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst +++ b/Help/variable/CMAKE_CUDA_HOST_COMPILER.rst @@ -3,27 +3,6 @@ CMAKE_CUDA_HOST_COMPILER .. versionadded:: 3.10 -When :variable:`CMAKE_CUDA_COMPILER_ID _COMPILER_ID>` is -``NVIDIA``, ``CMAKE_CUDA_HOST_COMPILER`` selects the compiler executable to use -when compiling host code for ``CUDA`` language files. -This maps to the ``nvcc -ccbin`` option. - -The ``CMAKE_CUDA_HOST_COMPILER`` variable may be set explicitly before CUDA is -first enabled by a :command:`project` or :command:`enable_language` command. -This can be done via ``-DCMAKE_CUDA_HOST_COMPILER=...`` on the command line -or in a :ref:`toolchain file `. Or, one may set -the :envvar:`CUDAHOSTCXX` environment variable to provide a default value. - -Once the CUDA language is enabled, the ``CMAKE_CUDA_HOST_COMPILER`` variable -is read-only and changes to it are undefined behavior. - -.. note:: - - Since ``CMAKE_CUDA_HOST_COMPILER`` is meaningful only when the - :variable:`CMAKE_CUDA_COMPILER_ID _COMPILER_ID>` is ``NVIDIA``, - it does not make sense to set ``CMAKE_CUDA_HOST_COMPILER`` without also - setting ``CMAKE_CUDA_COMPILER`` to NVCC. - -.. note:: - - Ignored when using :ref:`Visual Studio Generators`. +This is the original CUDA-specific name for the more general +:variable:`CMAKE__HOST_COMPILER` variable. See the latter +for details. diff --git a/Help/variable/CMAKE_CXX_SCAN_FOR_MODULES.rst b/Help/variable/CMAKE_CXX_SCAN_FOR_MODULES.rst index a40bf7524a7..28601babd27 100644 --- a/Help/variable/CMAKE_CXX_SCAN_FOR_MODULES.rst +++ b/Help/variable/CMAKE_CXX_SCAN_FOR_MODULES.rst @@ -1,15 +1,10 @@ CMAKE_CXX_SCAN_FOR_MODULES -------------------------- -.. versionadded:: 3.26 +.. versionadded:: 3.28 Whether to scan C++ source files for module dependencies. This variable is used to initialize the :prop_tgt:`CXX_SCAN_FOR_MODULES` property on all the targets. See that target property for additional information. - -.. note :: - - This setting is meaningful only when experimental support for C++ modules - has been enabled by the ``CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API`` gate. diff --git a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst index a7e9029dc4f..2e7f7c4370d 100644 --- a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst +++ b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst @@ -15,7 +15,8 @@ form. The format of the JSON file looks like: { "directory": "/home/user/development/project", "command": "/usr/bin/c++ ... -c ../foo/foo.cc", - "file": "../foo/foo.cc" + "file": "../foo/foo.cc", + "output": "../foo.dir/foo.cc.o" }, ... @@ -23,7 +24,8 @@ form. The format of the JSON file looks like: { "directory": "/home/user/development/project", "command": "/usr/bin/c++ ... -c ../foo/bar.cc", - "file": "../foo/bar.cc" + "file": "../foo/bar.cc", + "output": "../foo.dir/bar.cc.o" } ] diff --git a/Help/variable/CMAKE_HIP_ARCHITECTURES.rst b/Help/variable/CMAKE_HIP_ARCHITECTURES.rst index bcc6b35cddb..3f179831efe 100644 --- a/Help/variable/CMAKE_HIP_ARCHITECTURES.rst +++ b/Help/variable/CMAKE_HIP_ARCHITECTURES.rst @@ -3,10 +3,14 @@ CMAKE_HIP_ARCHITECTURES .. versionadded:: 3.21 -Default value for :prop_tgt:`HIP_ARCHITECTURES` property of targets. +List of GPU architectures to for which to generate device code. +Architecture names are interpreted based on :variable:`CMAKE_HIP_PLATFORM`. -This is initialized to the architectures reported by ``rocm_agent_enumerator``, -if available, and otherwise to the default chosen by the compiler. +This is initialized based on the value of :variable:`CMAKE_HIP_PLATFORM`: + +``amd`` + Uses architectures reported by ``rocm_agent_enumerator``, if available, + and otherwise to a default chosen by the compiler. This variable is used to initialize the :prop_tgt:`HIP_ARCHITECTURES` property on all targets. See the target property for additional information. diff --git a/Help/variable/CMAKE_HIP_PLATFORM.rst b/Help/variable/CMAKE_HIP_PLATFORM.rst new file mode 100644 index 00000000000..5e3a2b7d5f6 --- /dev/null +++ b/Help/variable/CMAKE_HIP_PLATFORM.rst @@ -0,0 +1,22 @@ +CMAKE_HIP_PLATFORM +------------------ + +.. versionadded:: 3.28 + +GPU platform for which HIP language sources are to be compiled. + +The value must be one of: + +``amd`` + AMD GPUs + +``nvidia`` + NVIDIA GPUs + +If not specified, a default is computed via ``hipconfig --platform``. + +:variable:`CMAKE_HIP_ARCHITECTURES` entries are interpreted with +as architectures of the GPU platform. + +:variable:`CMAKE_HIP_COMPILER _COMPILER>` must target +the same GPU platform. diff --git a/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst b/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst index cd7fd8dcea2..0024ba94302 100644 --- a/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst +++ b/Help/variable/CMAKE_IOS_INSTALL_COMBINED.rst @@ -2,6 +2,9 @@ CMAKE_IOS_INSTALL_COMBINED -------------------------- .. versionadded:: 3.5 +.. deprecated:: 3.28 + + This is deprecated because :prop_tgt:`IOS_INSTALL_COMBINED` is deprecated. Default value for :prop_tgt:`IOS_INSTALL_COMBINED` of targets. diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst index 5eb86c603e7..6893eea6d54 100644 --- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst +++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst @@ -18,6 +18,7 @@ Value Name ``CCur`` Concurrent Fortran ``Clang`` `LLVM Clang`_ ``Cray`` Cray Compiler +``CrayClang`` Cray Clang-based Compiler ``Embarcadero``, ``Borland`` `Embarcadero`_ ``Flang`` `Classic Flang Fortran Compiler`_ ``LLVMFlang`` `LLVM Flang Fortran Compiler`_ @@ -34,6 +35,7 @@ Value Name ``MSVC`` `Microsoft Visual Studio`_ ``NVHPC`` `NVIDIA HPC Compiler`_ ``NVIDIA`` `NVIDIA CUDA Compiler`_ +``OrangeC`` `OrangeC Compiler`_ ``OpenWatcom`` `Open Watcom`_ ``PGI`` The Portland Group ``PathScale`` PathScale @@ -62,6 +64,7 @@ languages. .. _NVIDIA HPC Compiler: https://developer.nvidia.com/hpc-compilers .. _NVIDIA CUDA Compiler: https://developer.nvidia.com/cuda-llvm-compiler .. _Open Watcom: https://open-watcom.github.io +.. _OrangeC Compiler: https://github.com/LADSoft/OrangeC .. _Small Device C Compiler: https://sdcc.sourceforge.net .. _Tiny C Compiler: https://bellard.org/tcc .. _Tasking Compiler Toolsets: https://www.tasking.com diff --git a/Help/variable/CMAKE_LANG_HOST_COMPILER.rst b/Help/variable/CMAKE_LANG_HOST_COMPILER.rst new file mode 100644 index 00000000000..cf3ba62a3cd --- /dev/null +++ b/Help/variable/CMAKE_LANG_HOST_COMPILER.rst @@ -0,0 +1,44 @@ +CMAKE__HOST_COMPILER +-------------------------- + +.. versionadded:: 3.10 + ``CMAKE_CUDA_HOST_COMPILER`` + +.. versionadded:: 3.28 + ``CMAKE_HIP_HOST_COMPILER`` + +This variable is available when ```` is ``CUDA`` or ``HIP``. + +When :variable:`CMAKE__COMPILER_ID` is +``NVIDIA``, ``CMAKE__HOST_COMPILER`` selects the compiler executable +to use when compiling host code for ``CUDA`` or ``HIP`` language files. +This maps to the ``nvcc -ccbin`` option. + +The ``CMAKE__HOST_COMPILER`` variable may be set explicitly before CUDA +or HIP is first enabled by a :command:`project` or :command:`enable_language` +command. +This can be done via ``-DCMAKE__HOST_COMPILER=...`` on the command line +or in a :ref:`toolchain file `. Or, one may set +the :envvar:`CUDAHOSTCXX` or :envvar:`HIPHOSTCXX` environment variable to +provide a default value. + +Once the CUDA or HIP language is enabled, the ``CMAKE__HOST_COMPILER`` +variable is read-only and changes to it are undefined behavior. + +.. note:: + + Since ``CMAKE__HOST_COMPILER`` is meaningful only when the + :variable:`CMAKE__COMPILER_ID` is ``NVIDIA``, + it does not make sense to set ``CMAKE__HOST_COMPILER`` without also + setting ``CMAKE__COMPILER`` to NVCC. + +.. note:: + + Projects should not try to set ``CMAKE__HOST_COMPILER`` to match + :variable:`CMAKE_CXX_COMPILER _COMPILER>` themselves. + It is the end-user's responsibility, not the project's, to ensure that + NVCC targets the same ABI as the C++ compiler. + +.. note:: + + Ignored when using :ref:`Visual Studio Generators`. diff --git a/Help/variable/CMAKE_MACOSX_BUNDLE.rst b/Help/variable/CMAKE_MACOSX_BUNDLE.rst index 43ddff517a6..483c5b395f0 100644 --- a/Help/variable/CMAKE_MACOSX_BUNDLE.rst +++ b/Help/variable/CMAKE_MACOSX_BUNDLE.rst @@ -7,4 +7,4 @@ This variable is used to initialize the :prop_tgt:`MACOSX_BUNDLE` property on all the targets. See that target property for additional information. This variable is set to ``ON`` by default if :variable:`CMAKE_SYSTEM_NAME` -equals to :ref:`iOS, tvOS or watchOS `. +equals to :ref:`iOS, tvOS, visionOS or watchOS `. diff --git a/Help/variable/CMAKE_OSX_VARIABLE.txt b/Help/variable/CMAKE_OSX_VARIABLE.txt index 5670980ca4a..962fcd35234 100644 --- a/Help/variable/CMAKE_OSX_VARIABLE.txt +++ b/Help/variable/CMAKE_OSX_VARIABLE.txt @@ -7,6 +7,6 @@ remove it while initializing a cache entry of the same name) unless policy :policy:`CMP0126` is set to ``NEW``. Despite the ``OSX`` part in the variable name(s) they apply also to -other SDKs than macOS like iOS, tvOS, or watchOS. +other SDKs than macOS like iOS, tvOS, visionOS, or watchOS. This variable is ignored on platforms other than Apple. diff --git a/Help/variable/CMAKE_SIZEOF_VOID_P.rst b/Help/variable/CMAKE_SIZEOF_VOID_P.rst index f5464d1d46d..0c1fd7aac99 100644 --- a/Help/variable/CMAKE_SIZEOF_VOID_P.rst +++ b/Help/variable/CMAKE_SIZEOF_VOID_P.rst @@ -4,5 +4,5 @@ CMAKE_SIZEOF_VOID_P Size of a ``void`` pointer. This is set to the size of a pointer on the target machine, and is determined -by a try compile. If a 64-bit size is found, then the library search -path is modified to look for 64-bit libraries first. +when a compiled language is enabled. If a 64-bit size is found, then the +library search path is modified to look for 64-bit libraries first. diff --git a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst index c8b5815e725..8dfcdc5a886 100644 --- a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst +++ b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst @@ -38,6 +38,12 @@ OpenBSD: Unix: * ``ENV{CONDA_PREFIX}`` when using a conda compiler +MSYSTEM environment with MinGW toolchain: + .. versionadded:: 3.28 + + * ``ENV{MSYSTEM_PREFIX}/local`` + * ``ENV{MSYSTEM_PREFIX}`` + Windows: * ``ENV{ProgramW6432}`` * ``ENV{ProgramFiles}`` diff --git a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst index 2bb97c42dd7..155931f8f67 100644 --- a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst +++ b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst @@ -10,5 +10,5 @@ This variable is not defined by other generators even if ``devenv.com`` is installed on the computer. The :variable:`CMAKE_VS_MSBUILD_COMMAND` is also provided for -:generator:`Visual Studio 11 2012` and above. +:generator:`Visual Studio 12 2013` and above. See also the :variable:`CMAKE_MAKE_PROGRAM` variable. diff --git a/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst b/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst index 8a521a3c8cf..96924d59c54 100644 --- a/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst +++ b/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst @@ -1,7 +1,7 @@ CMAKE_VS_MSBUILD_COMMAND ------------------------ -The generators for :generator:`Visual Studio 11 2012` and above set this +The generators for :generator:`Visual Studio 12 2013` and above set this variable to the ``MSBuild.exe`` command installed with the corresponding Visual Studio version. diff --git a/Help/variable/CMAKE_XCODE_BUILD_SYSTEM.rst b/Help/variable/CMAKE_XCODE_BUILD_SYSTEM.rst index d15306172e0..f3c213c361f 100644 --- a/Help/variable/CMAKE_XCODE_BUILD_SYSTEM.rst +++ b/Help/variable/CMAKE_XCODE_BUILD_SYSTEM.rst @@ -12,7 +12,8 @@ mature enough for use by CMake. The possible values are: ``1`` The original Xcode build system. - This is the default when using Xcode 11.x or below. + This is the default when using Xcode 11.x or below and supported + up to Xcode 13.x. ``12`` The Xcode "new build system" introduced by Xcode 10. diff --git a/Help/variable/ENV.rst b/Help/variable/ENV.rst index 6791853bb63..71df3dd0702 100644 --- a/Help/variable/ENV.rst +++ b/Help/variable/ENV.rst @@ -8,6 +8,17 @@ Use the syntax ``$ENV{VAR}`` to read environment variable ``VAR``. To test whether an environment variable is defined, use the signature ``if(DEFINED ENV{})`` of the :command:`if` command. +.. note:: + + Environment variable names containing special characters like parentheses + may need to be escaped. (Policy :policy:`CMP0053` must also be enabled.) + For example, to get the value of the Windows environment variable + ``ProgramFiles(x86)``, use: + + .. code-block:: cmake + + set(ProgramFiles_x86 "$ENV{ProgramFiles\(x86\)}") + For general information on environment variables, see the :ref:`Environment Variables ` section in the :manual:`cmake-language(7)` manual. diff --git a/Modules/CMakeCUDACompilerABI.cu b/Modules/CMakeCUDACompilerABI.cu index 8463e861c08..b04d0ec20f4 100644 --- a/Modules/CMakeCUDACompilerABI.cu +++ b/Modules/CMakeCUDACompilerABI.cu @@ -2,11 +2,8 @@ # error "A C or C++ compiler has been selected for CUDA" #endif -#include - -#include - #include "CMakeCompilerABI.h" +#include "CMakeCompilerCUDAArch.h" int main(int argc, char* argv[]) { @@ -19,25 +16,7 @@ int main(int argc, char* argv[]) #endif static_cast(argv); - int count = 0; - if (cudaGetDeviceCount(&count) != cudaSuccess || count == 0) { - std::fprintf(stderr, "No CUDA devices found.\n"); - return -1; - } - - int found = 0; - const char* sep = ""; - for (int device = 0; device < count; ++device) { - cudaDeviceProp prop; - if (cudaGetDeviceProperties(&prop, device) == cudaSuccess) { - std::printf("%s%d%d", sep, prop.major, prop.minor); - sep = ";"; - found = 1; - } - } - - if (!found) { - std::fprintf(stderr, "No CUDA architecture detected from any devices.\n"); + if (!cmakeCompilerCUDAArch()) { // Convince the compiler that the non-zero return value depends // on the info strings so they are not optimized out. return require ? -1 : 1; diff --git a/Modules/CMakeCompilerCUDAArch.h b/Modules/CMakeCompilerCUDAArch.h new file mode 100644 index 00000000000..dcb030ffae1 --- /dev/null +++ b/Modules/CMakeCompilerCUDAArch.h @@ -0,0 +1,29 @@ +#include + +#include + +static bool cmakeCompilerCUDAArch() +{ + int count = 0; + if (cudaGetDeviceCount(&count) != cudaSuccess || count == 0) { + std::fprintf(stderr, "No CUDA devices found.\n"); + return -1; + } + + bool found = false; + const char* sep = ""; + for (int device = 0; device < count; ++device) { + cudaDeviceProp prop; + if (cudaGetDeviceProperties(&prop, device) == cudaSuccess) { + std::printf("%s%d%d", sep, prop.major, prop.minor); + sep = ";"; + found = true; + } + } + + if (!found) { + std::fprintf(stderr, "No CUDA architecture detected from any devices.\n"); + } + + return found; +} diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake index 75d33e89ed1..7eb93e27e48 100644 --- a/Modules/CMakeCompilerIdDetection.cmake +++ b/Modules/CMakeCompilerIdDetection.cmake @@ -65,12 +65,14 @@ function(compiler_id_detection outvar lang) VisualAge NVHPC PGI + CrayClang Cray TI FujitsuClang Fujitsu GHS Tasking + OrangeC ) if ("x${lang}" STREQUAL "xC") list(APPEND ordered_compilers @@ -102,6 +104,10 @@ function(compiler_id_detection outvar lang) set(ordered_compilers NVIDIA Clang) endif() + if("x${lang}" STREQUAL "xHIP") + set(ordered_compilers NVIDIA Clang) + endif() + if(CID_ID_DEFINE) foreach(Id ${ordered_compilers}) string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "# define ${CID_PREFIX}COMPILER_IS_${Id} 0\n") diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index 8ec6c6627f8..6d7d17ef4d8 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -70,6 +70,10 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_ARMClang "--version") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_ARMClang "armclang") + list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS OrangeC ) + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_OrangeC "--version") + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_OrangeC "occ \\(OrangeC\\) Version") + list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP ) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C") diff --git a/Modules/CMakeDetermineCSharpCompiler.cmake b/Modules/CMakeDetermineCSharpCompiler.cmake index fe98469330e..652eb63e2ce 100644 --- a/Modules/CMakeDetermineCSharpCompiler.cmake +++ b/Modules/CMakeDetermineCSharpCompiler.cmake @@ -3,7 +3,7 @@ if(NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") message(FATAL_ERROR - "C# is currently only supported for Microsoft Visual Studio 11 2012 and later.") + "C# is currently only supported for Microsoft Visual Studio 12 2013 and later.") endif() include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index 53c5f7813b5..585b2aa178a 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -4,13 +4,13 @@ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake) -if( NOT ( ("${CMAKE_GENERATOR}" MATCHES "Make") OR - ("${CMAKE_GENERATOR}" MATCHES "Ninja") OR - ("${CMAKE_GENERATOR}" MATCHES "Visual Studio (1|[9][0-9])") ) ) +if(NOT ((CMAKE_GENERATOR MATCHES "Make") OR + (CMAKE_GENERATOR MATCHES "Ninja") OR + (CMAKE_GENERATOR MATCHES "Visual Studio (1|[9][0-9])"))) message(FATAL_ERROR "CUDA language not currently supported by \"${CMAKE_GENERATOR}\" generator") endif() -if(${CMAKE_GENERATOR} MATCHES "Visual Studio") +if(CMAKE_GENERATOR MATCHES "Visual Studio") if(DEFINED ENV{CUDAHOSTCXX} OR DEFINED CMAKE_CUDA_HOST_COMPILER) message(WARNING "Visual Studio does not support specifying CUDAHOSTCXX or CMAKE_CUDA_HOST_COMPILER. Using the C++ compiler provided by Visual Studio.") endif() @@ -62,7 +62,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) - if(${CMAKE_GENERATOR} MATCHES "Visual Studio") + if(CMAKE_GENERATOR MATCHES "Visual Studio") # We will not know CMAKE_CUDA_COMPILER until the main compiler id step # below extracts it, but we do know that the compiler id will be NVIDIA. set(CMAKE_CUDA_COMPILER_ID "NVIDIA") @@ -78,176 +78,18 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) message(FATAL_ERROR "Clang with CUDA is not yet supported on Windows. See CMake issue #20776.") endif() - # Find the CUDA toolkit. We store the CMAKE_CUDA_COMPILER_TOOLKIT_ROOT, CMAKE_CUDA_COMPILER_TOOLKIT_VERSION and - # CMAKE_CUDA_COMPILER_LIBRARY_ROOT in CMakeCUDACompiler.cmake so FindCUDAToolkit can avoid searching on future - # runs and the toolkit is the same. - # This is very similar to FindCUDAToolkit, but somewhat simplified since we can issue fatal errors - # if we fail and we don't need to account for searching the libraries. - - # For NVCC we can easily deduce the SDK binary directory from the compiler path. - if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") - set(_CUDA_NVCC_EXECUTABLE "${CMAKE_CUDA_COMPILER}") - else() - # Search using CUDAToolkit_ROOT and then CUDA_PATH for equivalence with FindCUDAToolkit. - # In FindCUDAToolkit CUDAToolkit_ROOT is searched automatically due to being in a find_package(). - # First we search candidate non-default paths to give them priority. - find_program(_CUDA_NVCC_EXECUTABLE - NAMES nvcc nvcc.exe - PATHS ${CUDAToolkit_ROOT} - ENV CUDAToolkit_ROOT - ENV CUDA_PATH - PATH_SUFFIXES bin - NO_DEFAULT_PATH - ) - - # If we didn't find NVCC, then try the default paths. - find_program(_CUDA_NVCC_EXECUTABLE - NAMES nvcc nvcc.exe - PATH_SUFFIXES bin - ) - - # If the user specified CUDAToolkit_ROOT but nvcc could not be found, this is an error. - if(NOT _CUDA_NVCC_EXECUTABLE AND (DEFINED CUDAToolkit_ROOT OR DEFINED ENV{CUDAToolkit_ROOT})) - set(fail_base "Could not find nvcc executable in path specified by") - - if(DEFINED CUDAToolkit_ROOT) - message(FATAL_ERROR "${fail_base} CUDAToolkit_ROOT=${CUDAToolkit_ROOT}") - elseif(DEFINED ENV{CUDAToolkit_ROOT}) - message(FATAL_ERROR "${fail_base} environment variable CUDAToolkit_ROOT=$ENV{CUDAToolkit_ROOT}") - endif() - endif() - - # CUDAToolkit_ROOT cmake/env variable not specified, try platform defaults. - # - # - Linux: /usr/local/cuda-X.Y - # - macOS: /Developer/NVIDIA/CUDA-X.Y - # - Windows: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.Y - # - # We will also search the default symlink location /usr/local/cuda first since - # if CUDAToolkit_ROOT is not specified, it is assumed that the symlinked - # directory is the desired location. - if(NOT _CUDA_NVCC_EXECUTABLE) - if(UNIX) - if(NOT APPLE) - set(platform_base "/usr/local/cuda-") - else() - set(platform_base "/Developer/NVIDIA/CUDA-") - endif() - else() - set(platform_base "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v") - endif() - - # Build out a descending list of possible cuda installations, e.g. - file(GLOB possible_paths "${platform_base}*") - # Iterate the glob results and create a descending list. - set(versions) - foreach(p ${possible_paths}) - # Extract version number from end of string - string(REGEX MATCH "[0-9][0-9]?\\.[0-9]$" p_version ${p}) - if(IS_DIRECTORY ${p} AND p_version) - list(APPEND versions ${p_version}) - endif() - endforeach() - - # Sort numerically in descending order, so we try the newest versions first. - list(SORT versions COMPARE NATURAL ORDER DESCENDING) - - # With a descending list of versions, populate possible paths to search. - set(search_paths) - foreach(v ${versions}) - list(APPEND search_paths "${platform_base}${v}") - endforeach() - - # Force the global default /usr/local/cuda to the front on Unix. - if(UNIX) - list(INSERT search_paths 0 "/usr/local/cuda") - endif() - - # Now search for nvcc again using the platform default search paths. - find_program(_CUDA_NVCC_EXECUTABLE - NAMES nvcc nvcc.exe - PATHS ${search_paths} - PATH_SUFFIXES bin - ) - - # We are done with these variables now, cleanup. - unset(platform_base) - unset(possible_paths) - unset(versions) - unset(search_paths) - - if(NOT _CUDA_NVCC_EXECUTABLE) - message(FATAL_ERROR "Failed to find nvcc.\nCompiler ${CMAKE_CUDA_COMPILER_ID} requires the CUDA toolkit. Please set the CUDAToolkit_ROOT variable.") - endif() - endif() - endif() - - # Given that NVCC can be provided by multiple different sources (NVIDIA HPC SDK, CUDA Toolkit, distro) - # each of which has a different layout, we need to extract the CUDA toolkit root from the compiler - # itself, allowing us to support numerous different scattered toolkit layouts - execute_process(COMMAND ${_CUDA_NVCC_EXECUTABLE} "-v" "__cmake_determine_cuda" - OUTPUT_VARIABLE _CUDA_NVCC_OUT ERROR_VARIABLE _CUDA_NVCC_OUT) - if(_CUDA_NVCC_OUT MATCHES "\\#\\$ TOP=([^\r\n]*)") - get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${CMAKE_MATCH_1}" ABSOLUTE) - else() - get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${_CUDA_NVCC_EXECUTABLE}" DIRECTORY) - get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}" DIRECTORY) - endif() - - if(_CUDA_NVCC_OUT MATCHES "\\#\\$ NVVMIR_LIBRARY_DIR=([^\r\n]*)") - get_filename_component(_CUDA_NVVMIR_LIBRARY_DIR "${CMAKE_MATCH_1}" ABSOLUTE) - - #We require the path to end in `/nvvm/libdevice' - if(_CUDA_NVVMIR_LIBRARY_DIR MATCHES "nvvm/libdevice$") - get_filename_component(_CUDA_NVVMIR_LIBRARY_DIR "${_CUDA_NVVMIR_LIBRARY_DIR}/../.." ABSOLUTE) - set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT_FROM_NVVMIR_LIBRARY_DIR "${_CUDA_NVVMIR_LIBRARY_DIR}") - endif() - - unset(_CUDA_NVVMIR_LIBRARY_DIR) - unset(_cuda_nvvmir_dir_name) - endif() - unset(_CUDA_NVCC_OUT) + # Find the CUDA toolkit to get: + # - CMAKE_CUDA_COMPILER_TOOLKIT_VERSION + # - CMAKE_CUDA_COMPILER_TOOLKIT_ROOT + # - CMAKE_CUDA_COMPILER_LIBRARY_ROOT + # We save them in CMakeCUDACompiler.cmake so FindCUDAToolkit can + # avoid searching on future runs and the toolkit is the same. + # Match arguments with cmake_cuda_architectures_all call. + include(Internal/CMakeCUDAFindToolkit) + cmake_cuda_find_toolkit(CUDA CMAKE_CUDA_COMPILER_) set(CMAKE_CUDA_DEVICE_LINKER "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/bin/nvlink${CMAKE_EXECUTABLE_SUFFIX}") set(CMAKE_CUDA_FATBINARY "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/bin/fatbinary${CMAKE_EXECUTABLE_SUFFIX}") - - # In a non-scattered installation the following are equivalent to CMAKE_CUDA_COMPILER_TOOLKIT_ROOT. - # We first check for a non-scattered installation to prefer it over a scattered installation. - - # CMAKE_CUDA_COMPILER_LIBRARY_ROOT contains the device library. - if(DEFINED CMAKE_CUDA_COMPILER_LIBRARY_ROOT_FROM_NVVMIR_LIBRARY_DIR) - set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_CUDA_COMPILER_LIBRARY_ROOT_FROM_NVVMIR_LIBRARY_DIR}") - elseif(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/nvvm/libdevice") - set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}") - elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/nvvm/libdevice") - set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT_LINK}/usr/lib/cuda") - elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/nvvm/libdevice") - set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT}/usr/lib/cuda") - else() - message(FATAL_ERROR "Couldn't find CUDA library root.") - endif() - unset(CMAKE_CUDA_COMPILER_LIBRARY_ROOT_FROM_NVVMIR_LIBRARY_DIR) - - # CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT contains the linking stubs necessary for device linking and other low-level library files. - if(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/nvidia-cuda-toolkit/bin/crt/link.stub") - set(CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT "${CMAKE_SYSROOT_LINK}/usr/lib/nvidia-cuda-toolkit") - elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/nvidia-cuda-toolkit/bin/crt/link.stub") - set(CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT "${CMAKE_SYSROOT}/usr/lib/nvidia-cuda-toolkit") - else() - set(CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}") - endif() - endif() - - # For regular nvcc we the toolkit version is the same as the compiler version and we can parse it from the vendor test output. - # For Clang we need to invoke nvcc to get version output. - if(NOT CMAKE_GENERATOR MATCHES "Visual Studio") - if(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang") - execute_process(COMMAND ${_CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE CMAKE_CUDA_COMPILER_ID_OUTPUT) - endif() - - if(CMAKE_CUDA_COMPILER_ID_OUTPUT MATCHES [=[V([0-9]+\.[0-9]+\.[0-9]+)]=]) - set(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION "${CMAKE_MATCH_1}") - endif() endif() set(CMAKE_CUDA_COMPILER_ID_FLAGS_ALWAYS "-v") @@ -269,23 +111,9 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) endif() endif() - # Rest of the code treats an empty value as equivalent to "use the defaults". - # Error out early to prevent confusing errors as a result of this. - # Note that this also catches invalid non-numerical values such as "a". - if(DEFINED CMAKE_CUDA_ARCHITECTURES) - if(CMAKE_CUDA_ARCHITECTURES STREQUAL "") - message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES must be non-empty if set.") - elseif(CMAKE_CUDA_ARCHITECTURES AND NOT CMAKE_CUDA_ARCHITECTURES MATCHES "^([0-9]+a?(-real|-virtual)?(;[0-9]+a?(-real|-virtual)?|;)*|all|all-major|native)$") - message(FATAL_ERROR - "CMAKE_CUDA_ARCHITECTURES:\n" - " ${CMAKE_CUDA_ARCHITECTURES}\n" - "is not one of the following:\n" - " * a semicolon-separated list of integers, each optionally\n" - " followed by '-real' or '-virtual'\n" - " * a special value: all, all-major, native\n" - ) - endif() - endif() + # If the user set CMAKE_CUDA_ARCHITECTURES, validate its value. + include(Internal/CMakeCUDAArchitecturesValidate) + cmake_cuda_architectures_validate(CUDA) if(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang") # Clang doesn't automatically select an architecture supported by the SDK. @@ -306,7 +134,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) CMAKE_DETERMINE_COMPILER_ID(CUDA CUDAFLAGS CMakeCUDACompilerId.cu) - if(${CMAKE_GENERATOR} MATCHES "Visual Studio") + if(CMAKE_GENERATOR MATCHES "Visual Studio") # Now that we have the path to nvcc, we can compute the toolkit root. get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${CMAKE_CUDA_COMPILER}" DIRECTORY) get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}" DIRECTORY) @@ -316,7 +144,12 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) set(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION ${CMAKE_CUDA_COMPILER_VERSION}) endif() - include(${CMAKE_ROOT}/Modules/CUDA/architectures.cmake) + include(Internal/CMakeCUDAArchitecturesAll) + # From CMAKE_CUDA_COMPILER_TOOLKIT_VERSION and CMAKE_CUDA_COMPILER_{ID,VERSION}, get: + # - CMAKE_CUDA_ARCHITECTURES_ALL + # - CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR + # Match arguments with cmake_cuda_find_toolkit call. + cmake_cuda_architectures_all(CUDA CMAKE_CUDA_COMPILER_) _cmake_find_compiler_sysroot(CUDA) endif() @@ -331,7 +164,7 @@ if(MSVC_CUDA_ARCHITECTURE_ID) "set(MSVC_CUDA_ARCHITECTURE_ID ${MSVC_CUDA_ARCHITECTURE_ID})") endif() -if(${CMAKE_GENERATOR} MATCHES "Visual Studio") +if(CMAKE_GENERATOR MATCHES "Visual Studio") set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${CMAKE_LINKER}") set(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES "") set(CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES "") @@ -351,11 +184,12 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio") set(_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT \"${CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT}\")") elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang") - string(REGEX MATCHALL "-target-cpu sm_([0-9]+)" target_cpus "${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}") + string(REGEX MATCHALL "-target-cpu sm_([0-9]+)" _clang_target_cpus "${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}") - foreach(cpu ${target_cpus}) - string(REGEX MATCH "-target-cpu sm_([0-9]+)" dont_care "${cpu}") - list(APPEND architectures_detected "${CMAKE_MATCH_1}") + foreach(_clang_target_cpu ${_clang_target_cpus}) + if(_clang_target_cpu MATCHES "-target-cpu sm_([0-9]+)") + list(APPEND CMAKE_CUDA_ARCHITECTURES_DEFAULT "${CMAKE_MATCH_1}") + endif() endforeach() # Find target directory when crosscompiling. @@ -411,141 +245,32 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang") set(CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES "${_CUDA_LIBRARY_DIR}") set(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES "") set(CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") -elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") - set(_nvcc_log "") - string(REPLACE "\r" "" _nvcc_output_orig "${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}") - if(_nvcc_output_orig MATCHES "#\\\$ +PATH= *([^\n]*)\n") - set(_nvcc_path "${CMAKE_MATCH_1}") - string(APPEND _nvcc_log " found 'PATH=' string: [${_nvcc_path}]\n") - string(REPLACE ":" ";" _nvcc_path "${_nvcc_path}") - else() - set(_nvcc_path "") - string(REPLACE "\n" "\n " _nvcc_output_log "\n${_nvcc_output_orig}") - string(APPEND _nvcc_log " no 'PATH=' string found in nvcc output:${_nvcc_output_log}\n") - endif() - if(_nvcc_output_orig MATCHES "#\\\$ +LIBRARIES= *([^\n]*)\n") - set(_nvcc_libraries "${CMAKE_MATCH_1}") - string(APPEND _nvcc_log " found 'LIBRARIES=' string: [${_nvcc_libraries}]\n") - else() - set(_nvcc_libraries "") - string(REPLACE "\n" "\n " _nvcc_output_log "\n${_nvcc_output_orig}") - string(APPEND _nvcc_log " no 'LIBRARIES=' string found in nvcc output:${_nvcc_output_log}\n") - endif() - - set(_nvcc_link_line "") - if(_nvcc_libraries) - # Remove variable assignments. - string(REGEX REPLACE "#\\\$ *[^= ]+=[^\n]*\n" "" _nvcc_output "${_nvcc_output_orig}") - # Encode [] characters that break list expansion. - string(REPLACE "[" "{==={" _nvcc_output "${_nvcc_output}") - string(REPLACE "]" "}===}" _nvcc_output "${_nvcc_output}") - # Split lines. - string(REGEX REPLACE "\n+(#\\\$ )?" ";" _nvcc_output "${_nvcc_output}") - foreach(line IN LISTS _nvcc_output) - set(_nvcc_output_line "${line}") - string(REPLACE "{==={" "[" _nvcc_output_line "${_nvcc_output_line}") - string(REPLACE "}===}" "]" _nvcc_output_line "${_nvcc_output_line}") - string(APPEND _nvcc_log " considering line: [${_nvcc_output_line}]\n") - if("${_nvcc_output_line}" MATCHES "^ *nvlink") - string(APPEND _nvcc_log " ignoring nvlink line\n") - elseif(_nvcc_libraries) - if("${_nvcc_output_line}" MATCHES "(@\"?((tmp/)?a\\.exe\\.res)\"?)") - set(_nvcc_link_res_arg "${CMAKE_MATCH_1}") - set(_nvcc_link_res_file "${CMAKE_MATCH_2}") - set(_nvcc_link_res "${CMAKE_PLATFORM_INFO_DIR}/CompilerIdCUDA/${_nvcc_link_res_file}") - if(EXISTS "${_nvcc_link_res}") - file(READ "${_nvcc_link_res}" _nvcc_link_res_content) - string(REPLACE "${_nvcc_link_res_arg}" "${_nvcc_link_res_content}" _nvcc_output_line "${_nvcc_output_line}") - endif() - endif() - string(FIND "${_nvcc_output_line}" "${_nvcc_libraries}" _nvcc_libraries_pos) - if(NOT _nvcc_libraries_pos EQUAL -1) - set(_nvcc_link_line "${_nvcc_output_line}") - string(APPEND _nvcc_log " extracted link line: [${_nvcc_link_line}]\n") - endif() - endif() - endforeach() - endif() - - if(_nvcc_link_line) - if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") - set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${CMAKE_LINKER}") - else() - #extract the compiler that is being used for linking - separate_arguments(_nvcc_link_line_args UNIX_COMMAND "${_nvcc_link_line}") - list(GET _nvcc_link_line_args 0 _nvcc_host_link_launcher) - if(IS_ABSOLUTE "${_nvcc_host_link_launcher}") - string(APPEND _nvcc_log " extracted link launcher absolute path: [${_nvcc_host_link_launcher}]\n") - set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${_nvcc_host_link_launcher}") - else() - string(APPEND _nvcc_log " extracted link launcher name: [${_nvcc_host_link_launcher}]\n") - find_program(_nvcc_find_host_link_launcher - NAMES ${_nvcc_host_link_launcher} - PATHS ${_nvcc_path} NO_DEFAULT_PATH) - find_program(_nvcc_find_host_link_launcher - NAMES ${_nvcc_host_link_launcher}) - if(_nvcc_find_host_link_launcher) - string(APPEND _nvcc_log " found link launcher absolute path: [${_nvcc_find_host_link_launcher}]\n") - set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${_nvcc_find_host_link_launcher}") - else() - string(APPEND _nvcc_log " could not find link launcher absolute path\n") - set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${_nvcc_host_link_launcher}") - endif() - unset(_nvcc_find_host_link_launcher CACHE) - endif() - endif() - #prefix the line with cuda-fake-ld so that implicit link info believes it is - #a link line - set(_nvcc_link_line "cuda-fake-ld ${_nvcc_link_line}") - CMAKE_PARSE_IMPLICIT_LINK_INFO("${_nvcc_link_line}" - CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES - CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES - CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES - log - "${CMAKE_CUDA_IMPLICIT_OBJECT_REGEX}" - LANGUAGE CUDA) - - # Detect CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT from the compiler by looking at which - # cudart library exists in the implicit link libraries passed to the host linker. - # This is required when a project sets the cuda runtime library as part of the - # initial flags. - if(";${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES};" MATCHES [[;cudart_static(\.lib)?;]]) - set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "STATIC") - elseif(";${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES};" MATCHES [[;cudart(\.lib)?;]]) - set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "SHARED") - else() - set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "NONE") - endif() - set(_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT - "set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT \"${CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT}\")") + # Don't leak variables unnecessarily to user code. + unset(_CUDA_INCLUDE_DIR) + unset(_CUDA_LIBRARY_DIR) + unset(_CUDA_TARGET_DIR) + unset(_CUDA_TARGET_NAME) +elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") + include(Internal/CMakeNVCCParseImplicitInfo) + # Parse CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT to get: + # - CMAKE_CUDA_ARCHITECTURES_DEFAULT + # - CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES + # - CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES + # - CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES + # - CMAKE_CUDA_HOST_LINK_LAUNCHER + # - CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT + # - CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES + # Match arguments with cmake_nvcc_filter_implicit_info call in CMakeTestCUDACompiler. + cmake_nvcc_parse_implicit_info(CUDA CMAKE_CUDA_) - message(CONFIGURE_LOG - "Parsed CUDA nvcc implicit link information:\n${_nvcc_log}\n${log}\n\n") - else() - message(CONFIGURE_LOG - "Failed to parse CUDA nvcc implicit link information:\n${_nvcc_log}\n\n") - message(FATAL_ERROR "Failed to extract nvcc implicit link line.") - endif() + set(_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT + "set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT \"${CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT}\")") endif() -# CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES is detected above as the list of -# libraries that the CUDA compiler implicitly passes to the host linker. -# CMake invokes the host linker directly and so needs to pass these libraries. -# We filter out those that should not be passed unconditionally both here -# and from CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES in CMakeTestCUDACompiler. -set(CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES_EXCLUDE - # The CUDA runtime libraries are controlled by CMAKE_CUDA_RUNTIME_LIBRARY. - cudart cudart.lib - cudart_static cudart_static.lib - cudadevrt cudadevrt.lib - - # Dependencies of the CUDA static runtime library on Linux hosts. - rt - pthread - dl - ) -list(REMOVE_ITEM CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES ${CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES_EXCLUDE}) +include(Internal/CMakeCUDAFilterImplicitLibs) +# Filter out implicit link libraries that should not be passed unconditionally. +cmake_cuda_filter_implicit_libs(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES) if(CMAKE_CUDA_COMPILER_SYSROOT) string(CONCAT _SET_CMAKE_CUDA_COMPILER_SYSROOT @@ -555,55 +280,17 @@ else() set(_SET_CMAKE_CUDA_COMPILER_SYSROOT "") endif() -# Determine CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES -if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") - set(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES) - string(REPLACE "\r" "" _nvcc_output_orig "${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}") - if(_nvcc_output_orig MATCHES "#\\\$ +INCLUDES= *([^\n]*)\n") - set(_nvcc_includes "${CMAKE_MATCH_1}") - string(APPEND _nvcc_log " found 'INCLUDES=' string: [${_nvcc_includes}]\n") - else() - set(_nvcc_includes "") - string(REPLACE "\n" "\n " _nvcc_output_log "\n${_nvcc_output_orig}") - string(APPEND _nvcc_log " no 'INCLUDES=' string found in nvcc output:${_nvcc_output_log}\n") - endif() - if(_nvcc_includes) - # across all operating system each include directory is prefixed with -I - separate_arguments(_nvcc_output NATIVE_COMMAND "${_nvcc_includes}") - foreach(line IN LISTS _nvcc_output) - string(REGEX REPLACE "^-I" "" line "${line}") - get_filename_component(line "${line}" ABSOLUTE) - list(APPEND CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES "${line}") - endforeach() - - message(CONFIGURE_LOG - "Parsed CUDA nvcc include information:\n${_nvcc_log}\n${log}\n\n") - else() - message(CONFIGURE_LOG - "Failed to detect CUDA nvcc include information:\n${_nvcc_log}\n\n") - endif() - - string(REGEX MATCHALL "-arch compute_([0-9]+)" target_cpus "${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}") - - foreach(cpu ${target_cpus}) - string(REGEX MATCH "-arch compute_([0-9]+)" dont_care "${cpu}") - list(APPEND architectures_detected "${CMAKE_MATCH_1}") - endforeach() -endif() - -# If the user didn't set the architectures, then set them to a default. -# If the user did, then make sure those architectures worked. +# If the user did not set CMAKE_CUDA_ARCHITECTURES, use the compiler's default. if("${CMAKE_CUDA_ARCHITECTURES}" STREQUAL "") cmake_policy(GET CMP0104 _CUDA_CMP0104) - if(NOT CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" OR _CUDA_CMP0104 STREQUAL "NEW") - set(CMAKE_CUDA_ARCHITECTURES "${architectures_detected}" CACHE STRING "CUDA architectures") - + set(CMAKE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES_DEFAULT}" CACHE STRING "CUDA architectures") if(NOT CMAKE_CUDA_ARCHITECTURES) message(FATAL_ERROR "Failed to detect a default CUDA architecture.\n\nCompiler output:\n${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}") endif() endif() endif() +unset(CMAKE_CUDA_ARCHITECTURES_DEFAULT) # configure all variables set in this file configure_file(${CMAKE_ROOT}/Modules/CMakeCUDACompiler.cmake.in @@ -611,14 +298,5 @@ configure_file(${CMAKE_ROOT}/Modules/CMakeCUDACompiler.cmake.in @ONLY ) -# Don't leak variables unnecessarily to user code. -unset(_CUDA_INCLUDE_DIR CACHE) -unset(_CUDA_NVCC_EXECUTABLE CACHE) -unset(_CUDA_LIBRARY_DIR) -unset(_CUDA_TARGET_DIR) -unset(_CUDA_TARGET_NAME) - -unset(architectures_detected) - set(CMAKE_CUDA_COMPILER_ENV_VAR "CUDACXX") set(CMAKE_CUDA_HOST_COMPILER_ENV_VAR "CUDAHOSTCXX") diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index 13bfeeced73..efc18f93c23 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -26,13 +26,13 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) if(DEFINED CMAKE_${lang}_VERBOSE_COMPILE_FLAG) set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_COMPILE_FLAG}") endif() - if(lang STREQUAL "CUDA") - if(CMAKE_CUDA_ARCHITECTURES STREQUAL "native") + if(lang MATCHES "^(CUDA|HIP)$") + if(CMAKE_${lang}_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_CUDA_ARCHITECTURES "all") + set(CMAKE_${lang}_ARCHITECTURES "all") endif() - set(CMAKE_CUDA_RUNTIME_LIBRARY "Static") + set(CMAKE_${lang}_RUNTIME_LIBRARY "Static") endif() if(NOT "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC") # Avoid adding our own platform standard libraries for compilers @@ -139,38 +139,46 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) endif() set(CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES "${_CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT}" PARENT_SCOPE) - # 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") + if(_CMAKE_${lang}_IMPLICIT_LINK_INFORMATION_DETERMINED_EARLY) + # Use implicit linker information detected during compiler id step. + set(implicit_dirs "${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") + set(implicit_objs "") + 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() endif() # Implicit link libraries cannot be used explicitly for multiple diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 2cf98534aec..4f1eabab259 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -174,6 +174,32 @@ 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. + if(COMPILER_${lang}_PRODUCED_OUTPUT MATCHES "-triple ([0-9a-z_]*)-.*windows-msvc([0-9]+)\\.([0-9]+)") + set(CMAKE_${lang}_SIMULATE_ID "MSVC") + 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}") + 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() + endif() + if (COMPILER_QNXNTO AND (CMAKE_${lang}_COMPILER_ID STREQUAL "GNU" OR CMAKE_${lang}_COMPILER_ID STREQUAL "LCC")) execute_process( COMMAND "${CMAKE_${lang}_COMPILER}" @@ -605,6 +631,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} if(CMAKE_OSX_SYSROOT) set(id_sdkroot "SDKROOT = \"${CMAKE_OSX_SYSROOT}\";") if(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ii][Pp][Hh][Oo][Nn][Ee]" OR + CMAKE_OSX_SYSROOT MATCHES "(^|/)[Xx][Rr]" OR CMAKE_OSX_SYSROOT MATCHES "(^|/)[Aa][Pp][Pp][Ll][Ee][Tt][Vv]") set(id_product_type "com.apple.product-type.bundle.unit-test") elseif(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ww][Aa][Tt][Cc][Hh]") diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 8cbaf70a765..392f0f1bfef 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -98,6 +98,9 @@ else() set(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS_FIRST # Get verbose output to help distinguish compilers. "-v" + + # Try compiling to an object file only, with verbose output. + "-v -c" ) set(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS # Try compiling to an object file only. @@ -108,6 +111,10 @@ else() ) endif() +if(CMAKE_Fortran_COMPILER_TARGET) + set(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS_FIRST "-v -c --target=${CMAKE_Fortran_COMPILER_TARGET}") +endif() + # Build a small source file to identify the compiler. if(NOT CMAKE_Fortran_COMPILER_ID_RUN) set(CMAKE_Fortran_COMPILER_ID_RUN 1) @@ -227,6 +234,49 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) endif() endif() +if("${CMAKE_Fortran_COMPILER_ID};${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "LLVMFlang;MSVC") + # With LLVMFlang targeting the MSVC ABI we link using lld-link. + # Detect the implicit link information from the compiler driver + # so we can explicitly pass it to the linker. + include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake) + set(_LLVMFlang_COMMAND "${CMAKE_Fortran_COMPILER}" "-###" ${CMAKE_CURRENT_LIST_DIR}/CMakeFortranCompilerABI.F) + if(CMAKE_Fortran_COMPILER_TARGET) + list(APPEND _LLVMFlang_COMMAND --target=${CMAKE_Fortran_COMPILER_TARGET}) + endif() + execute_process(COMMAND ${_LLVMFlang_COMMAND} + OUTPUT_VARIABLE _LLVMFlang_OUTPUT + ERROR_VARIABLE _LLVMFlang_OUTPUT + RESULT_VARIABLE _LLVMFlang_RESULT) + string(JOIN "\" \"" _LLVMFlang_COMMAND ${_LLVMFlang_COMMAND}) + message(CONFIGURE_LOG + "Running the Fortran compiler: \"${_LLVMFlang_COMMAND}\"\n" + "${_LLVMFlang_OUTPUT}" + ) + if(_LLVMFlang_RESULT EQUAL 0) + cmake_parse_implicit_link_info("${_LLVMFlang_OUTPUT}" + CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES + CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES + CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES + log + "${CMAKE_Fortran_IMPLICIT_OBJECT_REGEX}" + LANGUAGE Fortran) + message(CONFIGURE_LOG + "Parsed Fortran implicit link information:\n" + "${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 + # 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") + endif() + endif() + unset(_LLVMFlang_COMMAND) + unset(_LLVMFlang_OUTPUT) + unset(_LLVMFlang_RESULT) +endif() + if (NOT _CMAKE_TOOLCHAIN_LOCATION) get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_Fortran_COMPILER}" PATH) endif () diff --git a/Modules/CMakeDetermineHIPCompiler.cmake b/Modules/CMakeDetermineHIPCompiler.cmake index 9a40e829b63..e667099c9c0 100644 --- a/Modules/CMakeDetermineHIPCompiler.cmake +++ b/Modules/CMakeDetermineHIPCompiler.cmake @@ -5,11 +5,29 @@ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake) include(${CMAKE_ROOT}/Modules/CMakeParseLibraryArchitecture.cmake) -if( NOT ( ("${CMAKE_GENERATOR}" MATCHES "Make") OR - ("${CMAKE_GENERATOR}" MATCHES "Ninja") ) ) +if(NOT ((CMAKE_GENERATOR MATCHES "Make") OR + (CMAKE_GENERATOR MATCHES "Ninja"))) message(FATAL_ERROR "HIP language not currently supported by \"${CMAKE_GENERATOR}\" generator") endif() +if(NOT CMAKE_HIP_PLATFORM) + execute_process(COMMAND hipconfig --platform + OUTPUT_VARIABLE _CMAKE_HIPCONFIG_PLATFORM OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE _CMAKE_HIPCONFIG_RESULT + ) + if(_CMAKE_HIPCONFIG_RESULT EQUAL 0 AND _CMAKE_HIPCONFIG_PLATFORM MATCHES "^(nvidia|nvcc)$") + set(CMAKE_HIP_PLATFORM "nvidia" CACHE STRING "HIP platform" FORCE) + else() + set(CMAKE_HIP_PLATFORM "amd" CACHE STRING "HIP platform" FORCE) + endif() +endif() +if(NOT CMAKE_HIP_PLATFORM MATCHES "^(amd|nvidia)$") + message(FATAL_ERROR + "The CMAKE_HIP_PLATFORM has unsupported value:\n" + " '${CMAKE_HIP_PLATFORM}'\n" + "It must be 'amd' or 'nvidia'." + ) +endif() if(NOT CMAKE_HIP_COMPILER) set(CMAKE_HIP_COMPILER_INIT NOTFOUND) @@ -34,15 +52,19 @@ if(NOT CMAKE_HIP_COMPILER) # finally list compilers to try if(NOT CMAKE_HIP_COMPILER_INIT) - set(CMAKE_HIP_COMPILER_LIST clang++) + if(CMAKE_HIP_PLATFORM STREQUAL "nvidia") + set(CMAKE_HIP_COMPILER_LIST nvcc) + elseif(CMAKE_HIP_PLATFORM STREQUAL "amd") + set(CMAKE_HIP_COMPILER_LIST clang++) - # Look for the Clang coming with ROCm to support HIP. - execute_process(COMMAND hipconfig --hipclangpath - OUTPUT_VARIABLE _CMAKE_HIPCONFIG_CLANGPATH - RESULT_VARIABLE _CMAKE_HIPCONFIG_RESULT - ) - if(_CMAKE_HIPCONFIG_RESULT EQUAL 0 AND EXISTS "${_CMAKE_HIPCONFIG_CLANGPATH}") - set(CMAKE_HIP_COMPILER_HINTS "${_CMAKE_HIPCONFIG_CLANGPATH}") + # Look for the Clang coming with ROCm to support HIP. + execute_process(COMMAND hipconfig --hipclangpath + OUTPUT_VARIABLE _CMAKE_HIPCONFIG_CLANGPATH + RESULT_VARIABLE _CMAKE_HIPCONFIG_RESULT + ) + if(_CMAKE_HIPCONFIG_RESULT EQUAL 0 AND EXISTS "${_CMAKE_HIPCONFIG_CLANGPATH}") + set(CMAKE_HIP_COMPILER_HINTS "${_CMAKE_HIPCONFIG_CLANGPATH}") + endif() endif() endif() @@ -63,17 +85,65 @@ mark_as_advanced(CMAKE_HIP_COMPILER) if(NOT CMAKE_HIP_COMPILER_ID_RUN) set(CMAKE_HIP_COMPILER_ID_RUN 1) - # Try to identify the compiler. + include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) + + # We determine the vendor to use the right flags for detection right away. + # The main compiler identification is still needed below to extract other information. + list(APPEND CMAKE_HIP_COMPILER_ID_VENDORS NVIDIA Clang) + set(CMAKE_HIP_COMPILER_ID_VENDOR_REGEX_NVIDIA "nvcc: NVIDIA \\(R\\) Cuda compiler driver") + set(CMAKE_HIP_COMPILER_ID_VENDOR_REGEX_Clang "(clang version)") + CMAKE_DETERMINE_COMPILER_ID_VENDOR(HIP "--version") + + if(CMAKE_HIP_COMPILER_ID STREQUAL "NVIDIA") + # Find the CUDA toolkit to get: + # - CMAKE_HIP_COMPILER_CUDA_TOOLKIT_VERSION + # - CMAKE_HIP_COMPILER_CUDA_TOOLKIT_ROOT + # - CMAKE_HIP_COMPILER_CUDA_LIBRARY_ROOT + # We save them in CMakeHIPCompiler.cmake. + # Match arguments with cmake_cuda_architectures_all call. + include(Internal/CMakeCUDAFindToolkit) + cmake_cuda_find_toolkit(HIP CMAKE_HIP_COMPILER_CUDA_) + + # If the user set CMAKE_HIP_ARCHITECTURES, validate its value. + include(Internal/CMakeCUDAArchitecturesValidate) + cmake_cuda_architectures_validate(HIP) + + if(NOT CMAKE_HIP_HOST_COMPILER AND NOT $ENV{HIPHOSTCXX} STREQUAL "") + get_filename_component(CMAKE_HIP_HOST_COMPILER $ENV{HIPHOSTCXX} PROGRAM) + if(NOT EXISTS "${CMAKE_HIP_HOST_COMPILER}") + message(FATAL_ERROR "Could not find compiler set in environment variable HIPHOSTCXX:\n$ENV{HIPHOSTCXX}.\n${CMAKE_HIP_HOST_COMPILER}") + endif() + endif() + endif() + + if(CMAKE_HIP_COMPILER_ID STREQUAL "Clang") + list(APPEND CMAKE_HIP_COMPILER_ID_TEST_FLAGS_FIRST "-v") + elseif(CMAKE_HIP_COMPILER_ID STREQUAL "NVIDIA") + # Tell nvcc to treat .hip files as CUDA sources. + list(APPEND CMAKE_HIP_COMPILER_ID_TEST_FLAGS_FIRST "-x cu -v") + if(CMAKE_HIP_HOST_COMPILER) + string(APPEND CMAKE_HIP_COMPILER_ID_TEST_FLAGS_FIRST " -ccbin=\"${CMAKE_HIP_HOST_COMPILER}\"") + endif() + endif() + + # We perform compiler identification for a second time to extract implicit linking info. + # We need to unset the compiler ID otherwise CMAKE_DETERMINE_COMPILER_ID() doesn't work. set(CMAKE_HIP_COMPILER_ID) set(CMAKE_HIP_PLATFORM_ID) file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in CMAKE_HIP_COMPILER_ID_PLATFORM_CONTENT) - list(APPEND CMAKE_HIP_COMPILER_ID_TEST_FLAGS_FIRST "-v") - - include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) CMAKE_DETERMINE_COMPILER_ID(HIP HIPFLAGS CMakeHIPCompilerId.hip) + if(CMAKE_HIP_COMPILER_ID STREQUAL "NVIDIA") + include(Internal/CMakeCUDAArchitecturesAll) + # From CMAKE_HIP_COMPILER_CUDA_TOOLKIT_VERSION and CMAKE_HIP_COMPILER_{ID,VERSION}, get: + # - CMAKE_HIP_ARCHITECTURES_ALL + # - CMAKE_HIP_ARCHITECTURES_ALL_MAJOR + # Match arguments with cmake_cuda_find_toolkit call. + cmake_cuda_architectures_all(HIP CMAKE_HIP_COMPILER_CUDA_) + endif() + _cmake_find_compiler_sysroot(HIP) endif() @@ -104,56 +174,61 @@ if(NOT CMAKE_HIP_COMPILER_ROCM_ROOT) message(FATAL_ERROR "Failed to find ROCm root directory.") endif() -# Normally implicit link information is not detected until -cmake_parse_implicit_link_info("${CMAKE_HIP_COMPILER_PRODUCED_OUTPUT}" - _CMAKE_HIP_COMPILER_ID_IMPLICIT_LIBS - _CMAKE_HIP_COMPILER_ID_IMPLICIT_DIRS - _CMAKE_HIP_COMPILER_ID_IMPLICIT_FWKS - _CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG - "" LANGUAGE HIP) -message(CONFIGURE_LOG - "Parsed HIP implicit link information from compiler id output:\n${_CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG}\n\n") -cmake_parse_library_architecture(HIP "${_CMAKE_HIP_COMPILER_ID_IMPLICIT_DIRS}" "" CMAKE_HIP_LIBRARY_ARCHITECTURE) -if(CMAKE_HIP_LIBRARY_ARCHITECTURE) +if(CMAKE_HIP_PLATFORM STREQUAL "amd") + # For this platform we need the hip-lang cmake package. + + # Normally implicit link information is not detected until ABI detection, + # but we need to populate CMAKE_HIP_LIBRARY_ARCHITECTURE to find hip-lang. + cmake_parse_implicit_link_info("${CMAKE_HIP_COMPILER_PRODUCED_OUTPUT}" + _CMAKE_HIP_COMPILER_ID_IMPLICIT_LIBS + _CMAKE_HIP_COMPILER_ID_IMPLICIT_DIRS + _CMAKE_HIP_COMPILER_ID_IMPLICIT_FWKS + _CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG + "" LANGUAGE HIP) message(CONFIGURE_LOG - "Parsed HIP library architecture from compiler id output: ${CMAKE_HIP_LIBRARY_ARCHITECTURE}\n") -endif() -unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_LIBS) -unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_DIRS) -unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_FWKS) -unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG) - -if(NOT CMAKE_HIP_COMPILER_ROCM_LIB) - set(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS - "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib" - "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib64" - ) + "Parsed HIP implicit link information from compiler id output:\n${_CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG}\n\n") + cmake_parse_library_architecture(HIP "${_CMAKE_HIP_COMPILER_ID_IMPLICIT_DIRS}" "" CMAKE_HIP_LIBRARY_ARCHITECTURE) if(CMAKE_HIP_LIBRARY_ARCHITECTURE) - list(APPEND _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/${CMAKE_HIP_LIBRARY_ARCHITECTURE}") + message(CONFIGURE_LOG + "Parsed HIP library architecture from compiler id output: ${CMAKE_HIP_LIBRARY_ARCHITECTURE}\n") endif() - foreach(dir IN LISTS _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS) - if(EXISTS "${dir}/cmake/hip-lang/hip-lang-config.cmake") - set(CMAKE_HIP_COMPILER_ROCM_LIB "${dir}") - break() - endif() - endforeach() + unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_LIBS) + unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_DIRS) + unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_FWKS) + unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG) + if(NOT CMAKE_HIP_COMPILER_ROCM_LIB) - list(TRANSFORM _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS APPEND "/cmake/hip-lang/hip-lang-config.cmake") - string(REPLACE ";" "\n " _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS}") - message(FATAL_ERROR - "The ROCm root directory:\n" - " ${CMAKE_HIP_COMPILER_ROCM_ROOT}\n" - "does not contain the HIP runtime CMake package, expected at one of:\n" - " ${_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS}\n" + set(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS + "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib" + "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib64" ) + if(CMAKE_HIP_LIBRARY_ARCHITECTURE) + list(APPEND _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/${CMAKE_HIP_LIBRARY_ARCHITECTURE}") + endif() + foreach(dir IN LISTS _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS) + if(EXISTS "${dir}/cmake/hip-lang/hip-lang-config.cmake") + set(CMAKE_HIP_COMPILER_ROCM_LIB "${dir}") + break() + endif() + endforeach() + if(NOT CMAKE_HIP_COMPILER_ROCM_LIB) + list(TRANSFORM _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS APPEND "/cmake/hip-lang/hip-lang-config.cmake") + string(REPLACE ";" "\n " _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS}") + message(FATAL_ERROR + "The ROCm root directory:\n" + " ${CMAKE_HIP_COMPILER_ROCM_ROOT}\n" + "does not contain the HIP runtime CMake package, expected at one of:\n" + " ${_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS}\n" + ) + endif() + unset(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS) + endif() + if(CMAKE_HIP_COMPILER_ROCM_LIB MATCHES "/lib64$" AND NOT DEFINED CMAKE_SIZEOF_VOID_P) + # We have not yet determined the target ABI but we need 'find_package' to + # search lib64 directories to find hip-lang CMake package dependencies. + # This will be replaced by ABI detection later. + set(CMAKE_HIP_SIZEOF_DATA_PTR 8) endif() - unset(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS) -endif() -if(CMAKE_HIP_COMPILER_ROCM_LIB MATCHES "/lib64$" AND NOT DEFINED CMAKE_SIZEOF_VOID_P) - # We have not yet determined the target ABI but we need 'find_package' to - # search lib64 directories to find hip-lang CMake package dependencies. - # This will be replaced by ABI detection later. - set(CMAKE_HIP_SIZEOF_DATA_PTR 8) endif() if (NOT _CMAKE_TOOLCHAIN_LOCATION) @@ -165,6 +240,26 @@ include(CMakeFindBinUtils) include(Compiler/${CMAKE_HIP_COMPILER_ID}-FindBinUtils OPTIONAL) unset(_CMAKE_PROCESSING_LANGUAGE) +if(CMAKE_HIP_COMPILER_ID STREQUAL "Clang") + set(CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT "SHARED") +elseif(CMAKE_HIP_COMPILER_ID STREQUAL "NVIDIA") + include(Internal/CMakeNVCCParseImplicitInfo) + # Parse CMAKE_HIP_COMPILER_PRODUCED_OUTPUT to get: + # - CMAKE_HIP_ARCHITECTURES_DEFAULT + # - CMAKE_HIP_HOST_IMPLICIT_LINK_DIRECTORIES + # - CMAKE_HIP_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES + # - CMAKE_HIP_HOST_IMPLICIT_LINK_LIBRARIES + # - CMAKE_HIP_HOST_LINK_LAUNCHER + # - CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT + # - CMAKE_HIP_CUDA_TOOLKIT_INCLUDE_DIRECTORIES + # Match arguments with cmake_nvcc_filter_implicit_info call in CMakeTestHIPCompiler. + cmake_nvcc_parse_implicit_info(HIP CMAKE_HIP_CUDA_) + + include(Internal/CMakeCUDAFilterImplicitLibs) + # Filter out implicit link libraries that should not be passed unconditionally. + cmake_cuda_filter_implicit_libs(CMAKE_HIP_HOST_IMPLICIT_LINK_LIBRARIES) +endif() + if(CMAKE_HIP_COMPILER_SYSROOT) string(CONCAT _SET_CMAKE_HIP_COMPILER_SYSROOT "set(CMAKE_HIP_COMPILER_SYSROOT \"${CMAKE_HIP_COMPILER_SYSROOT}\")\n" @@ -185,7 +280,20 @@ if(MSVC_HIP_ARCHITECTURE_ID) "set(MSVC_HIP_ARCHITECTURE_ID ${MSVC_HIP_ARCHITECTURE_ID})") endif() -if(NOT DEFINED CMAKE_HIP_ARCHITECTURES) +if(CMAKE_HIP_COMPILER_ID STREQUAL "NVIDIA") + if(NOT "$ENV{CUDAARCHS}" STREQUAL "") + set(CMAKE_HIP_ARCHITECTURES "$ENV{CUDAARCHS}" CACHE STRING "CUDA architectures") + endif() + + # If the user did not set CMAKE_HIP_ARCHITECTURES, use the compiler's default. + if("${CMAKE_HIP_ARCHITECTURES}" STREQUAL "") + set(CMAKE_HIP_ARCHITECTURES "${CMAKE_HIP_ARCHITECTURES_DEFAULT}" CACHE STRING "HIP architectures" FORCE) + if(NOT CMAKE_HIP_ARCHITECTURES) + message(FATAL_ERROR "Failed to detect a default HIP architecture.\n\nCompiler output:\n${CMAKE_HIP_COMPILER_PRODUCED_OUTPUT}") + endif() + endif() + unset(CMAKE_HIP_ARCHITECTURES_DEFAULT) +elseif(NOT DEFINED CMAKE_HIP_ARCHITECTURES) # Use 'rocm_agent_enumerator' to get the current GPU architecture. set(_CMAKE_HIP_ARCHITECTURES) find_program(_CMAKE_HIP_ROCM_AGENT_ENUMERATOR diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index 386be73f68b..fff4e9dee3f 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -47,6 +47,28 @@ if(CMAKE_HOST_UNIX) set(CMAKE_HOST_SYSTEM_VERSION "${_CMAKE_HOST_SYSTEM_MAJOR_VERSION}.${_CMAKE_HOST_SYSTEM_MINOR_VERSION}") unset(_CMAKE_HOST_SYSTEM_MAJOR_VERSION) unset(_CMAKE_HOST_SYSTEM_MINOR_VERSION) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android") + execute_process(COMMAND getprop ro.build.version.sdk + OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) + + if(NOT DEFINED CMAKE_SYSTEM_VERSION) + set(_ANDROID_API_LEVEL_H $ENV{PREFIX}/include/android/api-level.h) + set(_ANDROID_API_REGEX "#define __ANDROID_API__ ([0-9]+)") + file(READ ${_ANDROID_API_LEVEL_H} _ANDROID_API_LEVEL_H_CONTENT) + string(REGEX MATCH ${_ANDROID_API_REGEX} _ANDROID_API_LINE "${_ANDROID_API_LEVEL_H_CONTENT}") + string(REGEX REPLACE ${_ANDROID_API_REGEX} "\\1" _ANDROID_API "${_ANDROID_API_LINE}") + if(_ANDROID_API) + set(CMAKE_SYSTEM_VERSION "${_ANDROID_API}") + endif() + + unset(_ANDROID_API_LEVEL_H) + unset(_ANDROID_API_LEVEL_H_CONTENT) + unset(_ANDROID_API_REGEX) + unset(_ANDROID_API_LINE) + unset(_ANDROID_API) + endif() else() execute_process(COMMAND ${CMAKE_UNAME} -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index f778891b414..e12b1756ed0 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -79,10 +79,10 @@ if(("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC" AND set(_CMAKE_MT_NAMES "mt") # Prepend toolchain-specific names. - if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL "xClang") + if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^x(Clang|LLVMFlang)$") set(_CMAKE_NM_NAMES "llvm-nm" "nm") list(PREPEND _CMAKE_AR_NAMES "llvm-lib") - # llvm-mt does not support all flags we need in vs_link_exe + # llvm-mt is not ready to be used as a replacement for mt.exe # list(PREPEND _CMAKE_MT_NAMES "llvm-mt") list(PREPEND _CMAKE_LINKER_NAMES "lld-link") list(APPEND _CMAKE_TOOL_VARS NM) diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index 6a2be283264..89a00abf09a 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -14,8 +14,9 @@ set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@") set(CMAKE_AR "@CMAKE_AR@") set(CMAKE_Fortran_COMPILER_AR "@CMAKE_Fortran_COMPILER_AR@") set(CMAKE_RANLIB "@CMAKE_RANLIB@") -set(CMAKE_TAPI "@CMAKE_TAPI@") +set(CMAKE_LINKER "@CMAKE_LINKER@") set(CMAKE_Fortran_COMPILER_RANLIB "@CMAKE_Fortran_COMPILER_RANLIB@") +set(CMAKE_TAPI "@CMAKE_TAPI@") set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@) set(CMAKE_Fortran_COMPILER_LOADED 1) set(CMAKE_Fortran_COMPILER_WORKS @CMAKE_Fortran_COMPILER_WORKS@) diff --git a/Modules/CMakeHIPCompiler.cmake.in b/Modules/CMakeHIPCompiler.cmake.in index 0fa5bf06cd5..6d5e62a2e1f 100644 --- a/Modules/CMakeHIPCompiler.cmake.in +++ b/Modules/CMakeHIPCompiler.cmake.in @@ -1,4 +1,6 @@ set(CMAKE_HIP_COMPILER "@CMAKE_HIP_COMPILER@") +set(CMAKE_HIP_HOST_COMPILER "@CMAKE_HIP_HOST_COMPILER@") +set(CMAKE_HIP_HOST_LINK_LAUNCHER "@CMAKE_HIP_HOST_LINK_LAUNCHER@") 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@") @@ -45,14 +47,27 @@ if(CMAKE_HIP_LIBRARY_ARCHITECTURE) set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_HIP_LIBRARY_ARCHITECTURE@") endif() -set(CMAKE_HIP_TOOLKIT_INCLUDE_DIRECTORIES "@CMAKE_HIP_TOOLKIT_INCLUDE_DIRECTORIES@") +set(CMAKE_HIP_COMPILER_CUDA_TOOLKIT_ROOT "@CMAKE_HIP_COMPILER_CUDA_TOOLKIT_ROOT@") +set(CMAKE_HIP_COMPILER_CUDA_TOOLKIT_LIBRARY_ROOT "@CMAKE_HIP_COMPILER_CUDA_TOOLKIT_LIBRARY_ROOT@") +set(CMAKE_HIP_COMPILER_CUDA_TOOLKIT_VERSION "@CMAKE_HIP_COMPILER_CUDA_TOOLKIT_VERSION@") +set(CMAKE_HIP_COMPILER_CUDA_LIBRARY_ROOT "@CMAKE_HIP_COMPILER_CUDA_LIBRARY_ROOT@") + +set(CMAKE_HIP_ARCHITECTURES_ALL "@CMAKE_HIP_ARCHITECTURES_ALL@") +set(CMAKE_HIP_ARCHITECTURES_ALL_MAJOR "@CMAKE_HIP_ARCHITECTURES_ALL_MAJOR@") +set(CMAKE_HIP_ARCHITECTURES_NATIVE "@CMAKE_HIP_ARCHITECTURES_NATIVE@") + +set(CMAKE_HIP_CUDA_TOOLKIT_INCLUDE_DIRECTORIES "@CMAKE_HIP_CUDA_TOOLKIT_INCLUDE_DIRECTORIES@") + +set(CMAKE_HIP_HOST_IMPLICIT_LINK_LIBRARIES "@CMAKE_HIP_HOST_IMPLICIT_LINK_LIBRARIES@") +set(CMAKE_HIP_HOST_IMPLICIT_LINK_DIRECTORIES "@CMAKE_HIP_HOST_IMPLICIT_LINK_DIRECTORIES@") +set(CMAKE_HIP_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_HIP_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@") set(CMAKE_HIP_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_HIP_IMPLICIT_INCLUDE_DIRECTORIES@") set(CMAKE_HIP_IMPLICIT_LINK_LIBRARIES "@CMAKE_HIP_IMPLICIT_LINK_LIBRARIES@") set(CMAKE_HIP_IMPLICIT_LINK_DIRECTORIES "@CMAKE_HIP_IMPLICIT_LINK_DIRECTORIES@") set(CMAKE_HIP_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_HIP_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@") -set(CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT "SHARED") +set(CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT "@CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT@") set(CMAKE_AR "@CMAKE_AR@") set(CMAKE_HIP_COMPILER_AR "@CMAKE_HIP_COMPILER_AR@") diff --git a/Modules/CMakeHIPCompilerABI.hip b/Modules/CMakeHIPCompilerABI.hip index 6c912bd1355..7d8b815d48e 100644 --- a/Modules/CMakeHIPCompilerABI.hip +++ b/Modules/CMakeHIPCompilerABI.hip @@ -1,9 +1,13 @@ -#ifndef __HIP__ +#if !defined(__HIP__) && !defined(__NVCC__) # error "A C or C++ compiler has been selected for HIP" #endif #include "CMakeCompilerABI.h" +#if defined(__NVCC__) +# include "CMakeCompilerCUDAArch.h" +#endif + int main(int argc, char* argv[]) { int require = 0; @@ -11,6 +15,16 @@ int main(int argc, char* argv[]) #if defined(ABI_ID) require += info_abi[argc]; #endif - (void)argv; + static_cast(argv); + +#if defined(__NVCC__) + if (!cmakeCompilerCUDAArch()) { + // Convince the compiler that the non-zero return value depends + // on the info strings so they are not optimized out. + return require ? -1 : 1; + } + return 0; +#else return require; +#endif } diff --git a/Modules/CMakeHIPCompilerId.hip.in b/Modules/CMakeHIPCompilerId.hip.in index 3c4a1d4be0e..4ac0f30cb69 100644 --- a/Modules/CMakeHIPCompilerId.hip.in +++ b/Modules/CMakeHIPCompilerId.hip.in @@ -1,4 +1,4 @@ -#ifndef __HIP__ +#if !defined(__HIP__) && !defined(__NVCC__) # error "A C or C++ compiler has been selected for HIP" #endif diff --git a/Modules/CMakeHIPInformation.cmake b/Modules/CMakeHIPInformation.cmake index 41a98db1cad..3995c36748a 100644 --- a/Modules/CMakeHIPInformation.cmake +++ b/Modules/CMakeHIPInformation.cmake @@ -8,6 +8,19 @@ else() endif() set(CMAKE_INCLUDE_FLAG_HIP "-I") +# Set implicit links early so compiler-specific modules can use them. +set(__IMPLICIT_LINKS) +foreach(dir ${CMAKE_HIP_HOST_IMPLICIT_LINK_DIRECTORIES}) + string(APPEND __IMPLICIT_LINKS " -L\"${dir}\"") +endforeach() +foreach(lib ${CMAKE_HIP_HOST_IMPLICIT_LINK_LIBRARIES}) + if(${lib} MATCHES "/") + string(APPEND __IMPLICIT_LINKS " \"${lib}\"") + else() + string(APPEND __IMPLICIT_LINKS " -l${lib}") + endif() +endforeach() + # Load compiler-specific information. if(CMAKE_HIP_COMPILER_ID) include(Compiler/${CMAKE_HIP_COMPILER_ID}-HIP OPTIONAL) @@ -129,7 +142,7 @@ endif() # compile a HIP file into an object file if(NOT CMAKE_HIP_COMPILE_OBJECT) set(CMAKE_HIP_COMPILE_OBJECT - " -o ${_CMAKE_COMPILE_AS_HIP_FLAG} -c ") + " ${_CMAKE_HIP_EXTRA_FLAGS} -o ${_CMAKE_COMPILE_AS_HIP_FLAG} -c ") endif() # compile a cu file into an executable diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index 1773dc4f28e..9213cc924b4 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -26,12 +26,22 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj 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}_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() + if(is_msvc) + string(APPEND linker "|link\\.exe|lld-link") + endif() set(startfile "CMAKE_LINK_STARTFILE-NOTFOUND") if(CMAKE_LINK_STARTFILE) set(startfile "${CMAKE_LINK_STARTFILE}") @@ -75,12 +85,6 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj endif() endif() endif() - set(is_msvc 0) - if(EXTRA_PARSE_LANGUAGE AND - ("x${CMAKE_${EXTRA_PARSE_LANGUAGE}_ID}" STREQUAL "xMSVC" OR - "x${CMAKE_${EXTRA_PARSE_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC")) - set(is_msvc 1) - endif() set(search_static 0) if("${cmd}" MATCHES "${linker_regex}") string(APPEND log " link line: [${line}]\n") diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 777c6807c58..1c6f0df4c8f 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -21,7 +21,8 @@ set(CMAKE_INCLUDE_FLAG_Swift "-I ") # FIXME: Move compiler- and platform-specific flags to the above-included modules. if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS" - OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") + OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" + OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -install_name -Xlinker ") elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -soname -Xlinker ") @@ -30,7 +31,8 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ") set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS" - OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") + OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" + OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP "") set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP "") else() diff --git a/Modules/CMakeSystemSpecificInitialize.cmake b/Modules/CMakeSystemSpecificInitialize.cmake index e87d868a8fa..ee8cb860c2b 100644 --- a/Modules/CMakeSystemSpecificInitialize.cmake +++ b/Modules/CMakeSystemSpecificInitialize.cmake @@ -25,7 +25,7 @@ unset(LINUX) # It is useful to share the same aforementioned configuration files and # avoids duplicating them in case of tightly related platforms. # -# An example are the platforms supported by Xcode (macOS, iOS, tvOS, +# An example are the platforms supported by Xcode (macOS, iOS, tvOS, visionOS # and watchOS). For all of those the CMAKE_EFFECTIVE_SYSTEM_NAME is # set to Apple which results in using # Platform/Apple-AppleClang-CXX.cmake for the Apple C++ compiler. diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake index 5779e4b7e4a..3057fe9d51b 100644 --- a/Modules/CMakeTestCUDACompiler.cmake +++ b/Modules/CMakeTestCUDACompiler.cmake @@ -22,51 +22,10 @@ if(CMAKE_CUDA_ABI_COMPILED) set(CMAKE_CUDA_COMPILER_WORKS TRUE) message(STATUS "Check for working CUDA compiler: ${CMAKE_CUDA_COMPILER} - skipped") - # Run the test binary to detect the native architectures. - execute_process(COMMAND "${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerABI_CUDA.bin" - RESULT_VARIABLE _CUDA_ARCHS_RESULT - OUTPUT_VARIABLE _CUDA_ARCHS_OUTPUT - ERROR_VARIABLE _CUDA_ARCHS_OUTPUT - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(_CUDA_ARCHS_RESULT EQUAL 0) - if("$ENV{CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP}") - # Undocumented hook used by CMake's CI. - # Clamp native architecture to version range supported by this CUDA. - list(GET CMAKE_CUDA_ARCHITECTURES_ALL 0 _CUDA_ARCH_MIN) - list(GET CMAKE_CUDA_ARCHITECTURES_ALL -1 _CUDA_ARCH_MAX) - set(CMAKE_CUDA_ARCHITECTURES_NATIVE "") - foreach(_CUDA_ARCH IN LISTS _CUDA_ARCHS_OUTPUT) - if(_CUDA_ARCH LESS _CUDA_ARCH_MIN) - set(_CUDA_ARCH "${_CUDA_ARCH_MIN}") - endif() - if(_CUDA_ARCH GREATER _CUDA_ARCH_MAX) - set(_CUDA_ARCH "${_CUDA_ARCH_MAX}") - endif() - list(APPEND CMAKE_CUDA_ARCHITECTURES_NATIVE ${_CUDA_ARCH}) - endforeach() - unset(_CUDA_ARCH) - unset(_CUDA_ARCH_MIN) - unset(_CUDA_ARCH_MAX) - else() - set(CMAKE_CUDA_ARCHITECTURES_NATIVE "${_CUDA_ARCHS_OUTPUT}") - endif() - list(REMOVE_DUPLICATES CMAKE_CUDA_ARCHITECTURES_NATIVE) - list(TRANSFORM CMAKE_CUDA_ARCHITECTURES_NATIVE APPEND "-real") - else() - if(NOT _CUDA_ARCHS_RESULT MATCHES "[0-9]+") - set(_CUDA_ARCHS_STATUS " (${_CUDA_ARCHS_RESULT})") - else() - set(_CUDA_ARCHS_STATUS "") - endif() - string(REPLACE "\n" "\n " _CUDA_ARCHS_OUTPUT " ${_CUDA_ARCHS_OUTPUT}") - message(CONFIGURE_LOG - "Detecting the CUDA native architecture(s) failed with " - "the following output:\n${_CUDA_ARCHS_OUTPUT}\n\n") - endif() - unset(_CUDA_ARCHS_EXE) - unset(_CUDA_ARCHS_RESULT) - unset(_CUDA_ARCHS_OUTPUT) + include(Internal/CMakeCUDAArchitecturesNative) + # Run the test binary to get: + # - CMAKE_CUDA_ARCHITECTURES_NATIVE + cmake_cuda_architectures_native(CUDA) endif() # This file is used by EnableLanguage in cmGlobalGenerator to @@ -114,22 +73,14 @@ if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES "${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES}") endif() +include(Internal/CMakeCUDAFilterImplicitLibs) # Filter out implicit link libraries that should not be passed unconditionally. -# See CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES_EXCLUDE in CMakeDetermineCUDACompiler. -list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES ${CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES_EXCLUDE}) +cmake_cuda_filter_implicit_libs(CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES) if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") - # Remove the CUDA Toolkit include directories from the set of - # implicit system include directories. - # This resolves the issue that NVCC doesn't specify these - # includes as SYSTEM includes when compiling device code, and sometimes - # they contain headers that generate warnings, so let users mark them - # as SYSTEM explicitly - if(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES) - list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES - ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} - ) - endif() + include(Internal/CMakeNVCCFilterImplicitInfo) + # Match arguments with cmake_nvcc_parse_implicit_info call in CMakeDetermineCUDACompiler. + cmake_nvcc_filter_implicit_info(CUDA CMAKE_CUDA_) endif() # Re-configure to save learned information. diff --git a/Modules/CMakeTestHIPCompiler.cmake b/Modules/CMakeTestHIPCompiler.cmake index 686f0555496..ec54d80f2f3 100644 --- a/Modules/CMakeTestHIPCompiler.cmake +++ b/Modules/CMakeTestHIPCompiler.cmake @@ -10,7 +10,10 @@ if(CMAKE_HIP_COMPILER_FORCED) endif() set(__CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS}") -string(APPEND CMAKE_HIP_FLAGS " --cuda-host-only") + +if(CMAKE_HIP_COMPILER_ID STREQUAL "Clang") + string(APPEND CMAKE_HIP_FLAGS " --cuda-host-only") +endif() include(CMakeTestCompilerCommon) @@ -31,6 +34,13 @@ if(CMAKE_HIP_ABI_COMPILED) # The compiler worked so skip dedicated test below. set(CMAKE_HIP_COMPILER_WORKS TRUE) message(STATUS "Check for working HIP compiler: ${CMAKE_HIP_COMPILER} - skipped") + + if(CMAKE_HIP_COMPILER_ID STREQUAL "NVIDIA") + include(Internal/CMakeCUDAArchitecturesNative) + # Run the test binary to get: + # - CMAKE_HIP_ARCHITECTURES_NATIVE + cmake_cuda_architectures_native(HIP) + endif() endif() # This file is used by EnableLanguage in cmGlobalGenerator to @@ -42,7 +52,7 @@ if(NOT CMAKE_HIP_COMPILER_WORKS) PrintTestCompilerStatus("HIP") __TestCompiler_setTryCompileTargetType() string(CONCAT __TestCompiler_testHIPCompilerSource - "#ifndef __HIP__\n" + "#if !defined(__HIP__) && !defined(__NVCC__)\n" "# error \"The CMAKE_HIP_COMPILER is set to a C/CXX compiler\"\n" "#endif\n" "int main(){return 0;}\n") @@ -76,6 +86,16 @@ unset(__CMAKE_HIP_FLAGS) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompileFeatures.cmake) CMAKE_DETERMINE_COMPILE_FEATURES(HIP) +if(CMAKE_HIP_COMPILER_ID STREQUAL "NVIDIA") + include(Internal/CMakeNVCCFilterImplicitInfo) + # Match arguments with cmake_nvcc_parse_implicit_info call in CMakeDetermineHIPCompiler. + cmake_nvcc_filter_implicit_info(HIP CMAKE_HIP_CUDA_) + + include(Internal/CMakeCUDAFilterImplicitLibs) + # Filter out implicit link libraries that should not be passed unconditionally. + cmake_cuda_filter_implicit_libs(CMAKE_HIP_IMPLICIT_LINK_LIBRARIES) +endif() + # Re-configure to save learned information. configure_file( ${CMAKE_ROOT}/Modules/CMakeHIPCompiler.cmake.in diff --git a/Modules/CUDA/architectures.cmake b/Modules/CUDA/architectures.cmake deleted file mode 100644 index 7d6a6e04898..00000000000 --- a/Modules/CUDA/architectures.cmake +++ /dev/null @@ -1,69 +0,0 @@ -# See supported GPUs on Wikipedia -# https://en.wikipedia.org/wiki/CUDA#GPUs_supported - -# Initial set based on CUDA 7.0. -set(CMAKE_CUDA_ARCHITECTURES_ALL 20 21 30 35 37 50 52 53) -set(CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 20 30 35 50) - -if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 8.0) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 60 61 62) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 60) -endif() - -if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 9.0) - if(NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Clang" OR CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 70 72) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 70) - endif() - - list(REMOVE_ITEM CMAKE_CUDA_ARCHITECTURES_ALL 20 21) - list(REMOVE_ITEM CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 20) -endif() - -if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 10.0 - AND (NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Clang" OR CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 75) -endif() - -if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 11.0) - if(NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Clang" OR CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 80) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 80) - endif() - - list(REMOVE_ITEM CMAKE_CUDA_ARCHITECTURES_ALL 30) - list(REMOVE_ITEM CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 30) -endif() - -if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 11.1 - AND (NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Clang" OR CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 86) -endif() - -if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 11.4 - AND (NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 87) -endif() - -if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 11.8 - AND (NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 89 90) - list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 90) -endif() - -if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 12.0 - AND (NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")) - list(REMOVE_ITEM CMAKE_CUDA_ARCHITECTURES_ALL 35 37) - list(REMOVE_ITEM CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 35) -endif() - -# only generate jit code for the newest arch for all/all-major -list(POP_BACK CMAKE_CUDA_ARCHITECTURES_ALL _latest_arch) -list(TRANSFORM CMAKE_CUDA_ARCHITECTURES_ALL APPEND "-real") -list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL ${_latest_arch}) - -list(POP_BACK CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR _latest_arch) -list(TRANSFORM CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR APPEND "-real") -list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR ${_latest_arch}) - -unset(_latest_arch) diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake index 8ecf9d02834..d3a21f3b58d 100644 --- a/Modules/CheckCXXSymbolExists.cmake +++ b/Modules/CheckCXXSymbolExists.cmake @@ -33,7 +33,7 @@ CheckCXXSymbolExists function. Since there is no reliable way to predict whether a given function in the system environment may be defined as an overloaded function or may be an overloaded function on other systems or will become so in the future, it - is generally advised to use the :module:`CheckCXXSourceCompiles` module for + is generally advised to use the :module:`CheckSourceCompiles` module for checking any function symbol (unless somehow you surely know the checked function is not overloaded on other systems or will not be so in the future). diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index 7ea0748208c..94948b99505 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -5,26 +5,45 @@ CheckLanguage ------------- -检查是否可以启用语言 +Check whether a language can be enabled by the :command:`enable_language` +or :command:`project` commands: -Usage: +.. command:: check_language -:: + .. code-block:: cmake - check_language() + check_language() -where ```` is a language that may be passed to :command:`enable_language` -such as ``Fortran``. If :variable:`CMAKE__COMPILER` is already defined -the check does nothing. Otherwise it tries enabling the language in a -test project. The result is cached in :variable:`CMAKE__COMPILER` -as the compiler that was found, or ``NOTFOUND`` if the language cannot be -enabled. For CUDA which can have an explicit host compiler, the cache -:variable:`CMAKE_CUDA_HOST_COMPILER` variable will be set if it was required -for compilation (and cleared if it was not). + Try enabling language ```` in a test project and record results + in the cache: -Example: + :variable:`CMAKE__COMPILER` + If the language can be enabled, this variable is set to the compiler + that was found. If the language cannot be enabled, this variable is + set to ``NOTFOUND``. -:: + If this variable is already set, either explicitly or cached by + a previous call, the check is skipped. + + :variable:`CMAKE__HOST_COMPILER` + This variable is set when ```` is ``CUDA`` or ``HIP``. + + If the check detects an explicit host compiler that is required for + compilation, this variable will be set to that compiler. + If the check detects that no explicit host compiler is needed, + this variable will be cleared. + + If this variable is already set, its value is preserved only if + :variable:`CMAKE__COMPILER` is also set. + Otherwise, the check runs and overwrites + :variable:`CMAKE__HOST_COMPILER` with a new result. + Note that :variable:`CMAKE__HOST_COMPILER` documents it should + not be set without also setting + :variable:`CMAKE__COMPILER` to a NVCC compiler. + +For example: + +.. code-block:: cmake check_language(Fortran) if(CMAKE_Fortran_COMPILER) @@ -46,7 +65,7 @@ macro(check_language lang) file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}) set(extra_compiler_variables) - if(${lang} STREQUAL CUDA AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") + if("${lang}" MATCHES "^(CUDA|HIP)$" AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") set(extra_compiler_variables "set(CMAKE_CUDA_HOST_COMPILER \\\"\${CMAKE_CUDA_HOST_COMPILER}\\\")") endif() diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index a74e90ba78f..c0d23564fa8 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -32,7 +32,7 @@ endif() if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") - string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE + string(CONCAT CMAKE_CXX_SCANDEP_SOURCE "\"${CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS}\"" " -format=p1689" " --" @@ -41,7 +41,8 @@ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) " -MT " " -MD -MF " " > ") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "clang") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "@") + set(CMAKE_CXX_MODULE_MAP_FORMAT "clang") + set(CMAKE_CXX_MODULE_MAP_FLAG "@") + set(CMAKE_CXX_MODULE_BMI_ONLY_FLAG "--precompile") endif() endif() diff --git a/Modules/Compiler/CrayClang-C.cmake b/Modules/Compiler/CrayClang-C.cmake new file mode 100644 index 00000000000..bf878fcde1a --- /dev/null +++ b/Modules/Compiler/CrayClang-C.cmake @@ -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. + +include(Compiler/CrayClang) +__compiler_cray_clang(C) + +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + +string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG") +string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG") + +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_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 15.0.0 17) diff --git a/Modules/Compiler/CrayClang-CXX.cmake b/Modules/Compiler/CrayClang-CXX.cmake new file mode 100644 index 00000000000..de6a53c3173 --- /dev/null +++ b/Modules/Compiler/CrayClang-CXX.cmake @@ -0,0 +1,35 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +include(Compiler/CrayClang) +__compiler_cray_clang(CXX) + + +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) +set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") + +string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG") +string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG") + +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++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) + +__compiler_check_default_language_standard(CXX 15.0.0 14) diff --git a/Modules/Compiler/CrayClang-DetermineCompiler.cmake b/Modules/Compiler/CrayClang-DetermineCompiler.cmake new file mode 100644 index 00000000000..18284449bac --- /dev/null +++ b/Modules/Compiler/CrayClang-DetermineCompiler.cmake @@ -0,0 +1,8 @@ +set(_compiler_id_pp_test "defined(__clang__) && defined(__cray__)") + +set(_compiler_id_version_compute " +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__cray_major__) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__cray_minor__) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__cray_patchlevel__) +# define @PREFIX@COMPILER_VERSION_INTERNAL_STR __clang_version__ +") diff --git a/Modules/Compiler/CrayClang.cmake b/Modules/Compiler/CrayClang.cmake new file mode 100644 index 00000000000..d2db9ddb1be --- /dev/null +++ b/Modules/Compiler/CrayClang.cmake @@ -0,0 +1,17 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# This module is shared by multiple languages; use include blocker. +if(__COMPILER_CRAYCLANG) + return() +endif() +set(__COMPILER_CRAYCLANG 1) + +include(Compiler/Clang) + +macro (__compiler_cray_clang lang) + set(__crayclang_ver "${CMAKE_${lang}_COMPILER_VERSION}") + set("CMAKE_${lang}_COMPILER_VERSION" "${CMAKE_${lang}_COMPILER_VERSION_INTERNAL}") + __compiler_clang(${lang}) + set("CMAKE_${lang}_COMPILER_VERSION" "${__crayclang_ver}") +endmacro () diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index b35f2541727..2e1b4ade840 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -72,3 +72,24 @@ elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) 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) + string(CONCAT CMAKE_CXX_SCANDEP_SOURCE + " -E -x c++ " + " -MT -MD -MF " + " -fmodules-ts -fdeps-file= -fdeps-target= -fdeps-format=p1689r5" + " -o ") + set(CMAKE_CXX_MODULE_MAP_FORMAT "gcc") + string(CONCAT CMAKE_CXX_MODULE_MAP_FLAG + # Turn on modules. + "-fmodules-ts" + # Read the module mapper file. + " -fmodule-mapper=" + # Make sure dependency tracking is enabled (missing from `try_*`). + " -MD" + # Suppress `CXX_MODULES +=` from generated depfile snippets. + " -fdeps-format=p1689r5" + # Force C++ as a language. + " -x c++") + set(CMAKE_CXX_MODULE_BMI_ONLY_FLAG "-fmodule-only") +endif() diff --git a/Modules/Compiler/IBMClang-CXX.cmake b/Modules/Compiler/IBMClang-CXX.cmake index 5431b17e204..be9b5257b8e 100644 --- a/Modules/Compiler/IBMClang-CXX.cmake +++ b/Modules/Compiler/IBMClang-CXX.cmake @@ -31,6 +31,8 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.1.0) set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17") 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") endif() __compiler_check_default_language_standard(CXX 17.1.0 17) diff --git a/Modules/Compiler/IntelLLVM.cmake b/Modules/Compiler/IntelLLVM.cmake index e256c8f454e..f3c0bf41c1b 100644 --- a/Modules/Compiler/IntelLLVM.cmake +++ b/Modules/Compiler/IntelLLVM.cmake @@ -44,6 +44,13 @@ else() string(APPEND CMAKE_${lang}_FLAGS_INIT " ") string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g") + if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 2023.0.0) + if("x${lang}" STREQUAL "xFortran") + string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -diag-disable:10440") + else() + string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -Rno-debug-disables-optimization") + endif() + endif() 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") diff --git a/Modules/Compiler/LLVMFlang-Fortran.cmake b/Modules/Compiler/LLVMFlang-Fortran.cmake index 291413edeb6..d27f094e58a 100644 --- a/Modules/Compiler/LLVMFlang-Fortran.cmake +++ b/Modules/Compiler/LLVMFlang-Fortran.cmake @@ -1,5 +1,3 @@ -set(CMAKE_Fortran_VERBOSE_FLAG "-v") - set(CMAKE_Fortran_SUBMODULE_SEP "-") set(CMAKE_Fortran_SUBMODULE_EXT ".mod") @@ -15,6 +13,12 @@ set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp") set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nocpp") set(CMAKE_Fortran_POSTPROCESS_FLAG "-ffixed-line-length-72") -string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -O0 -g") -string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -O2 -g") -string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3") +set(CMAKE_Fortran_COMPILE_OPTIONS_TARGET "--target=") + +if(NOT "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC") + set(CMAKE_Fortran_VERBOSE_FLAG "-v") + + string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " -O0 -g") + string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -O2 -g") + string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3") +endif() diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 10a9073ac9b..79cd2e082f1 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -79,12 +79,13 @@ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) endif() if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.34") - string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE + string(CONCAT CMAKE_CXX_SCANDEP_SOURCE " -nologo -TP" " -showIncludes" " -scanDependencies " " -Fo") - set(CMAKE_EXPERIMENTAL_CXX_SCANDEP_DEPFILE_FORMAT "msvc") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT "msvc") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "@") + set(CMAKE_CXX_SCANDEP_DEPFILE_FORMAT "msvc") + set(CMAKE_CXX_MODULE_MAP_FORMAT "msvc") + set(CMAKE_CXX_MODULE_MAP_FLAG "@") + set(CMAKE_CXX_MODULE_BMI_ONLY_FLAG "-ifcOnly;-ifcOutput;") endif () diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index c839d1cbbb2..93ad1829a4a 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -1,10 +1,9 @@ -include(Compiler/CMakeCommonCompilerMacros) +include(Compiler/NVIDIA) +__compiler_nvidia_cxx_standards(CUDA) +__compiler_nvidia_cuda_flags(CUDA) set(CMAKE_CUDA_COMPILER_HAS_DEVICE_LINK_PHASE True) -set(CMAKE_CUDA_VERBOSE_FLAG "-v") -set(CMAKE_CUDA_VERBOSE_COMPILE_FLAG "-Xcompiler=-v") -set(_CMAKE_COMPILE_AS_CUDA_FLAG "-x cu") set(_CMAKE_CUDA_WHOLE_FLAG "-c") set(_CMAKE_CUDA_RDC_FLAG "-rdc=true") set(_CMAKE_CUDA_PTX_FLAG "-ptx") @@ -14,162 +13,11 @@ if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.7.0") set(_CMAKE_CUDA_OPTIX_FLAG "-optix-ir") endif() -if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89) - # The -forward-unknown-to-host-compiler flag was only - # added to nvcc in 10.2 so before that we had no good - # way to invoke the CUDA compiler and propagate unknown - # flags such as -pthread to the host compiler - set(_CMAKE_CUDA_EXTRA_FLAGS "-forward-unknown-to-host-compiler") -else() - set(_CMAKE_CUDA_EXTRA_FLAGS "") -endif() - -if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0") - set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "-Wno-deprecated-gpu-targets") -else() - set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "") -endif() - -if(CMAKE_CUDA_HOST_COMPILER AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") - string(APPEND _CMAKE_CUDA_EXTRA_FLAGS " -ccbin=") -endif() - -if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89) - # Starting in 10.2, nvcc supported treating all warnings as errors - set(CMAKE_CUDA_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror" "all-warnings") -endif() - -if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89) - # The -MD flag was only added to nvcc in 10.2 so - # before that we had to invoke the compiler twice - # to get header dependency information - set(CMAKE_DEPFILE_FLAGS_CUDA "-MD -MT -MF ") -else() - set(CMAKE_CUDA_DEPENDS_EXTRA_COMMANDS " ${_CMAKE_CUDA_EXTRA_FLAGS} ${_CMAKE_COMPILE_AS_CUDA_FLAG} -M -MT -o ") -endif() -set(CMAKE_CUDA_DEPFILE_FORMAT gcc) -if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) - AND CMAKE_GENERATOR MATCHES "Makefiles|WMake") - set(CMAKE_CUDA_DEPENDS_USE_COMPILER TRUE) -endif() - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2) - set(_CMAKE_CUDA_IPO_SUPPORTED_BY_CMAKE YES) - set(_CMAKE_CUDA_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) - set(CMAKE_CUDA_DEVICE_LINK_OPTIONS_IPO " -dlto") endif() -if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") - set(CMAKE_CUDA_COMPILE_OPTIONS_PIE -Xcompiler=-fPIE) - set(CMAKE_CUDA_COMPILE_OPTIONS_PIC -Xcompiler=-fPIC) - set(CMAKE_CUDA_COMPILE_OPTIONS_VISIBILITY -Xcompiler=-fvisibility=) - # CMAKE_SHARED_LIBRARY_CUDA_FLAGS is sent to the host linker so we - # don't need to forward it through nvcc. - set(CMAKE_SHARED_LIBRARY_CUDA_FLAGS -fPIC) - string(APPEND CMAKE_CUDA_FLAGS_INIT " ") - string(APPEND CMAKE_CUDA_FLAGS_DEBUG_INIT " -g") - string(APPEND CMAKE_CUDA_FLAGS_RELEASE_INIT " -O3 -DNDEBUG") - string(APPEND CMAKE_CUDA_FLAGS_MINSIZEREL_INIT " -O1 -DNDEBUG") - string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG") -endif() - -set(CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS -shared) -set(CMAKE_INCLUDE_SYSTEM_FLAG_CUDA "-isystem ") - -if (CMAKE_CUDA_SIMULATE_ID STREQUAL "GNU") - set(CMAKE_CUDA_LINKER_WRAPPER_FLAG "-Wl,") - set(CMAKE_CUDA_LINKER_WRAPPER_FLAG_SEP ",") -elseif(CMAKE_CUDA_SIMULATE_ID STREQUAL "Clang") - set(CMAKE_CUDA_LINKER_WRAPPER_FLAG "-Xlinker" " ") - set(CMAKE_CUDA_LINKER_WRAPPER_FLAG_SEP) -endif() - set(CMAKE_CUDA_DEVICE_COMPILER_WRAPPER_FLAG "-Xcompiler=") set(CMAKE_CUDA_DEVICE_COMPILER_WRAPPER_FLAG_SEP ",") set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG "-Xlinker=") set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG_SEP ",") - -set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static") -set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "cudadevrt;cudart") -set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_NONE "") - -if(UNIX AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX")) - list(APPEND CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "rt" "pthread" "dl") -endif() - -if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") - # MSVC requires c++14 as the minimum level - set(CMAKE_CUDA03_STANDARD_COMPILE_OPTION "") - set(CMAKE_CUDA03_EXTENSION_COMPILE_OPTION "") - - # MSVC requires c++14 as the minimum level - set(CMAKE_CUDA11_STANDARD_COMPILE_OPTION "") - set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "") - - if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0) - if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.10.25017) - set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14") - set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14") - else() - set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "") - set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "") - endif() - endif() - - if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0) - if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.11.25505) - set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "-std=c++17") - set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "-std=c++17") - endif() - endif() - - if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 12.0) - if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.11.25505) - set(CMAKE_CUDA20_STANDARD_COMPILE_OPTION "-std=c++20") - set(CMAKE_CUDA20_EXTENSION_COMPILE_OPTION "-std=c++20") - endif() - endif() - -else() - set(CMAKE_CUDA03_STANDARD_COMPILE_OPTION "") - set(CMAKE_CUDA03_EXTENSION_COMPILE_OPTION "") - - set(CMAKE_CUDA11_STANDARD_COMPILE_OPTION "-std=c++11") - set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "-std=c++11") - - if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0) - set(CMAKE_CUDA03_STANDARD_COMPILE_OPTION "-std=c++03") - set(CMAKE_CUDA03_EXTENSION_COMPILE_OPTION "-std=c++03") - set(CMAKE_CUDA14_STANDARD_COMPILE_OPTION "-std=c++14") - set(CMAKE_CUDA14_EXTENSION_COMPILE_OPTION "-std=c++14") - endif() - - if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0) - set(CMAKE_CUDA17_STANDARD_COMPILE_OPTION "-std=c++17") - set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "-std=c++17") - endif() - - if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 12.0) - set(CMAKE_CUDA20_STANDARD_COMPILE_OPTION "-std=c++20") - set(CMAKE_CUDA20_EXTENSION_COMPILE_OPTION "-std=c++20") - endif() - -endif() - -if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0") - set(CMAKE_CUDA_RESPONSE_FILE_DEVICE_LINK_FLAG "--options-file ") - set(CMAKE_CUDA_RESPONSE_FILE_FLAG "--options-file ") -endif() - -if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0") - set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 1) - set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 1) - set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 1) -else() - set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 0) - set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 0) - set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0) -endif() - -__compiler_check_default_language_standard(CUDA 6.0 03) diff --git a/Modules/Compiler/NVIDIA-HIP.cmake b/Modules/Compiler/NVIDIA-HIP.cmake new file mode 100644 index 00000000000..c888bc7ddee --- /dev/null +++ b/Modules/Compiler/NVIDIA-HIP.cmake @@ -0,0 +1,14 @@ +include(Compiler/NVIDIA) +__compiler_nvidia_cxx_standards(HIP) +__compiler_nvidia_cuda_flags(HIP) + +# The ROCm hip-lang cmake package's device runtime library is not needed for NVIDIA GPUs. +set(_CMAKE_HIP_DEVICE_RUNTIME_TARGET "") + +set(CMAKE_HIP_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_HIP_COMPILER_ROCM_ROOT}/include") + +set(CMAKE_HIP_LINK_EXECUTABLE + " -o ${__IMPLICIT_LINKS}") +set(CMAKE_HIP_CREATE_SHARED_LIBRARY + " -o ${__IMPLICIT_LINKS}") +set(CMAKE_HIP_CREATE_SHARED_MODULE "${CMAKE_HIP_CREATE_SHARED_LIBRARY}") diff --git a/Modules/Compiler/NVIDIA.cmake b/Modules/Compiler/NVIDIA.cmake new file mode 100644 index 00000000000..a126c57d85b --- /dev/null +++ b/Modules/Compiler/NVIDIA.cmake @@ -0,0 +1,168 @@ + +# This module is shared by multiple languages; use include blocker. +if(__COMPILER_NVIDIA) + return() +endif() +set(__COMPILER_NVIDIA 1) + +include(Compiler/CMakeCommonCompilerMacros) + +macro(__compiler_nvidia_cxx_standards lang) + if("x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC") + # MSVC requires c++14 as the minimum level + set(CMAKE_${lang}03_STANDARD_COMPILE_OPTION "") + set(CMAKE_${lang}03_EXTENSION_COMPILE_OPTION "") + + # MSVC requires c++14 as the minimum level + set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "") + set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "") + + 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") + set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "-std=c++14") + else() + set(CMAKE_${lang}14_STANDARD_COMPILE_OPTION "") + set(CMAKE_${lang}14_EXTENSION_COMPILE_OPTION "") + endif() + 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") + endif() + endif() + + if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 12.0) + 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") + endif() + endif() + else() + set(CMAKE_${lang}03_STANDARD_COMPILE_OPTION "") + set(CMAKE_${lang}03_EXTENSION_COMPILE_OPTION "") + + set(CMAKE_${lang}11_STANDARD_COMPILE_OPTION "-std=c++11") + set(CMAKE_${lang}11_EXTENSION_COMPILE_OPTION "-std=c++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") + 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") + 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") + endif() + endif() + + __compiler_check_default_language_standard(${lang} 6.0 03) +endmacro() + +macro(__compiler_nvidia_cuda_flags lang) + set(CMAKE_${lang}_VERBOSE_FLAG "-v") + set(CMAKE_${lang}_VERBOSE_COMPILE_FLAG "-Xcompiler=-v") + set(_CMAKE_COMPILE_AS_${lang}_FLAG "-x cu") + + if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89) + # The -forward-unknown-to-host-compiler flag was only + # added to nvcc in 10.2 so before that we had no good + # way to invoke the NVCC compiler and propagate unknown + # flags such as -pthread to the host compiler + set(_CMAKE_${lang}_EXTRA_FLAGS "-forward-unknown-to-host-compiler") + else() + set(_CMAKE_${lang}_EXTRA_FLAGS "") + endif() + + if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0") + set(_CMAKE_${lang}_EXTRA_DEVICE_LINK_FLAGS "-Wno-deprecated-gpu-targets") + else() + set(_CMAKE_${lang}_EXTRA_DEVICE_LINK_FLAGS "") + endif() + + if(CMAKE_${lang}_HOST_COMPILER AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") + string(APPEND _CMAKE_${lang}_EXTRA_FLAGS " -ccbin=") + endif() + + if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89) + # Starting in 10.2, nvcc supported treating all warnings as errors + set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror" "all-warnings") + endif() + + set(CMAKE_${lang}_DEPFILE_FORMAT gcc) + if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) + AND CMAKE_GENERATOR MATCHES "Makefiles|WMake") + set(CMAKE_${lang}_DEPENDS_USE_COMPILER TRUE) + endif() + + if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89) + # The -MD flag was only added to nvcc in 10.2 so + # before that we had to invoke the compiler twice + # to get header dependency information + set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT -MF ") + else() + set(CMAKE_${lang}_DEPENDS_EXTRA_COMMANDS " ${_CMAKE_${lang}_EXTRA_FLAGS} ${_CMAKE_COMPILE_AS_${lang}_FLAG} -M -MT -o ") + endif() + + if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2) + set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES) + set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) + endif() + + if(NOT "x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE -Xcompiler=-fPIE) + set(CMAKE_${lang}_COMPILE_OPTIONS_PIC -Xcompiler=-fPIC) + set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY -Xcompiler=-fvisibility=) + # CMAKE_SHARED_LIBRARY_${lang}_FLAGS is sent to the host linker so we + # don't need to forward it through nvcc. + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS -fPIC) + string(APPEND CMAKE_${lang}_FLAGS_INIT " ") + string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g") + string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG") + string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O1 -DNDEBUG") + string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG") + endif() + + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS -shared) + set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ") + + if (CMAKE_${lang}_SIMULATE_ID STREQUAL "GNU") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",") + elseif(CMAKE_${lang}_SIMULATE_ID STREQUAL "Clang") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ") + set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP) + endif() + + set(CMAKE_${lang}_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static") + set(CMAKE_${lang}_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "cudadevrt;cudart") + set(CMAKE_${lang}_RUNTIME_LIBRARY_LINK_OPTIONS_NONE "") + + if(UNIX AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX")) + list(APPEND CMAKE_${lang}_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "rt" "pthread" "dl") + endif() + + if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0") + set(CMAKE_${lang}_RESPONSE_FILE_DEVICE_LINK_FLAG "--options-file ") + set(CMAKE_${lang}_RESPONSE_FILE_FLAG "--options-file ") + endif() + + if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0") + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1) + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 1) + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) + else() + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 0) + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 0) + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 0) + endif() +endmacro() diff --git a/Modules/Compiler/OrangeC-ASM.cmake b/Modules/Compiler/OrangeC-ASM.cmake new file mode 100644 index 00000000000..fe789119cff --- /dev/null +++ b/Modules/Compiler/OrangeC-ASM.cmake @@ -0,0 +1,7 @@ +include(Compiler/OrangeC) +__compiler_orangec(ASM) + +set(CMAKE_ASM_OUTPUT_EXTENSION ".o") +set(CMAKE_ASM_VERBOSE_FLAG "-yyyyy") + +set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm;nas) diff --git a/Modules/Compiler/OrangeC-C.cmake b/Modules/Compiler/OrangeC-C.cmake new file mode 100644 index 00000000000..15a6476fa1d --- /dev/null +++ b/Modules/Compiler/OrangeC-C.cmake @@ -0,0 +1,20 @@ +include(Compiler/OrangeC) +include(Compiler/CMakeCommonCompilerMacros) + +set(CMAKE_C_OUTPUT_EXTENSION ".o") +set(CMAKE_C_VERBOSE_FLAG "-yyyyy") +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + +set(CMAKE_C90_STANDARD_COMPILE_OPTION -std=c89) +set(CMAKE_C90_EXTENSION_COMPILE_OPTION -std=c89) +set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON) +set(CMAKE_C99_STANDARD_COMPILE_OPTION -std=c99) +set(CMAKE_C99_EXTENSION_COMPILE_OPTION -std=c99) +set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON) +set(CMAKE_C11_STANDARD_COMPILE_OPTION -std=c11) +set(CMAKE_C11_EXTENSION_COMPILE_OPTION -std=c11) +set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON) + +__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 new file mode 100644 index 00000000000..3f9d59ce6bf --- /dev/null +++ b/Modules/Compiler/OrangeC-CXX.cmake @@ -0,0 +1,25 @@ +include(Compiler/OrangeC) +include(Compiler/CMakeCommonCompilerMacros) + +set(_ORANGEC_COMPILE_CXX " -x c++") +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) + +set(CMAKE_CXX_OUTPUT_EXTENSION ".o") +set(CMAKE_CXX_VERBOSE_FLAG "-yyyyy") + + + +#- OrangeC is a little lax when accepting compiler version specifications. +# Usually changing the version only changes the value of __cplusplus. +# Also we don't support CXX98 +set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") +set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++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=c++14") +set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON) + +__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/OrangeC-DetermineCompiler.cmake b/Modules/Compiler/OrangeC-DetermineCompiler.cmake new file mode 100644 index 00000000000..2ecc1401472 --- /dev/null +++ b/Modules/Compiler/OrangeC-DetermineCompiler.cmake @@ -0,0 +1,7 @@ + +set(_compiler_id_pp_test "defined(__ORANGEC__)") + +set(_compiler_id_version_compute " +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__ORANGEC_MAJOR__) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__ORANGEC_MINOR__) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__ORANGEC_PATCHLEVEL__)") diff --git a/Modules/Compiler/OrangeC.cmake b/Modules/Compiler/OrangeC.cmake new file mode 100644 index 00000000000..fbb245b748a --- /dev/null +++ b/Modules/Compiler/OrangeC.cmake @@ -0,0 +1,33 @@ +include_guard() + +macro(__compiler_orangec lang) + if ("x${lang}" MATCHES "^x(C|CXX)$") + set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE " ${_ORANGEC_COMPILE_${lang}} -! +i -o ") + set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE " ${_ORANGEC_COMPILE_${lang}} -! -S -o ") + endif() + set(CMAKE_${lang}_COMPILE_OBJECT " ${_ORANGEC_COMPILE_${lang}} -! -c -o ") + unset(_ORANGEC_COMPILE_${lang}) + + set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT -MF ") + set(CMAKE_${lang}_DEPFILE_FORMAT gcc) + set(CMAKE_${lang}_DEPENDS_USE_COMPILER TRUE) + + string(APPEND CMAKE_${lang}_FLAGS_INIT " ") + string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g") + string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O2 -DNDEBUG") + string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O1 -DNDEBUG") + string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG") + + set(CMAKE_${lang}_CREATE_STATIC_LIBRARY + " -! -static -o ") + set(CMAKE_${lang}_LINK_EXECUTABLE " -! -o --out-implib ") + set(CMAKE_${lang}_CREATE_SHARED_LIBRARY + " -! -o --out-implib ") + set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}") + + set(CMAKE_LIBRARY_PATH_FLAG "-L") + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-! -shared") + + set(CMAKE_${lang}_RESPONSE_FILE_FLAG "@") + set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@") +endmacro() diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 605908d771e..f43f48d1aee 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -11,11 +11,8 @@ ExternalProject .. contents:: -Commands -^^^^^^^^ - External Project Definition -""""""""""""""""""""""""""" +^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. command:: ExternalProject_Add @@ -34,866 +31,908 @@ External Project Definition customized. The function supports a large number of options which can be used to tailor the external project behavior. - **Directory Options:** - Most of the time, the default directory layout is sufficient. It is largely - an implementation detail that the main project usually doesn't need to - change. In some circumstances, however, control over the directory layout - can be useful or necessary. The directory options are potentially more - useful from the point of view that the main build can use the - :command:`ExternalProject_Get_Property` command to retrieve their values, - thereby allowing the main project to refer to build artifacts of the - external project. - - ``PREFIX `` - Root directory for the external project. Unless otherwise noted below, - all other directories associated with the external project will be - created under here. - - ``TMP_DIR `` - Directory in which to store temporary files. - - ``STAMP_DIR `` - Directory in which to store the timestamps of each step. Log files from - individual steps are also created in here unless overridden by LOG_DIR - (see *Logging Options* below). - - ``LOG_DIR `` - .. versionadded:: 3.14 - - Directory in which to store the logs of each step. - - ``DOWNLOAD_DIR `` - Directory in which to store downloaded files before unpacking them. This - directory is only used by the URL download method, all other download - methods use ``SOURCE_DIR`` directly instead. - - ``SOURCE_DIR `` - Source directory into which downloaded contents will be unpacked, or for - non-URL download methods, the directory in which the repository should be - checked out, cloned, etc. If no download method is specified, this must - point to an existing directory where the external project has already - been unpacked or cloned/checked out. - - .. note:: - If a download method is specified, any existing contents of the source - directory may be deleted. Only the URL download method checks whether - this directory is either missing or empty before initiating the - download, stopping with an error if it is not empty. All other - download methods silently discard any previous contents of the source - directory. - - ``BINARY_DIR `` - Specify the build directory location. This option is ignored if - ``BUILD_IN_SOURCE`` is enabled. - - ``INSTALL_DIR `` - Installation prefix to be placed in the ```` placeholder. - This does not actually configure the external project to install to - the given prefix. That must be done by passing appropriate arguments - to the external project configuration step, e.g. using ````. - - If any of the above ``..._DIR`` options are not specified, their defaults - are computed as follows. If the ``PREFIX`` option is given or the - ``EP_PREFIX`` directory property is set, then an external project is built - and installed under the specified prefix:: - - TMP_DIR = /tmp - STAMP_DIR = /src/-stamp - DOWNLOAD_DIR = /src - SOURCE_DIR = /src/ - BINARY_DIR = /src/-build - INSTALL_DIR = - LOG_DIR = - - Otherwise, if the ``EP_BASE`` directory property is set then components - of an external project are stored under the specified base:: - - TMP_DIR = /tmp/ - STAMP_DIR = /Stamp/ - DOWNLOAD_DIR = /Download/ - SOURCE_DIR = /Source/ - BINARY_DIR = /Build/ - INSTALL_DIR = /Install/ - LOG_DIR = - - If no ``PREFIX``, ``EP_PREFIX``, or ``EP_BASE`` is specified, then the - default is to set ``PREFIX`` to ``-prefix``. Relative paths are - interpreted with respect to :variable:`CMAKE_CURRENT_BINARY_DIR` at the - point where ``ExternalProject_Add()`` is called. - - **Download Step Options:** - A download method can be omitted if the ``SOURCE_DIR`` option is used to - point to an existing non-empty directory. Otherwise, one of the download - methods below must be specified (multiple download methods should not be - given) or a custom ``DOWNLOAD_COMMAND`` provided. - - ``DOWNLOAD_COMMAND ...`` - Overrides the command used for the download step - (:manual:`generator expressions ` are - supported). If this option is specified, all other download options will - be ignored. Providing an empty string for ```` effectively disables - the download step. - - *URL Download* - ``URL [...]`` - List of paths and/or URL(s) of the external project's source. When more - than one URL is given, they are tried in turn until one succeeds. A URL - may be an ordinary path in the local file system (in which case it - must be the only URL provided) or any downloadable URL supported by the - :command:`file(DOWNLOAD)` command. A local filesystem path may refer to - either an existing directory or to an archive file, whereas a URL is - expected to point to a file which can be treated as an archive. When an - archive is used, it will be unpacked automatically unless the - ``DOWNLOAD_NO_EXTRACT`` option is set to prevent it. The archive type - is determined by inspecting the actual content rather than using logic - based on the file extension. - - .. versionchanged:: 3.7 - Multiple URLs are allowed. - - ``URL_HASH =`` - Hash of the archive file to be downloaded. The argument should be of - the form ``=`` where ``algo`` can be any of the hashing - algorithms supported by the :command:`file()` command. Specifying this - option is strongly recommended for URL downloads, as it ensures the - integrity of the downloaded content. It is also used as a check for a - previously downloaded file, allowing connection to the remote location - to be avoided altogether if the local directory already has a file from - an earlier download that matches the specified hash. - - ``URL_MD5 `` - Equivalent to ``URL_HASH MD5=``. - - ``DOWNLOAD_NAME `` - File name to use for the downloaded file. If not given, the end of the - URL is used to determine the file name. This option is rarely needed, - the default name is generally suitable and is not normally used outside - of code internal to the ``ExternalProject`` module. - - ``DOWNLOAD_EXTRACT_TIMESTAMP `` - .. versionadded:: 3.24 - - When specified with a true value, the timestamps of the extracted - files will match those in the archive. When false, the timestamps of - the extracted files will reflect the time at which the extraction - was performed. If the download URL changes, timestamps based off - those in the archive can result in dependent targets not being rebuilt - when they potentially should have been. Therefore, unless the file - timestamps are significant to the project in some way, use a false - value for this option. If ``DOWNLOAD_EXTRACT_TIMESTAMP`` is not given, - the default is false. See policy :policy:`CMP0135`. - - ``DOWNLOAD_NO_EXTRACT `` - .. versionadded:: 3.6 - - Allows the extraction part of the download step to be disabled by - passing a boolean true value for this option. If this option is not - given, the downloaded contents will be unpacked automatically if - required. If extraction has been disabled, the full path to the - downloaded file is available as ```` in subsequent - steps or as the property ``DOWNLOADED_FILE`` with the - :command:`ExternalProject_Get_Property` command. - - ``DOWNLOAD_NO_PROGRESS `` - Can be used to disable logging the download progress. If this option is - not given, download progress messages will be logged. - - ``TIMEOUT `` - Maximum time allowed for file download operations. - - ``INACTIVITY_TIMEOUT `` - .. versionadded:: 3.19 - - Terminate the operation after a period of inactivity. - - ``HTTP_USERNAME `` - .. versionadded:: 3.7 - - Username for the download operation if authentication is required. - - ``HTTP_PASSWORD `` - .. versionadded:: 3.7 - - Password for the download operation if authentication is required. - - ``HTTP_HEADER [...]`` - .. versionadded:: 3.7 - - Provides an arbitrary list of HTTP headers for the download operation. - This can be useful for accessing content in systems like AWS, etc. - - ``TLS_VERIFY `` - 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. - - .. 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. - - ``TLS_CAINFO `` - Specify a custom certificate authority file to use if ``TLS_VERIFY`` - is enabled. If this option is not specified, the value of the - :variable:`CMAKE_TLS_CAINFO` variable will be used instead (see - :command:`file(DOWNLOAD)`) - - ``NETRC `` - .. versionadded:: 3.11 - - Specify whether the ``.netrc`` file is to be used for operation. - If this option is not specified, the value of the - :variable:`CMAKE_NETRC` variable will be used instead - (see :command:`file(DOWNLOAD)`). Valid levels are: - - ``IGNORED`` - The ``.netrc`` file is ignored. - This is the default. - ``OPTIONAL`` - The ``.netrc`` file is optional, and information in the URL - is preferred. The file will be scanned to find which ever - information is not specified in the URL. - ``REQUIRED`` - The ``.netrc`` file is required, and information in the URL - is ignored. - - ``NETRC_FILE `` - .. versionadded:: 3.11 - - Specify an alternative ``.netrc`` file to the one in your home directory - if the ``NETRC`` level is ``OPTIONAL`` or ``REQUIRED``. If this option - is not specified, the value of the :variable:`CMAKE_NETRC_FILE` variable - will be used instead (see :command:`file(DOWNLOAD)`) - - .. versionadded:: 3.1 - Added support for `tbz2`, `.tar.xz`, `.txz`, and `.7z` extensions. - - *Git* - NOTE: A git version of 1.6.5 or later is required if this download method - is used. - - ``GIT_REPOSITORY `` - URL of the git repository. Any URL understood by the ``git`` command - may be used. - - .. versionchanged:: 3.27 - A relative URL will be resolved based on the parent project's - remote, subject to :policy:`CMP0150`. See the policy documentation - for how the remote is selected, including conditions where the - remote selection can fail. Local filesystem remotes should - always use absolute paths. - - ``GIT_TAG `` - Git branch name, tag or commit hash. Note that branch names and tags - should generally be specified as remote names (i.e. ``origin/myBranch`` - rather than simply ``myBranch``). This ensures that if the remote end - has its tag moved or branch rebased or history rewritten, the local - clone will still be updated correctly. In general, however, specifying - a commit hash should be preferred for a number of reasons: - - - If the local clone already has the commit corresponding to the hash, - no ``git fetch`` needs to be performed to check for changes each time - CMake is re-run. This can result in a significant speed up if many - external projects are being used. - - Using a specific git hash ensures that the main project's own history - is fully traceable to a specific point in the external project's - evolution. If a branch or tag name is used instead, then checking out - a specific commit of the main project doesn't necessarily pin the - whole build to a specific point in the life of the external project. - The lack of such deterministic behavior makes the main project lose - traceability and repeatability. - - If ``GIT_SHALLOW`` is enabled then ``GIT_TAG`` works only with - branch names and tags. A commit hash is not allowed. - - Note that if not provided, ``GIT_TAG`` defaults to ``master``, not the - default Git branch name. - - ``GIT_REMOTE_NAME `` - The optional name of the remote. If this option is not specified, it - defaults to ``origin``. - - ``GIT_SUBMODULES ...`` - Specific git submodules that should also be updated. If this option is - not provided, all git submodules will be updated. - - .. versionchanged:: 3.16 - When :policy:`CMP0097` is set to ``NEW``, if this value is set - to an empty string then no submodules are initialized or updated. - - ``GIT_SUBMODULES_RECURSE `` - .. versionadded:: 3.17 - - Specify whether git submodules (if any) should update recursively by - passing the ``--recursive`` flag to ``git submodule update``. - If not specified, the default is on. - - ``GIT_SHALLOW `` - .. versionadded:: 3.6 - - When this option is enabled, the ``git clone`` operation will be given - the ``--depth 1`` option. This performs a shallow clone, which avoids - downloading the whole history and instead retrieves just the commit - denoted by the ``GIT_TAG`` option. - - ``GIT_PROGRESS `` - .. versionadded:: 3.8 - - When enabled, this option instructs the ``git clone`` operation to - report its progress by passing it the ``--progress`` option. Without - this option, the clone step for large projects may appear to make the - build stall, since nothing will be logged until the clone operation - finishes. While this option can be used to provide progress to prevent - the appearance of the build having stalled, it may also make the build - overly noisy if lots of external projects are used. - - ``GIT_CONFIG [...]`` - .. versionadded:: 3.8 - - Specify a list of config options to pass to ``git clone``. Each option - listed will be transformed into its own ``--config