summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-07-15 16:33:49 (GMT)
committerBrad King <brad.king@kitware.com>2013-07-24 14:43:02 (GMT)
commit10a069b50468fc97737f5144a6d7790e0d972a91 (patch)
tree62cc8f6e7a7e17602f5b799898a3c3e496dd4d06 /Source/cmGeneratorExpressionEvaluator.cxx
parentb94e726a83b92f5b7376b97aa448107884a76685 (diff)
downloadCMake-10a069b50468fc97737f5144a6d7790e0d972a91.zip
CMake-10a069b50468fc97737f5144a6d7790e0d972a91.tar.gz
CMake-10a069b50468fc97737f5144a6d7790e0d972a91.tar.bz2
Genex: Fix $<CONFIG> with IMPORTED targets and multiple locations.
The old code checked only that there was a LOCATION for the specified config, but did not check whether the config actually mapped. Task-number: 14292
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 2bdff78..22d080c 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";
}