summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml251
-rwxr-xr-x.gitlab/ci/docker/debian10-aarch64/install_deps.sh1
-rwxr-xr-x.gitlab/ci/docker/debian10/install_deps.sh1
-rw-r--r--.gitlab/os-linux.yml12
-rw-r--r--.gitlab/os-macos.yml12
-rw-r--r--Help/dev/maint.rst6
-rw-r--r--Help/dev/review.rst13
-rw-r--r--Help/envvar/CMAKE_INSTALL_MODE.rst111
-rw-r--r--Help/policy/CMP0077.rst4
-rw-r--r--Help/policy/CMP0126.rst5
-rw-r--r--Help/prop_test/ENVIRONMENT_MODIFICATION.rst6
-rw-r--r--Help/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.rst19
-rw-r--r--Modules/CMakeCCompilerId.c.in2
-rw-r--r--Modules/CMakeCUDACompilerId.cu.in2
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in2
-rw-r--r--Modules/ExternalProject.cmake16
-rw-r--r--Modules/UseSWIG.cmake2
-rw-r--r--Source/cmGlobalGenerator.cxx3
-rw-r--r--Source/cmMakefile.cxx3
-rw-r--r--Source/cmTimestamp.cxx2
-rw-r--r--Tests/RunCMake/try_compile/EnvConfig.c7
-rw-r--r--Tests/RunCMake/try_compile/EnvConfig.cmake18
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake2
-rw-r--r--Tests/UseSWIG/CMakeLists.txt1
24 files changed, 331 insertions, 170 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 79e970b..06570d9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,5 @@
include:
- # Metadata shared my many jobs
+ # Metadata shared by many jobs
- local: .gitlab/rules.yml
- local: .gitlab/artifacts.yml
@@ -34,9 +34,16 @@ stages:
# - dependency/needs jobs for required jobs
################################################################################
+# Job prefixes:
+# - `b:` build
+# - `l:` lint
+# - `p:` prep
+# - `t:` test
+# - `u:` upload
+
# Prep jobs
-prep:source-package:
+p:source-package:
extends:
- .linux_prep_source
- .cmake_prep_source_linux
@@ -44,7 +51,7 @@ prep:source-package:
- .cmake_release_artifacts
- .run_only_for_package
-prep:doc-package:
+p:doc-package:
extends:
- .fedora34_sphinx_package
- .cmake_prep_doc_linux
@@ -52,74 +59,74 @@ prep:doc-package:
- .cmake_doc_artifacts
- .run_only_for_package
-.upload:source-package:
+.u:source-package:
extends:
- .rsync_upload_binary
- .run_only_for_package
dependencies:
- - prep:source-package
+ - p:source-package
needs:
- - prep:source-package
+ - p:source-package
variables:
RSYNC_DESTINATION: dev
# Documentation builds
-build:help:master:
+b:help:master:
extends:
- .cmake_org_help
- .run_only_for_continuous_master
-.upload:help:master:
+.u:help:master:
extends:
- .rsync_upload_help
- .run_only_for_continuous_master
variables:
RSYNC_DESTINATION: git-master
dependencies:
- - build:help:master
+ - b:help:master
needs:
- - build:help:master
+ - b:help:master
-build:help:stage:
+b:help:stage:
extends:
- .cmake_org_help
- .run_only_for_continuous_stage
-.upload:help:stage:
+.u:help:stage:
extends:
- .rsync_upload_help
- .run_only_for_continuous_stage
variables:
RSYNC_DESTINATION: git-stage
dependencies:
- - build:help:stage
+ - b:help:stage
needs:
- - build:help:stage
+ - b:help:stage
# Lint builds
-lint:codespell:
+l:codespell:
extends:
- .cmake_codespell_linux
- .linux_builder_tags
- .run_automatically
-lint:debian10-iwyu:
+l:iwyu-debian10:
extends:
- .debian10_iwyu
- .cmake_build_linux
- .linux_builder_tags
- .run_automatically
-lint:fedora34-tidy:
+l:tidy-fedora34:
extends:
- .fedora34_tidy
- .cmake_build_linux
- .linux_builder_tags_qt
- .run_automatically
-lint:fedora34-sphinx:
+l:sphinx-fedora34:
extends:
- .fedora34_sphinx
- .cmake_build_linux
@@ -129,7 +136,7 @@ lint:fedora34-sphinx:
CMAKE_CI_JOB_CONTINUOUS: "true"
CMAKE_CI_JOB_HELP: "true"
-lint:fedora34-clang-analyzer:
+l:clang-analyzer-fedora34:
extends:
- .fedora34_clang_analyzer
- .cmake_build_linux
@@ -140,7 +147,7 @@ lint:fedora34-clang-analyzer:
# Linux builds
-build:centos6-x86_64:
+b:centos6-x86_64:
extends:
- .linux_release_x86_64
- .cmake_build_linux_release
@@ -148,7 +155,7 @@ build:centos6-x86_64:
- .linux_builder_tags
- .run_manually
-build:centos7-aarch64:
+b:centos7-aarch64:
extends:
- .linux_release_aarch64
- .cmake_build_linux_release
@@ -158,7 +165,7 @@ build:centos7-aarch64:
variables:
CMAKE_CI_NO_MR: "true"
-test:debian10-ninja:
+t:debian10-ninja:
extends:
- .debian10_ninja
- .cmake_test_linux_release
@@ -169,7 +176,7 @@ test:debian10-ninja:
variables:
CMAKE_CI_JOB_NIGHTLY_NINJA: "true"
-test:debian10-aarch64-ninja:
+t:debian10-aarch64-ninja:
extends:
- .debian10_aarch64_ninja
- .cmake_test_linux_release
@@ -180,7 +187,7 @@ test:debian10-aarch64-ninja:
variables:
CMAKE_CI_NO_MR: "true"
-test:debian10-ninja-clang:
+t:debian10-ninja-clang:
extends:
- .debian10_ninja_clang
- .cmake_test_linux_release
@@ -190,7 +197,7 @@ test:debian10-ninja-clang:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-test:debian10-makefiles-clang:
+t:debian10-makefiles-clang:
extends:
- .debian10_makefiles_clang
- .cmake_test_linux_release
@@ -200,7 +207,7 @@ test:debian10-makefiles-clang:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-test:fedora34-makefiles:
+t:fedora34-makefiles:
extends:
- .fedora34_makefiles
- .cmake_test_linux_release
@@ -208,7 +215,7 @@ test:fedora34-makefiles:
- .run_dependent
- .needs_centos6_x86_64
-test:fedora34-makefiles-nospace:
+t:fedora34-makefiles-nospace:
extends:
- .fedora34_makefiles
- .cmake_test_linux_release
@@ -221,7 +228,7 @@ test:fedora34-makefiles-nospace:
CMAKE_CI_BUILD_NAME: fedora34_makefiles_nospace
CMAKE_CI_JOB_NIGHTLY: "true"
-test:cuda9.2-nvidia:
+t:cuda9.2-nvidia:
extends:
- .cuda9.2_nvidia
- .cmake_test_linux_release
@@ -231,7 +238,7 @@ test:cuda9.2-nvidia:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-test:cuda10.2-nvidia:
+t:cuda10.2-nvidia:
extends:
- .cuda10.2_nvidia
- .cmake_test_linux_release
@@ -240,7 +247,7 @@ test:cuda10.2-nvidia:
- .run_dependent
- .needs_centos6_x86_64
-test:cuda10.2-clang:
+t:cuda10.2-clang:
extends:
- .cuda10.2_clang
- .cmake_test_linux_release
@@ -250,7 +257,7 @@ test:cuda10.2-clang:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-test:hip4.2-radeon:
+t:hip4.2-radeon:
extends:
- .hip4.2_radeon
- .cmake_test_linux_release
@@ -260,7 +267,7 @@ test:hip4.2-radeon:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-build:fedora34-ninja:
+b:fedora34-ninja:
extends:
- .fedora34_ninja
- .cmake_build_linux
@@ -268,7 +275,7 @@ build:fedora34-ninja:
- .linux_builder_tags_qt
- .run_manually
-test:fedora34-ninja:
+t:fedora34-ninja:
extends:
- .fedora34_ninja
- .cmake_test_linux
@@ -276,11 +283,11 @@ test:fedora34-ninja:
- .cmake_test_artifacts
- .run_dependent
dependencies:
- - build:fedora34-ninja
+ - b:fedora34-ninja
needs:
- - build:fedora34-ninja
+ - b:fedora34-ninja
-test:fedora34-ninja-multi:
+t:fedora34-ninja-multi:
extends:
- .fedora34_ninja_multi
- .cmake_test_linux_external
@@ -288,228 +295,228 @@ test:fedora34-ninja-multi:
- .cmake_junit_artifacts
- .run_dependent
dependencies:
- - test:fedora34-ninja
+ - t:fedora34-ninja
needs:
- - test:fedora34-ninja
+ - t:fedora34-ninja
-test:intel2016-makefiles:
+t:intel2016-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2016_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2016-el7
-test:intel2016u1-makefiles:
+t:intel2016u1-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2016u1_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2016u1-el7
-test:intel2016u2-makefiles:
+t:intel2016u2-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2016u2_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2016u2-el7
-test:intel2017-makefiles:
+t:intel2017-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2017_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017-el7
-test:intel2017u1-makefiles:
+t:intel2017u1-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2017u1_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u1-el7
-test:intel2017u2-makefiles:
+t:intel2017u2-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2017u2_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u2-el7
-test:intel2017u3-makefiles:
+t:intel2017u3-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2017u3_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u3-el7
-test:intel2017u4-makefiles:
+t:intel2017u4-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2017u4_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u4-el7
-test:intel2017u5-makefiles:
+t:intel2017u5-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2017u5_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u5-el7
-test:intel2017u6-makefiles:
+t:intel2017u6-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2017u6_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u6-el7
-test:intel2017u7-makefiles:
+t:intel2017u7-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2017u7_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u7-el7
-test:intel2017u8-makefiles:
+t:intel2017u8-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2017u8_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u8-el7
-test:intel2018-makefiles:
+t:intel2018-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2018_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018-el7
-test:intel2018u1-makefiles:
+t:intel2018u1-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2018u1_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u1-el7
-test:intel2018u2-makefiles:
+t:intel2018u2-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2018u2_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u2-el7
-test:intel2018u3-makefiles:
+t:intel2018u3-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2018u3_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u3-el7
-test:intel2018u4-makefiles:
+t:intel2018u4-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2018u4_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u4-el7
-test:intel2019-makefiles:
+t:intel2019-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2019_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019-el7
-test:intel2019u1-makefiles:
+t:intel2019u1-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2019u1_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u1-el7
-test:intel2019u2-makefiles:
+t:intel2019u2-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2019u2_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u2-el7
-test:intel2019u3-makefiles:
+t:intel2019u3-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2019u3_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u3-el7
-test:intel2019u4-makefiles:
+t:intel2019u4-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2019u4_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u4-el7
-test:intel2020-makefiles:
+t:intel2020-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2020_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2020-el8
-test:intel2020u2-makefiles:
+t:intel2020u2-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2020u2_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2020u2-el8
-test:intel2020u4-makefiles:
+t:intel2020u4-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2020u4_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2020u4-el8
-test:intel2021.1.1-makefiles:
+t:intel2021.1.1-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2021.1.1_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2021.1.1-el8
-test:intel2021.1.2-makefiles:
+t:intel2021.1.2-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2021.1.2_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2021.1.2-el8
-test:intel2021.2.0-makefiles:
+t:intel2021.2.0-makefiles:
extends:
- .cmake_test_linux_intelclassic_makefiles
variables:
CMAKE_CI_BUILD_NAME: intel2021.2.0_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2021.2.0-el8
-test:oneapi2021.1.1-makefiles:
+t:oneapi2021.1.1-makefiles:
extends:
- .cmake_test_linux_inteloneapi_makefiles
variables:
CMAKE_CI_BUILD_NAME: oneapi2021.1.1_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2021.1.1-el8
-test:oneapi2021.1.2-makefiles:
+t:oneapi2021.1.2-makefiles:
extends:
- .cmake_test_linux_inteloneapi_makefiles
variables:
CMAKE_CI_BUILD_NAME: oneapi2021.1.2_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2021.1.2-el8
-test:oneapi2021.2.0-makefiles:
+t:oneapi2021.2.0-makefiles:
extends:
- .cmake_test_linux_inteloneapi_makefiles
variables:
CMAKE_CI_BUILD_NAME: oneapi2021.2.0_makefiles
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2021.2.0-el8
-build:linux-x86_64-package:
+b:linux-x86_64-package:
extends:
- .linux_package
- .linux_release_x86_64
@@ -518,22 +525,22 @@ build:linux-x86_64-package:
- .linux_builder_tags
- .run_only_for_package
dependencies:
- - prep:doc-package
+ - p:doc-package
needs:
- - prep:doc-package
+ - p:doc-package
-.upload:linux-x86_64-package:
+.u:linux-x86_64-package:
extends:
- .rsync_upload_binary
- .run_only_for_package
dependencies:
- - build:linux-x86_64-package
+ - b:linux-x86_64-package
needs:
- - build:linux-x86_64-package
+ - b:linux-x86_64-package
variables:
RSYNC_DESTINATION: dev
-build:linux-aarch64-package:
+b:linux-aarch64-package:
extends:
- .linux_package
- .linux_release_aarch64
@@ -542,24 +549,24 @@ build:linux-aarch64-package:
- .linux_builder_tags_aarch64
- .run_only_for_package
dependencies:
- - prep:doc-package
+ - p:doc-package
needs:
- - prep:doc-package
+ - p:doc-package
-.upload:linux-aarch64-package:
+.u:linux-aarch64-package:
extends:
- .rsync_upload_binary
- .run_only_for_package
dependencies:
- - build:linux-aarch64-package
+ - b:linux-aarch64-package
needs:
- - build:linux-aarch64-package
+ - b:linux-aarch64-package
variables:
RSYNC_DESTINATION: dev
## Sanitizer builds
-build:fedora34-asan:
+b:fedora34-asan:
extends:
- .fedora34_asan
- .cmake_build_linux
@@ -569,22 +576,22 @@ build:fedora34-asan:
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
-test:fedora34-asan:
+t:fedora34-asan:
extends:
- .fedora34_asan
- .cmake_memcheck_linux
- .linux_builder_tags_qt
- .run_dependent
dependencies:
- - build:fedora34-asan
+ - b:fedora34-asan
needs:
- - build:fedora34-asan
+ - b:fedora34-asan
variables:
CMAKE_CI_JOB_NIGHTLY: "true"
# macOS builds
-build:macos-x86_64-ninja:
+b:macos-x86_64-ninja:
extends:
- .macos_x86_64_ninja
- .cmake_build_macos
@@ -592,7 +599,7 @@ build:macos-x86_64-ninja:
- .macos_x86_64_builder_tags
- .run_manually
-build:macos-arm64-ninja:
+b:macos-arm64-ninja:
extends:
- .macos_arm64_ninja
- .cmake_build_macos
@@ -602,7 +609,7 @@ build:macos-arm64-ninja:
variables:
CMAKE_CI_NO_MR: "true"
-test:macos-x86_64-ninja:
+t:macos-x86_64-ninja:
extends:
- .macos_x86_64_ninja
- .cmake_test_macos
@@ -610,13 +617,13 @@ test:macos-x86_64-ninja:
- .macos_x86_64_builder_tags
- .run_dependent
dependencies:
- - build:macos-x86_64-ninja
+ - b:macos-x86_64-ninja
needs:
- - build:macos-x86_64-ninja
+ - b:macos-x86_64-ninja
variables:
CMAKE_CI_JOB_NIGHTLY_NINJA: "true"
-test:macos-arm64-ninja:
+t:macos-arm64-ninja:
extends:
- .macos_arm64_ninja
- .cmake_test_macos
@@ -624,13 +631,13 @@ test:macos-arm64-ninja:
- .macos_arm64_builder_tags
- .run_dependent
dependencies:
- - build:macos-arm64-ninja
+ - b:macos-arm64-ninja
needs:
- - build:macos-arm64-ninja
+ - b:macos-arm64-ninja
variables:
CMAKE_CI_NO_MR: "true"
-build:macos-x86_64-makefiles:
+b:macos-x86_64-makefiles:
extends:
- .macos_x86_64_makefiles
- .cmake_build_macos
@@ -638,18 +645,18 @@ build:macos-x86_64-makefiles:
- .macos_x86_64_builder_tags
- .run_manually
-test:macos-x86_64-makefiles:
+t:macos-x86_64-makefiles:
extends:
- .macos_x86_64_makefiles
- .cmake_test_macos
- .macos_x86_64_builder_tags
- .run_dependent
dependencies:
- - build:macos-x86_64-makefiles
+ - b:macos-x86_64-makefiles
needs:
- - build:macos-x86_64-makefiles
+ - b:macos-x86_64-makefiles
-test:macos-x86_64-xcode:
+t:macos-x86_64-xcode:
extends:
- .macos_x86_64_xcode
- .cmake_test_macos_external
@@ -657,11 +664,11 @@ test:macos-x86_64-xcode:
- .cmake_junit_artifacts
- .run_dependent
dependencies:
- - test:macos-x86_64-ninja
+ - t:macos-x86_64-ninja
needs:
- - test:macos-x86_64-ninja
+ - t:macos-x86_64-ninja
-test:macos-arm64-xcode:
+t:macos-arm64-xcode:
extends:
- .macos_arm64_xcode
- .cmake_test_macos_external
@@ -669,13 +676,13 @@ test:macos-arm64-xcode:
- .cmake_junit_artifacts
- .run_dependent
dependencies:
- - test:macos-arm64-ninja
+ - t:macos-arm64-ninja
needs:
- - test:macos-arm64-ninja
+ - t:macos-arm64-ninja
variables:
CMAKE_CI_NO_MR: "true"
-build:macos-package:
+b:macos-package:
extends:
- .macos_package
- .cmake_build_macos_package
@@ -683,22 +690,22 @@ build:macos-package:
- .macos_x86_64_builder_tags_package
- .run_only_for_package
dependencies:
- - prep:doc-package
+ - p:doc-package
needs:
- - prep:doc-package
+ - p:doc-package
-.upload:macos-package:
+.u:macos-package:
extends:
- .rsync_upload_binary
- .run_only_for_package
dependencies:
- - build:macos-package
+ - b:macos-package
needs:
- - build:macos-package
+ - b:macos-package
variables:
RSYNC_DESTINATION: dev
-build:macos10.10-package:
+b:macos10.10-package:
extends:
- .macos10.10_package
- .cmake_build_macos_package
@@ -706,24 +713,24 @@ build:macos10.10-package:
- .macos_x86_64_builder_tags_package
- .run_only_for_package
dependencies:
- - prep:doc-package
+ - p:doc-package
needs:
- - prep:doc-package
+ - p:doc-package
-.upload:macos10.10-package:
+.u:macos10.10-package:
extends:
- .rsync_upload_binary
- .run_only_for_package
dependencies:
- - build:macos10.10-package
+ - b:macos10.10-package
needs:
- - build:macos10.10-package
+ - b:macos10.10-package
variables:
RSYNC_DESTINATION: dev
# Windows builds
-build:windows-vs2022-x64-ninja:
+b:windows-vs2022-x64-ninja:
extends:
- .windows_vs2022_x64_ninja
- .cmake_build_windows
@@ -731,7 +738,7 @@ build:windows-vs2022-x64-ninja:
- .windows_tags_nonconcurrent_vs2022
- .run_manually
-test:windows-vs2022-x64-ninja:
+t:windows-vs2022-x64-ninja:
extends:
- .windows_vs2022_x64_ninja
- .cmake_test_windows
@@ -739,11 +746,11 @@ test:windows-vs2022-x64-ninja:
- .cmake_test_artifacts
- .run_dependent
dependencies:
- - build:windows-vs2022-x64-ninja
+ - b:windows-vs2022-x64-ninja
needs:
- - build:windows-vs2022-x64-ninja
+ - b:windows-vs2022-x64-ninja
-test:windows-vs2022-x64:
+t:windows-vs2022-x64:
extends:
- .windows_vs2022_x64
- .cmake_test_windows_external
@@ -751,6 +758,6 @@ test:windows-vs2022-x64:
- .cmake_junit_artifacts
- .run_dependent
dependencies:
- - test:windows-vs2022-x64-ninja
+ - t:windows-vs2022-x64-ninja
needs:
- - test:windows-vs2022-x64-ninja
+ - t:windows-vs2022-x64-ninja
diff --git a/.gitlab/ci/docker/debian10-aarch64/install_deps.sh b/.gitlab/ci/docker/debian10-aarch64/install_deps.sh
index d7f4f9c..d5c5e22 100755
--- a/.gitlab/ci/docker/debian10-aarch64/install_deps.sh
+++ b/.gitlab/ci/docker/debian10-aarch64/install_deps.sh
@@ -52,6 +52,7 @@ apt-get install -y \
libgif-dev \
libgl1-mesa-dev \
libglew-dev \
+ libgmock-dev \
libgrpc++-dev libgrpc-dev \
libgsl-dev \
libgtest-dev \
diff --git a/.gitlab/ci/docker/debian10/install_deps.sh b/.gitlab/ci/docker/debian10/install_deps.sh
index b4d0f86..d3d6b67 100755
--- a/.gitlab/ci/docker/debian10/install_deps.sh
+++ b/.gitlab/ci/docker/debian10/install_deps.sh
@@ -52,6 +52,7 @@ apt-get install -y \
libgif-dev \
libgl1-mesa-dev \
libglew-dev \
+ libgmock-dev \
libgrpc++-dev libgrpc-dev \
libgsl-dev \
libgtest-dev \
diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml
index 7fce177..c831530 100644
--- a/.gitlab/os-linux.yml
+++ b/.gitlab/os-linux.yml
@@ -32,20 +32,20 @@
.needs_centos6_x86_64:
dependencies:
- - build:centos6-x86_64
+ - b:centos6-x86_64
needs:
- - build:centos6-x86_64
+ - b:centos6-x86_64
.needs_centos7_aarch64:
dependencies:
- - build:centos7-aarch64
+ - b:centos7-aarch64
needs:
- - build:centos7-aarch64
+ - b:centos7-aarch64
### Debian
.debian10:
- image: "kitware/cmake:ci-debian10-x86_64-2021-10-05"
+ image: "kitware/cmake:ci-debian10-x86_64-2021-11-18"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
@@ -60,7 +60,7 @@
CMake_SKIP_INSTALL: 1
.debian10_aarch64:
- image: "kitware/cmake:ci-debian10-aarch64-2021-10-05"
+ image: "kitware/cmake:ci-debian10-aarch64-2021-11-18"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml
index 3ffd9d7..66bbbf3 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-13.0.app/Contents/Developer"
+ DEVELOPER_DIR: "/Applications/Xcode-13.1.app/Contents/Developer"
# Avoid conflicting with other projects running on the same machine.
SCCACHE_SERVER_PORT: 4227
@@ -87,7 +87,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- - xcode-13.0
+ - xcode-13.1
- nonconcurrent
.macos_x86_64_builder_tags_package:
@@ -95,7 +95,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- - xcode-13.0
+ - xcode-13.1
- nonconcurrent
- finder
@@ -104,7 +104,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- - xcode-13.0
+ - xcode-13.1
- concurrent
.macos_arm64_builder_tags:
@@ -112,7 +112,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- - xcode-13.0
+ - xcode-13.1
- nonconcurrent
.macos_arm64_builder_ext_tags:
@@ -120,7 +120,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- - xcode-13.0
+ - xcode-13.1
- concurrent
## macOS-specific scripts
diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst
index 664b7a4..54d627d 100644
--- a/Help/dev/maint.rst
+++ b/Help/dev/maint.rst
@@ -245,12 +245,12 @@ Commit with a message such as::
Release versions do not have the development topic section of
the CMake Release Notes index page.
-Update ``.gitlab-ci.yml`` to drop the ``upload:`` jobs from the
+Update ``.gitlab-ci.yml`` to drop the upload jobs from the
packaging pipeline by renaming them to start in ``.``:
.. code-block:: shell
- sed -i 's/^upload:/.upload:/' .gitlab-ci.yml
+ sed -i 's/^u:/.u:/' .gitlab-ci.yml
Commit with a message such as::
@@ -298,7 +298,7 @@ the version date from ``origin/master``:
git checkout origin/master -- \
Source/CMakeVersion.cmake Help/release/dev/0-sample-topic.rst
sed -i $'/^Releases/ i\\\n.. include:: dev.txt\\\n' Help/release/index.rst
- sed -i 's/^\.upload:/upload:/' .gitlab-ci.yml
+ sed -i 's/^\.u:/u:/' .gitlab-ci.yml
Update ``Source/CMakeVersion.cmake`` to set the version to
``$major.$minor.$date``:
diff --git a/Help/dev/review.rst b/Help/dev/review.rst
index 198e100..34796a1 100644
--- a/Help/dev/review.rst
+++ b/Help/dev/review.rst
@@ -324,6 +324,19 @@ Heavier jobs require a manual trigger to run:
* ``failed``: Restart jobs which have completed, but without success.
* ``completed``: Restart all completed jobs.
+
+In order to keep job names shorter and keep as much information visible on the
+GitLab web interface as possible, jobs have a short prefix which indicates
+what its main purpose is:
+
+ * ``b:`` jobs build CMake for the purposes of running the
+ test suite.
+ * ``l:`` jobs perform "linting" on the CMake source tree such as static
+ analysis.
+ * ``p:`` jobs perform preparatory tasks for use in other jobs.
+ * ``t:`` jobs perform testing of CMake.
+ * ``u:`` jobs upload other job results to permanent locations.
+
If the merge request topic branch is updated by a push, a new manual trigger
using one of the above methods is needed to start CI again.
diff --git a/Help/envvar/CMAKE_INSTALL_MODE.rst b/Help/envvar/CMAKE_INSTALL_MODE.rst
index 37db0d7..4549ea1 100644
--- a/Help/envvar/CMAKE_INSTALL_MODE.rst
+++ b/Help/envvar/CMAKE_INSTALL_MODE.rst
@@ -13,25 +13,104 @@ source directory into a destination directory. This environment variable
however allows the user to override this behavior, causing CMake to create
symbolic links instead.
-.. note::
- A symbolic link consists of a reference file path rather than contents of its own,
- hence there are two ways to express the relation, either by a relative or an absolute path.
+Usage Scenarios
+^^^^^^^^^^^^^^^
+
+Installing symbolic links rather than copying files can help in the following
+ways:
+
+* Conserving storage space because files do not have to be duplicated on disk.
+* Changes to the source of the symbolic link are seen at the install
+ destination without having to re-run the install step.
+* Editing through the link at the install destination will modify the source
+ of the link. This may be useful when dealing with CMake project hierarchies,
+ i.e. using :module:`ExternalProject` and consistent source navigation and
+ refactoring is desired across projects.
+
+Allowed Values
+^^^^^^^^^^^^^^
The following values are allowed for ``CMAKE_INSTALL_MODE``:
-* empty, unset or ``COPY``: default behavior, duplicate the file at its destination
-* ``ABS_SYMLINK``: create an *absolute* symbolic link to the source file at the destination *or fail*
-* ``ABS_SYMLINK_OR_COPY``: like ``ABS_SYMLINK`` but silently copy on error
-* ``REL_SYMLINK``: create an *relative* symbolic link to the source file at the destination *or fail*
-* ``REL_SYMLINK_OR_COPY``: like ``REL_SYMLINK`` but silently copy on error
-* ``SYMLINK``: try as if through ``REL_SYMLINK`` and fall back to ``ABS_SYMLINK`` if the referenced
- file cannot be expressed using a relative path. Fail on error.
-* ``SYMLINK_OR_COPY``: like ``SYMLINK`` but silently copy on error
+``COPY``, empty or unset
+ Duplicate the file at its destination. This is the default behavior.
+
+``ABS_SYMLINK``
+ Create an *absolute* symbolic link to the source file at the destination.
+ Halt with an error if the link cannot be created.
+
+``ABS_SYMLINK_OR_COPY``
+ Like ``ABS_SYMLINK`` but fall back to silently copying if the symlink
+ couldn't be created.
+
+``REL_SYMLINK``
+ Create a *relative* symbolic link to the source file at the destination.
+ Halt with an error if the link cannot be created.
+
+``REL_SYMLINK_OR_COPY``
+ Like ``REL_SYMLINK`` but fall back to silently copying if the symlink
+ couldn't be created.
+
+``SYMLINK``
+ Try as if through ``REL_SYMLINK`` and fall back to ``ABS_SYMLINK`` if the
+ referenced file cannot be expressed using a relative path.
+ Halt with an error if the link cannot be created.
+
+``SYMLINK_OR_COPY``
+ Like ``SYMLINK`` but fall back to silently copying if the symlink couldn't
+ be created.
+
+.. note::
+ A symbolic link consists of a reference file path rather than contents of its
+ own, hence there are two ways to express the relation, either by a *relative*
+ or an *absolute* path.
+
+When To Set The Environment Variable
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+For the environment variable to take effect, it must be set during the correct
+build phase(s).
+
+* If the project calls :command:`file(INSTALL)` directly, the environment
+ variable must be set during the configuration phase.
+* In order to apply to :command:`install()`, the environment variable must be
+ set during installation. This could be during a build if using the
+ ``install`` or ``package`` build targets, or separate from the build when
+ invoking an install or running :manual:`cpack <cpack(1)>` from the command
+ line.
+* When using :module:`ExternalProject`, it might be required during the build
+ phase, since the external project's own configure, build and install steps
+ will execute during the main project's build phase.
+
+Given the above, it is recommended to set the environment variable consistently
+across all phases (configure, build and install).
+
+Caveats
+^^^^^^^
+
+Use this environment variable with caution. The following highlights some
+points to be considered:
+
+* ``CMAKE_INSTALL_MODE`` only affects files, not directories.
+
+* Symbolic links are not available on all platforms.
+
+* The way this environment variable interacts with the install step of
+ :module:`ExternalProject` is more complex. For further details, see that
+ module's documentation.
-Installing symbolic links rather than copying files can help conserve storage space because files do
-not have to be duplicated on disk. However, modifications applied to the source immediately affects
-the symbolic link and vice versa. *Use with caution*.
+* A symbolic link ties the destination to the source in a persistent way.
+ Writing to either of the two affects both file system objects.
+ This is in contrast to normal install behavior which only copies files as
+ they were at the time the install was performed, with no enduring
+ relationship between the source and destination of the install.
-.. note:: ``CMAKE_INSTALL_MODE`` only affects files, *not* directories.
+* Combining ``CMAKE_INSTALL_MODE`` with :prop_tgt:`IOS_INSTALL_COMBINED` is
+ not supported.
-.. note:: Symbolic links are not available on all platforms.
+* Changing ``CMAKE_INSTALL_MODE`` from what it was on a previous run can lead
+ to unexpected results. Moving from a non-symlinking mode to a symlinking
+ mode will discard any previous file at the destination, but the reverse is
+ not true. Once a symlink exists at the destination, even if you switch to a
+ non-symlink mode, the symlink will continue to exist at the destination and
+ will not be replaced by an actual file.
diff --git a/Help/policy/CMP0077.rst b/Help/policy/CMP0077.rst
index d8744a9..482125a 100644
--- a/Help/policy/CMP0077.rst
+++ b/Help/policy/CMP0077.rst
@@ -53,6 +53,8 @@ between the two policies.
This policy was introduced in CMake version 3.13. CMake version
|release| warns when the policy is not set and uses ``OLD`` behavior.
Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
-explicitly.
+explicitly within a project. Use the :variable:`CMAKE_POLICY_DEFAULT_CMP0077
+<CMAKE_POLICY_DEFAULT_CMP\<NNNN\>>` variable to set the policy for
+a third-party project in a subdirectory without modifying it.
.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0126.rst b/Help/policy/CMP0126.rst
index ba027b3..1b69957 100644
--- a/Help/policy/CMP0126.rst
+++ b/Help/policy/CMP0126.rst
@@ -22,7 +22,10 @@ will *not* set the cache variable if a non-cache variable of the same name
already exists and :policy:`CMP0077` is set to ``NEW``.
Policy ``CMP0126`` was introduced in CMake version 3.21. Use the
-:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly
+within a project. Use the :variable:`CMAKE_POLICY_DEFAULT_CMP0126
+<CMAKE_POLICY_DEFAULT_CMP\<NNNN\>>` variable to set the policy for
+a third-party project in a subdirectory without modifying it.
Unlike many policies, CMake version |release| does *not* warn when the policy
is not set and simply uses ``OLD`` behavior. See documentation of the
:variable:`CMAKE_POLICY_WARNING_CMP0126 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
diff --git a/Help/prop_test/ENVIRONMENT_MODIFICATION.rst b/Help/prop_test/ENVIRONMENT_MODIFICATION.rst
index 0b3cd83..1e17329 100644
--- a/Help/prop_test/ENVIRONMENT_MODIFICATION.rst
+++ b/Help/prop_test/ENVIRONMENT_MODIFICATION.rst
@@ -21,9 +21,11 @@ order specified in the property's value. The ``OP`` may be one of:
- ``string_append``: Appends ``VALUE`` to the current value of ``MYVAR``.
- ``string_prepend``: Prepends ``VALUE`` to the current value of ``MYVAR``.
- ``path_list_append``: Appends ``VALUE`` to the current value of ``MYVAR``
- using the platform-specific list separator.
+ using the host platform's path list separator (``;`` on Windows and ``:``
+ elsewhere).
- ``path_list_prepend``: Prepends ``VALUE`` to the current value of
- ``MYVAR`` using the platform-specific list separator.
+ ``MYVAR`` using the host platform's path list separator (``;`` on Windows
+ and ``:`` elsewhere).
- ``cmake_list_append``: Appends ``VALUE`` to the current value of ``MYVAR``
using ``;`` as the separator.
- ``cmake_list_prepend``: Prepends ``VALUE`` to the current value of
diff --git a/Help/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.rst
index 43582be..d643fb8 100644
--- a/Help/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.rst
+++ b/Help/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.rst
@@ -9,9 +9,16 @@ the given version unset. Set ``CMAKE_POLICY_DEFAULT_CMP<NNNN>`` to ``OLD``
or ``NEW`` to specify the default for policy ``CMP<NNNN>``, where ``<NNNN>``
is the policy number.
-This variable should not be set by a project in CMake code; use
-:command:`cmake_policy(SET)` instead. Users running CMake may set this
-variable in the cache (e.g. ``-DCMAKE_POLICY_DEFAULT_CMP<NNNN>=<OLD|NEW>``)
-to set a policy not otherwise set by the project. Set to ``OLD`` to quiet a
-policy warning while using old behavior or to ``NEW`` to try building the
-project with new behavior.
+This variable should not be set by a project in CMake code as a way to
+set its own policies; use :command:`cmake_policy(SET)` instead. This
+variable is meant to externally set policies for which a project has
+not itself been updated:
+
+* Users running CMake may set this variable in the cache
+ (e.g. ``-DCMAKE_POLICY_DEFAULT_CMP<NNNN>=<OLD|NEW>``). Set it to ``OLD``
+ to quiet a policy warning while using old behavior or to ``NEW`` to
+ try building the project with new behavior.
+
+* Projects may set this variable before a call to :command:`add_subdirectory`
+ that adds a third-party project in order to set its policies without
+ modifying third-party code.
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 43ede3e..30ad9824 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -60,7 +60,7 @@ const char* info_language_standard_default =
"INFO" ":" "standard_default[" C_VERSION "]";
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
-// !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode.
+/* !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode. */
#if (defined(__clang__) || defined(__GNUC__) || \
defined(__TI_COMPILER_VERSION__)) && \
!defined(__STRICT_ANSI__) && !defined(_MSC_VER)
diff --git a/Modules/CMakeCUDACompilerId.cu.in b/Modules/CMakeCUDACompilerId.cu.in
index bc685a7..becb9b4 100644
--- a/Modules/CMakeCUDACompilerId.cu.in
+++ b/Modules/CMakeCUDACompilerId.cu.in
@@ -33,7 +33,7 @@ const char* info_language_standard_default = "INFO" ":" "standard_default["
"]";
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
-// !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode.
+/* !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode. */
#if (defined(__clang__) || defined(__GNUC__)) && !defined(__STRICT_ANSI__) && \
!defined(_MSC_VER)
"ON"
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index cdf9c18..e7a5487 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -66,7 +66,7 @@ const char* info_language_standard_default = "INFO" ":" "standard_default["
"]";
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
-// !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode.
+/* !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode. */
#if (defined(__clang__) || defined(__GNUC__) || \
defined(__TI_COMPILER_VERSION__)) && \
!defined(__STRICT_ANSI__) && !defined(_MSC_VER)
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index e49faae..4004ea4 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -637,6 +637,22 @@ External Project Definition
supported). Passing an empty string as the ``<cmd>`` makes the install
step do nothing.
+ .. note::
+ If the :envvar:`CMAKE_INSTALL_MODE` environment variable is set when the
+ main project is built, it will only have an effect if the following
+ conditions are met:
+
+ * The main project's configure step assumed the external project uses
+ CMake as its build system.
+ * The external project's install command actually runs. Note that due
+ to the way ``ExternalProject`` may use timestamps internally, if
+ nothing the install step depends on needs to be re-executed, the
+ install command might also not need to run.
+
+ Note also that ``ExternalProject`` does not check whether the
+ :envvar:`CMAKE_INSTALL_MODE` environment variable changes from one run
+ to another.
+
**Test Step Options:**
The test step is only defined if at least one of the following ``TEST_...``
options are provided.
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 9808861..35b1704 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -686,7 +686,7 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
${swig_custom_products}
${swig_cleanup_command}
# Let's create the ${outdir} at execution time, in case dir contains $(OutDir)
- COMMAND "${CMAKE_COMMAND}" -E make_directory ${outdir} ${outfiledir}
+ COMMAND "${CMAKE_COMMAND}" -E make_directory "${workingdir}" "${outdir}" "${outfiledir}"
${swig_timestamp_command}
COMMAND "${CMAKE_COMMAND}" -E env "SWIG_LIB=${SWIG_DIR}" "${SWIG_EXECUTABLE}"
"-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}"
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 9914902..97ad7ab 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -498,7 +498,8 @@ bool cmGlobalGenerator::CheckLanguages(
void cmGlobalGenerator::EnableLanguage(
std::vector<std::string> const& languages, cmMakefile* mf, bool optional)
{
- if (!this->IsMultiConfig()) {
+ if (!this->IsMultiConfig() &&
+ !this->GetCMakeInstance()->GetIsInTryCompile()) {
std::string envBuildType;
if (!mf->GetDefinition("CMAKE_BUILD_TYPE") &&
cmSystemTools::GetEnv("CMAKE_BUILD_TYPE", envBuildType)) {
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 83984f7..88f3cc7 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3167,7 +3167,8 @@ void cmMakefile::InitCMAKE_CONFIGURATION_TYPES(std::string const& genDefault)
return;
}
std::string initConfigs;
- if (!cmSystemTools::GetEnv("CMAKE_CONFIGURATION_TYPES", initConfigs)) {
+ if (this->GetCMakeInstance()->GetIsInTryCompile() ||
+ !cmSystemTools::GetEnv("CMAKE_CONFIGURATION_TYPES", initConfigs)) {
initConfigs = genDefault;
}
this->AddCacheDefinition(
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index c8f5a4b..3826577 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -197,7 +197,7 @@ std::string cmTimestamp::AddTimestampComponent(char flag,
#ifdef __MINGW32__
/* See a bug in MinGW: https://sourceforge.net/p/mingw-w64/bugs/793/. A work
* around is to try to use strftime() from ucrtbase.dll. */
- using T = size_t(WINAPI*)(char*, size_t, const char*, const struct tm*);
+ using T = size_t(__cdecl*)(char*, size_t, const char*, const struct tm*);
auto loadUcrtStrftime = []() -> T {
auto handle =
LoadLibraryExA("ucrtbase.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
diff --git a/Tests/RunCMake/try_compile/EnvConfig.c b/Tests/RunCMake/try_compile/EnvConfig.c
new file mode 100644
index 0000000..5b1d400
--- /dev/null
+++ b/Tests/RunCMake/try_compile/EnvConfig.c
@@ -0,0 +1,7 @@
+#ifdef TC_CONFIG_BAD
+# error "Built in 'Bad' config"
+#endif
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/try_compile/EnvConfig.cmake b/Tests/RunCMake/try_compile/EnvConfig.cmake
new file mode 100644
index 0000000..4040c59
--- /dev/null
+++ b/Tests/RunCMake/try_compile/EnvConfig.cmake
@@ -0,0 +1,18 @@
+enable_language(C)
+
+set(ENV{CMAKE_BUILD_TYPE} "Bad")
+set(ENV{CMAKE_CONFIGURATION_TYPES} "Bad;Debug")
+
+add_library(tc_defs INTERFACE IMPORTED)
+target_compile_definitions(tc_defs INTERFACE "TC_CONFIG_$<UPPER_CASE:$<CONFIG>>")
+
+try_compile(ENV_CONFIG_RESULT "${CMAKE_BINARY_DIR}"
+ SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/EnvConfig.c"
+ COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/EnvConfig.bin"
+ OUTPUT_VARIABLE tc_output
+ LINK_LIBRARIES tc_defs
+ )
+if(NOT ENV_CONFIG_RESULT)
+ string(REPLACE "\n" "\n " tc_output " ${tc_output}")
+ message(FATAL_ERROR "try_compile failed:\n${tc_output}")
+endif()
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index fffb038..b19fd0e 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -16,6 +16,8 @@ run_cmake(BadSources2)
run_cmake(NonSourceCopyFile)
run_cmake(NonSourceCompileDefinitions)
+run_cmake(EnvConfig)
+
set(RunCMake_TEST_OPTIONS --debug-trycompile)
run_cmake(PlatformVariables)
run_cmake(WarnDeprecated)
diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt
index c3f9e03..c76e8a0 100644
--- a/Tests/UseSWIG/CMakeLists.txt
+++ b/Tests/UseSWIG/CMakeLists.txt
@@ -76,6 +76,7 @@ if(SWIG_FOUND AND NOT SWIG_VERSION VERSION_LESS "4.0.2"
${build_generator_args}
--build-project TestBasicPython
--build-options ${build_options} -DSWIG_USE_SWIG_DEPENDENCIES=ON
+ "-DSWIG_OUTFILE_DIR=${CMake_BINARY_DIR}/Tests/UseSWIG/BasicPython.Depfile"
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
add_test(NAME UseSWIG.Depfile.BasicPerl COMMAND