summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-12 08:32:13 -0500
committerCMake Topic Stage <kwrobot@kitware.com>2013-11-12 08:32:13 -0500
commitd3f7fa22ed8150eb030255adc4470578f1cc71e3 (patch)
treed502cc0740d1c02d48f2912076eeba1f706115f8
parenta4b9adec893b7cbce41fbffe65564f80b05e5746 (diff)
parent77a0fd5135e3f9cdd0a365ab3ce41a9393f41037 (diff)
downloadcmake-d3f7fa22ed8150eb030255adc4470578f1cc71e3.tar.gz
Merge topic 'pp-transitive-property-handling'
77a0fd5 Genex: Use a preprocessor foreach to follow transitive properties. 1464933 Genex: Simplify the preprocessor looper for interface properties.
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx2
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h8
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx31
3 files changed, 18 insertions, 23 deletions
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index b70fed6dd8..d9bc04c95b 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -32,7 +32,7 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
ImportPropertyMap properties;
#define FIND_TARGETS(PROPERTY) \
- this->FindTargets(#PROPERTY, te, emittedDeps);
+ this->FindTargets("INTERFACE_" #PROPERTY, te, emittedDeps);
CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 0b7ef025c9..c8594e7730 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -23,10 +23,10 @@
F(EvaluatingCompileOptions)
#define CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(F) \
- F(INTERFACE_INCLUDE_DIRECTORIES) \
- F(INTERFACE_SYSTEM_INCLUDE_DIRECTORIES) \
- F(INTERFACE_COMPILE_DEFINITIONS) \
- F(INTERFACE_COMPILE_OPTIONS)
+ F(INCLUDE_DIRECTORIES) \
+ F(SYSTEM_INCLUDE_DIRECTORIES) \
+ F(COMPILE_DEFINITIONS) \
+ F(COMPILE_OPTIONS)
//----------------------------------------------------------------------------
struct cmGeneratorExpressionDAGChecker
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 107ef737f6..2ae5a22387 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -652,7 +652,7 @@ static const struct JoinNode : public cmGeneratorExpressionNode
} joinNode;
#define TRANSITIVE_PROPERTY_NAME(PROPERTY) \
- , #PROPERTY
+ , "INTERFACE_" #PROPERTY
//----------------------------------------------------------------------------
static const char* targetPropertyTransitiveWhitelist[] = {
@@ -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;