mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 21:59:54 -06:00
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
This commit is contained in:
@@ -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 */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user