From 68d4280ac4cb692b908620884b0842b7a01debeb Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Fri, 5 Sep 2014 14:02:58 -0400
Subject: VS: Refactor internal default platform name selection

Rename the 'PlatformName' member to 'DefaultPlatformName' and make
sure it is only read through a 'GetPlatformName()' call.  This will
allow non-default names to be chosen later.
---
 Source/cmGlobalVisualStudio10Generator.cxx |  2 +-
 Source/cmGlobalVisualStudio7Generator.cxx  | 14 ++++++++++----
 Source/cmGlobalVisualStudio7Generator.h    |  4 ++--
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 063e9e1..e753c3c 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -125,7 +125,7 @@ bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s,
     {
     return false;
     }
-  if(this->PlatformName == "Itanium" || this->PlatformName == "x64")
+  if(this->GetPlatformName() == "Itanium" || this->GetPlatformName() == "x64")
     {
     if(this->IsExpressEdition() && !this->Find64BitTools(mf))
       {
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index e312ff1..cb82e54 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -27,11 +27,11 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
 
   if (platformName.empty())
     {
-    this->PlatformName = "Win32";
+    this->DefaultPlatformName = "Win32";
     }
   else
     {
-    this->PlatformName = platformName;
+    this->DefaultPlatformName = platformName;
     }
 }
 
@@ -260,14 +260,20 @@ cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator()
 }
 
 //----------------------------------------------------------------------------
+std::string const& cmGlobalVisualStudio7Generator::GetPlatformName() const
+{
+  return this->DefaultPlatformName;
+}
+
+//----------------------------------------------------------------------------
 bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s,
                                                    cmMakefile* mf)
 {
-  if(this->PlatformName == "x64")
+  if(this->GetPlatformName() == "x64")
     {
     mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
     }
-  else if(this->PlatformName == "Itanium")
+  else if(this->GetPlatformName() == "Itanium")
     {
     mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE");
     }
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 7e3ed23..dc8b915 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -39,7 +39,7 @@ public:
   static std::string GetActualName() {return "Visual Studio 7";}
 
   ///! Get the name for the platform.
-  const std::string& GetPlatformName() const { return this->PlatformName; }
+  std::string const& GetPlatformName() const;
 
   ///! Create a local generator appropriate to this Global Generator
   virtual cmLocalGenerator *CreateLocalGenerator();
@@ -175,7 +175,7 @@ protected:
   // Set during OutputSLNFile with the name of the current project.
   // There is one SLN file per project.
   std::string CurrentProject;
-  std::string PlatformName;
+  std::string DefaultPlatformName;
   bool MasmEnabled;
 
 private:
-- 
cgit v0.12