Forráskód Böngészése

VS: Remove platform specific generator files

Move the whole logic into the base class and the factory.
Patrick Gansterer 13 éve
szülő
commit
75ebebc39c

+ 0 - 14
Source/CMakeLists.txt

@@ -331,12 +331,6 @@ if (WIN32)
       cmGlobalVisualStudio8Generator.h
       cmGlobalVisualStudio9Generator.cxx
       cmGlobalVisualStudio9Generator.h
-      cmGlobalVisualStudio8Win64Generator.cxx
-      cmGlobalVisualStudio8Win64Generator.h
-      cmGlobalVisualStudio9Win64Generator.cxx
-      cmGlobalVisualStudio9Win64Generator.h
-      cmGlobalVisualStudio9IA64Generator.cxx
-      cmGlobalVisualStudio9IA64Generator.h
       cmVisualStudioGeneratorOptions.h
       cmVisualStudioGeneratorOptions.cxx
       cmVisualStudio10TargetGenerator.h
@@ -345,16 +339,8 @@ if (WIN32)
       cmLocalVisualStudio10Generator.h
       cmGlobalVisualStudio10Generator.h
       cmGlobalVisualStudio10Generator.cxx
-      cmGlobalVisualStudio10Win64Generator.h
-      cmGlobalVisualStudio10Win64Generator.cxx
-      cmGlobalVisualStudio10IA64Generator.h
-      cmGlobalVisualStudio10IA64Generator.cxx
       cmGlobalVisualStudio11Generator.h
       cmGlobalVisualStudio11Generator.cxx
-      cmGlobalVisualStudio11Win64Generator.h
-      cmGlobalVisualStudio11Win64Generator.cxx
-      cmGlobalVisualStudio11ARMGenerator.h
-      cmGlobalVisualStudio11ARMGenerator.cxx
       cmGlobalVisualStudioGenerator.cxx
       cmGlobalVisualStudioGenerator.h
       cmGlobalWatcomWMakeGenerator.cxx

+ 54 - 10
Source/cmGlobalVisualStudio10Generator.cxx

@@ -16,8 +16,61 @@
 #include "cmSourceFile.h"
 #include "cmake.h"
 
+static const char vs10Win32generatorName[] = "Visual Studio 10";
+static const char vs10Win64generatorName[] = "Visual Studio 10 Win64";
+static const char vs10IA64generatorName[] = "Visual Studio 10 IA64";
 
-cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator()
+class cmGlobalVisualStudio10Generator::Factory
+  : public cmGlobalGeneratorFactory
+{
+public:
+  virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
+    if(!strcmp(name, vs10Win32generatorName))
+      {
+      return new cmGlobalVisualStudio10Generator(
+        vs10Win32generatorName, NULL, NULL);
+      }
+    if(!strcmp(name, vs10Win64generatorName))
+      {
+      return new cmGlobalVisualStudio10Generator(
+        vs10Win64generatorName, "x64", "CMAKE_FORCE_WIN64");
+      }
+    if(!strcmp(name, vs10IA64generatorName))
+      {
+      return new cmGlobalVisualStudio10Generator(
+        vs10IA64generatorName, "Itanium", "CMAKE_FORCE_IA64");
+      }
+    return 0;
+  }
+
+  virtual void GetDocumentation(cmDocumentationEntry& entry) const {
+    entry.Name = "Visual Studio 10";
+    entry.Brief = "Generates Visual Studio 10 project files.";
+    entry.Full =
+      "It is possible to append a space followed by the platform name "
+      "to create project files for a specific target platform. E.g. "
+      "\"Visual Studio 10 Win64\" will create project files for "
+      "the x64 processor; \"Visual Studio 10 IA64\" for Itanium.";
+  }
+
+  virtual void GetGenerators(std::vector<std::string>& names) const {
+    names.push_back(vs10Win32generatorName);
+    names.push_back(vs10Win64generatorName);
+    names.push_back(vs10IA64generatorName); }
+};
+
+//----------------------------------------------------------------------------
+cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory()
+{
+  return new Factory;
+}
+
+//----------------------------------------------------------------------------
+cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
+  const char* name, const char* architectureId,
+  const char* additionalPlatformDefinition)
+  : cmGlobalVisualStudio8Generator(name, architectureId,
+                                   additionalPlatformDefinition)
 {
   this->FindMakeProgramFile = "CMakeVS10FindMake.cmake";
   std::string vc10Express;
@@ -86,15 +139,6 @@ void cmGlobalVisualStudio10Generator::Generate()
     }
 }
 
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio10Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
-  entry.Name = cmGlobalVisualStudio10Generator::GetActualName();
-  entry.Brief = "Generates Visual Studio 10 project files.";
-  entry.Full = "";
-}
-
 //----------------------------------------------------------------------------
 void cmGlobalVisualStudio10Generator
 ::EnableLanguage(std::vector<std::string>const &  lang,

+ 4 - 11
Source/cmGlobalVisualStudio10Generator.h

@@ -24,10 +24,9 @@ class cmGlobalVisualStudio10Generator :
   public cmGlobalVisualStudio8Generator
 {
 public:
-  cmGlobalVisualStudio10Generator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio10Generator>(); }
+  cmGlobalVisualStudio10Generator(const char* name,
+    const char* architectureId, const char* additionalPlatformDefinition);
+  static cmGlobalGeneratorFactory* NewFactory();
 
   virtual std::string
   GenerateBuildCommand(const char* makeProgram,
@@ -35,15 +34,8 @@ public:
                        const char* additionalOptions, const char *targetName,
                        const char* config, bool ignoreErrors, bool);
 
-  ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio10Generator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 10";}
   virtual void AddPlatformDefinitions(cmMakefile* mf);
 
-  /** Get the documentation entry for this generator.  */
-  static void GetDocumentation(cmDocumentationEntry& entry);
-
   ///! create the correct local generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
@@ -93,6 +85,7 @@ protected:
   bool UseFolderProperty();
 
 private:
+  class Factory;
   struct LongestSourcePath
   {
     LongestSourcePath(): Length(0), Target(0), SourceFile(0) {}

+ 0 - 30
Source/cmGlobalVisualStudio10IA64Generator.cxx

@@ -1,30 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#include "cmGlobalVisualStudio10IA64Generator.h"
-#include "cmMakefile.h"
-#include "cmake.h"
-
-//----------------------------------------------------------------------------
-cmGlobalVisualStudio10IA64Generator::cmGlobalVisualStudio10IA64Generator()
-{
-  this->ArchitectureId = "Itanium";
-  this->AdditionalPlatformDefinition = "CMAKE_FORCE_IA64";
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio10IA64Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
-  entry.Name = cmGlobalVisualStudio10IA64Generator::GetActualName();
-  entry.Brief = "Generates Visual Studio 10 Itanium project files.";
-  entry.Full = "";
-}

+ 0 - 34
Source/cmGlobalVisualStudio10IA64Generator.h

@@ -1,34 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#ifndef cmGlobalVisualStudio10IA64Generator_h
-#define cmGlobalVisualStudio10IA64Generator_h
-
-#include "cmGlobalVisualStudio10Generator.h"
-
-class cmGlobalVisualStudio10IA64Generator :
-  public cmGlobalVisualStudio10Generator
-{
-public:
-  cmGlobalVisualStudio10IA64Generator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio10IA64Generator>(); }
-
-  ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio10IA64Generator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 10 IA64";}
-
-  /** Get the documentation entry for this generator.  */
-  static void GetDocumentation(cmDocumentationEntry& entry);
-};
-#endif

+ 0 - 30
Source/cmGlobalVisualStudio10Win64Generator.cxx

@@ -1,30 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#include "cmGlobalVisualStudio10Win64Generator.h"
-#include "cmMakefile.h"
-#include "cmake.h"
-
-//----------------------------------------------------------------------------
-cmGlobalVisualStudio10Win64Generator::cmGlobalVisualStudio10Win64Generator()
-{
-  this->ArchitectureId = "x64";
-  this->AdditionalPlatformDefinition = "CMAKE_FORCE_WIN64";
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio10Win64Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
-  entry.Name = cmGlobalVisualStudio10Win64Generator::GetActualName();
-  entry.Brief = "Generates Visual Studio 10 Win64 project files.";
-  entry.Full = "";
-}

+ 0 - 34
Source/cmGlobalVisualStudio10Win64Generator.h

@@ -1,34 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#ifndef cmGlobalVisualStudio10Win64Generator_h
-#define cmGlobalVisualStudio10Win64Generator_h
-
-#include "cmGlobalVisualStudio10Generator.h"
-
-class cmGlobalVisualStudio10Win64Generator :
-  public cmGlobalVisualStudio10Generator
-{
-public:
-  cmGlobalVisualStudio10Win64Generator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio10Win64Generator>(); }
-
-  ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio10Win64Generator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 10 Win64";}
-
-  /** Get the documentation entry for this generator.  */
-  static void GetDocumentation(cmDocumentationEntry& entry);
-};
-#endif

