summaryrefslogtreecommitdiff
path: root/Source/cmPolicies.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-16 11:56:54 -0400
committerBrad King <brad.king@kitware.com>2018-03-16 12:06:04 -0400
commit0df559832bdc629df333b57c798d42e77716a94b (patch)
treef366843e9dd59e516b3e6bfb2a1761d594c5b945 /Source/cmPolicies.cxx
parentb3e668ea25d35a04adc41e17cfb4c8ab7a97a7d9 (diff)
downloadcmake-0df559832bdc629df333b57c798d42e77716a94b.tar.gz
cmPolicies: Pass policy version as std::string
Diffstat (limited to 'Source/cmPolicies.cxx')
-rw-r--r--Source/cmPolicies.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index e7d1b72183..7e3bd78dec 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -153,12 +153,13 @@ static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy,
return true;
}
-bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, const char* version)
+bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf,
+ std::string const& version_min)
{
std::string ver = "2.4.0";
- if (version && strlen(version) > 0) {
- ver = version;
+ if (!version_min.empty()) {
+ ver = version_min;
}
unsigned int majorVer = 2;
@@ -200,7 +201,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, const char* version)
tweakVer > cmVersion::GetTweakVersion())) {
std::ostringstream e;
e << "An attempt was made to set the policy version of CMake to \""
- << version << "\" which is greater than this version of CMake. "
+ << version_min << "\" which is greater than this version of CMake. "
<< "This is not allowed because the greater version may have new "
<< "policies not known to this CMake. "
<< "You may need a newer CMake version to build this project.";