summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-10-25 13:55:40 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-11-09 19:31:35 (GMT)
commit77a0fd5135e3f9cdd0a365ab3ce41a9393f41037 (patch)
treea5cdb882c179f4ad22d31a19ed941146a5ab5241 /Source/cmGeneratorExpressionEvaluator.cxx
parent146493363ebcb7618e5da175f89b69fcc4f9bb16 (diff)
downloadCMake-77a0fd5135e3f9cdd0a365ab3ce41a9393f41037.zip
CMake-77a0fd5135e3f9cdd0a365ab3ce41a9393f41037.tar.gz
CMake-77a0fd5135e3f9cdd0a365ab3ce41a9393f41037.tar.bz2
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 2d26053..2ae5a22 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;