+ 0 - 29
Source/cmGlobalVisualStudio11ARMGenerator.cxx

@@ -1,29 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#include "cmGlobalVisualStudio11ARMGenerator.h"
-#include "cmMakefile.h"
-#include "cmake.h"
-
-//----------------------------------------------------------------------------
-cmGlobalVisualStudio11ARMGenerator::cmGlobalVisualStudio11ARMGenerator()
-{
-  this->ArchitectureId = "ARM";
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio11ARMGenerator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
-  entry.Name = cmGlobalVisualStudio11ARMGenerator::GetActualName();
-  entry.Brief = "Generates Visual Studio 11 ARM project files.";
-  entry.Full = "";
-}

+ 0 - 34
Source/cmGlobalVisualStudio11ARMGenerator.h

@@ -1,34 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#ifndef cmGlobalVisualStudio11ARMGenerator_h
-#define cmGlobalVisualStudio11ARMGenerator_h
-
-#include "cmGlobalVisualStudio11Generator.h"
-
-class cmGlobalVisualStudio11ARMGenerator :
-  public cmGlobalVisualStudio11Generator
-{
-public:
-  cmGlobalVisualStudio11ARMGenerator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio11ARMGenerator>(); }
-
-  ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio11ARMGenerator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 11 ARM";}
-
-  /** Get the documentation entry for this generator.  */
-  static void GetDocumentation(cmDocumentationEntry& entry);
-};
-#endif

+ 54 - 10
Source/cmGlobalVisualStudio11Generator.cxx

@@ -13,8 +13,61 @@
 #include "cmLocalVisualStudio10Generator.h"
 #include "cmMakefile.h"
 
+static const char vs11Win32generatorName[] = "Visual Studio 11";
+static const char vs11Win64generatorName[] = "Visual Studio 11 Win64";
+static const char vs11ARMgeneratorName[] = "Visual Studio 11 ARM";
+
+class cmGlobalVisualStudio11Generator::Factory
+  : public cmGlobalGeneratorFactory
+{
+public:
+  virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
+    if(!strcmp(name, vs11Win32generatorName))
+      {
+      return new cmGlobalVisualStudio11Generator(
+        vs11Win32generatorName, NULL, NULL);
+      }
+    if(!strcmp(name, vs11Win64generatorName))
+      {
+      return new cmGlobalVisualStudio11Generator(
+        vs11Win64generatorName, "x64", "CMAKE_FORCE_WIN64");
+      }
+    if(!strcmp(name, vs11ARMgeneratorName))
+      {
+      return new cmGlobalVisualStudio11Generator(
+        vs11ARMgeneratorName, "ARM", NULL);
+      }
+    return 0;
+  }
+
+  virtual void GetDocumentation(cmDocumentationEntry& entry) const {
+    entry.Name = "Visual Studio 11";
+    entry.Brief = "Generates Visual Studio 11 project files.";
+    entry.Full =
+      "It is possible to append a space followed by the platform name "
+      "to create project files for a specific target platform. E.g. "
+      "\"Visual Studio 11 Win64\" will create project files for "
+      "the x64 processor; \"Visual Studio 11 ARM\" for ARM.";
+  }
+
+  virtual void GetGenerators(std::vector<std::string>& names) const {
+    names.push_back(vs11Win32generatorName);
+    names.push_back(vs11Win64generatorName);
+    names.push_back(vs11ARMgeneratorName); }
+};
+
 //----------------------------------------------------------------------------
-cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator()
+cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory()
+{
+  return new Factory;
+}
+
+//----------------------------------------------------------------------------
+cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
+  const char* name, const char* architectureId,
+  const char* additionalPlatformDefinition)
+  : cmGlobalVisualStudio10Generator(name, architectureId,
+                                   additionalPlatformDefinition)
 {
   this->FindMakeProgramFile = "CMakeVS11FindMake.cmake";
   std::string vc11Express;
@@ -40,12 +93,3 @@ cmLocalGenerator *cmGlobalVisualStudio11Generator::CreateLocalGenerator()
   lg->SetGlobalGenerator(this);
   return lg;
 }
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio11Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
-  entry.Name = cmGlobalVisualStudio11Generator::GetActualName();
-  entry.Brief = "Generates Visual Studio 11 project files.";
-  entry.Full = "";
-}

+ 5 - 12
Source/cmGlobalVisualStudio11Generator.h

@@ -20,21 +20,12 @@ class cmGlobalVisualStudio11Generator:
   public cmGlobalVisualStudio10Generator
 {
 public:
-  cmGlobalVisualStudio11Generator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio11Generator>(); }
-
-  ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio11Generator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 11";}
+  cmGlobalVisualStudio11Generator(const char* name,
+    const char* architectureId, const char* additionalPlatformDefinition);
+  static cmGlobalGeneratorFactory* NewFactory();
 
   virtual void WriteSLNHeader(std::ostream& fout);
 
-  /** Get the documentation entry for this generator.  */
-  static void GetDocumentation(cmDocumentationEntry& entry);
-
   ///! create the correct local generator
   virtual cmLocalGenerator *CreateLocalGenerator();
 
@@ -42,5 +33,7 @@ public:
   virtual std::string GetUserMacrosDirectory() { return ""; }
 protected:
   virtual const char* GetIDEVersion() { return "11.0"; }
+private:
+  class Factory;
 };
 #endif

+ 0 - 30
Source/cmGlobalVisualStudio11Win64Generator.cxx

@@ -1,30 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#include "cmGlobalVisualStudio11Win64Generator.h"
-#include "cmMakefile.h"
-#include "cmake.h"
-
-//----------------------------------------------------------------------------
-cmGlobalVisualStudio11Win64Generator::cmGlobalVisualStudio11Win64Generator()
-{
-  this->ArchitectureId = "x64";
-  this->AdditionalPlatformDefinition = "CMAKE_FORCE_WIN64";
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio11Win64Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
-  entry.Name = cmGlobalVisualStudio11Win64Generator::GetActualName();
-  entry.Brief = "Generates Visual Studio 11 Win64 project files.";
-  entry.Full = "";
-}

+ 0 - 34
Source/cmGlobalVisualStudio11Win64Generator.h

