summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-20 13:04:51 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-05-20 13:06:17 (GMT)
commitbceca2fb47c8e783a025f4eea41638821052b54c (patch)
tree3edac7e31f6f4ae70953853acf9e124c0e49b57c /Source
parent1c73776e0b1daa611099f31fb988e704deb86c5c (diff)
parentca24b70d316be44d6503ada6a8c24aa909d78caa (diff)
downloadCMake-bceca2fb47c8e783a025f4eea41638821052b54c.zip
CMake-bceca2fb47c8e783a025f4eea41638821052b54c.tar.gz
CMake-bceca2fb47c8e783a025f4eea41638821052b54c.tar.bz2
Merge topic 'export-cmake-policy-version-range'
ca24b70d31 Export: Specify a policy range in exported files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4755
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExportFileGenerator.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 28037c6..ed0689a 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -923,12 +923,14 @@ void cmExportFileGenerator::GeneratePolicyHeaderCode(std::ostream& os)
/* clang-format on */
// Isolate the file policy level.
- // We use 2.6 here instead of the current version because newer
- // versions of CMake should be able to export files imported by 2.6
- // until the import format changes.
+ // Support CMake versions as far back as 2.6 but also support using NEW
+ // policy settings for up to CMake 3.17 (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)\n";
+ << "cmake_policy(VERSION 2.6...3.17)\n";
/* clang-format on */
}