From 807fca4ce67e4c95133082060b82fdecca30fcde Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 16 Aug 2010 21:49:14 +0200 Subject: [PATCH] VS: Convert PlatformName member to a virtual method --- Source/cmGlobalVisualStudio10Generator.cxx | 2 +- Source/cmGlobalVisualStudio10Win64Generator.cxx | 1 - Source/cmGlobalVisualStudio10Win64Generator.h | 2 ++ Source/cmGlobalVisualStudio8Generator.cxx | 14 +++++++------- Source/cmGlobalVisualStudio8Generator.h | 5 ++--- Source/cmGlobalVisualStudio8Win64Generator.cxx | 3 +-- Source/cmGlobalVisualStudio8Win64Generator.h | 2 ++ Source/cmGlobalVisualStudio9Generator.cxx | 1 + Source/cmGlobalVisualStudio9Win64Generator.cxx | 3 +-- Source/cmGlobalVisualStudio9Win64Generator.h | 2 ++ 10 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 691502f1a..403507f98 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -40,7 +40,7 @@ void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout) cmLocalGenerator *cmGlobalVisualStudio10Generator::CreateLocalGenerator() { cmLocalVisualStudio10Generator* lg = new cmLocalVisualStudio10Generator; - lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetPlatformName(this->GetPlatformName()); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio10Win64Generator.cxx b/Source/cmGlobalVisualStudio10Win64Generator.cxx index 1004fa98f..109b60d1f 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio10Win64Generator.cxx @@ -16,7 +16,6 @@ //---------------------------------------------------------------------------- cmGlobalVisualStudio10Win64Generator::cmGlobalVisualStudio10Win64Generator() { - this->PlatformName = "x64"; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h index 98ba03ceb..39c9d081b 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.h +++ b/Source/cmGlobalVisualStudio10Win64Generator.h @@ -27,6 +27,8 @@ public: return cmGlobalVisualStudio10Win64Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 10 Win64";} + virtual const char* GetPlatformName() const {return "x64";} + /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 6e0f0480e..c4de91efc 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -21,7 +21,6 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() { this->FindMakeProgramFile = "CMakeVS8FindMake.cmake"; this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; - this->PlatformName = "Win32"; } //---------------------------------------------------------------------------- @@ -30,6 +29,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator() { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion8(); + lg->SetPlatformName(this->GetPlatformName()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); lg->SetGlobalGenerator(this); return lg; @@ -252,8 +252,8 @@ cmGlobalVisualStudio8Generator for(std::vector::iterator i = this->Configurations.begin(); i != this->Configurations.end(); ++i) { - fout << "\t\t" << *i << "|" << this->PlatformName << " = " << *i << "|" - << this->PlatformName << "\n"; + fout << "\t\t" << *i << "|" << this->GetPlatformName() << " = " << *i << "|" + << this->GetPlatformName() << "\n"; } fout << "\tEndGlobalSection\n"; } @@ -269,13 +269,13 @@ cmGlobalVisualStudio8Generator i != this->Configurations.end(); ++i) { fout << "\t\t{" << guid << "}." << *i - << "|" << this->PlatformName << ".ActiveCfg = " - << *i << "|" << this->PlatformName << "\n"; + << "|" << this->GetPlatformName() << ".ActiveCfg = " + << *i << "|" << this->GetPlatformName() << "\n"; if(partOfDefaultBuild) { fout << "\t\t{" << guid << "}." << *i - << "|" << this->PlatformName << ".Build.0 = " - << *i << "|" << this->PlatformName << "\n"; + << "|" << this->GetPlatformName() << ".Build.0 = " + << *i << "|" << this->GetPlatformName() << "\n"; } } } diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 9d836bda3..ceee53bcc 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -32,14 +32,14 @@ public: return cmGlobalVisualStudio8Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 8 2005";} + virtual const char* GetPlatformName() const {return "Win32";} + /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); - std::string const& GetPlatformName() const { return this->PlatformName; } - /** * Override Configure and Generate to add the build-system check * target. @@ -78,6 +78,5 @@ protected: virtual void WriteProjectConfigurations(std::ostream& fout, const char* name, bool partOfDefaultBuild); - std::string PlatformName; // Win32 or x64 }; #endif diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx index d5558bb91..ea2c65f3a 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio8Win64Generator.cxx @@ -19,7 +19,6 @@ cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator() { - this->PlatformName = "x64"; } ///! Create a local generator appropriate to this Global Generator @@ -27,7 +26,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Win64Generator::CreateLocalGenerator() { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion8(); - lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetPlatformName(this->GetPlatformName()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); lg->SetGlobalGenerator(this); return lg; diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h index 44c237cd4..084ba697c 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.h +++ b/Source/cmGlobalVisualStudio8Win64Generator.h @@ -33,6 +33,8 @@ public: return cmGlobalVisualStudio8Win64Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 8 2005 Win64";} + virtual const char* GetPlatformName() const {return "x64";} + /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index f6ae70599..98acf0f89 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -42,6 +42,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator() { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion9(); + lg->SetPlatformName(this->GetPlatformName()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); lg->SetGlobalGenerator(this); return lg; diff --git a/Source/cmGlobalVisualStudio9Win64Generator.cxx b/Source/cmGlobalVisualStudio9Win64Generator.cxx index c5b9babfd..67c0bf612 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio9Win64Generator.cxx @@ -16,7 +16,6 @@ cmGlobalVisualStudio9Win64Generator::cmGlobalVisualStudio9Win64Generator() { - this->PlatformName = "x64"; } ///! Create a local generator appropriate to this Global Generator @@ -24,7 +23,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Win64Generator::CreateLocalGenerator() { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion9(); - lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetPlatformName(this->GetPlatformName()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); lg->SetGlobalGenerator(this); return lg; diff --git a/Source/cmGlobalVisualStudio9Win64Generator.h b/Source/cmGlobalVisualStudio9Win64Generator.h index 55abcfc56..f6dcc03cd 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.h +++ b/Source/cmGlobalVisualStudio9Win64Generator.h @@ -33,6 +33,8 @@ public: return cmGlobalVisualStudio9Win64Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 9 2008 Win64";} + virtual const char* GetPlatformName() const {return "x64";} + /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const;