@@ -1,34 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#ifndef cmGlobalVisualStudio11Win64Generator_h
-#define cmGlobalVisualStudio11Win64Generator_h
-
-#include "cmGlobalVisualStudio11Generator.h"
-
-class cmGlobalVisualStudio11Win64Generator :
-  public cmGlobalVisualStudio11Generator
-{
-public:
-  cmGlobalVisualStudio11Win64Generator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio11Win64Generator>(); }
-
-  ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio11Win64Generator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 11 Win64";}
-
-  /** Get the documentation entry for this generator.  */
-  static void GetDocumentation(cmDocumentationEntry& entry);
-};
-#endif

+ 54 - 1
Source/cmGlobalVisualStudio8Generator.cxx

@@ -16,11 +16,64 @@
 #include "cmake.h"
 #include "cmGeneratedFileStream.h"
 
+static const char vs8Win32generatorName[] = "Visual Studio 8 2005";
+static const char vs8Win64generatorName[] = "Visual Studio 8 2005 Win64";
+
+class cmGlobalVisualStudio8Generator::Factory
+  : public cmGlobalGeneratorFactory
+{
+public:
+  virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
+    if(!strcmp(name, vs8Win32generatorName))
+      {
+      return new cmGlobalVisualStudio8Generator(
+        vs8Win32generatorName, NULL, NULL);
+      }
+    if(!strcmp(name, vs8Win64generatorName))
+      {
+      return new cmGlobalVisualStudio8Generator(
+        vs8Win64generatorName, "x64", "CMAKE_FORCE_WIN64");
+      }
+    return 0;
+  }
+
+  virtual void GetDocumentation(cmDocumentationEntry& entry) const {
+    entry.Name = "Visual Studio 8 2005";
+    entry.Brief = "Generates Visual Studio 8 2005 project files.";
+    entry.Full =
+      "It is possible to append a space followed by the platform name "
+      "to create project files for a specific target platform. E.g. "
+      "\"Visual Studio 8 2005 Win64\" will create project files for "
+      "the x64 processor.";
+  }
+
+  virtual void GetGenerators(std::vector<std::string>& names) const {
+    names.push_back(vs8Win32generatorName);
+    names.push_back(vs8Win64generatorName); }
+};
+
+//----------------------------------------------------------------------------
+cmGlobalGeneratorFactory* cmGlobalVisualStudio8Generator::NewFactory()
+{
+  return new Factory;
+}
+
 //----------------------------------------------------------------------------
-cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator()
+cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
+  const char* name, const char* architectureId,
+  const char* additionalPlatformDefinition)
 {
   this->FindMakeProgramFile = "CMakeVS8FindMake.cmake";
   this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
+  this->Name = name;
+  if (architectureId)
+    {
+    this->ArchitectureId = architectureId;
+    }
+  if (additionalPlatformDefinition)
+    {
+    this->AdditionalPlatformDefinition = additionalPlatformDefinition;
+    }
 }
 
 //----------------------------------------------------------------------------

+ 9 - 7
Source/cmGlobalVisualStudio8Generator.h

@@ -23,15 +23,12 @@
 class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator
 {
 public:
-  cmGlobalVisualStudio8Generator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio8Generator>(); }
+  cmGlobalVisualStudio8Generator(const char* name,
+    const char* architectureId, const char* additionalPlatformDefinition);
+  static cmGlobalGeneratorFactory* NewFactory();
 
   ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio8Generator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 8 2005";}
+  virtual const char* GetName() const {return this->Name;}
 
   const char* GetPlatformName() const;
 
@@ -82,5 +79,10 @@ protected:
   virtual bool ComputeTargetDepends();
   virtual void WriteProjectDepends(std::ostream& fout, const char* name,
                                    const char* path, cmTarget &t);
+
+  const char* Name;
+
+private:
+  class Factory;
 };
 #endif

+ 0 - 33
Source/cmGlobalVisualStudio8Win64Generator.cxx

