summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-07 19:42:55 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-07 19:42:55 (GMT)
commit31e6ee502ea1d3897fc553030190610a9980ab4a (patch)
tree8c1b7a12e1f5002bb4bb4c1251a3801e4894f7bf /Source/cmTarget.cxx
parentea574d98edf9ccda5d33ed47f36930f05b45fb0b (diff)
parentf01dc72c582290390196f89593f32acf3e14b71f (diff)
downloadCMake-31e6ee502ea1d3897fc553030190610a9980ab4a.zip
CMake-31e6ee502ea1d3897fc553030190610a9980ab4a.tar.gz
CMake-31e6ee502ea1d3897fc553030190610a9980ab4a.tar.bz2
Merge topic 'authorative-LINK_LIBRARIES'
f01dc72 Use one authorative source of the LINK_LIBRARIES property.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx64
1 files changed, 46 insertions, 18 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 8ccd19c..b491762 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2661,6 +2661,11 @@ void cmTarget::FinalizeSystemIncludeDirectories()
end = this->Internal->LinkInterfacePropertyEntries.end();
it != end; ++it)
{
+ if (!cmGeneratorExpression::IsValidTargetName(it->Value)
+ && cmGeneratorExpression::Find(it->Value) == std::string::npos)
+ {
+ continue;
+ }
{
cmListFileBacktrace lfbt;
cmGeneratorExpression ge(lfbt);
@@ -3037,15 +3042,11 @@ void cmTarget::SetProperty(const char* prop, const char* value)
if (strcmp(prop, "LINK_LIBRARIES") == 0)
{
this->Internal->LinkInterfacePropertyEntries.clear();
- if (cmGeneratorExpression::IsValidTargetName(value)
- || cmGeneratorExpression::Find(value) != std::string::npos)
- {
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmValueWithOrigin entry(value, lfbt);
- this->Internal->LinkInterfacePropertyEntries.push_back(entry);
- }
- // Fall through
+ cmListFileBacktrace lfbt;
+ this->Makefile->GetBacktrace(lfbt);
+ cmValueWithOrigin entry(value, lfbt);
+ this->Internal->LinkInterfacePropertyEntries.push_back(entry);
+ return;
}
this->Properties.SetProperty(prop, value, cmProperty::TARGET);
this->MaybeInvalidatePropertyCache(prop);
@@ -3103,15 +3104,11 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
}
if (strcmp(prop, "LINK_LIBRARIES") == 0)
{
- if (cmGeneratorExpression::IsValidTargetName(value)
- || cmGeneratorExpression::Find(value) != std::string::npos)
- {
- cmListFileBacktrace lfbt;
- this->Makefile->GetBacktrace(lfbt);
- cmValueWithOrigin entry(value, lfbt);
- this->Internal->LinkInterfacePropertyEntries.push_back(entry);
- }
- // Fall through
+ cmListFileBacktrace lfbt;
+ this->Makefile->GetBacktrace(lfbt);
+ cmValueWithOrigin entry(value, lfbt);
+ this->Internal->LinkInterfacePropertyEntries.push_back(entry);
+ return;
}
this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString);
this->MaybeInvalidatePropertyCache(prop);
@@ -3391,6 +3388,11 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
end = this->Internal->LinkInterfacePropertyEntries.end();
it != end; ++it)
{
+ if (!cmGeneratorExpression::IsValidTargetName(it->Value)
+ && cmGeneratorExpression::Find(it->Value) == std::string::npos)
+ {
+ continue;
+ }
{
cmGeneratorExpression ge(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@@ -3589,6 +3591,11 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
end = this->Internal->LinkInterfacePropertyEntries.end();
it != end; ++it)
{
+ if (!cmGeneratorExpression::IsValidTargetName(it->Value)
+ && cmGeneratorExpression::Find(it->Value) == std::string::npos)
+ {
+ continue;
+ }
{
cmGeneratorExpression ge(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@@ -3697,6 +3704,11 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
end = this->Internal->LinkInterfacePropertyEntries.end();
it != end; ++it)
{
+ if (!cmGeneratorExpression::IsValidTargetName(it->Value)
+ && cmGeneratorExpression::Find(it->Value) == std::string::npos)
+ {
+ continue;
+ }
{
cmGeneratorExpression ge(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@@ -4185,6 +4197,22 @@ const char *cmTarget::GetProperty(const char* prop,
}
return output.c_str();
}
+ if(strcmp(prop,"LINK_LIBRARIES") == 0)
+ {
+ static std::string output;
+ output = "";
+ std::string sep;
+ for (std::vector<cmValueWithOrigin>::const_iterator
+ it = this->Internal->LinkInterfacePropertyEntries.begin(),
+ end = this->Internal->LinkInterfacePropertyEntries.end();
+ it != end; ++it)
+ {
+ output += sep;
+ output += it->Value;
+ sep = ";";
+ }
+ return output.c_str();
+ }
if (strcmp(prop,"IMPORTED") == 0)
{