summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-09-23 11:45:17 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-01-05 00:18:37 (GMT)
commit894f52f32d96ae92df0ba3dac2a70fe9c87e818d (patch)
treeac4350fb4cea5b188f7880ea4207d4a4fecbdf7e /Source/cmGeneratorExpressionEvaluator.cxx
parentf5b1980fb27fa902d37856ec3e22daddfeb9d52f (diff)
downloadCMake-894f52f32d96ae92df0ba3dac2a70fe9c87e818d.zip
CMake-894f52f32d96ae92df0ba3dac2a70fe9c87e818d.tar.gz
CMake-894f52f32d96ae92df0ba3dac2a70fe9c87e818d.tar.bz2
Handle INTERFACE properties transitively for includes and defines.
Contextually, the behavior is as if the properties content from another target is included in the string and then the result is evaluated.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx30
1 files changed, 29 insertions, 1 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 4b44ebe..b7ce155 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -286,6 +286,13 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
}
} configurationTestNode;
+
+//----------------------------------------------------------------------------
+static const char* targetPropertyTransitiveWhitelist[] = {
+ "INTERFACE_INCLUDE_DIRECTORIES"
+ , "INTERFACE_COMPILE_DEFINITIONS"
+};
+
//----------------------------------------------------------------------------
static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{
@@ -394,7 +401,28 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
const char *prop = target->GetProperty(propertyName.c_str());
- return prop ? prop : "";
+ if (!prop)
+ {
+ return std::string();
+ }
+
+ for (size_t i = 0;
+ i < (sizeof(targetPropertyTransitiveWhitelist) /
+ sizeof(*targetPropertyTransitiveWhitelist));
+ ++i)
+ {
+ if (targetPropertyTransitiveWhitelist[i] == propertyName)
+ {
+ cmGeneratorExpression ge(context->Backtrace);
+ return ge.Parse(prop)->Evaluate(context->Makefile,
+ context->Config,
+ context->Quiet,
+ context->HeadTarget,
+ target,
+ &dagChecker);
+ }
+ }
+ return prop;
}
} targetPropertyNode;