summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-12 13:31:02 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-05-12 13:31:02 (GMT)
commitc1e428c0393c62a32dfd54fadfc34546c9c004d8 (patch)
treeee0d44cb99a62c0937daa6439725ecf573533df6 /Source
parenta2bb00d19669be96e3bfde22fee100578d2cb6e1 (diff)
parent75c3d18dd6b356c692c4f105b0df8413a6d3e0e6 (diff)
downloadCMake-c1e428c0393c62a32dfd54fadfc34546c9c004d8.zip
CMake-c1e428c0393c62a32dfd54fadfc34546c9c004d8.tar.gz
CMake-c1e428c0393c62a32dfd54fadfc34546c9c004d8.tar.bz2
Merge topic 'target-property-policy-context'
75c3d18d Merge branch 'backport-target-property-policy-context' into target-property-policy-context 911cc9a3 cmTarget: Evaluate CMP0026 and CMP0051 in calling context cb810abe cmTarget: Drop unused GetProperty signature 23409f50 cmTarget: Evaluate CMP0026 in calling context 2e75bf67 cmTarget: Drop unused GetProperty signature
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGetPropertyCommand.cxx3
-rw-r--r--Source/cmGetTargetPropertyCommand.cxx2
-rw-r--r--Source/cmTarget.cxx36
-rw-r--r--Source/cmTarget.h5
4 files changed, 23 insertions, 23 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 6dd40c9..512d789 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -302,7 +302,8 @@ bool cmGetPropertyCommand::HandleTargetMode()
}
if(cmTarget* target = this->Makefile->FindTargetToUse(this->Name))
{
- return this->StoreResult(target->GetProperty(this->PropertyName));
+ return this->StoreResult(target->GetProperty(this->PropertyName,
+ this->Makefile));
}
else
{
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
index e3ec0bc..aa6f0c1 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -38,7 +38,7 @@ bool cmGetTargetPropertyCommand
else if(cmTarget* tgt = this->Makefile->FindTargetToUse(targetName))
{
cmTarget& target = *tgt;
- const char* prop_cstr = target.GetProperty(args[2]);
+ const char* prop_cstr = target.GetProperty(args[2], this->Makefile);
if(prop_cstr)
{
prop = prop_cstr;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index dda855f..3f2ae9e 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3178,13 +3178,7 @@ const char* cmTarget::GetFeature(const std::string& feature,
}
//----------------------------------------------------------------------------
-const char *cmTarget::GetProperty(const std::string& prop) const
-{
- return this->GetProperty(prop, cmProperty::TARGET);
-}
-
-//----------------------------------------------------------------------------
-bool cmTarget::HandleLocationPropertyPolicy() const
+bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
{
if (this->IsImported())
{
@@ -3193,7 +3187,7 @@ bool cmTarget::HandleLocationPropertyPolicy() const
cmOStringStream e;
const char *modal = 0;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
- switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0026))
+ switch (context->GetPolicyStatus(cmPolicies::CMP0026))
{
case cmPolicies::WARN:
e << (this->Makefile->GetPolicies()
@@ -3214,15 +3208,21 @@ bool cmTarget::HandleLocationPropertyPolicy() const
<< this->GetName() << "\". Use the target name directly with "
"add_custom_command, or use the generator expression $<TARGET_FILE>, "
"as appropriate.\n";
- this->Makefile->IssueMessage(messageType, e.str());
+ context->IssueMessage(messageType, e.str());
}
return messageType != cmake::FATAL_ERROR;
}
//----------------------------------------------------------------------------
+const char *cmTarget::GetProperty(const std::string& prop) const
+{
+ return this->GetProperty(prop, this->Makefile);
+}
+
+//----------------------------------------------------------------------------
const char *cmTarget::GetProperty(const std::string& prop,
- cmProperty::ScopeType scope) const
+ cmMakefile* context) const
{
if (this->GetType() == INTERFACE_LIBRARY
&& !whiteListedInterfaceProperty(prop))
@@ -3230,7 +3230,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
cmOStringStream e;
e << "INTERFACE_LIBRARY targets may only have whitelisted properties. "
"The property \"" << prop << "\" is not allowed.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ context->IssueMessage(cmake::FATAL_ERROR, e.str());
return 0;
}
@@ -3249,7 +3249,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
{
if(prop == "LOCATION")
{
- if (!this->HandleLocationPropertyPolicy())
+ if (!this->HandleLocationPropertyPolicy(context))
{
return 0;
}
@@ -3270,7 +3270,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
// Support "LOCATION_<CONFIG>".
if(cmHasLiteralPrefix(prop, "LOCATION_"))
{
- if (!this->HandleLocationPropertyPolicy())
+ if (!this->HandleLocationPropertyPolicy(context))
{
return 0;
}
@@ -3285,7 +3285,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
std::string configName(prop.c_str(), prop.size() - 9);
if(configName != "IMPORTED")
{
- if (!this->HandleLocationPropertyPolicy())
+ if (!this->HandleLocationPropertyPolicy(context))
{
return 0;
}
@@ -3423,7 +3423,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
bool noMessage = true;
cmOStringStream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
- switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0051))
+ switch(context->GetPolicyStatus(cmPolicies::CMP0051))
{
case cmPolicies::WARN:
e << (this->Makefile->GetPolicies()
@@ -3444,7 +3444,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
"read at configure time. Code reading that property needs to be "
"adapted to ignore the generator expression using the "
"string(GENEX_STRIP) command.";
- this->Makefile->IssueMessage(messageType, e.str());
+ context->IssueMessage(messageType, e.str());
}
if (addContent)
{
@@ -3489,10 +3489,10 @@ const char *cmTarget::GetProperty(const std::string& prop,
}
bool chain = false;
const char *retVal =
- this->Properties.GetPropertyValue(prop, scope, chain);
+ this->Properties.GetPropertyValue(prop, cmProperty::TARGET, chain);
if (chain)
{
- return this->Makefile->GetProperty(prop,scope);
+ return this->Makefile->GetProperty(prop, cmProperty::TARGET);
}
return retVal;
}
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 4d8022e..bee6b34 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -231,8 +231,7 @@ public:
void AppendProperty(const std::string& prop, const char* value,
bool asString=false);
const char *GetProperty(const std::string& prop) const;
- const char *GetProperty(const std::string& prop,
- cmProperty::ScopeType scope) const;
+ const char *GetProperty(const std::string& prop, cmMakefile* context) const;
bool GetPropertyAsBool(const std::string& prop) const;
void CheckProperty(const std::string& prop, cmMakefile* context) const;
@@ -589,7 +588,7 @@ public:
const std::string &compatibilityType) const;
private:
- bool HandleLocationPropertyPolicy() const;
+ bool HandleLocationPropertyPolicy(cmMakefile* context) const;
// The set of include directories that are marked as system include
// directories.