summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-16 16:42:36 (GMT)
committerBrad King <brad.king@kitware.com>2018-03-21 12:00:28 (GMT)
commit45408b5ea1e3654b5d4f6289ca1a0b5c0f1ac4e9 (patch)
tree73dd09488de4a0559bd3e3dd1828f8c75278f31c /Source/cmMakefile.cxx
parent6a41aa2abd75ceaa9081edc1c7f8510d2c17dd7e (diff)
downloadCMake-45408b5ea1e3654b5d4f6289ca1a0b5c0f1ac4e9.zip
CMake-45408b5ea1e3654b5d4f6289ca1a0b5c0f1ac4e9.tar.gz
CMake-45408b5ea1e3654b5d4f6289ca1a0b5c0f1ac4e9.tar.bz2
cmake_minimum_required: Optionally set policies with version range
Teach `cmake_minimum_required` and `cmake_policy(VERSION)` to support a version range of the form `<min>[...<max>]`. Define this to mean that version `<min>` is required, but known policies up to those introduced by `<max>` will be set to `NEW`. This will allow projects to easily specify a range of versions for which they have been updated.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 23883f7..92d7681 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1464,7 +1464,7 @@ void cmMakefile::Configure()
this->SetCheckCMP0000(true);
// Implicitly set the version for the user.
- this->SetPolicyVersion("2.4");
+ this->SetPolicyVersion("2.4", std::string());
}
}
bool hasProject = false;
@@ -4149,9 +4149,10 @@ void cmMakefile::PopSnapshot(bool reportError)
assert(this->StateSnapshot.IsValid());
}
-bool cmMakefile::SetPolicyVersion(std::string const& version_min)
+bool cmMakefile::SetPolicyVersion(std::string const& version_min,
+ std::string const& version_max)
{
- return cmPolicies::ApplyPolicyVersion(this, version_min);
+ return cmPolicies::ApplyPolicyVersion(this, version_min, version_max);
}
bool cmMakefile::HasCMP0054AlreadyBeenReported(