ENH: change CMP_ to CMP

This commit is contained in:
Ken Martin 2008-03-13 11:38:46 -04:00
parent 0deb9012a6
commit 73df9a5cd4
7 changed files with 21 additions and 21 deletions

View File

@ -80,10 +80,10 @@ public:
"The policy version specified must be at least 2.4 or the command " "The policy version specified must be at least 2.4 or the command "
"will report an error. " "will report an error. "
"In order to get compatibility features supporting versions earlier " "In order to get compatibility features supporting versions earlier "
"than 2.4 see documentation of policy CMP_0001." "than 2.4 see documentation of policy CMP0001."
"\n" "\n"
" cmake_policy(SET <CMP_NNNN> NEW)\n" " cmake_policy(SET <CMPNNNN> NEW)\n"
" cmake_policy(SET <CMP_NNNN> OLD)\n" " cmake_policy(SET <CMPNNNN> OLD)\n"
"Tell CMake to use the OLD or NEW behavior for a given policy. " "Tell CMake to use the OLD or NEW behavior for a given policy. "
"Projects depending on the old behavior of a given policy may " "Projects depending on the old behavior of a given policy may "
"silence a policy warning by setting the policy state to OLD. " "silence a policy warning by setting the policy state to OLD. "

View File

@ -143,11 +143,11 @@ bool cmListFile::ParseFile(const char* filename,
// if no policy command is found this is an error // if no policy command is found this is an error
if(!hasPolicy) if(!hasPolicy)
{ {
switch (mf->GetPolicyStatus(cmPolicies::CMP_0000)) switch (mf->GetPolicyStatus(cmPolicies::CMP0000))
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
mf->IssueMessage(cmake::AUTHOR_WARNING, mf->IssueMessage(cmake::AUTHOR_WARNING,
mf->GetPolicies()->GetPolicyWarning(cmPolicies::CMP_0000) mf->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0000)
); );
// Implicitly set the version for the user. // Implicitly set the version for the user.
@ -156,7 +156,7 @@ bool cmListFile::ParseFile(const char* filename,
break; break;
default: default:
mf->IssueMessage(cmake::FATAL_ERROR, mf->IssueMessage(cmake::FATAL_ERROR,
mf->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP_0000) mf->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP0000)
); );
return false; return false;
} }

View File

@ -2673,7 +2673,7 @@ bool cmLocalGenerator::NeedBackwardsCompatibility(unsigned int major,
{ {
// Check the policy to decide whether to pay attention to this // Check the policy to decide whether to pay attention to this
// variable. // variable.
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP_0001)) switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0001))
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
// WARN is just OLD without warning because user code does not // WARN is just OLD without warning because user code does not

View File

