summaryrefslogtreecommitdiff
path: root/Source/cmGeneratorExpressionEvaluator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-10-25 15:55:40 +0200
committerStephen Kelly <steveire@gmail.com>2013-11-09 20:31:35 +0100
commit77a0fd5135e3f9cdd0a365ab3ce41a9393f41037 (patch)
treea5cdb882c179f4ad22d31a19ed941146a5ab5241 /Source/cmGeneratorExpressionEvaluator.cxx
parent146493363ebcb7618e5da175f89b69fcc4f9bb16 (diff)
downloadcmake-77a0fd5135e3f9cdd0a365ab3ce41a9393f41037.tar.gz
Genex: Use a preprocessor foreach to follow transitive properties.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx29
1 files changed, 12 insertions, 17 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 2d26053e45..2ae5a22387 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -893,26 +893,21 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
std::string interfacePropertyName;
- if (propertyName == "INTERFACE_INCLUDE_DIRECTORIES"
- || propertyName == "INCLUDE_DIRECTORIES")
- {
- interfacePropertyName = "INTERFACE_INCLUDE_DIRECTORIES";
- }
- else if (propertyName == "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES")
- {
- interfacePropertyName = "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES";
- }
- else if (propertyName == "INTERFACE_COMPILE_DEFINITIONS"
- || propertyName == "COMPILE_DEFINITIONS"
- || strncmp(propertyName.c_str(), "COMPILE_DEFINITIONS_", 20) == 0)
+#define POPULATE_INTERFACE_PROPERTY_NAME(prop) \
+ if (propertyName == #prop || propertyName == "INTERFACE_" #prop) \
+ { \
+ interfacePropertyName = "INTERFACE_" #prop; \
+ } \
+ else
+
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(POPULATE_INTERFACE_PROPERTY_NAME)
+ // Note that the above macro terminates with an else
+ /* else */ if (strncmp(propertyName.c_str(),
+ "COMPILE_DEFINITIONS_", 20) == 0)
{
interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
}
- else if (propertyName == "INTERFACE_COMPILE_OPTIONS"
- || propertyName == "COMPILE_OPTIONS")
- {
- interfacePropertyName = "INTERFACE_COMPILE_OPTIONS";
- }
+#undef POPULATE_INTERFACE_PROPERTY_NAME
cmTarget const* headTarget = context->HeadTarget
? context->HeadTarget : target;