diff options
author | Patrick Gansterer <paroga@paroga.com> | 2013-08-05 10:49:32 (GMT) |
---|---|---|
committer | Patrick Gansterer <paroga@paroga.com> | 2013-08-05 11:38:23 (GMT) |
commit | 4b15dc855d8f5347169391b6a1a86320f2efaae4 (patch) | |
tree | 8174d7940f650b9b829d45de56cd804137289704 /Source/cmGlobalVisualStudio7Generator.cxx | |
parent | 60e568cf790705b3ed7a61d6768ba6220bfbabe8 (diff) | |
download | CMake-4b15dc855d8f5347169391b6a1a86320f2efaae4.zip CMake-4b15dc855d8f5347169391b6a1a86320f2efaae4.tar.gz CMake-4b15dc855d8f5347169391b6a1a86320f2efaae4.tar.bz2 |
VS: Set CMAKE_VS_PLATFORM_NAME for VS7 and VS71 too
Move the code which sets CMAKE_VS_PLATFORM_NAME from
cmGlobalVisualStudio8Generator to cmGlobalVisualStudio7Generator.
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 9a34ecf..812659e 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -144,6 +144,27 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator() return lg; } +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf) +{ + cmGlobalVisualStudioGenerator::AddPlatformDefinitions(mf); + mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName()); +} + +//---------------------------------------------------------------------------- +const char* cmGlobalVisualStudio7Generator::GetPlatformName() const +{ + if (!this->PlatformName.empty()) + { + return this->PlatformName.c_str(); + } + if (this->ArchitectureId == "X86") + { + return "Win32"; + } + return this->ArchitectureId.c_str(); +} + void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) { // process the configurations @@ -601,20 +622,20 @@ void cmGlobalVisualStudio7Generator const std::set<std::string>& configsPartOfDefaultBuild, const char* platformMapping) { + const char* platformName = + platformMapping ? platformMapping : this->GetPlatformName(); std::string guid = this->GetGUID(name); for(std::vector<std::string>::iterator i = this->Configurations.begin(); i != this->Configurations.end(); ++i) { fout << "\t\t{" << guid << "}." << *i - << ".ActiveCfg = " << *i << "|" - << (platformMapping ? platformMapping : "Win32") << "\n"; + << ".ActiveCfg = " << *i << "|" << platformName << "\n"; std::set<std::string>::const_iterator ci = configsPartOfDefaultBuild.find(*i); if(!(ci == configsPartOfDefaultBuild.end())) { fout << "\t\t{" << guid << "}." << *i - << ".Build.0 = " << *i << "|" - << (platformMapping ? platformMapping : "Win32") << "\n"; + << ".Build.0 = " << *i << "|" << platformName << "\n"; } } } |