ENH: clean up some policy stuff and interactions with CMAKE_BACKWARDS_COMPATIBILITY and CMAKE_MINIMUM_REQUIRED

This commit is contained in:
Ken Martin
2008-03-07 11:43:47 -05:00
parent 497779d4b3
commit 55eede4b13
5 changed files with 65 additions and 26 deletions

View File

@@ -134,22 +134,15 @@ bool cmListFile::ParseFile(const char* filename,
hasPolicy = true;
break;
}
if (cmSystemTools::LowerCase(i->Name) == "cmake_minimum_required")
{
hasPolicy = true;
break;
}
}
// if no policy command is found this is an error
if(!hasPolicy)
{
// add in the old CMAKE_BACKWARDS_COMPATIBILITY var for old CMake compatibility
if (!mf->GetCacheManager()->
GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))
{
mf->AddCacheDefinition
("CMAKE_BACKWARDS_COMPATIBILITY", "2.5",
"For backwards compatibility, what version of CMake "
"commands and "
"syntax should this version of CMake try to support.",
cmCacheManager::STRING);
}
switch (mf->GetPolicyStatus(cmPolicies::CMP_0000))
{
case cmPolicies::WARN:
@@ -165,20 +158,6 @@ bool cmListFile::ParseFile(const char* filename,
return false;
}
}
else
{
// add in the old CMAKE_BACKWARDS_COMPATIBILITY var for old CMake compatibility
if (!mf->GetCacheManager()->
GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))
{
mf->AddCacheDefinition
("CMAKE_BACKWARDS_COMPATIBILITY", "2.5",
"For backwards compatibility, what version of CMake "
"commands and "
"syntax should this version of CMake try to support.",
cmCacheManager::INTERNAL);
}
}
}
if(topLevel)