diff options
author | Brad King <brad.king@kitware.com> | 2017-09-13 09:56:23 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-09-13 09:56:23 -0400 |
commit | 9f66fe9a01451cb5a6e883b05dbc05d6c6c6f4f7 (patch) | |
tree | 667a60287a6cdfc51e8578c512fb0b71d187407a | |
parent | ffa164736ec78f27583ca4515ff3dfc7a82fc702 (diff) | |
parent | c5b5bb270f54dab4ff529688a26ea8aa271fa0e1 (diff) | |
download | cmake-9f66fe9a01451cb5a6e883b05dbc05d6c6c6f4f7.tar.gz |
Merge branch 'backport-vs-fix-config-map' into release-3.9
Merge-request: !1256
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 14 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 14 |
2 files changed, 20 insertions, 8 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index aeceb8debc..3b45c902c8 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -200,10 +200,16 @@ void cmGlobalVisualStudio71Generator::WriteProjectConfigurations( std::string guid = this->GetGUID(name); for (std::vector<std::string>::const_iterator i = configs.begin(); i != configs.end(); ++i) { - const char* dstConfig = target.GetProperty("MAP_IMPORTED_CONFIG_" + - cmSystemTools::UpperCase(*i)); - if (dstConfig == CM_NULLPTR) { - dstConfig = i->c_str(); + std::vector<std::string> mapConfig; + const char* dstConfig = i->c_str(); + if (target.GetProperty("EXTERNAL_MSPROJECT")) { + if (const char* m = target.GetProperty("MAP_IMPORTED_CONFIG_" + + cmSystemTools::UpperCase(*i))) { + cmSystemTools::ExpandListArgument(m, mapConfig); + if (!mapConfig.empty()) { + dstConfig = mapConfig[0].c_str(); + } + } } fout << "\t\t{" << guid << "}." << *i << ".ActiveCfg = " << dstConfig << "|" << platformName << std::endl; diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 7a42b72e88..f06a8a1c6a 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -354,10 +354,16 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations( std::string guid = this->GetGUID(name); for (std::vector<std::string>::const_iterator i = configs.begin(); i != configs.end(); ++i) { - const char* dstConfig = target.GetProperty("MAP_IMPORTED_CONFIG_" + - cmSystemTools::UpperCase(*i)); - if (dstConfig == CM_NULLPTR) { - dstConfig = i->c_str(); + std::vector<std::string> mapConfig; + const char* dstConfig = i->c_str(); + if (target.GetProperty("EXTERNAL_MSPROJECT")) { + if (const char* m = target.GetProperty("MAP_IMPORTED_CONFIG_" + + cmSystemTools::UpperCase(*i))) { + cmSystemTools::ExpandListArgument(m, mapConfig); + if (!mapConfig.empty()) { + dstConfig = mapConfig[0].c_str(); + } + } } fout << "\t\t{" << guid << "}." << *i << "|" << this->GetPlatformName() << ".ActiveCfg = " << dstConfig << "|" |