@@ -1,33 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#include "windows.h" // this must be first to define GetCurrentDirectory
-#include "cmGlobalVisualStudio8Win64Generator.h"
-#include "cmLocalVisualStudio7Generator.h"
-#include "cmMakefile.h"
-#include "cmake.h"
-
-
-
-cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator()
-{
-  this->ArchitectureId = "x64";
-  this->AdditionalPlatformDefinition = "CMAKE_FORCE_WIN64";
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio8Win64Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
-  entry.Name = cmGlobalVisualStudio8Win64Generator::GetActualName();
-  entry.Brief = "Generates Visual Studio 8 2005 Win64 project files.";
-  entry.Full = "";
-}

+ 0 - 40
Source/cmGlobalVisualStudio8Win64Generator.h

@@ -1,40 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#ifndef cmGlobalVisualStudio8Win64Generator_h
-#define cmGlobalVisualStudio8Win64Generator_h
-
-#include "cmGlobalVisualStudio8Generator.h"
-
-
-/** \class cmGlobalVisualStudio8Win64Generator
- * \brief Write a Unix makefiles.
- *
- * cmGlobalVisualStudio8Win64Generator manages UNIX build process for a tree
- */
-class cmGlobalVisualStudio8Win64Generator :
-  public cmGlobalVisualStudio8Generator
-{
-public:
-  cmGlobalVisualStudio8Win64Generator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio8Win64Generator>(); }
-
-  ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio8Win64Generator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 8 2005 Win64";}
-
-  /** Get the documentation entry for this generator.  */
-  static void GetDocumentation(cmDocumentationEntry& entry);
-};
-#endif

+ 53 - 10
Source/cmGlobalVisualStudio9Generator.cxx

@@ -15,9 +15,61 @@
 #include "cmMakefile.h"
 #include "cmake.h"
 
+static const char vs9Win32generatorName[] = "Visual Studio 9 2008";
+static const char vs9Win64generatorName[] = "Visual Studio 8 2005 Win64";
+static const char vs9IA64generatorName[] = "Visual Studio 9 2008 IA64";
 
+class cmGlobalVisualStudio9Generator::Factory
+  : public cmGlobalGeneratorFactory
+{
+public:
+  virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
+    if(!strcmp(name, vs9Win32generatorName))
+      {
+      return new cmGlobalVisualStudio9Generator(
+        vs9Win32generatorName, NULL, NULL);
+      }
+    if(!strcmp(name, vs9Win64generatorName))
+      {
+      return new cmGlobalVisualStudio9Generator(
+        vs9Win64generatorName, "x64", "CMAKE_FORCE_WIN64");
+      }
+    if(!strcmp(name, vs9IA64generatorName))
+      {
+      return new cmGlobalVisualStudio9Generator(
+        vs9IA64generatorName, "Itanium", "CMAKE_FORCE_IA64");
+      }
+    return 0;
+  }
+
+  virtual void GetDocumentation(cmDocumentationEntry& entry) const {
+    entry.Name = "Visual Studio 9 2008";
+    entry.Brief = "Generates Visual Studio 9 2008 project files.";
+    entry.Full =
+      "It is possible to append a space followed by the platform name "
+      "to create project files for a specific target platform. E.g. "
+      "\"Visual Studio 9 2008 Win64\" will create project files for "
+      "the x64 processor; \"Visual Studio 9 2008 IA64\" for Itanium.";
+  }
 
-cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator()
+  virtual void GetGenerators(std::vector<std::string>& names) const {
+    names.push_back(vs9Win32generatorName);
+    names.push_back(vs9Win64generatorName);
+    names.push_back(vs9IA64generatorName); }
+};
+
+//----------------------------------------------------------------------------
+cmGlobalGeneratorFactory* cmGlobalVisualStudio9Generator::NewFactory()
+{
+  return new Factory;
+}
+
+//----------------------------------------------------------------------------
+cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator(
+  const char* name, const char* architectureId,
+  const char* additionalPlatformDefinition)
+  : cmGlobalVisualStudio8Generator(name, architectureId,
+                                   additionalPlatformDefinition)
 {
   this->FindMakeProgramFile = "CMakeVS9FindMake.cmake";
 }
