summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2008-03-07 16:43:47 (GMT)
committerKen Martin <ken.martin@kitware.com>2008-03-07 16:43:47 (GMT)
commit55eede4b131e39cc341832cd99d3b339f040af75 (patch)
tree7a36fdcf05163e4a35e2c0ecc3b91d017afe7236 /Source/cmPolicies.cxx
parent497779d4b3be8ac387690bc95fdadab122fa5a3c (diff)
downloadCMake-55eede4b131e39cc341832cd99d3b339f040af75.zip
CMake-55eede4b131e39cc341832cd99d3b339f040af75.tar.gz
CMake-55eede4b131e39cc341832cd99d3b339f040af75.tar.bz2
ENH: clean up some policy stuff and interactions with CMAKE_BACKWARDS_COMPATIBILITY and CMAKE_MINIMUM_REQUIRED
Diffstat (limited to 'Source/cmPolicies.cxx')
-rw-r--r--Source/cmPolicies.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 382507b..79fecc3 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -184,6 +184,30 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
return false;
}
+ // it is an error if the policy version is less than 2.4
+ if (majorVer < 2 || majorVer == 2 && minorVer < 4)
+ {
+ mf->IssueError("An attempt was made to set the policy version of "
+ "CMake to something earlier than 2.4, this is an error!");
+ }
+
+ // if the version is 2.4 then make sure the backwards compatibility variable is visible
+ if (majorVer == 2 && minorVer == 4)
+ {
+ // set the default BACKWARDS compatibility to be visible
+ mf->GetCacheManager()->GetCacheIterator(
+ "CMAKE_BACKWARDS_COMPATIBILITY").SetType
+ (cmCacheManager::STRING);
+ // const char *cbcValue =
+ // mf->GetCacheManager()->
+ // GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY");
+ // mf->AddCacheDefinition
+ // ("CMAKE_BACKWARDS_COMPATIBILITY",cbcValue,
+ // "For backwards compatibility, what version of CMake commands and "
+ // "syntax should this version of CMake allow.",
+ // cmCacheManager::STRING);
+ }
+
// now loop over all the policies and set them as appropriate
std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
= this->Policies.begin();