diff options
author | Brad King <brad.king@kitware.com> | 2017-04-06 13:38:32 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-04-06 13:38:36 (GMT) |
commit | da9fe11b98ae9b176c1fbee8afb2cacddacf0c11 (patch) | |
tree | 0d26ece4efa2bab097f8fdfe760045aa96f0d4a0 /Source | |
parent | 0ef6b24988c1ea94760f4cbaf68862b5a2534f0e (diff) | |
parent | 227de0b95d6fd12e47da502ce34e8aea6d57cc43 (diff) | |
download | CMake-da9fe11b98ae9b176c1fbee8afb2cacddacf0c11.zip CMake-da9fe11b98ae9b176c1fbee8afb2cacddacf0c11.tar.gz CMake-da9fe11b98ae9b176c1fbee8afb2cacddacf0c11.tar.bz2 |
Merge topic 'include_external_msproject-map-config'
227de0b9 include_external_msproject: Honor MAP_IMPORTED_CONFIG_<CONFIG>
4cd815f0 VS: Pass whole target to WriteProjectConfigurations
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !669
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 15 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.h | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 10 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.h | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 15 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 4 |
6 files changed, 31 insertions, 21 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 55a788f..3f8d381 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -249,7 +249,7 @@ void cmGlobalVisualStudio71Generator::WriteExternalProject( // Write a dsp file into the SLN file, Note, that dependencies from // executables to the libraries it uses are also done here void cmGlobalVisualStudio71Generator::WriteProjectConfigurations( - std::ostream& fout, const std::string& name, cmStateEnums::TargetType, + std::ostream& fout, const std::string& name, cmGeneratorTarget const& target, std::vector<std::string> const& configs, const std::set<std::string>& configsPartOfDefaultBuild, std::string const& platformMapping) @@ -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; } } } diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 9953047..c65a84a 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -56,8 +56,8 @@ protected: const char* path, cmGeneratorTarget const* t); virtual void WriteProjectConfigurations( - std::ostream& fout, const std::string& name, cmStateEnums::TargetType type, - std::vector<std::string> const& configs, + std::ostream& fout, const std::string& name, + cmGeneratorTarget const& target, std::vector<std::string> const& configs, const std::set<std::string>& configsPartOfDefaultBuild, const std::string& platformMapping = ""); virtual void WriteExternalProject(std::ostream& fout, diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index e7fb203..2d0abf9 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -356,16 +356,16 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations( if (expath) { std::set<std::string> allConfigurations(configs.begin(), configs.end()); const char* mapping = target->GetProperty("VS_PLATFORM_MAPPING"); - this->WriteProjectConfigurations( - fout, target->GetName().c_str(), target->GetType(), configs, - allConfigurations, mapping ? mapping : ""); + this->WriteProjectConfigurations(fout, target->GetName().c_str(), + *target, configs, allConfigurations, + mapping ? mapping : ""); } else { const std::set<std::string>& configsPartOfDefaultBuild = this->IsPartOfDefaultBuild(configs, projectTargets, target); const char* vcprojName = target->GetProperty("GENERATOR_FILE_NAME"); if (vcprojName) { - this->WriteProjectConfigurations(fout, vcprojName, target->GetType(), - configs, configsPartOfDefaultBuild); + this->WriteProjectConfigurations(fout, vcprojName, *target, configs, + configsPartOfDefaultBuild); } } } diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 1f96cc6..32a8d60 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -121,8 +121,8 @@ protected: const char* path, cmGeneratorTarget const* t) = 0; virtual void WriteProjectConfigurations( - std::ostream& fout, const std::string& name, cmStateEnums::TargetType type, - std::vector<std::string> const& configs, + std::ostream& fout, const std::string& name, + cmGeneratorTarget const& target, std::vector<std::string> const& configs, const std::set<std::string>& configsPartOfDefaultBuild, const std::string& platformMapping = "") = 0; virtual void WriteSLNGlobalSections(std::ostream& fout, diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 8353a3f..634db7f 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -353,7 +353,7 @@ void cmGlobalVisualStudio8Generator::WriteSolutionConfigurations( } void cmGlobalVisualStudio8Generator::WriteProjectConfigurations( - std::ostream& fout, const std::string& name, cmStateEnums::TargetType type, + std::ostream& fout, const std::string& name, cmGeneratorTarget const& target, std::vector<std::string> const& configs, const std::set<std::string>& configsPartOfDefaultBuild, std::string const& platformMapping) @@ -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(type)) { + if (this->NeedsDeploy(target.GetType())) { fout << "\t\t{" << guid << "}." << *i << "|" << this->GetPlatformName() - << ".Deploy.0 = " << *i << "|" + << ".Deploy.0 = " << dstConfig << "|" << (!platformMapping.empty() ? platformMapping : this->GetPlatformName()) << "\n"; diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 53feb47..03fa077 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -82,8 +82,8 @@ protected: virtual void WriteSolutionConfigurations( std::ostream& fout, std::vector<std::string> const& configs); virtual void WriteProjectConfigurations( - std::ostream& fout, const std::string& name, cmStateEnums::TargetType type, - std::vector<std::string> const& configs, + std::ostream& fout, const std::string& name, + cmGeneratorTarget const& target, std::vector<std::string> const& configs, const std::set<std::string>& configsPartOfDefaultBuild, const std::string& platformMapping = ""); virtual bool ComputeTargetDepends(); |