summaryrefslogtreecommitdiff
path: root/Source/cmTargetPropCommandBase.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-01-29 17:23:31 +0100
committerStephen Kelly <steveire@gmail.com>2013-01-29 19:34:04 +0100
commit7bf490e9bb6128082aa178f28691b3fc418322fe (patch)
treea8f701d2db9a3960cceb1596705906c19ba42df4 /Source/cmTargetPropCommandBase.cxx
parentf6b16d4b0642d26111cddff714b464e22b715482 (diff)
downloadcmake-7bf490e9bb6128082aa178f28691b3fc418322fe.tar.gz
Make subclasses responsible for joining content.
This way we can add handling of relative/absolute paths and of -D in compile definitions.
Diffstat (limited to 'Source/cmTargetPropCommandBase.cxx')
-rw-r--r--Source/cmTargetPropCommandBase.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index ef404382af..18a1d2a9f6 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -88,9 +88,8 @@ bool cmTargetPropCommandBase
++argIndex;
- std::string content;
+ std::vector<std::string> content;
- std::string sep;
for(unsigned int i=argIndex; i < args.size(); ++i, ++argIndex)
{
if(args[i] == "PUBLIC"
@@ -100,8 +99,7 @@ bool cmTargetPropCommandBase
this->PopulateTargetProperies(scope, content, prepend);
return true;
}
- content += sep + args[i];
- sep = ";";
+ content.push_back(args[i]);
}
this->PopulateTargetProperies(scope, content, prepend);
return true;
@@ -110,7 +108,8 @@ bool cmTargetPropCommandBase
//----------------------------------------------------------------------------
void cmTargetPropCommandBase
::PopulateTargetProperies(const std::string &scope,
- const std::string &content, bool prepend)
+ const std::vector<std::string> &content,
+ bool prepend)
{
if (scope == "PRIVATE" || scope == "PUBLIC")
{
@@ -122,7 +121,7 @@ void cmTargetPropCommandBase
{
const std::string propName = std::string("INTERFACE_") + this->Property;
const char *propValue = this->Target->GetProperty(propName.c_str());
- const std::string totalContent = content + (propValue
+ const std::string totalContent = this->Join(content) + (propValue
? std::string(";") + propValue
: std::string());
this->Target->SetProperty(propName.c_str(), totalContent.c_str());
@@ -130,7 +129,7 @@ void cmTargetPropCommandBase
else
{
this->Target->AppendProperty(("INTERFACE_" + this->Property).c_str(),
- content.c_str());
+ this->Join(content).c_str());
}
}
}