@ -3278,17 +3278,17 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
else else
{ {
// target names must be globally unique // target names must be globally unique
switch (this->GetPolicyStatus(cmPolicies::CMP_0002)) switch (this->GetPolicyStatus(cmPolicies::CMP0002))
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
this->IssueMessage(cmake::AUTHOR_WARNING, this->GetPolicies()-> this->IssueMessage(cmake::AUTHOR_WARNING, this->GetPolicies()->
GetPolicyWarning(cmPolicies::CMP_0002)); GetPolicyWarning(cmPolicies::CMP0002));
case cmPolicies::OLD: case cmPolicies::OLD:
return true; return true;
case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS: case cmPolicies::REQUIRED_ALWAYS:
this->IssueMessage(cmake::FATAL_ERROR, this->IssueMessage(cmake::FATAL_ERROR,
this->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP_0002) this->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP0002)
); );
return true; return true;
case cmPolicies::NEW: case cmPolicies::NEW:
@ -3333,7 +3333,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
} }
e << "created in source directory \"" e << "created in source directory \""
<< existing->GetMakefile()->GetCurrentDirectory() << "\". " << existing->GetMakefile()->GetCurrentDirectory() << "\". "
<< "See documentation for policy CMP_0002 for more details."; << "See documentation for policy CMP0002 for more details.";
msg = e.str(); msg = e.str();
return false; return false;
} }
@ -3411,7 +3411,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
// Special hook for presenting compatibility variable as soon as // Special hook for presenting compatibility variable as soon as
// the user requests it. // the user requests it.
if(id == cmPolicies::CMP_0001 && if(id == cmPolicies::CMP0001 &&
(status == cmPolicies::WARN || status == cmPolicies::OLD)) (status == cmPolicies::WARN || status == cmPolicies::OLD))
{ {
if(!(this->GetCacheManager() if(!(this->GetCacheManager()

View File

@ -86,7 +86,7 @@ cmPolicies::cmPolicies()
{ {
// define all the policies // define all the policies
this->DefinePolicy( this->DefinePolicy(
CMP_0000, "CMP_0000", CMP0000, "CMP0000",
"A policy version number must be specified.", "A policy version number must be specified.",
"CMake requires that projects specify the version of CMake to which " "CMake requires that projects specify the version of CMake to which "
"they have been written. " "they have been written. "
@ -103,7 +103,7 @@ cmPolicies::cmPolicies()
); );
this->DefinePolicy( this->DefinePolicy(
CMP_0001, "CMP_0001", CMP0001, "CMP0001",
"CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.", "CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.",
"The OLD behavior is to check CMAKE_BACKWARDS_COMPATIBILITY and present " "The OLD behavior is to check CMAKE_BACKWARDS_COMPATIBILITY and present "
"it to the user. " "it to the user. "
@ -119,7 +119,7 @@ cmPolicies::cmPolicies()
); );
this->DefinePolicy( this->DefinePolicy(
CMP_0002, "CMP_0002", CMP0002, "CMP0002",
"Logical target names must be globally unique.", "Logical target names must be globally unique.",
"Targets names created with " "Targets names created with "
"add_executable, add_library, or add_custom_target " "add_executable, add_library, or add_custom_target "
@ -209,7 +209,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
"In CMake 2.4 and below backwards compatibility was handled with the " "In CMake 2.4 and below backwards compatibility was handled with the "
"CMAKE_BACKWARDS_COMPATIBILITY variable. " "CMAKE_BACKWARDS_COMPATIBILITY variable. "
"In order to get compatibility features supporting versions earlier " "In order to get compatibility features supporting versions earlier "
"than 2.4 set policy CMP_0001 to OLD to tell CMake to check the " "than 2.4 set policy CMP0001 to OLD to tell CMake to check the "
"CMAKE_BACKWARDS_COMPATIBILITY variable. " "CMAKE_BACKWARDS_COMPATIBILITY variable. "
"One way to so this is to set the policy version to 2.4 exactly." "One way to so this is to set the policy version to 2.4 exactly."
); );

View File

@ -40,13 +40,13 @@ public:
enum PolicyID enum PolicyID
{ {
CMP_0000, // Policy version specification CMP0000, // Policy version specification
CMP_0001, // Ignore old compatibility variable CMP0001, // Ignore old compatibility variable
CMP_0002, // Target names must be unique CMP0002, // Target names must be unique
// Always the last entry. Useful mostly to avoid adding a comma // Always the last entry. Useful mostly to avoid adding a comma
// the last policy when adding a new one. // the last policy when adding a new one.
CMP_COUNT CMPCOUNT
}; };
///! convert a string policy ID into a number ///! convert a string policy ID into a number

View File

@ -3344,7 +3344,7 @@ void cmake::DefineProperties(cmake *cm)
"ALLOW_DUPLICATE_CUSTOM_TARGETS", cmProperty::GLOBAL, "ALLOW_DUPLICATE_CUSTOM_TARGETS", cmProperty::GLOBAL,
"Allow duplicate custom targets to be created.", "Allow duplicate custom targets to be created.",
"Normally CMake requires that all targets built in a project have " "Normally CMake requires that all targets built in a project have "
"globally unique logical names (see policy CMP_0002). " "globally unique logical names (see policy CMP0002). "
"This is necessary to generate meaningful project file names in " "This is necessary to generate meaningful project file names in "
"Xcode and VS IDE generators. " "Xcode and VS IDE generators. "
"It also allows the target names to be referenced unambiguously.\n" "It also allows the target names to be referenced unambiguously.\n"