summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2014-03-28 20:38:10 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-31 13:45:10 (GMT)
commit77b581c2f004a36b2b62cc7c678abf51f92c76b5 (patch)
tree38d8a72a1d631f6a9b5cd30ab9ab14a256e7826a /Source
parenta48de7d8506325e7f27c9dada578744e1ff3fb35 (diff)
downloadCMake-77b581c2f004a36b2b62cc7c678abf51f92c76b5.zip
CMake-77b581c2f004a36b2b62cc7c678abf51f92c76b5.tar.gz
CMake-77b581c2f004a36b2b62cc7c678abf51f92c76b5.tar.bz2
Policies: omit warnings about unset policies when they are actually set to NEW
Diffstat (limited to 'Source')
-rw-r--r--Source/cmAddCustomTargetCommand.cxx6
-rw-r--r--Source/cmAddExecutableCommand.cxx6
-rw-r--r--Source/cmAddLibraryCommand.cxx11
-rw-r--r--Source/cmComputeTargetDepends.cxx7
-rw-r--r--Source/cmIncludeCommand.cxx6
-rw-r--r--Source/cmMakefile.cxx6
-rw-r--r--Source/cmTarget.cxx6
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx14
8 files changed, 34 insertions, 28 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index ef62523..e27d830 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -165,10 +165,13 @@ bool cmAddCustomTargetCommand
if (!nameOk)
{
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ cmOStringStream e;
bool issueMessage = false;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037))
{
case cmPolicies::WARN:
+ e << (this->Makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n";
issueMessage = true;
case cmPolicies::OLD:
break;
@@ -180,9 +183,6 @@ bool cmAddCustomTargetCommand
}
if (issueMessage)
{
- cmOStringStream e;
- e << (this->Makefile->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n";
e << "The target name \"" << targetName <<
"\" is reserved or not valid for certain "
"CMake features, such as generator expressions, and may result "
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index 62b6667..3f9400e 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -79,10 +79,13 @@ bool cmAddExecutableCommand
if (!nameOk)
{
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ cmOStringStream e;
bool issueMessage = false;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037))
{
case cmPolicies::WARN:
+ e << (this->Makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n";
issueMessage = true;
case cmPolicies::OLD:
break;
@@ -94,9 +97,6 @@ bool cmAddExecutableCommand
}
if (issueMessage)
{
- cmOStringStream e;
- e << (this->Makefile->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n";
e << "The target name \"" << exename <<
"\" is reserved or not valid for certain "
"CMake features, such as generator expressions, and may result "
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 009b1ca..e62a40e 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -214,11 +214,17 @@ bool cmAddLibraryCommand
if (!nameOk)
{
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ cmOStringStream e;
bool issueMessage = false;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037))
{
case cmPolicies::WARN:
- issueMessage = type != cmTarget::INTERFACE_LIBRARY;
+ if(type != cmTarget::INTERFACE_LIBRARY)
+ {
+ e << (this->Makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n";
+ issueMessage = true;
+ }
case cmPolicies::OLD:
break;
case cmPolicies::NEW:
@@ -229,9 +235,6 @@ bool cmAddLibraryCommand
}
if (issueMessage)
{
- cmOStringStream e;
- e << (this->Makefile->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0037)) << "\n";
e << "The target name \"" << libName <<
"\" is reserved or not valid for certain "
"CMake features, such as generator expressions, and may result "
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 7870564..9136869 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -349,9 +349,12 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
cmMakefile *makefile = depender->GetMakefile();
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
bool issueMessage = false;
+ cmOStringStream e;
switch(depender->GetPolicyStatusCMP0046())
{
case cmPolicies::WARN:
+ e << (makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0046)) << "\n";
issueMessage = true;
case cmPolicies::OLD:
break;
@@ -364,9 +367,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
if(issueMessage)
{
cmake* cm = this->GlobalGenerator->GetCMakeInstance();
- cmOStringStream e;
- e << (makefile->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0046)) << "\n";
+
e << "The dependency target \"" << dependee_name
<< "\" of target \"" << depender->GetName() << "\" does not exist.";
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index e8ee33f..fbcbc75 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -98,11 +98,14 @@ bool cmIncludeCommand
if (gg->IsExportedTargetsFile(fname_abs))
{
const char *modal = 0;
+ cmOStringStream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0024))
{
case cmPolicies::WARN:
+ e << (this->Makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0024)) << "\n";
modal = "should";
case cmPolicies::OLD:
break;
@@ -114,9 +117,6 @@ bool cmIncludeCommand
}
if (modal)
{
- cmOStringStream e;
- e << (this->Makefile->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0024)) << "\n";
e << "The file\n " << fname_abs << "\nwas generated by the export() "
"command. It " << modal << " not be used as the argument to the "
"include() command. Use ALIAS targets instead to refer to targets "
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 10137ec..11559d9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -893,9 +893,12 @@ cmMakefile::AddCustomCommandToTarget(const char* target,
{
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
bool issueMessage = false;
+ cmOStringStream e;
switch(this->GetPolicyStatus(cmPolicies::CMP0040))
{
case cmPolicies::WARN:
+ e << (this->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0040)) << "\n";
issueMessage = true;
case cmPolicies::OLD:
break;
@@ -908,9 +911,6 @@ cmMakefile::AddCustomCommandToTarget(const char* target,
if(issueMessage)
{
- cmOStringStream e;
- e << (this->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0040)) << "\n";
e << "The target name \"" << target << "\" is unknown in this context.";
IssueMessage(messageType, e.str().c_str());
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0c89656..e2a568b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2636,11 +2636,14 @@ bool cmTarget::HandleLocationPropertyPolicy() const
{
return true;
}
+ cmOStringStream e;
const char *modal = 0;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0026))
{
case cmPolicies::WARN:
+ e << (this->Makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0026)) << "\n";
modal = "should";
case cmPolicies::OLD:
break;
@@ -2653,9 +2656,6 @@ bool cmTarget::HandleLocationPropertyPolicy() const
if (modal)
{
- cmOStringStream e;
- e << (this->Makefile->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0026)) << "\n";
e << "The LOCATION property " << modal << " not be read from target \""
<< this->GetName() << "\". Use the target name directly with "
"add_custom_command, or use the generator expression $<TARGET_FILE>, "
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 02da933..95a2cba 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -103,11 +103,14 @@ bool cmTargetLinkLibrariesCommand
if (this->Target->GetType() == cmTarget::UTILITY)
{
+ cmOStringStream e;
const char *modal = 0;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0039))
{
case cmPolicies::WARN:
+ e << this->Makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0039) << "\n";
modal = "should";
case cmPolicies::OLD:
break;
@@ -119,9 +122,7 @@ bool cmTargetLinkLibrariesCommand
}
if (modal)
{
- cmOStringStream e;
- e << this->Makefile->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0039) << "\n"
+ e <<
"Utility target \"" << this->Target->GetName() << "\" " << modal
<< " not be used as the target of a target_link_libraries call.";
this->Makefile->IssueMessage(messageType, e.str().c_str());
@@ -373,11 +374,14 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
? cmTarget::KeywordTLLSignature : cmTarget::PlainTLLSignature;
if (!this->Target->PushTLLCommandTrace(sig))
{
+ cmOStringStream e;
const char *modal = 0;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0023))
{
case cmPolicies::WARN:
+ e << this->Makefile->GetPolicies()
+ ->GetPolicyWarning(cmPolicies::CMP0023) << "\n";
modal = "should";
case cmPolicies::OLD:
break;
@@ -390,14 +394,12 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
if(modal)
{
- cmOStringStream e;
// If the sig is a keyword form and there is a conflict, the existing
// form must be the plain form.
const char *existingSig
= (sig == cmTarget::KeywordTLLSignature ? "plain"
: "keyword");
- e << this->Makefile->GetPolicies()
- ->GetPolicyWarning(cmPolicies::CMP0023) << "\n"
+ e <<
"The " << existingSig << " signature for target_link_libraries "
"has already been used with the target \""
<< this->Target->GetName() << "\". All uses of "