|
|
@@ -173,6 +173,25 @@ public:
|
|
|
this->Error += e;
|
|
|
}
|
|
|
|
|
|
+ /** Check if the command is disallowed by a policy. */
|
|
|
+ bool Disallowed(cmPolicies::PolicyID pol, const char* e)
|
|
|
+ {
|
|
|
+ switch(this->Makefile->GetPolicyStatus(pol))
|
|
|
+ {
|
|
|
+ case cmPolicies::WARN:
|
|
|
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
|
|
|
+ this->Makefile->GetPolicies()->GetPolicyWarning(pol));
|
|
|
+ case cmPolicies::OLD:
|
|
|
+ return false;
|
|
|
+ case cmPolicies::REQUIRED_IF_USED:
|
|
|
+ case cmPolicies::REQUIRED_ALWAYS:
|
|
|
+ case cmPolicies::NEW:
|
|
|
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
protected:
|
|
|
cmMakefile* Makefile;
|
|
|
cmCommandArgumentsHelper Helper;
|