@@ -40,15 +92,6 @@ cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator()
   return lg;
 }
 
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio9Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
-  entry.Name = cmGlobalVisualStudio9Generator::GetActualName();
-  entry.Brief = "Generates Visual Studio 9 2008 project files.";
-  entry.Full = "";
-}
-
 //----------------------------------------------------------------------------
 void cmGlobalVisualStudio9Generator
 ::EnableLanguage(std::vector<std::string>const &  lang,

+ 5 - 12
Source/cmGlobalVisualStudio9Generator.h

@@ -24,18 +24,9 @@ class cmGlobalVisualStudio9Generator :
   public cmGlobalVisualStudio8Generator
 {
 public:
-  cmGlobalVisualStudio9Generator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio9Generator>(); }
-
-  ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio9Generator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 9 2008";}
-
-  /** Get the documentation entry for this generator.  */
-  static void GetDocumentation(cmDocumentationEntry& entry);
+  cmGlobalVisualStudio9Generator(const char* name,
+    const char* architectureId, const char* additionalPlatformDefinition);
+  static cmGlobalGeneratorFactory* NewFactory();
 
   ///! create the correct local generator
   virtual cmLocalGenerator *CreateLocalGenerator();
@@ -62,5 +53,7 @@ public:
   virtual std::string GetUserMacrosRegKeyBase();
 protected:
   virtual const char* GetIDEVersion() { return "9.0"; }
+private:
+  class Factory;
 };
 #endif

+ 0 - 30
Source/cmGlobalVisualStudio9IA64Generator.cxx

@@ -1,30 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#include "cmGlobalVisualStudio9IA64Generator.h"
-#include "cmLocalVisualStudio7Generator.h"
-#include "cmMakefile.h"
-
-
-cmGlobalVisualStudio9IA64Generator::cmGlobalVisualStudio9IA64Generator()
-{
-  this->ArchitectureId = "Itanium";
-  this->AdditionalPlatformDefinition = "CMAKE_FORCE_IA64";
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio9IA64Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
-  entry.Name = cmGlobalVisualStudio9IA64Generator::GetActualName();
-  entry.Brief = "Generates Visual Studio 9 2008 Itanium project files.";
-  entry.Full = "";
-}

+ 0 - 40
Source/cmGlobalVisualStudio9IA64Generator.h

@@ -1,40 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#ifndef cmGlobalVisualStudio9IA64Generator_h
-#define cmGlobalVisualStudio9IA64Generator_h
-
-#include "cmGlobalVisualStudio9Generator.h"
-
-
-/** \class cmGlobalVisualStudio8IA64Generator
- * \brief Write a Unix makefiles.
- *
- * cmGlobalVisualStudio8IA64Generator manages UNIX build process for a tree
- */
-class cmGlobalVisualStudio9IA64Generator :
-  public cmGlobalVisualStudio9Generator
-{
-public:
-  cmGlobalVisualStudio9IA64Generator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio9IA64Generator>(); }
-
-  ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio9IA64Generator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 9 2008 IA64";}
-
-  /** Get the documentation entry for this generator.  */
-  static void GetDocumentation(cmDocumentationEntry& entry);
-};
-#endif

+ 0 - 30
Source/cmGlobalVisualStudio9Win64Generator.cxx

@@ -1,30 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#include "cmGlobalVisualStudio9Win64Generator.h"
-#include "cmLocalVisualStudio7Generator.h"
-#include "cmMakefile.h"
-
-
-cmGlobalVisualStudio9Win64Generator::cmGlobalVisualStudio9Win64Generator()
-{
-  this->ArchitectureId = "x64";
-  this->AdditionalPlatformDefinition = "CMAKE_FORCE_WIN64";
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio9Win64Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
-  entry.Name = cmGlobalVisualStudio9Win64Generator::GetActualName();
-  entry.Brief = "Generates Visual Studio 9 2008 Win64 project files.";
-  entry.Full = "";
-}

