Clarify documentation and message for CMP0012
This commit re-words the warning message produced for CMP0012 to avoid the word 'you' since often the person reading the message is not the author of the code. We also add an example of the bad OLD behavior to the policy documentation.
This commit is contained in:
parent
5837f4a613
commit
3d3efbd3f5
|
@ -269,10 +269,9 @@ namespace
|
|||
if (cmSystemTools::IsOff(def))
|
||||
{
|
||||
cmPolicies* policies = makefile->GetPolicies();
|
||||
errorString = "You have used a variable or argument named \""
|
||||
errorString = "A variable or argument named \""
|
||||
+ newArg
|
||||
+ "\" in a conditional statement. Please be aware of issues "
|
||||
+ "related to policy CMP0012. "
|
||||
+ "\" appears in a conditional statement. "
|
||||
+ policies->GetPolicyWarning(cmPolicies::CMP0012);
|
||||
status = cmake::AUTHOR_WARNING;
|
||||
}
|
||||
|
@ -285,10 +284,9 @@ namespace
|
|||
if (!cmSystemTools::IsOff(def))
|
||||
{
|
||||
cmPolicies* policies = makefile->GetPolicies();
|
||||
errorString = "You have used a variable or argument named \""
|
||||
errorString = "A variable or argument named \""
|
||||
+ newArg
|
||||
+ "\" in a conditional statement. Please be aware of issues "
|
||||
+ "related to policy CMP0012. "
|
||||
+ "\" appears in a conditional statement. "
|
||||
+ policies->GetPolicyWarning(cmPolicies::CMP0012);
|
||||
status = cmake::AUTHOR_WARNING;
|
||||
}
|
||||
|
|
|
@ -362,7 +362,9 @@ cmPolicies::cmPolicies()
|
|||
"In CMake versions 2.6.4 and lower the only boolean constants were 0 "
|
||||
"and 1. Other boolean constants such as true, false, yes, no, "
|
||||
"on, off, y, n, notfound, ignore (all case insensitive) were recognized "
|
||||
"in some cases but not all. In later versions of cmake these values are "
|
||||
"in some cases but not all. "
|
||||
"For example, the code \"if(TRUE)\" might have evaluated as false. "
|
||||
"In later versions of cmake these values are "
|
||||
"treated as boolean constants more consistently and should not be used "
|
||||
"as variable names. "
|
||||
"The OLD behavior for this policy is to allow variables to have names "
|
||||
|
|
Loading…
Reference in New Issue