summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-01-19 10:21:14 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-01-20 16:06:47 (GMT)
commite98799105bdb296e8d9f5b3ef5cf99bcebcafc40 (patch)
tree3cc97cedcc2bac471a9868e95a9982d35de6258c /Source/cmTarget.cxx
parentd9afacced34b2ef17a6c3ca2f66975272cf8473f (diff)
downloadCMake-e98799105bdb296e8d9f5b3ef5cf99bcebcafc40.zip
CMake-e98799105bdb296e8d9f5b3ef5cf99bcebcafc40.tar.gz
CMake-e98799105bdb296e8d9f5b3ef5cf99bcebcafc40.tar.bz2
Make INTERFACE determined properties readable in generator expressions.
The properties are evaluated as link-dependent interface properties when evaluating the generator expressions.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx47
1 files changed, 47 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 7a2ead3..c1c484b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4613,6 +4613,53 @@ bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
}
//----------------------------------------------------------------------------
+bool isLinkDependentProperty(cmTarget *tgt, const std::string &p,
+ const char *interfaceProperty,
+ const char *config)
+{
+ cmComputeLinkInformation *info = tgt->GetLinkInformation(config);
+
+ const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
+
+ for(cmComputeLinkInformation::ItemVector::const_iterator li =
+ deps.begin();
+ li != deps.end(); ++li)
+ {
+ if (!li->Target)
+ {
+ continue;
+ }
+ const char *prop = li->Target->GetProperty(interfaceProperty);
+ if (!prop)
+ {
+ continue;
+ }
+
+ std::vector<std::string> props;
+ cmSystemTools::ExpandListArgument(prop, props);
+
+ for(std::vector<std::string>::iterator pi = props.begin();
+ pi != props.end(); ++pi)
+ {
+ if (*pi == p)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+//----------------------------------------------------------------------------
+bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
+ const char *config)
+{
+ return isLinkDependentProperty(this, p, "COMPATIBLE_INTERFACE_BOOL",
+ config);
+}
+
+//----------------------------------------------------------------------------
void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
{
for(std::vector<cmSourceFile*>::const_iterator