+ 0 - 40
Source/cmGlobalVisualStudio9Win64Generator.h

@@ -1,40 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#ifndef cmGlobalVisualStudio9Win64Generator_h
-#define cmGlobalVisualStudio9Win64Generator_h
-
-#include "cmGlobalVisualStudio9Generator.h"
-
-
-/** \class cmGlobalVisualStudio8Win64Generator
- * \brief Write a Unix makefiles.
- *
- * cmGlobalVisualStudio8Win64Generator manages UNIX build process for a tree
- */
-class cmGlobalVisualStudio9Win64Generator :
-  public cmGlobalVisualStudio9Generator
-{
-public:
-  cmGlobalVisualStudio9Win64Generator();
-  static cmGlobalGeneratorFactory* NewFactory() {
-    return new cmGlobalGeneratorSimpleFactory
-      <cmGlobalVisualStudio9Win64Generator>(); }
-
-  ///! Get the name for the generator.
-  virtual const char* GetName() const {
-    return cmGlobalVisualStudio9Win64Generator::GetActualName();}
-  static const char* GetActualName() {return "Visual Studio 9 2008 Win64";}
-
-  /** Get the documentation entry for this generator.  */
-  static void GetDocumentation(cmDocumentationEntry& entry);
-};
-#endif

+ 0 - 21
Source/cmake.cxx

@@ -63,15 +63,8 @@
 #    include "cmGlobalVisualStudio71Generator.h"
 #    include "cmGlobalVisualStudio8Generator.h"
 #    include "cmGlobalVisualStudio9Generator.h"
-#    include "cmGlobalVisualStudio9IA64Generator.h"
-#    include "cmGlobalVisualStudio9Win64Generator.h"
 #    include "cmGlobalVisualStudio10Generator.h"
-#    include "cmGlobalVisualStudio10IA64Generator.h"
-#    include "cmGlobalVisualStudio10Win64Generator.h"
 #    include "cmGlobalVisualStudio11Generator.h"
-#    include "cmGlobalVisualStudio11Win64Generator.h"
-#    include "cmGlobalVisualStudio11ARMGenerator.h"
-#    include "cmGlobalVisualStudio8Win64Generator.h"
 #    include "cmGlobalBorlandMakefileGenerator.h"
 #    include "cmGlobalNMakeMakefileGenerator.h"
 #    include "cmGlobalJOMMakefileGenerator.h"
@@ -2588,28 +2581,14 @@ void cmake::AddDefaultGenerators()
     cmGlobalVisualStudio7Generator::NewFactory());
   this->Generators.push_back(
     cmGlobalVisualStudio10Generator::NewFactory());
-  this->Generators.push_back(
-    cmGlobalVisualStudio10IA64Generator::NewFactory());
-  this->Generators.push_back(
-    cmGlobalVisualStudio10Win64Generator::NewFactory());
   this->Generators.push_back(
     cmGlobalVisualStudio11Generator::NewFactory());
-  this->Generators.push_back(
-    cmGlobalVisualStudio11Win64Generator::NewFactory());
-  this->Generators.push_back(
-    cmGlobalVisualStudio11ARMGenerator::NewFactory());
   this->Generators.push_back(
     cmGlobalVisualStudio71Generator::NewFactory());
   this->Generators.push_back(
     cmGlobalVisualStudio8Generator::NewFactory());
   this->Generators.push_back(
     cmGlobalVisualStudio9Generator::NewFactory());
-  this->Generators.push_back(
-    cmGlobalVisualStudio9IA64Generator::NewFactory());
-  this->Generators.push_back(
-    cmGlobalVisualStudio9Win64Generator::NewFactory());
-  this->Generators.push_back(
-    cmGlobalVisualStudio8Win64Generator::NewFactory());
   this->Generators.push_back(
     cmGlobalBorlandMakefileGenerator::NewFactory());
   this->Generators.push_back(