ENH: Improve error message when invalid policy is given.

This commit is contained in:
Brad King 2008-03-13 14:13:44 -04:00
parent 870571b28b
commit fb0296656d
1 changed files with 5 additions and 4 deletions

View File

@ -3332,11 +3332,12 @@ bool cmMakefile::SetPolicy(const char *id,
{
cmPolicies::PolicyID pid;
if (!this->GetPolicies()->GetPolicyID(id, /* out */ pid))
{
cmSystemTools::Error("Invalid policy string used. Invalid string was "
, id);
{
cmOStringStream e;
e << "Policy \"" << id << "\" is not known to this version of CMake.";
this->IssueMessage(cmake::FATAL_ERROR, e.str());
return false;
}
}
return this->SetPolicy(pid,status);
}