include_external_msproject: Honor MAP_IMPORTED_CONFIG_<CONFIG>

This allows projects added via `include_external_msproject` to compile
the preferred configuration despite different naming conventions.
This commit is contained in:
Beeble
2017-04-04 21:13:35 +02:00
committed by Brad King
parent 4cd815f0b3
commit 227de0b95d
11 changed files with 61 additions and 11 deletions

View File

@@ -259,13 +259,18 @@ void cmGlobalVisualStudio71Generator::WriteProjectConfigurations(
std::string guid = this->GetGUID(name);
for (std::vector<std::string>::const_iterator i = configs.begin();
i != configs.end(); ++i) {
fout << "\t\t{" << guid << "}." << *i << ".ActiveCfg = " << *i << "|"
<< platformName << std::endl;
const char* dstConfig = target.GetProperty("MAP_IMPORTED_CONFIG_" +
cmSystemTools::UpperCase(*i));
if (dstConfig == CM_NULLPTR) {
dstConfig = i->c_str();
}
fout << "\t\t{" << guid << "}." << *i << ".ActiveCfg = " << dstConfig
<< "|" << platformName << std::endl;
std::set<std::string>::const_iterator ci =
configsPartOfDefaultBuild.find(*i);
if (!(ci == configsPartOfDefaultBuild.end())) {
fout << "\t\t{" << guid << "}." << *i << ".Build.0 = " << *i << "|"
<< platformName << std::endl;
fout << "\t\t{" << guid << "}." << *i << ".Build.0 = " << dstConfig
<< "|" << platformName << std::endl;
}
}
}

View File

@@ -361,8 +361,13 @@ 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();
}
fout << "\t\t{" << guid << "}." << *i << "|" << this->GetPlatformName()
<< ".ActiveCfg = " << *i << "|"
<< ".ActiveCfg = " << dstConfig << "|"
<< (!platformMapping.empty() ? platformMapping
: this->GetPlatformName())
<< "\n";
@@ -370,14 +375,14 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations(
configsPartOfDefaultBuild.find(*i);
if (!(ci == configsPartOfDefaultBuild.end())) {
fout << "\t\t{" << guid << "}." << *i << "|" << this->GetPlatformName()
<< ".Build.0 = " << *i << "|"
<< ".Build.0 = " << dstConfig << "|"
<< (!platformMapping.empty() ? platformMapping
: this->GetPlatformName())
<< "\n";
}
if (this->NeedsDeploy(target.GetType())) {
fout << "\t\t{" << guid << "}." << *i << "|" << this->GetPlatformName()
<< ".Deploy.0 = " << *i << "|"
<< ".Deploy.0 = " << dstConfig << "|"
<< (!platformMapping.empty() ? platformMapping
: this->GetPlatformName())
<< "\n";