summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-24 15:02:19 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-07-24 15:02:19 (GMT)
commit571d050415dce07fe2ea0062eb300af36ca2d5e1 (patch)
treeb973a42093a52ce53de29bcc3144a4cc4481807c /Source/cmGeneratorExpressionEvaluator.cxx
parent6077847edc57f8104ba0c1edce16ce28178f899b (diff)
parent10a069b50468fc97737f5144a6d7790e0d972a91 (diff)
downloadCMake-571d050415dce07fe2ea0062eb300af36ca2d5e1.zip
CMake-571d050415dce07fe2ea0062eb300af36ca2d5e1.tar.gz
CMake-571d050415dce07fe2ea0062eb300af36ca2d5e1.tar.bz2
Merge topic 'fix-mapped-config-genex'
10a069b Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index c1f53b4..b59298f 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -564,10 +564,26 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
const char* loc = 0;
const char* imp = 0;
std::string suffix;
- return context->CurrentTarget->GetMappedConfig(context->Config,
+ if (context->CurrentTarget->GetMappedConfig(context->Config,
&loc,
&imp,
- suffix) ? "1" : "0";
+ suffix))
+ {
+ // This imported target has an appropriate location
+ // for this (possibly mapped) config.
+ // Check if there is a proper config mapping for the tested config.
+ std::vector<std::string> mappedConfigs;
+ std::string mapProp = "MAP_IMPORTED_CONFIG_";
+ mapProp += context->Config;
+ if(const char* mapValue =
+ context->CurrentTarget->GetProperty(mapProp.c_str()))
+ {
+ cmSystemTools::ExpandListArgument(cmSystemTools::UpperCase(mapValue),
+ mappedConfigs);
+ return std::find(mappedConfigs.begin(), mappedConfigs.end(),
+ context->Config) != mappedConfigs.end() ? "1" : "0";
+ }
+ }
}
return "0";
}