cmMakefile: Remove CMP0001 handling to callers.
This commit is contained in:
parent
d0dcce15f4
commit
5447ca1a94
|
@ -93,6 +93,22 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector<std::string> const& args)
|
||||||
this->SetError("SET failed to set policy.");
|
this->SetError("SET failed to set policy.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if(args[1] == "CMP0001" &&
|
||||||
|
(status == cmPolicies::WARN || status == cmPolicies::OLD))
|
||||||
|
{
|
||||||
|
if(!(this->Makefile->GetState()
|
||||||
|
->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
|
||||||
|
{
|
||||||
|
// Set it to 2.4 because that is the last version where the
|
||||||
|
// variable had meaning.
|
||||||
|
this->Makefile->AddCacheDefinition
|
||||||
|
("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
|
||||||
|
"For backwards compatibility, what version of CMake "
|
||||||
|
"commands and "
|
||||||
|
"syntax should this version of CMake try to support.",
|
||||||
|
cmState::STRING);
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4822,25 +4822,6 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
|
||||||
previous_was_weak = psi->Weak;
|
previous_was_weak = psi->Weak;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special hook for presenting compatibility variable as soon as
|
|
||||||
// the user requests it.
|
|
||||||
if(id == cmPolicies::CMP0001 &&
|
|
||||||
(status == cmPolicies::WARN || status == cmPolicies::OLD))
|
|
||||||
{
|
|
||||||
if(!(this->GetState()
|
|
||||||
->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
|
|
||||||
{
|
|
||||||
// Set it to 2.4 because that is the last version where the
|
|
||||||
// variable had meaning.
|
|
||||||
this->AddCacheDefinition
|
|
||||||
("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
|
|
||||||
"For backwards compatibility, what version of CMake "
|
|
||||||
"commands and "
|
|
||||||
"syntax should this version of CMake try to support.",
|
|
||||||
cmState::STRING);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,6 +255,22 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if(pid == cmPolicies::CMP0001 &&
|
||||||
|
(status == cmPolicies::WARN || status == cmPolicies::OLD))
|
||||||
|
{
|
||||||
|
if(!(mf->GetState()
|
||||||
|
->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
|
||||||
|
{
|
||||||
|
// Set it to 2.4 because that is the last version where the
|
||||||
|
// variable had meaning.
|
||||||
|
mf->AddCacheDefinition
|
||||||
|
("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
|
||||||
|
"For backwards compatibility, what version of CMake "
|
||||||
|
"commands and "
|
||||||
|
"syntax should this version of CMake try to support.",
|
||||||
|
cmState::STRING);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue