summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-07-01 21:19:25 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-07-02 14:40:02 (GMT)
commit286f22770907fad3453eadf34e641ad736237292 (patch)
tree6afa8ae25b632ee79250c9f0f12fba5c22ddf29f /Source
parent83498d413530570f7ab9affee5b8301c888bf91e (diff)
downloadCMake-286f22770907fad3453eadf34e641ad736237292.zip
CMake-286f22770907fad3453eadf34e641ad736237292.tar.gz
CMake-286f22770907fad3453eadf34e641ad736237292.tar.bz2
Extend the cmTargetPropCommandBase interface property handling.
This can be used to handle INTERFACE SYSTEM include directories in particular.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTargetPropCommandBase.cxx36
-rw-r--r--Source/cmTargetPropCommandBase.h3
2 files changed, 25 insertions, 14 deletions
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 771097c..64f40d6 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -126,19 +126,27 @@ void cmTargetPropCommandBase
}
if (scope == "INTERFACE" || scope == "PUBLIC")
{
- if (prepend)
- {
- const std::string propName = std::string("INTERFACE_") + this->Property;
- const char *propValue = this->Target->GetProperty(propName.c_str());
- const std::string totalContent = this->Join(content) + (propValue
- ? std::string(";") + propValue
- : std::string());
- this->Target->SetProperty(propName.c_str(), totalContent.c_str());
- }
- else
- {
- this->Target->AppendProperty(("INTERFACE_" + this->Property).c_str(),
- this->Join(content).c_str());
- }
+ this->HandleInterfaceContent(this->Target, content, prepend);
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmTargetPropCommandBase::HandleInterfaceContent(cmTarget *tgt,
+ const std::vector<std::string> &content,
+ bool prepend)
+{
+ if (prepend)
+ {
+ const std::string propName = std::string("INTERFACE_") + this->Property;
+ const char *propValue = tgt->GetProperty(propName.c_str());
+ const std::string totalContent = this->Join(content) + (propValue
+ ? std::string(";") + propValue
+ : std::string());
+ tgt->SetProperty(propName.c_str(), totalContent.c_str());
+ }
+ else
+ {
+ tgt->AppendProperty(("INTERFACE_" + this->Property).c_str(),
+ this->Join(content).c_str());
}
}
diff --git a/Source/cmTargetPropCommandBase.h b/Source/cmTargetPropCommandBase.h
index 8047a48..9db7581 100644
--- a/Source/cmTargetPropCommandBase.h
+++ b/Source/cmTargetPropCommandBase.h
@@ -36,6 +36,9 @@ protected:
std::string Property;
cmTarget *Target;
+ virtual void HandleInterfaceContent(cmTarget *tgt,
+ const std::vector<std::string> &content,
+ bool prepend);
private:
virtual void HandleImportedTarget(const std::string &tgt) = 0;
virtual void HandleMissingTarget(const std::string &name) = 0;