diff options
author | Brad King <brad.king@kitware.com> | 2022-02-04 13:24:20 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-02-04 13:24:26 (GMT) |
commit | f84dcbd496ad6abb1491b621142e2c222f23c11c (patch) | |
tree | 7bcb39db53d4313301815deb298366a54cbb3192 /Source | |
parent | 57692659c677a9301af9b15657ccd56c65001c14 (diff) | |
parent | 9a48012f93376cefe94f1e61260ebbb1e1c2fed6 (diff) | |
download | CMake-f84dcbd496ad6abb1491b621142e2c222f23c11c.zip CMake-f84dcbd496ad6abb1491b621142e2c222f23c11c.tar.gz CMake-f84dcbd496ad6abb1491b621142e2c222f23c11c.tar.bz2 |
Merge topic 'post-rel-dev'
9a48012f93 Configure CMake itself with policies through CMake 3.22
a5a9687799 export: Increase maximum policy version in exported files to 3.22
a9ffded98c Add deprecation warnings for policies CMP0097 and below
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6948
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 2d80f0e..452c03c 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -933,13 +933,13 @@ void cmExportFileGenerator::GeneratePolicyHeaderCode(std::ostream& os) // Isolate the file policy level. // Support CMake versions as far back as 2.6 but also support using NEW - // policy settings for up to CMake 3.21 (this upper limit may be reviewed + // policy settings for up to CMake 3.22 (this upper limit may be reviewed // and increased from time to time). This reduces the opportunity for CMake // warnings when an older export file is later used with newer CMake // versions. /* clang-format off */ os << "cmake_policy(PUSH)\n" - << "cmake_policy(VERSION 2.6...3.21)\n"; + << "cmake_policy(VERSION 2.6...3.22)\n"; /* clang-format on */ } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 68e61bb..4b1635b 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -4395,12 +4395,14 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, } // Deprecate old policies. - if (status == cmPolicies::OLD && id <= cmPolicies::CMP0094 && + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0097 && !(this->GetCMakeInstance()->GetIsInTryCompile() && ( // Policies set by cmCoreTryCompile::TryCompileCode. id == cmPolicies::CMP0065 || id == cmPolicies::CMP0083 || - id == cmPolicies::CMP0091))) { + id == cmPolicies::CMP0091)) && + (!this->IsSet("CMAKE_WARN_DEPRECATED") || + this->IsOn("CMAKE_WARN_DEPRECATED"))) { this->IssueMessage(MessageType::DEPRECATION_WARNING, cmPolicies::GetPolicyDeprecatedWarning(id)); } |