diff options
author | Brad King <brad.king@kitware.com> | 2013-07-24 15:02:19 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-07-24 15:02:19 (GMT) |
commit | 571d050415dce07fe2ea0062eb300af36ca2d5e1 (patch) | |
tree | b973a42093a52ce53de29bcc3144a4cc4481807c /Source/cmGeneratorExpressionEvaluator.cxx | |
parent | 6077847edc57f8104ba0c1edce16ce28178f899b (diff) | |
parent | 10a069b50468fc97737f5144a6d7790e0d972a91 (diff) | |
download | CMake-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.cxx | 20 |
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"; } |