From e8f841473bcefc618ddf6712567e624156e88399 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 19 Nov 2012 15:48:33 +0100 Subject: [PATCH 01/10] Introduce the abstract class cmGlobalGeneratorFactory This new abstract class allows us move some logic from the cmGlobalGenerator into its own layer in a next step. --- Source/CMakeLists.txt | 1 + Source/cmGlobalBorlandMakefileGenerator.h | 5 +- Source/cmGlobalGeneratorFactory.h | 51 +++++++++++++++++ Source/cmGlobalJOMMakefileGenerator.h | 5 +- Source/cmGlobalMSYSMakefileGenerator.h | 5 +- Source/cmGlobalMinGWMakefileGenerator.h | 5 +- Source/cmGlobalNMakeMakefileGenerator.h | 5 +- Source/cmGlobalNinjaGenerator.h | 5 +- Source/cmGlobalUnixMakefileGenerator3.h | 6 +- Source/cmGlobalVisualStudio10Generator.h | 5 +- Source/cmGlobalVisualStudio10IA64Generator.h | 5 +- Source/cmGlobalVisualStudio10Win64Generator.h | 5 +- Source/cmGlobalVisualStudio11ARMGenerator.h | 5 +- Source/cmGlobalVisualStudio11Generator.h | 5 +- Source/cmGlobalVisualStudio11Win64Generator.h | 5 +- Source/cmGlobalVisualStudio6Generator.h | 6 +- Source/cmGlobalVisualStudio71Generator.h | 5 +- Source/cmGlobalVisualStudio7Generator.h | 6 +- Source/cmGlobalVisualStudio8Generator.h | 5 +- Source/cmGlobalVisualStudio8Win64Generator.h | 5 +- Source/cmGlobalVisualStudio9Generator.h | 5 +- Source/cmGlobalVisualStudio9IA64Generator.h | 5 +- Source/cmGlobalVisualStudio9Win64Generator.h | 5 +- Source/cmGlobalWatcomWMakeGenerator.h | 4 +- Source/cmGlobalXCodeGenerator.cxx | 19 ++++++- Source/cmGlobalXCodeGenerator.h | 4 +- Source/cmake.cxx | 57 ++++++++++--------- Source/cmake.h | 5 +- 28 files changed, 174 insertions(+), 75 deletions(-) create mode 100644 Source/cmGlobalGeneratorFactory.h diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 8bf6c4084..7bf167818 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -201,6 +201,7 @@ set(SRCS cmGeneratorTarget.h cmGlobalGenerator.cxx cmGlobalGenerator.h + cmGlobalGeneratorFactory.h cmGlobalUnixMakefileGenerator3.cxx cmGlobalUnixMakefileGenerator3.h cmGraphAdjacencyList.h diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index c0cb8a6d1..40bdcb03b 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h @@ -23,8 +23,9 @@ class cmGlobalBorlandMakefileGenerator : public cmGlobalNMakeMakefileGenerator { public: cmGlobalBorlandMakefileGenerator(); - static cmGlobalGenerator* New() - { return new cmGlobalBorlandMakefileGenerator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h new file mode 100644 index 000000000..05c84208e --- /dev/null +++ b/Source/cmGlobalGeneratorFactory.h @@ -0,0 +1,51 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2012 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 cmGlobalGeneratorFactory_h +#define cmGlobalGeneratorFactory_h + +#include "cmStandardIncludes.h" + +class cmGlobalGenerator; +struct cmDocumentationEntry; + +/** \class cmGlobalGeneratorFactory + * \brief Responable for creating cmGlobalGenerator instances + * + * Subclasses of this class generate instances of cmGlobalGenerator. + */ +class cmGlobalGeneratorFactory +{ +public: + virtual ~cmGlobalGeneratorFactory() {} + + /** Create a GlobalGenerator */ + virtual cmGlobalGenerator* CreateGlobalGenerator() const = 0; + + /** Get the documentation entry for this factory */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const = 0; +}; + +template +class cmGlobalGeneratorSimpleFactory : public cmGlobalGeneratorFactory +{ +public: + /** Create a GlobalGenerator */ + virtual cmGlobalGenerator* CreateGlobalGenerator() const { + return new T; } + + /** Get the documentation entry for this factory */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const { + T().GetDocumentation(entry); } +}; + +#endif diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h index 691ebdb8f..8686fbfee 100644 --- a/Source/cmGlobalJOMMakefileGenerator.h +++ b/Source/cmGlobalJOMMakefileGenerator.h @@ -23,8 +23,9 @@ class cmGlobalJOMMakefileGenerator : public cmGlobalUnixMakefileGenerator3 { public: cmGlobalJOMMakefileGenerator(); - static cmGlobalGenerator* New() { - return new cmGlobalJOMMakefileGenerator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalJOMMakefileGenerator::GetActualName();} diff --git a/Source/cmGlobalMSYSMakefileGenerator.h b/Source/cmGlobalMSYSMakefileGenerator.h index b76a5bf9b..17decf2c9 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.h +++ b/Source/cmGlobalMSYSMakefileGenerator.h @@ -23,8 +23,9 @@ class cmGlobalMSYSMakefileGenerator : public cmGlobalUnixMakefileGenerator3 { public: cmGlobalMSYSMakefileGenerator(); - static cmGlobalGenerator* New() { - return new cmGlobalMSYSMakefileGenerator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalMinGWMakefileGenerator.h b/Source/cmGlobalMinGWMakefileGenerator.h index 9a6a5139f..54a6f5b3f 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.h +++ b/Source/cmGlobalMinGWMakefileGenerator.h @@ -23,8 +23,9 @@ class cmGlobalMinGWMakefileGenerator : public cmGlobalUnixMakefileGenerator3 { public: cmGlobalMinGWMakefileGenerator(); - static cmGlobalGenerator* New() { - return new cmGlobalMinGWMakefileGenerator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalMinGWMakefileGenerator::GetActualName();} diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index de33b8f94..183ea9e0b 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h @@ -23,8 +23,9 @@ class cmGlobalNMakeMakefileGenerator : public cmGlobalUnixMakefileGenerator3 { public: cmGlobalNMakeMakefileGenerator(); - static cmGlobalGenerator* New() { - return new cmGlobalNMakeMakefileGenerator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalNMakeMakefileGenerator::GetActualName();} diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 24c391610..7e1f6e3b9 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -14,6 +14,7 @@ # define cmGlobalNinjaGenerator_h # include "cmGlobalGenerator.h" +# include "cmGlobalGeneratorFactory.h" # include "cmNinjaTypes.h" //#define NINJA_GEN_VERBOSE_FILES @@ -160,8 +161,8 @@ public: cmGlobalNinjaGenerator(); /// Convenience method for creating an instance of this class. - static cmGlobalGenerator* New() { - return new cmGlobalNinjaGenerator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory(); } /// Destructor. virtual ~cmGlobalNinjaGenerator() { } diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index e6dd09d6d..914820c37 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -13,6 +13,7 @@ #define cmGlobalUnixMakefileGenerator3_h #include "cmGlobalGenerator.h" +#include "cmGlobalGeneratorFactory.h" class cmGeneratedFileStream; class cmMakefileTargetGenerator; @@ -54,8 +55,9 @@ class cmGlobalUnixMakefileGenerator3 : public cmGlobalGenerator { public: cmGlobalUnixMakefileGenerator3(); - static cmGlobalGenerator* New() { - return new cmGlobalUnixMakefileGenerator3; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 47ce790f8..58bad5989 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -25,8 +25,9 @@ class cmGlobalVisualStudio10Generator : { public: cmGlobalVisualStudio10Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio10Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } virtual std::string GenerateBuildCommand(const char* makeProgram, diff --git a/Source/cmGlobalVisualStudio10IA64Generator.h b/Source/cmGlobalVisualStudio10IA64Generator.h index a088272ef..a7819a31c 100644 --- a/Source/cmGlobalVisualStudio10IA64Generator.h +++ b/Source/cmGlobalVisualStudio10IA64Generator.h @@ -19,8 +19,9 @@ class cmGlobalVisualStudio10IA64Generator : { public: cmGlobalVisualStudio10IA64Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio10IA64Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h index 8a2de4c0a..2728d1573 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.h +++ b/Source/cmGlobalVisualStudio10Win64Generator.h @@ -19,8 +19,9 @@ class cmGlobalVisualStudio10Win64Generator : { public: cmGlobalVisualStudio10Win64Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio10Win64Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio11ARMGenerator.h b/Source/cmGlobalVisualStudio11ARMGenerator.h index 71dbf2e3b..b1d30373b 100644 --- a/Source/cmGlobalVisualStudio11ARMGenerator.h +++ b/Source/cmGlobalVisualStudio11ARMGenerator.h @@ -19,8 +19,9 @@ class cmGlobalVisualStudio11ARMGenerator : { public: cmGlobalVisualStudio11ARMGenerator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio11ARMGenerator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index 56337a4db..c8f27a4a8 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -21,8 +21,9 @@ class cmGlobalVisualStudio11Generator: { public: cmGlobalVisualStudio11Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio11Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio11Win64Generator.h b/Source/cmGlobalVisualStudio11Win64Generator.h index 9445d156c..5ddf4a785 100644 --- a/Source/cmGlobalVisualStudio11Win64Generator.h +++ b/Source/cmGlobalVisualStudio11Win64Generator.h @@ -19,8 +19,9 @@ class cmGlobalVisualStudio11Win64Generator : { public: cmGlobalVisualStudio11Win64Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio11Win64Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index 259aa8d03..bc23cf81b 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -13,6 +13,7 @@ #define cmGlobalVisualStudio6Generator_h #include "cmGlobalVisualStudioGenerator.h" +#include "cmGlobalGeneratorFactory.h" class cmTarget; @@ -25,8 +26,9 @@ class cmGlobalVisualStudio6Generator : public cmGlobalVisualStudioGenerator { public: cmGlobalVisualStudio6Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio6Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index a8daad6a2..fa0ad92ef 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -24,8 +24,9 @@ class cmGlobalVisualStudio71Generator : public cmGlobalVisualStudio7Generator { public: cmGlobalVisualStudio71Generator(); - static cmGlobalGenerator* New() - { return new cmGlobalVisualStudio71Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 1df58f97b..0f935c78c 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -13,6 +13,7 @@ #define cmGlobalVisualStudio7Generator_h #include "cmGlobalVisualStudioGenerator.h" +#include "cmGlobalGeneratorFactory.h" class cmTarget; struct cmIDEFlagTable; @@ -26,8 +27,9 @@ class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator { public: cmGlobalVisualStudio7Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio7Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 5009f2960..157464b9e 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -24,8 +24,9 @@ class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator { public: cmGlobalVisualStudio8Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio8Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h index 12f80125a..612c5d787 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.h +++ b/Source/cmGlobalVisualStudio8Win64Generator.h @@ -25,8 +25,9 @@ class cmGlobalVisualStudio8Win64Generator : { public: cmGlobalVisualStudio8Win64Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio8Win64Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h index 0b0d1437f..d8d5e9045 100644 --- a/Source/cmGlobalVisualStudio9Generator.h +++ b/Source/cmGlobalVisualStudio9Generator.h @@ -25,8 +25,9 @@ class cmGlobalVisualStudio9Generator : { public: cmGlobalVisualStudio9Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio9Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio9IA64Generator.h b/Source/cmGlobalVisualStudio9IA64Generator.h index 989b0d1af..27bf71d63 100644 --- a/Source/cmGlobalVisualStudio9IA64Generator.h +++ b/Source/cmGlobalVisualStudio9IA64Generator.h @@ -25,8 +25,9 @@ class cmGlobalVisualStudio9IA64Generator : { public: cmGlobalVisualStudio9IA64Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio9IA64Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalVisualStudio9Win64Generator.h b/Source/cmGlobalVisualStudio9Win64Generator.h index 7c20cf4e2..e0c59bafa 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.h +++ b/Source/cmGlobalVisualStudio9Win64Generator.h @@ -25,8 +25,9 @@ class cmGlobalVisualStudio9Win64Generator : { public: cmGlobalVisualStudio9Win64Generator(); - static cmGlobalGenerator* New() { - return new cmGlobalVisualStudio9Win64Generator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index ee16eaebc..ac29b1ccd 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -23,7 +23,9 @@ class cmGlobalWatcomWMakeGenerator : public cmGlobalUnixMakefileGenerator3 { public: cmGlobalWatcomWMakeGenerator(); - static cmGlobalGenerator* New() { return new cmGlobalWatcomWMakeGenerator; } + static cmGlobalGeneratorFactory* NewFactory() { + return new cmGlobalGeneratorSimpleFactory + (); } ///! Get the name for the generator. virtual const char* GetName() const { return cmGlobalWatcomWMakeGenerator::GetActualName();} diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 5b2ddd8b4..4b07a3689 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -20,6 +20,7 @@ #include "cmSourceFile.h" #include "cmCustomCommandGenerator.h" #include "cmGeneratorTarget.h" +#include "cmGlobalGeneratorFactory.h" #include @@ -112,6 +113,15 @@ public: } }; +class cmGlobalXCodeGenerator::Factory : public cmGlobalGeneratorFactory +{ +public: + virtual cmGlobalGenerator* CreateGlobalGenerator() const; + + virtual void GetDocumentation(cmDocumentationEntry& entry) const { + cmGlobalXCodeGenerator().GetDocumentation(entry); } +}; + //---------------------------------------------------------------------------- cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version) { @@ -132,7 +142,14 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version) } //---------------------------------------------------------------------------- -cmGlobalGenerator* cmGlobalXCodeGenerator::New() +cmGlobalGeneratorFactory* cmGlobalXCodeGenerator::NewFactory() +{ + return new Factory; +} + +//---------------------------------------------------------------------------- +cmGlobalGenerator* cmGlobalXCodeGenerator::Factory +::CreateGlobalGenerator() const { #if defined(CMAKE_BUILD_WITH_CMAKE) cmXcodeVersionParser parser; diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index afa1ca22e..c79293a1e 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -15,6 +15,7 @@ #include "cmGlobalGenerator.h" #include "cmXCodeObject.h" #include "cmCustomCommand.h" +class cmGlobalGeneratorFactory; class cmTarget; class cmSourceFile; class cmSourceGroup; @@ -29,7 +30,7 @@ class cmGlobalXCodeGenerator : public cmGlobalGenerator { public: cmGlobalXCodeGenerator(std::string const& version); - static cmGlobalGenerator* New(); + static cmGlobalGeneratorFactory* NewFactory(); ///! Get the name for the generator. virtual const char* GetName() const { @@ -186,6 +187,7 @@ private: const char* varNameSuffix, const char* default_flags); + class Factory; class BuildObjectListOrString; friend class BuildObjectListOrString; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 012342715..08a322f9d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -222,6 +222,11 @@ cmake::~cmake() { delete (*j).second; } + for(RegisteredGeneratorsMap::iterator j = this->Generators.begin(); + j != this->Generators.end(); ++j) + { + delete (*j).second; + } #ifdef CMAKE_BUILD_WITH_CMAKE delete this->VariableWatch; #endif @@ -1904,7 +1909,7 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const char* name) } } - generator = (genIt->second)(); + generator = genIt->second->CreateGlobalGenerator(); generator->SetCMakeInstance(this); generator->SetExternalMakefileProjectGenerator(extraGenerator); return generator; @@ -2571,54 +2576,54 @@ void cmake::AddDefaultGenerators() #if defined(_WIN32) && !defined(__CYGWIN__) # if !defined(CMAKE_BOOT_MINGW) this->Generators[cmGlobalVisualStudio6Generator::GetActualName()] = - &cmGlobalVisualStudio6Generator::New; + cmGlobalVisualStudio6Generator::NewFactory(); this->Generators[cmGlobalVisualStudio7Generator::GetActualName()] = - &cmGlobalVisualStudio7Generator::New; + cmGlobalVisualStudio7Generator::NewFactory(); this->Generators[cmGlobalVisualStudio10Generator::GetActualName()] = - &cmGlobalVisualStudio10Generator::New; + cmGlobalVisualStudio10Generator::NewFactory(); this->Generators[cmGlobalVisualStudio10IA64Generator::GetActualName()] = - &cmGlobalVisualStudio10IA64Generator::New; + cmGlobalVisualStudio10IA64Generator::NewFactory(); this->Generators[cmGlobalVisualStudio10Win64Generator::GetActualName()] = - &cmGlobalVisualStudio10Win64Generator::New; + cmGlobalVisualStudio10Win64Generator::NewFactory(); this->Generators[cmGlobalVisualStudio11Generator::GetActualName()] = - &cmGlobalVisualStudio11Generator::New; + cmGlobalVisualStudio11Generator::NewFactory(); this->Generators[cmGlobalVisualStudio11Win64Generator::GetActualName()] = - &cmGlobalVisualStudio11Win64Generator::New; + cmGlobalVisualStudio11Win64Generator::NewFactory(); this->Generators[cmGlobalVisualStudio11ARMGenerator::GetActualName()] = - &cmGlobalVisualStudio11ARMGenerator::New; + cmGlobalVisualStudio11ARMGenerator::NewFactory(); this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] = - &cmGlobalVisualStudio71Generator::New; + cmGlobalVisualStudio71Generator::NewFactory(); this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = - &cmGlobalVisualStudio8Generator::New; + cmGlobalVisualStudio8Generator::NewFactory(); this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] = - &cmGlobalVisualStudio9Generator::New; + cmGlobalVisualStudio9Generator::NewFactory(); this->Generators[cmGlobalVisualStudio9IA64Generator::GetActualName()] = - &cmGlobalVisualStudio9IA64Generator::New; + cmGlobalVisualStudio9IA64Generator::NewFactory(); this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] = - &cmGlobalVisualStudio9Win64Generator::New; + cmGlobalVisualStudio9Win64Generator::NewFactory(); this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = - &cmGlobalVisualStudio8Win64Generator::New; + cmGlobalVisualStudio8Win64Generator::NewFactory(); this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = - &cmGlobalBorlandMakefileGenerator::New; + cmGlobalBorlandMakefileGenerator::NewFactory(); this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = - &cmGlobalNMakeMakefileGenerator::New; + cmGlobalNMakeMakefileGenerator::NewFactory(); this->Generators[cmGlobalJOMMakefileGenerator::GetActualName()] = - &cmGlobalJOMMakefileGenerator::New; + cmGlobalJOMMakefileGenerator::NewFactory(); this->Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] = - &cmGlobalWatcomWMakeGenerator::New; + cmGlobalWatcomWMakeGenerator::NewFactory(); # endif this->Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] = - &cmGlobalMSYSMakefileGenerator::New; + cmGlobalMSYSMakefileGenerator::NewFactory(); this->Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] = - &cmGlobalMinGWMakefileGenerator::New; + cmGlobalMinGWMakefileGenerator::NewFactory(); #endif this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] = - &cmGlobalUnixMakefileGenerator3::New; + cmGlobalUnixMakefileGenerator3::NewFactory(); this->Generators[cmGlobalNinjaGenerator::GetActualName()] = - &cmGlobalNinjaGenerator::New; + cmGlobalNinjaGenerator::NewFactory(); #ifdef CMAKE_USE_XCODE this->Generators[cmGlobalXCodeGenerator::GetActualName()] = - &cmGlobalXCodeGenerator::New; + cmGlobalXCodeGenerator::NewFactory(); #endif } @@ -2716,9 +2721,7 @@ void cmake::GetGeneratorDocumentation(std::vector& v) i != this->Generators.end(); ++i) { cmDocumentationEntry e; - cmGlobalGenerator* generator = (i->second)(); - generator->GetDocumentation(e); - delete generator; + i->second->GetDocumentation(e); v.push_back(e); } for(RegisteredExtraGeneratorsMap::const_iterator diff --git a/Source/cmake.h b/Source/cmake.h index 94c6f128f..e6bfa44dd 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -17,6 +17,7 @@ #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" +class cmGlobalGeneratorFactory; class cmGlobalGenerator; class cmLocalGenerator; class cmCacheManager; @@ -396,10 +397,8 @@ protected: cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)(); typedef std::map RegisteredExtraGeneratorsMap; - - typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); typedef std::map RegisteredGeneratorsMap; + cmGlobalGeneratorFactory*> RegisteredGeneratorsMap; RegisteredCommandsMap Commands; RegisteredGeneratorsMap Generators; RegisteredExtraGeneratorsMap ExtraGenerators; From 30a695021ccc6583493b3e7f9992ad428cd2855f Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 19 Nov 2012 15:52:46 +0100 Subject: [PATCH 02/10] Add cmGlobalGeneratorFactory::GetGenerators() This allows cmGlobalGeneratorFactory to create more than one type of cmGlobalGenerator in a next step. --- Source/cmGlobalGeneratorFactory.h | 7 +++++++ Source/cmGlobalXCodeGenerator.cxx | 3 +++ Source/cmake.cxx | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 05c84208e..9d8f7a085 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -33,6 +33,9 @@ public: /** Get the documentation entry for this factory */ virtual void GetDocumentation(cmDocumentationEntry& entry) const = 0; + + /** Get the names of the current registered generators */ + virtual void GetGenerators(std::vector& names) const = 0; }; template @@ -46,6 +49,10 @@ public: /** Get the documentation entry for this factory */ virtual void GetDocumentation(cmDocumentationEntry& entry) const { T().GetDocumentation(entry); } + + /** Get the names of the current registered generators */ + virtual void GetGenerators(std::vector& names) const { + names.push_back(T::GetActualName()); } }; #endif diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 4b07a3689..59ca652a4 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -120,6 +120,9 @@ public: virtual void GetDocumentation(cmDocumentationEntry& entry) const { cmGlobalXCodeGenerator().GetDocumentation(entry); } + + virtual void GetGenerators(std::vector& names) const { + names.push_back(cmGlobalXCodeGenerator::GetActualName()); } }; //---------------------------------------------------------------------------- diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 08a322f9d..2d531ba2b 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1877,7 +1877,7 @@ void cmake::GetRegisteredGenerators(std::vector& names) for(RegisteredGeneratorsMap::const_iterator i = this->Generators.begin(); i != this->Generators.end(); ++i) { - names.push_back(i->first); + i->second->GetGenerators(names); } for(RegisteredExtraGeneratorsMap::const_iterator i = this->ExtraGenerators.begin(); From 984ebc3350f72cb005999f7b796803f83be15304 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 19 Nov 2012 15:56:31 +0100 Subject: [PATCH 03/10] Search generator in cmake::ExtraGenerators before in cmake::Generators Since ExtraGenerators does not contain items, which are in Generators too, there is not change in behaviour. The benefit of this change is, that the lookup in the Generators map is now only done once. --- Source/cmake.cxx | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2d531ba2b..cd7150730 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1889,29 +1889,32 @@ void cmake::GetRegisteredGenerators(std::vector& names) cmGlobalGenerator* cmake::CreateGlobalGenerator(const char* name) { - cmGlobalGenerator* generator = 0; cmExternalMakefileProjectGenerator* extraGenerator = 0; - RegisteredGeneratorsMap::const_iterator genIt = this->Generators.find(name); - if(genIt == this->Generators.end()) + RegisteredExtraGeneratorsMap::const_iterator extraGenIt = + this->ExtraGenerators.find(name); + if (extraGenIt != this->ExtraGenerators.end()) { - RegisteredExtraGeneratorsMap::const_iterator extraGenIt = - this->ExtraGenerators.find(name); - if (extraGenIt == this->ExtraGenerators.end()) - { - return 0; - } extraGenerator = (extraGenIt->second)(); - genIt=this->Generators.find(extraGenerator->GetGlobalGeneratorName(name)); - if(genIt == this->Generators.end()) - { - delete extraGenerator; - return 0; - } - } + name = extraGenerator->GetGlobalGeneratorName(name); + } + + cmGlobalGenerator* generator = 0; + RegisteredGeneratorsMap::const_iterator genIt = this->Generators.find(name); + if(genIt != this->Generators.end()) + { + generator = genIt->second->CreateGlobalGenerator(); + } + + if (generator) + { + generator->SetCMakeInstance(this); + generator->SetExternalMakefileProjectGenerator(extraGenerator); + } + else + { + delete extraGenerator; + } - generator = genIt->second->CreateGlobalGenerator(); - generator->SetCMakeInstance(this); - generator->SetExternalMakefileProjectGenerator(extraGenerator); return generator; } From 04ff866ca8a0c5f4f8712d6cfafcd192ed4cbe58 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 19 Nov 2012 16:13:54 +0100 Subject: [PATCH 04/10] Allow a GeneratorFactory handling of more than one generator Pass the name of the requested generator to the generator factory, which is now responsible to check if it can create a matching generator for the name. This allows us to add more logic to the factory in a next step, so that not every possible generator needs to get registered explicit in cmake::AddDefaultGenerators(). --- Source/cmGlobalGeneratorFactory.h | 5 +- Source/cmGlobalXCodeGenerator.cxx | 6 +- Source/cmake.cxx | 120 +++++++++++++++--------------- Source/cmake.h | 5 +- 4 files changed, 71 insertions(+), 65 deletions(-) diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 9d8f7a085..0dfb36240 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -29,7 +29,7 @@ public: virtual ~cmGlobalGeneratorFactory() {} /** Create a GlobalGenerator */ - virtual cmGlobalGenerator* CreateGlobalGenerator() const = 0; + virtual cmGlobalGenerator* CreateGlobalGenerator(const char* n) const = 0; /** Get the documentation entry for this factory */ virtual void GetDocumentation(cmDocumentationEntry& entry) const = 0; @@ -43,7 +43,8 @@ class cmGlobalGeneratorSimpleFactory : public cmGlobalGeneratorFactory { public: /** Create a GlobalGenerator */ - virtual cmGlobalGenerator* CreateGlobalGenerator() const { + virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const { + if (strcmp(name, T::GetActualName())) return 0; return new T; } /** Get the documentation entry for this factory */ diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 59ca652a4..e6f342234 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -116,7 +116,7 @@ public: class cmGlobalXCodeGenerator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator() const; + virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const; virtual void GetDocumentation(cmDocumentationEntry& entry) const { cmGlobalXCodeGenerator().GetDocumentation(entry); } @@ -152,8 +152,10 @@ cmGlobalGeneratorFactory* cmGlobalXCodeGenerator::NewFactory() //---------------------------------------------------------------------------- cmGlobalGenerator* cmGlobalXCodeGenerator::Factory -::CreateGlobalGenerator() const +::CreateGlobalGenerator(const char* name) const { + if (strcmp(name, GetActualName())) + return 0; #if defined(CMAKE_BUILD_WITH_CMAKE) cmXcodeVersionParser parser; std::string versionFile; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index cd7150730..3eda86d65 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -222,10 +222,10 @@ cmake::~cmake() { delete (*j).second; } - for(RegisteredGeneratorsMap::iterator j = this->Generators.begin(); + for(RegisteredGeneratorsVector::iterator j = this->Generators.begin(); j != this->Generators.end(); ++j) { - delete (*j).second; + delete *j; } #ifdef CMAKE_BUILD_WITH_CMAKE delete this->VariableWatch; @@ -1874,10 +1874,10 @@ void cmake::AddDefaultExtraGenerators() //---------------------------------------------------------------------------- void cmake::GetRegisteredGenerators(std::vector& names) { - for(RegisteredGeneratorsMap::const_iterator i = this->Generators.begin(); + for(RegisteredGeneratorsVector::const_iterator i = this->Generators.begin(); i != this->Generators.end(); ++i) { - i->second->GetGenerators(names); + (*i)->GetGenerators(names); } for(RegisteredExtraGeneratorsMap::const_iterator i = this->ExtraGenerators.begin(); @@ -1899,10 +1899,14 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const char* name) } cmGlobalGenerator* generator = 0; - RegisteredGeneratorsMap::const_iterator genIt = this->Generators.find(name); - if(genIt != this->Generators.end()) + for (RegisteredGeneratorsVector::const_iterator i = + this->Generators.begin(); i != this->Generators.end(); ++i) { - generator = genIt->second->CreateGlobalGenerator(); + generator = (*i)->CreateGlobalGenerator(name); + if (generator) + { + break; + } } if (generator) @@ -2578,55 +2582,55 @@ void cmake::AddDefaultGenerators() { #if defined(_WIN32) && !defined(__CYGWIN__) # if !defined(CMAKE_BOOT_MINGW) - this->Generators[cmGlobalVisualStudio6Generator::GetActualName()] = - cmGlobalVisualStudio6Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio7Generator::GetActualName()] = - cmGlobalVisualStudio7Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio10Generator::GetActualName()] = - cmGlobalVisualStudio10Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio10IA64Generator::GetActualName()] = - cmGlobalVisualStudio10IA64Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio10Win64Generator::GetActualName()] = - cmGlobalVisualStudio10Win64Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio11Generator::GetActualName()] = - cmGlobalVisualStudio11Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio11Win64Generator::GetActualName()] = - cmGlobalVisualStudio11Win64Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio11ARMGenerator::GetActualName()] = - cmGlobalVisualStudio11ARMGenerator::NewFactory(); - this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] = - cmGlobalVisualStudio71Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = - cmGlobalVisualStudio8Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] = - cmGlobalVisualStudio9Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio9IA64Generator::GetActualName()] = - cmGlobalVisualStudio9IA64Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] = - cmGlobalVisualStudio9Win64Generator::NewFactory(); - this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = - cmGlobalVisualStudio8Win64Generator::NewFactory(); - this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = - cmGlobalBorlandMakefileGenerator::NewFactory(); - this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = - cmGlobalNMakeMakefileGenerator::NewFactory(); - this->Generators[cmGlobalJOMMakefileGenerator::GetActualName()] = - cmGlobalJOMMakefileGenerator::NewFactory(); - this->Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] = - cmGlobalWatcomWMakeGenerator::NewFactory(); + this->Generators.push_back( + cmGlobalVisualStudio6Generator::NewFactory()); + this->Generators.push_back( + 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( + cmGlobalNMakeMakefileGenerator::NewFactory()); + this->Generators.push_back( + cmGlobalJOMMakefileGenerator::NewFactory()); + this->Generators.push_back( + cmGlobalWatcomWMakeGenerator::NewFactory()); # endif - this->Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] = - cmGlobalMSYSMakefileGenerator::NewFactory(); - this->Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] = - cmGlobalMinGWMakefileGenerator::NewFactory(); + this->Generators.push_back( + cmGlobalMSYSMakefileGenerator::NewFactory()); + this->Generators.push_back( + cmGlobalMinGWMakefileGenerator::NewFactory()); #endif - this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] = - cmGlobalUnixMakefileGenerator3::NewFactory(); - this->Generators[cmGlobalNinjaGenerator::GetActualName()] = - cmGlobalNinjaGenerator::NewFactory(); + this->Generators.push_back( + cmGlobalUnixMakefileGenerator3::NewFactory()); + this->Generators.push_back( + cmGlobalNinjaGenerator::NewFactory()); #ifdef CMAKE_USE_XCODE - this->Generators[cmGlobalXCodeGenerator::GetActualName()] = - cmGlobalXCodeGenerator::NewFactory(); + this->Generators.push_back( + cmGlobalXCodeGenerator::NewFactory()); #endif } @@ -2720,15 +2724,15 @@ void cmake::GetPropertiesDocumentation(std::map& v) { - for(RegisteredGeneratorsMap::const_iterator i = this->Generators.begin(); - i != this->Generators.end(); ++i) + for(RegisteredGeneratorsVector::const_iterator i = + this->Generators.begin(); i != this->Generators.end(); ++i) { cmDocumentationEntry e; - i->second->GetDocumentation(e); + (*i)->GetDocumentation(e); v.push_back(e); } - for(RegisteredExtraGeneratorsMap::const_iterator - i = this->ExtraGenerators.begin(); i != this->ExtraGenerators.end(); ++i) + for(RegisteredExtraGeneratorsMap::const_iterator i = + this->ExtraGenerators.begin(); i != this->ExtraGenerators.end(); ++i) { cmDocumentationEntry e; cmExternalMakefileProjectGenerator* generator = (i->second)(); diff --git a/Source/cmake.h b/Source/cmake.h index e6bfa44dd..79e05ca0c 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -397,10 +397,9 @@ protected: cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)(); typedef std::map RegisteredExtraGeneratorsMap; - typedef std::map RegisteredGeneratorsMap; + typedef std::vector RegisteredGeneratorsVector; RegisteredCommandsMap Commands; - RegisteredGeneratorsMap Generators; + RegisteredGeneratorsVector Generators; RegisteredExtraGeneratorsMap ExtraGenerators; void AddDefaultCommands(); void AddDefaultGenerators(); From 5170a8800ff4613dd41f6995e8efd43df36a40bd Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 19 Nov 2012 16:42:24 +0100 Subject: [PATCH 05/10] Make cmGlobalGenerator::GetDocumentation() a static function Making the function static allows us to call it directly, without creating and removing an instance of the generator. --- Source/cmGlobalBorlandMakefileGenerator.cxx | 4 ++-- Source/cmGlobalBorlandMakefileGenerator.h | 2 +- Source/cmGlobalGenerator.cxx | 8 -------- Source/cmGlobalGenerator.h | 3 --- Source/cmGlobalGeneratorFactory.h | 2 +- Source/cmGlobalJOMMakefileGenerator.cxx | 4 ++-- Source/cmGlobalJOMMakefileGenerator.h | 2 +- Source/cmGlobalMSYSMakefileGenerator.cxx | 4 ++-- Source/cmGlobalMSYSMakefileGenerator.h | 2 +- Source/cmGlobalMinGWMakefileGenerator.cxx | 4 ++-- Source/cmGlobalMinGWMakefileGenerator.h | 2 +- Source/cmGlobalNMakeMakefileGenerator.cxx | 4 ++-- Source/cmGlobalNMakeMakefileGenerator.h | 2 +- Source/cmGlobalNinjaGenerator.cxx | 4 ++-- Source/cmGlobalNinjaGenerator.h | 2 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 4 ++-- Source/cmGlobalUnixMakefileGenerator3.h | 2 +- Source/cmGlobalVisualStudio10Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio10Generator.h | 2 +- Source/cmGlobalVisualStudio10IA64Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio10IA64Generator.h | 2 +- Source/cmGlobalVisualStudio10Win64Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio10Win64Generator.h | 2 +- Source/cmGlobalVisualStudio11ARMGenerator.cxx | 4 ++-- Source/cmGlobalVisualStudio11ARMGenerator.h | 2 +- Source/cmGlobalVisualStudio11Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio11Generator.h | 2 +- Source/cmGlobalVisualStudio11Win64Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio11Win64Generator.h | 2 +- Source/cmGlobalVisualStudio6Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio6Generator.h | 2 +- Source/cmGlobalVisualStudio71Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio71Generator.h | 2 +- Source/cmGlobalVisualStudio7Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio7Generator.h | 2 +- Source/cmGlobalVisualStudio8Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio8Generator.h | 2 +- Source/cmGlobalVisualStudio8Win64Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio8Win64Generator.h | 2 +- Source/cmGlobalVisualStudio9Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio9Generator.h | 2 +- Source/cmGlobalVisualStudio9IA64Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio9IA64Generator.h | 2 +- Source/cmGlobalVisualStudio9Win64Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio9Win64Generator.h | 2 +- Source/cmGlobalWatcomWMakeGenerator.cxx | 4 ++-- Source/cmGlobalWatcomWMakeGenerator.h | 2 +- Source/cmGlobalXCodeGenerator.cxx | 5 ++--- Source/cmGlobalXCodeGenerator.h | 2 +- 49 files changed, 70 insertions(+), 82 deletions(-) diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index 8c6787a2c..2a7d61d6a 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -55,9 +55,9 @@ cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalBorlandMakefileGenerator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalBorlandMakefileGenerator::GetActualName(); entry.Brief = "Generates Borland makefiles."; entry.Full = ""; } diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index 40bdcb03b..bd3db3eae 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h @@ -33,7 +33,7 @@ public: static const char* GetActualName() {return "Borland Makefiles";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index b9de4d8aa..ee7a9b3bb 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1555,14 +1555,6 @@ void cmGlobalGenerator::SetConfiguredFilesPath(cmGlobalGenerator* gen) } } -//---------------------------------------------------------------------------- -void cmGlobalGenerator::GetDocumentation(cmDocumentationEntry& entry) const -{ - entry.Name = this->GetName(); - entry.Brief = ""; - entry.Full = ""; -} - bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) { diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 0aab2d63e..bb805d9b1 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -49,9 +49,6 @@ public: ///! Get the name for this generator virtual const char *GetName() const { return "Generic"; }; - /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; - /** * Create LocalGenerators and process the CMakeLists files. This does not * actually produce any makefiles, DSPs, etc. diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 0dfb36240..fd1d65fb5 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -49,7 +49,7 @@ public: /** Get the documentation entry for this factory */ virtual void GetDocumentation(cmDocumentationEntry& entry) const { - T().GetDocumentation(entry); } + T::GetDocumentation(entry); } /** Get the names of the current registered generators */ virtual void GetGenerators(std::vector& names) const { diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx index ef42bd4d6..4af06076f 100644 --- a/Source/cmGlobalJOMMakefileGenerator.cxx +++ b/Source/cmGlobalJOMMakefileGenerator.cxx @@ -61,9 +61,9 @@ cmLocalGenerator *cmGlobalJOMMakefileGenerator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalJOMMakefileGenerator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalJOMMakefileGenerator::GetActualName(); entry.Brief = "Generates JOM makefiles."; entry.Full = ""; } diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h index 8686fbfee..28893bf27 100644 --- a/Source/cmGlobalJOMMakefileGenerator.h +++ b/Source/cmGlobalJOMMakefileGenerator.h @@ -34,7 +34,7 @@ public: static const char* GetActualName() {return "NMake Makefiles JOM";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx index 80526aad8..d49639bef 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.cxx +++ b/Source/cmGlobalMSYSMakefileGenerator.cxx @@ -106,9 +106,9 @@ cmLocalGenerator *cmGlobalMSYSMakefileGenerator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalMSYSMakefileGenerator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalMSYSMakefileGenerator::GetActualName(); entry.Brief = "Generates MSYS makefiles."; entry.Full = "The makefiles use /bin/sh as the shell. " "They require msys to be installed on the machine."; diff --git a/Source/cmGlobalMSYSMakefileGenerator.h b/Source/cmGlobalMSYSMakefileGenerator.h index 17decf2c9..659de1186 100644 --- a/Source/cmGlobalMSYSMakefileGenerator.h +++ b/Source/cmGlobalMSYSMakefileGenerator.h @@ -33,7 +33,7 @@ public: static const char* GetActualName() {return "MSYS Makefiles";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx index d6045c8de..e202b0230 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.cxx +++ b/Source/cmGlobalMinGWMakefileGenerator.cxx @@ -71,9 +71,9 @@ cmLocalGenerator *cmGlobalMinGWMakefileGenerator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalMinGWMakefileGenerator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalMinGWMakefileGenerator::GetActualName(); entry.Brief = "Generates a make file for use with mingw32-make."; entry.Full = "The makefiles generated use cmd.exe as the shell. " "They do not require msys or a unix shell."; diff --git a/Source/cmGlobalMinGWMakefileGenerator.h b/Source/cmGlobalMinGWMakefileGenerator.h index 54a6f5b3f..7951e9886 100644 --- a/Source/cmGlobalMinGWMakefileGenerator.h +++ b/Source/cmGlobalMinGWMakefileGenerator.h @@ -32,7 +32,7 @@ public: static const char* GetActualName() {return "MinGW Makefiles";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index 57a26c8ae..7af4ee3a8 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -61,9 +61,9 @@ cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalNMakeMakefileGenerator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalNMakeMakefileGenerator::GetActualName(); entry.Brief = "Generates NMake makefiles."; entry.Full = ""; } diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index 183ea9e0b..5756fbd0d 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h @@ -32,7 +32,7 @@ public: static const char* GetActualName() {return "NMake Makefiles";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 05f5b4c86..60f5a4746 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -452,9 +452,9 @@ cmLocalGenerator* cmGlobalNinjaGenerator::CreateLocalGenerator() } void cmGlobalNinjaGenerator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalNinjaGenerator::GetActualName(); entry.Brief = "Generates build.ninja files (experimental)."; entry.Full = "A build.ninja file is generated into the build tree. Recent " diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 7e1f6e3b9..c3df7d935 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -178,7 +178,7 @@ public: static const char* GetActualName() { return "Ninja"; } /// Overloaded methods. @see cmGlobalGenerator::GetDocumentation() - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); /// Overloaded methods. @see cmGlobalGenerator::Generate() virtual void Generate(); diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index ebd82194c..e26cca940 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -61,9 +61,9 @@ cmLocalGenerator *cmGlobalUnixMakefileGenerator3::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalUnixMakefileGenerator3 -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalUnixMakefileGenerator3::GetActualName(); entry.Brief = "Generates standard UNIX makefiles."; entry.Full = "A hierarchy of UNIX makefiles is generated into the build tree. Any " diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 914820c37..385cdc4a1 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -65,7 +65,7 @@ public: static const char* GetActualName() {return "Unix Makefiles";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator3 virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 480c577f2..b88522306 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -88,9 +88,9 @@ void cmGlobalVisualStudio10Generator::Generate() //---------------------------------------------------------------------------- void cmGlobalVisualStudio10Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio10Generator::GetActualName(); entry.Brief = "Generates Visual Studio 10 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 58bad5989..c08424259 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -42,7 +42,7 @@ public: virtual void AddPlatformDefinitions(cmMakefile* mf); /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! create the correct local generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio10IA64Generator.cxx b/Source/cmGlobalVisualStudio10IA64Generator.cxx index 25dd88f2a..40bc30774 100644 --- a/Source/cmGlobalVisualStudio10IA64Generator.cxx +++ b/Source/cmGlobalVisualStudio10IA64Generator.cxx @@ -21,9 +21,9 @@ cmGlobalVisualStudio10IA64Generator::cmGlobalVisualStudio10IA64Generator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio10IA64Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio10IA64Generator::GetActualName(); entry.Brief = "Generates Visual Studio 10 Itanium project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio10IA64Generator.h b/Source/cmGlobalVisualStudio10IA64Generator.h index a7819a31c..25436777d 100644 --- a/Source/cmGlobalVisualStudio10IA64Generator.h +++ b/Source/cmGlobalVisualStudio10IA64Generator.h @@ -31,7 +31,7 @@ public: virtual const char* GetPlatformName() const {return "Itanium";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); virtual void AddPlatformDefinitions(cmMakefile* mf); diff --git a/Source/cmGlobalVisualStudio10Win64Generator.cxx b/Source/cmGlobalVisualStudio10Win64Generator.cxx index d0a0c49a1..d9db7317f 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio10Win64Generator.cxx @@ -21,9 +21,9 @@ cmGlobalVisualStudio10Win64Generator::cmGlobalVisualStudio10Win64Generator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio10Win64Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio10Win64Generator::GetActualName(); entry.Brief = "Generates Visual Studio 10 Win64 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h index 2728d1573..d95f770db 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.h +++ b/Source/cmGlobalVisualStudio10Win64Generator.h @@ -31,7 +31,7 @@ public: virtual const char* GetPlatformName() const {return "x64";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); virtual void AddPlatformDefinitions(cmMakefile* mf); diff --git a/Source/cmGlobalVisualStudio11ARMGenerator.cxx b/Source/cmGlobalVisualStudio11ARMGenerator.cxx index efd71c65d..b1b06818e 100644 --- a/Source/cmGlobalVisualStudio11ARMGenerator.cxx +++ b/Source/cmGlobalVisualStudio11ARMGenerator.cxx @@ -21,9 +21,9 @@ cmGlobalVisualStudio11ARMGenerator::cmGlobalVisualStudio11ARMGenerator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio11ARMGenerator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio11ARMGenerator::GetActualName(); entry.Brief = "Generates Visual Studio 11 ARM project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio11ARMGenerator.h b/Source/cmGlobalVisualStudio11ARMGenerator.h index b1d30373b..7596d3380 100644 --- a/Source/cmGlobalVisualStudio11ARMGenerator.h +++ b/Source/cmGlobalVisualStudio11ARMGenerator.h @@ -31,6 +31,6 @@ public: virtual const char* GetPlatformName() const {return "ARM";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); }; #endif diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 23a1204bd..1f4693aac 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -43,9 +43,9 @@ cmLocalGenerator *cmGlobalVisualStudio11Generator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio11Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio11Generator::GetActualName(); entry.Brief = "Generates Visual Studio 11 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index c8f27a4a8..0af273707 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -33,7 +33,7 @@ public: virtual void WriteSLNHeader(std::ostream& fout); /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! create the correct local generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio11Win64Generator.cxx b/Source/cmGlobalVisualStudio11Win64Generator.cxx index 94e07bf38..5810b03dd 100644 --- a/Source/cmGlobalVisualStudio11Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio11Win64Generator.cxx @@ -21,9 +21,9 @@ cmGlobalVisualStudio11Win64Generator::cmGlobalVisualStudio11Win64Generator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio11Win64Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio11Win64Generator::GetActualName(); entry.Brief = "Generates Visual Studio 11 Win64 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio11Win64Generator.h b/Source/cmGlobalVisualStudio11Win64Generator.h index 5ddf4a785..ff42281bd 100644 --- a/Source/cmGlobalVisualStudio11Win64Generator.h +++ b/Source/cmGlobalVisualStudio11Win64Generator.h @@ -31,7 +31,7 @@ public: virtual const char* GetPlatformName() const {return "x64";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); virtual void AddPlatformDefinitions(cmMakefile* mf); }; diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 0ec4850b4..cb15c30f5 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -397,9 +397,9 @@ cmGlobalVisualStudio6Generator::WriteUtilityDepend(cmTarget* target) //---------------------------------------------------------------------------- void cmGlobalVisualStudio6Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio6Generator::GetActualName(); entry.Brief = "Generates Visual Studio 6 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index bc23cf81b..40149e911 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -36,7 +36,7 @@ public: static const char* GetActualName() {return "Visual Studio 6";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index ab2308f50..67aa8b1b4 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -313,9 +313,9 @@ void cmGlobalVisualStudio71Generator::WriteSLNHeader(std::ostream& fout) //---------------------------------------------------------------------------- void cmGlobalVisualStudio71Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio71Generator::GetActualName(); entry.Brief = "Generates Visual Studio .NET 2003 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index fa0ad92ef..dfbbe437b 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -34,7 +34,7 @@ public: static const char* GetActualName() {return "Visual Studio 7 .NET 2003";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 15ef7384e..d02dca800 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -740,9 +740,9 @@ std::vector *cmGlobalVisualStudio7Generator::GetConfigurations() //---------------------------------------------------------------------------- void cmGlobalVisualStudio7Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio7Generator::GetActualName(); entry.Brief = "Generates Visual Studio .NET 2002 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 0f935c78c..b59c0b139 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -40,7 +40,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); /** * Try to determine system infomation such as shared library diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index a6ed2a645..2697129ef 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -45,9 +45,9 @@ void cmGlobalVisualStudio8Generator::WriteSLNHeader(std::ostream& fout) //---------------------------------------------------------------------------- void cmGlobalVisualStudio8Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio8Generator::GetActualName(); entry.Brief = "Generates Visual Studio 8 2005 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 157464b9e..ec0d07c07 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -36,7 +36,7 @@ public: virtual const char* GetPlatformName() const {return "Win32";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx index 4cbc2750d..448230304 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio8Win64Generator.cxx @@ -24,9 +24,9 @@ cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio8Win64Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio8Win64Generator::GetActualName(); entry.Brief = "Generates Visual Studio 8 2005 Win64 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h index 612c5d787..883b74af2 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.h +++ b/Source/cmGlobalVisualStudio8Win64Generator.h @@ -37,7 +37,7 @@ public: virtual const char* GetPlatformName() const {return "x64";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); /** * Try to determine system infomation such as shared library diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index 70af50d7b..d12d6ee4c 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -42,9 +42,9 @@ cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio9Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio9Generator::GetActualName(); entry.Brief = "Generates Visual Studio 9 2008 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h index d8d5e9045..5da587b49 100644 --- a/Source/cmGlobalVisualStudio9Generator.h +++ b/Source/cmGlobalVisualStudio9Generator.h @@ -35,7 +35,7 @@ public: static const char* GetActualName() {return "Visual Studio 9 2008";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! create the correct local generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio9IA64Generator.cxx b/Source/cmGlobalVisualStudio9IA64Generator.cxx index 38dbfacc4..c56413b45 100644 --- a/Source/cmGlobalVisualStudio9IA64Generator.cxx +++ b/Source/cmGlobalVisualStudio9IA64Generator.cxx @@ -21,9 +21,9 @@ cmGlobalVisualStudio9IA64Generator::cmGlobalVisualStudio9IA64Generator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio9IA64Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio9IA64Generator::GetActualName(); entry.Brief = "Generates Visual Studio 9 2008 Itanium project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio9IA64Generator.h b/Source/cmGlobalVisualStudio9IA64Generator.h index 27bf71d63..ac962416b 100644 --- a/Source/cmGlobalVisualStudio9IA64Generator.h +++ b/Source/cmGlobalVisualStudio9IA64Generator.h @@ -37,7 +37,7 @@ public: virtual const char* GetPlatformName() const {return "Itanium";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); /** * Try to determine system infomation such as shared library diff --git a/Source/cmGlobalVisualStudio9Win64Generator.cxx b/Source/cmGlobalVisualStudio9Win64Generator.cxx index 4d8a6463b..f58cde5fc 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio9Win64Generator.cxx @@ -21,9 +21,9 @@ cmGlobalVisualStudio9Win64Generator::cmGlobalVisualStudio9Win64Generator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio9Win64Generator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalVisualStudio9Win64Generator::GetActualName(); entry.Brief = "Generates Visual Studio 9 2008 Win64 project files."; entry.Full = ""; } diff --git a/Source/cmGlobalVisualStudio9Win64Generator.h b/Source/cmGlobalVisualStudio9Win64Generator.h index e0c59bafa..de7a1820b 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.h +++ b/Source/cmGlobalVisualStudio9Win64Generator.h @@ -37,7 +37,7 @@ public: virtual const char* GetPlatformName() const {return "x64";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); /** * Try to determine system infomation such as shared library diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx index 45b171ff2..e3cebc4ac 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.cxx +++ b/Source/cmGlobalWatcomWMakeGenerator.cxx @@ -58,9 +58,9 @@ cmLocalGenerator *cmGlobalWatcomWMakeGenerator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalWatcomWMakeGenerator -::GetDocumentation(cmDocumentationEntry& entry) const +::GetDocumentation(cmDocumentationEntry& entry) { - entry.Name = this->GetName(); + entry.Name = cmGlobalWatcomWMakeGenerator::GetActualName(); entry.Brief = "Generates Watcom WMake makefiles."; entry.Full = ""; } diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index ac29b1ccd..23e60a1fc 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -32,7 +32,7 @@ public: static const char* GetActualName() {return "Watcom WMake";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e6f342234..4ef2f5736 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -119,7 +119,7 @@ public: virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const; virtual void GetDocumentation(cmDocumentationEntry& entry) const { - cmGlobalXCodeGenerator().GetDocumentation(entry); } + cmGlobalXCodeGenerator::GetDocumentation(entry); } virtual void GetGenerators(std::vector& names) const { names.push_back(cmGlobalXCodeGenerator::GetActualName()); } @@ -3496,9 +3496,8 @@ const char* cmGlobalXCodeGenerator::GetCMakeCFGIntDir() const //---------------------------------------------------------------------------- void cmGlobalXCodeGenerator::GetDocumentation(cmDocumentationEntry& entry) - const { - entry.Name = this->GetName(); + entry.Name = cmGlobalXCodeGenerator::GetActualName(); entry.Brief = "Generate Xcode project files."; entry.Full = ""; } diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index c79293a1e..c98652f5d 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -38,7 +38,7 @@ public: static const char* GetActualName() {return "Xcode";} /** Get the documentation entry for this generator. */ - virtual void GetDocumentation(cmDocumentationEntry& entry) const; + static void GetDocumentation(cmDocumentationEntry& entry); ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); From 6f439b30cb0b1a76c8e7ee8f169a0415a8a47c70 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 19 Nov 2012 17:21:47 +0100 Subject: [PATCH 06/10] VS: Remove AddPlatformDefinitions from platform-specific generators Move the logic for handling platform specific defines from the subclasses into the cmGlobalVisualStudioGenerator base class. --- Source/cmGlobalVisualStudio10IA64Generator.cxx | 9 +-------- Source/cmGlobalVisualStudio10IA64Generator.h | 2 -- Source/cmGlobalVisualStudio10Win64Generator.cxx | 9 +-------- Source/cmGlobalVisualStudio10Win64Generator.h | 2 -- Source/cmGlobalVisualStudio11Win64Generator.cxx | 9 +-------- Source/cmGlobalVisualStudio11Win64Generator.h | 2 -- Source/cmGlobalVisualStudio8Win64Generator.cxx | 9 +-------- Source/cmGlobalVisualStudio8Win64Generator.h | 6 ------ Source/cmGlobalVisualStudio9IA64Generator.cxx | 9 +-------- Source/cmGlobalVisualStudio9IA64Generator.h | 6 ------ Source/cmGlobalVisualStudio9Win64Generator.cxx | 9 +-------- Source/cmGlobalVisualStudio9Win64Generator.h | 6 ------ Source/cmGlobalVisualStudioGenerator.cxx | 6 ++++++ Source/cmGlobalVisualStudioGenerator.h | 1 + 14 files changed, 13 insertions(+), 72 deletions(-) diff --git a/Source/cmGlobalVisualStudio10IA64Generator.cxx b/Source/cmGlobalVisualStudio10IA64Generator.cxx index 40bc30774..fabe717bb 100644 --- a/Source/cmGlobalVisualStudio10IA64Generator.cxx +++ b/Source/cmGlobalVisualStudio10IA64Generator.cxx @@ -17,6 +17,7 @@ cmGlobalVisualStudio10IA64Generator::cmGlobalVisualStudio10IA64Generator() { this->ArchitectureId = "x64"; + this->AdditionalPlatformDefinition = "CMAKE_FORCE_IA64"; } //---------------------------------------------------------------------------- @@ -28,14 +29,6 @@ void cmGlobalVisualStudio10IA64Generator entry.Full = ""; } -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio10IA64Generator -::AddPlatformDefinitions(cmMakefile* mf) -{ - this->cmGlobalVisualStudio10Generator::AddPlatformDefinitions(mf); - mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE"); -} - //---------------------------------------------------------------------------- void cmGlobalVisualStudio10IA64Generator ::EnableLanguage(std::vector const& languages, diff --git a/Source/cmGlobalVisualStudio10IA64Generator.h b/Source/cmGlobalVisualStudio10IA64Generator.h index 25436777d..ae12cc32d 100644 --- a/Source/cmGlobalVisualStudio10IA64Generator.h +++ b/Source/cmGlobalVisualStudio10IA64Generator.h @@ -33,8 +33,6 @@ public: /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); - virtual void AddPlatformDefinitions(cmMakefile* mf); - virtual void EnableLanguage(std::vectorconst& languages, cmMakefile *, bool optional); }; diff --git a/Source/cmGlobalVisualStudio10Win64Generator.cxx b/Source/cmGlobalVisualStudio10Win64Generator.cxx index d9db7317f..0352a46f5 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio10Win64Generator.cxx @@ -17,6 +17,7 @@ cmGlobalVisualStudio10Win64Generator::cmGlobalVisualStudio10Win64Generator() { this->ArchitectureId = "x64"; + this->AdditionalPlatformDefinition = "CMAKE_FORCE_WIN64"; } //---------------------------------------------------------------------------- @@ -28,14 +29,6 @@ void cmGlobalVisualStudio10Win64Generator entry.Full = ""; } -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio10Win64Generator -::AddPlatformDefinitions(cmMakefile* mf) -{ - this->cmGlobalVisualStudio10Generator::AddPlatformDefinitions(mf); - mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); -} - //---------------------------------------------------------------------------- void cmGlobalVisualStudio10Win64Generator ::EnableLanguage(std::vector const& languages, diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h index d95f770db..66d77a97a 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.h +++ b/Source/cmGlobalVisualStudio10Win64Generator.h @@ -33,8 +33,6 @@ public: /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); - virtual void AddPlatformDefinitions(cmMakefile* mf); - virtual void EnableLanguage(std::vectorconst& languages, cmMakefile *, bool optional); }; diff --git a/Source/cmGlobalVisualStudio11Win64Generator.cxx b/Source/cmGlobalVisualStudio11Win64Generator.cxx index 5810b03dd..aca0a4e87 100644 --- a/Source/cmGlobalVisualStudio11Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio11Win64Generator.cxx @@ -17,6 +17,7 @@ cmGlobalVisualStudio11Win64Generator::cmGlobalVisualStudio11Win64Generator() { this->ArchitectureId = "x64"; + this->AdditionalPlatformDefinition = "CMAKE_FORCE_WIN64"; } //---------------------------------------------------------------------------- @@ -27,11 +28,3 @@ void cmGlobalVisualStudio11Win64Generator entry.Brief = "Generates Visual Studio 11 Win64 project files."; entry.Full = ""; } - -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio11Win64Generator -::AddPlatformDefinitions(cmMakefile* mf) -{ - this->cmGlobalVisualStudio11Generator::AddPlatformDefinitions(mf); - mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); -} diff --git a/Source/cmGlobalVisualStudio11Win64Generator.h b/Source/cmGlobalVisualStudio11Win64Generator.h index ff42281bd..bb33877e8 100644 --- a/Source/cmGlobalVisualStudio11Win64Generator.h +++ b/Source/cmGlobalVisualStudio11Win64Generator.h @@ -32,7 +32,5 @@ public: /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); - - virtual void AddPlatformDefinitions(cmMakefile* mf); }; #endif diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx index 448230304..a84e44c9b 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio8Win64Generator.cxx @@ -20,6 +20,7 @@ cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator() { this->ArchitectureId = "x64"; + this->AdditionalPlatformDefinition = "CMAKE_FORCE_WIN64"; } //---------------------------------------------------------------------------- @@ -30,11 +31,3 @@ void cmGlobalVisualStudio8Win64Generator entry.Brief = "Generates Visual Studio 8 2005 Win64 project files."; entry.Full = ""; } - -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio8Win64Generator -::AddPlatformDefinitions(cmMakefile* mf) -{ - this->cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf); - mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); -} diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h index 883b74af2..4283c2869 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.h +++ b/Source/cmGlobalVisualStudio8Win64Generator.h @@ -38,11 +38,5 @@ public: /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); - - /** - * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. - */ - virtual void AddPlatformDefinitions(cmMakefile *); }; #endif diff --git a/Source/cmGlobalVisualStudio9IA64Generator.cxx b/Source/cmGlobalVisualStudio9IA64Generator.cxx index c56413b45..6b0ed600f 100644 --- a/Source/cmGlobalVisualStudio9IA64Generator.cxx +++ b/Source/cmGlobalVisualStudio9IA64Generator.cxx @@ -17,6 +17,7 @@ cmGlobalVisualStudio9IA64Generator::cmGlobalVisualStudio9IA64Generator() { this->ArchitectureId = "Itanium"; + this->AdditionalPlatformDefinition = "CMAKE_FORCE_IA64"; } //---------------------------------------------------------------------------- @@ -27,11 +28,3 @@ void cmGlobalVisualStudio9IA64Generator entry.Brief = "Generates Visual Studio 9 2008 Itanium project files."; entry.Full = ""; } - -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio9IA64Generator -::AddPlatformDefinitions(cmMakefile* mf) -{ - cmGlobalVisualStudio9Generator::AddPlatformDefinitions(mf); - mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE"); -} diff --git a/Source/cmGlobalVisualStudio9IA64Generator.h b/Source/cmGlobalVisualStudio9IA64Generator.h index ac962416b..0e5861ac4 100644 --- a/Source/cmGlobalVisualStudio9IA64Generator.h +++ b/Source/cmGlobalVisualStudio9IA64Generator.h @@ -38,11 +38,5 @@ public: /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); - - /** - * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. - */ - virtual void AddPlatformDefinitions(cmMakefile *); }; #endif diff --git a/Source/cmGlobalVisualStudio9Win64Generator.cxx b/Source/cmGlobalVisualStudio9Win64Generator.cxx index f58cde5fc..37288b693 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio9Win64Generator.cxx @@ -17,6 +17,7 @@ cmGlobalVisualStudio9Win64Generator::cmGlobalVisualStudio9Win64Generator() { this->ArchitectureId = "x64"; + this->AdditionalPlatformDefinition = "CMAKE_FORCE_WIN64"; } //---------------------------------------------------------------------------- @@ -27,11 +28,3 @@ void cmGlobalVisualStudio9Win64Generator entry.Brief = "Generates Visual Studio 9 2008 Win64 project files."; entry.Full = ""; } - -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio9Win64Generator -::AddPlatformDefinitions(cmMakefile* mf) -{ - cmGlobalVisualStudio9Generator::AddPlatformDefinitions(mf); - mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); -} diff --git a/Source/cmGlobalVisualStudio9Win64Generator.h b/Source/cmGlobalVisualStudio9Win64Generator.h index de7a1820b..713c402ab 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.h +++ b/Source/cmGlobalVisualStudio9Win64Generator.h @@ -38,11 +38,5 @@ public: /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); - - /** - * Try to determine system infomation such as shared library - * extension, pthreads, byte order etc. - */ - virtual void AddPlatformDefinitions(cmMakefile *); }; #endif diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index ea6757dea..a51735154 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -22,6 +22,7 @@ cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator() { this->ArchitectureId = "X86"; + this->AdditionalPlatformDefinition = NULL; } //---------------------------------------------------------------------------- @@ -493,6 +494,11 @@ void cmGlobalVisualStudioGenerator::AddPlatformDefinitions(cmMakefile* mf) { mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", this->ArchitectureId); mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", this->ArchitectureId); + + if(this->AdditionalPlatformDefinition) + { + mf->AddDefinition(this->AdditionalPlatformDefinition, "TRUE"); + } } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index cebf7d741..7258e313e 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -99,6 +99,7 @@ protected: typedef std::map UtilityDependsMap; UtilityDependsMap UtilityDepends; const char* ArchitectureId; + const char* AdditionalPlatformDefinition; private: void ComputeTargetObjects(cmGeneratorTarget* gt) const; From 8d42ab426092f24f07b43ab2717f6071a7dc01e5 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 19 Nov 2012 17:48:57 +0100 Subject: [PATCH 07/10] VS: Fix ArchitectureId of Visual Studio 10 IA64 generator Replace "x64" with "Itanium" like at the VS 9 IA64 generator. --- Source/cmGlobalVisualStudio10IA64Generator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGlobalVisualStudio10IA64Generator.cxx b/Source/cmGlobalVisualStudio10IA64Generator.cxx index fabe717bb..9a03d1be4 100644 --- a/Source/cmGlobalVisualStudio10IA64Generator.cxx +++ b/Source/cmGlobalVisualStudio10IA64Generator.cxx @@ -16,7 +16,7 @@ //---------------------------------------------------------------------------- cmGlobalVisualStudio10IA64Generator::cmGlobalVisualStudio10IA64Generator() { - this->ArchitectureId = "x64"; + this->ArchitectureId = "Itanium"; this->AdditionalPlatformDefinition = "CMAKE_FORCE_IA64"; } From 5bdf01184baa0301bd71f486b87d225f07cd80d0 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 19 Nov 2012 18:03:36 +0100 Subject: [PATCH 08/10] VS: Remove GetPlatformName from platform-specific generators Use the existing ArchitectureId to generate the PlatformName to reduce duplicated information in the classes. --- Source/cmGlobalVisualStudio10IA64Generator.h | 2 -- Source/cmGlobalVisualStudio10Win64Generator.h | 2 -- Source/cmGlobalVisualStudio11ARMGenerator.h | 2 -- Source/cmGlobalVisualStudio11Win64Generator.h | 2 -- Source/cmGlobalVisualStudio8Generator.cxx | 10 ++++++++++ Source/cmGlobalVisualStudio8Generator.h | 2 +- Source/cmGlobalVisualStudio8Win64Generator.h | 2 -- Source/cmGlobalVisualStudio9IA64Generator.h | 2 -- Source/cmGlobalVisualStudio9Win64Generator.h | 2 -- 9 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Source/cmGlobalVisualStudio10IA64Generator.h b/Source/cmGlobalVisualStudio10IA64Generator.h index ae12cc32d..3c3325ea2 100644 --- a/Source/cmGlobalVisualStudio10IA64Generator.h +++ b/Source/cmGlobalVisualStudio10IA64Generator.h @@ -28,8 +28,6 @@ public: return cmGlobalVisualStudio10IA64Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 10 IA64";} - virtual const char* GetPlatformName() const {return "Itanium";} - /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h index 66d77a97a..30b2164cc 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.h +++ b/Source/cmGlobalVisualStudio10Win64Generator.h @@ -28,8 +28,6 @@ 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. */ static void GetDocumentation(cmDocumentationEntry& entry); diff --git a/Source/cmGlobalVisualStudio11ARMGenerator.h b/Source/cmGlobalVisualStudio11ARMGenerator.h index 7596d3380..8ca013f16 100644 --- a/Source/cmGlobalVisualStudio11ARMGenerator.h +++ b/Source/cmGlobalVisualStudio11ARMGenerator.h @@ -28,8 +28,6 @@ public: return cmGlobalVisualStudio11ARMGenerator::GetActualName();} static const char* GetActualName() {return "Visual Studio 11 ARM";} - virtual const char* GetPlatformName() const {return "ARM";} - /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); }; diff --git a/Source/cmGlobalVisualStudio11Win64Generator.h b/Source/cmGlobalVisualStudio11Win64Generator.h index bb33877e8..515b2a765 100644 --- a/Source/cmGlobalVisualStudio11Win64Generator.h +++ b/Source/cmGlobalVisualStudio11Win64Generator.h @@ -28,8 +28,6 @@ public: return cmGlobalVisualStudio11Win64Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 11 Win64";} - virtual const char* GetPlatformName() const {return "x64";} - /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); }; diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 2697129ef..17f1c3785 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -23,6 +23,16 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; } +//---------------------------------------------------------------------------- +const char* cmGlobalVisualStudio8Generator::GetPlatformName() const +{ + if (!strcmp(this->ArchitectureId, "X86")) + { + return "Win32"; + } + return this->ArchitectureId; +} + //---------------------------------------------------------------------------- ///! Create a local generator appropriate to this Global Generator cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator() diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index ec0d07c07..097b796cf 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -33,7 +33,7 @@ public: return cmGlobalVisualStudio8Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 8 2005";} - virtual const char* GetPlatformName() const {return "Win32";} + const char* GetPlatformName() const; /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h index 4283c2869..2ff2dd08c 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.h +++ b/Source/cmGlobalVisualStudio8Win64Generator.h @@ -34,8 +34,6 @@ 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. */ static void GetDocumentation(cmDocumentationEntry& entry); }; diff --git a/Source/cmGlobalVisualStudio9IA64Generator.h b/Source/cmGlobalVisualStudio9IA64Generator.h index 0e5861ac4..7af61e796 100644 --- a/Source/cmGlobalVisualStudio9IA64Generator.h +++ b/Source/cmGlobalVisualStudio9IA64Generator.h @@ -34,8 +34,6 @@ public: return cmGlobalVisualStudio9IA64Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 9 2008 IA64";} - virtual const char* GetPlatformName() const {return "Itanium";} - /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); }; diff --git a/Source/cmGlobalVisualStudio9Win64Generator.h b/Source/cmGlobalVisualStudio9Win64Generator.h index 713c402ab..c6b74a0e7 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.h +++ b/Source/cmGlobalVisualStudio9Win64Generator.h @@ -34,8 +34,6 @@ 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. */ static void GetDocumentation(cmDocumentationEntry& entry); }; From 8b62080c9db6a15649bd1673179076c096e26bec Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 19 Nov 2012 18:11:17 +0100 Subject: [PATCH 09/10] VS: Remove EnableLanguage from platform-specific generators Move the logic into the base class to remove duplicated code. --- Source/cmGlobalVisualStudio10Generator.cxx | 8 ++++++++ Source/cmGlobalVisualStudio10IA64Generator.cxx | 13 ------------- Source/cmGlobalVisualStudio10IA64Generator.h | 3 --- Source/cmGlobalVisualStudio10Win64Generator.cxx | 13 ------------- Source/cmGlobalVisualStudio10Win64Generator.h | 3 --- 5 files changed, 8 insertions(+), 32 deletions(-) diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index b88522306..db363bf7e 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -100,6 +100,14 @@ void cmGlobalVisualStudio10Generator ::EnableLanguage(std::vectorconst & lang, cmMakefile *mf, bool optional) { + if(!strcmp(this->ArchitectureId, "Itanium") || + !strcmp(this->ArchitectureId, "x64")) + { + if(this->IsExpressEdition() && !this->Find64BitTools(mf)) + { + return; + } + } cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional); } diff --git a/Source/cmGlobalVisualStudio10IA64Generator.cxx b/Source/cmGlobalVisualStudio10IA64Generator.cxx index 9a03d1be4..08a2e7a21 100644 --- a/Source/cmGlobalVisualStudio10IA64Generator.cxx +++ b/Source/cmGlobalVisualStudio10IA64Generator.cxx @@ -28,16 +28,3 @@ void cmGlobalVisualStudio10IA64Generator entry.Brief = "Generates Visual Studio 10 Itanium project files."; entry.Full = ""; } - -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio10IA64Generator -::EnableLanguage(std::vector const& languages, - cmMakefile* mf, bool optional) -{ - if(this->IsExpressEdition() && !this->Find64BitTools(mf)) - { - return; - } - this->cmGlobalVisualStudio10Generator - ::EnableLanguage(languages, mf, optional); -} diff --git a/Source/cmGlobalVisualStudio10IA64Generator.h b/Source/cmGlobalVisualStudio10IA64Generator.h index 3c3325ea2..2bf76592b 100644 --- a/Source/cmGlobalVisualStudio10IA64Generator.h +++ b/Source/cmGlobalVisualStudio10IA64Generator.h @@ -30,8 +30,5 @@ public: /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); - - virtual void EnableLanguage(std::vectorconst& languages, - cmMakefile *, bool optional); }; #endif diff --git a/Source/cmGlobalVisualStudio10Win64Generator.cxx b/Source/cmGlobalVisualStudio10Win64Generator.cxx index 0352a46f5..93b5a6409 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio10Win64Generator.cxx @@ -28,16 +28,3 @@ void cmGlobalVisualStudio10Win64Generator entry.Brief = "Generates Visual Studio 10 Win64 project files."; entry.Full = ""; } - -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio10Win64Generator -::EnableLanguage(std::vector const& languages, - cmMakefile* mf, bool optional) -{ - if(this->IsExpressEdition() && !this->Find64BitTools(mf)) - { - return; - } - this->cmGlobalVisualStudio10Generator - ::EnableLanguage(languages, mf, optional); -} diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h index 30b2164cc..59a34f43d 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.h +++ b/Source/cmGlobalVisualStudio10Win64Generator.h @@ -30,8 +30,5 @@ public: /** Get the documentation entry for this generator. */ static void GetDocumentation(cmDocumentationEntry& entry); - - virtual void EnableLanguage(std::vectorconst& languages, - cmMakefile *, bool optional); }; #endif From 75ebebc39c93aab4d3a0c03560d2c9db82b574f4 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 19 Nov 2012 19:05:55 +0100 Subject: [PATCH 10/10] VS: Remove platform specific generator files Move the whole logic into the base class and the factory. --- Source/CMakeLists.txt | 14 ---- Source/cmGlobalVisualStudio10Generator.cxx | 64 ++++++++++++++++--- Source/cmGlobalVisualStudio10Generator.h | 15 ++--- .../cmGlobalVisualStudio10IA64Generator.cxx | 30 --------- Source/cmGlobalVisualStudio10IA64Generator.h | 34 ---------- .../cmGlobalVisualStudio10Win64Generator.cxx | 30 --------- Source/cmGlobalVisualStudio10Win64Generator.h | 34 ---------- Source/cmGlobalVisualStudio11ARMGenerator.cxx | 29 --------- Source/cmGlobalVisualStudio11ARMGenerator.h | 34 ---------- Source/cmGlobalVisualStudio11Generator.cxx | 64 ++++++++++++++++--- Source/cmGlobalVisualStudio11Generator.h | 17 ++--- .../cmGlobalVisualStudio11Win64Generator.cxx | 30 --------- Source/cmGlobalVisualStudio11Win64Generator.h | 34 ---------- Source/cmGlobalVisualStudio8Generator.cxx | 55 +++++++++++++++- Source/cmGlobalVisualStudio8Generator.h | 16 +++-- .../cmGlobalVisualStudio8Win64Generator.cxx | 33 ---------- Source/cmGlobalVisualStudio8Win64Generator.h | 40 ------------ Source/cmGlobalVisualStudio9Generator.cxx | 63 +++++++++++++++--- Source/cmGlobalVisualStudio9Generator.h | 17 ++--- Source/cmGlobalVisualStudio9IA64Generator.cxx | 30 --------- Source/cmGlobalVisualStudio9IA64Generator.h | 40 ------------ .../cmGlobalVisualStudio9Win64Generator.cxx | 30 --------- Source/cmGlobalVisualStudio9Win64Generator.h | 40 ------------ Source/cmake.cxx | 21 ------ 24 files changed, 238 insertions(+), 576 deletions(-) delete mode 100644 Source/cmGlobalVisualStudio10IA64Generator.cxx delete mode 100644 Source/cmGlobalVisualStudio10IA64Generator.h delete mode 100644 Source/cmGlobalVisualStudio10Win64Generator.cxx delete mode 100644 Source/cmGlobalVisualStudio10Win64Generator.h delete mode 100644 Source/cmGlobalVisualStudio11ARMGenerator.cxx delete mode 100644 Source/cmGlobalVisualStudio11ARMGenerator.h delete mode 100644 Source/cmGlobalVisualStudio11Win64Generator.cxx delete mode 100644 Source/cmGlobalVisualStudio11Win64Generator.h delete mode 100644 Source/cmGlobalVisualStudio8Win64Generator.cxx delete mode 100644 Source/cmGlobalVisualStudio8Win64Generator.h delete mode 100644 Source/cmGlobalVisualStudio9IA64Generator.cxx delete mode 100644 Source/cmGlobalVisualStudio9IA64Generator.h delete mode 100644 Source/cmGlobalVisualStudio9Win64Generator.cxx delete mode 100644 Source/cmGlobalVisualStudio9Win64Generator.h diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 7bf167818..fa174bc2f 100644 --- a/Source/CMakeLists.txt +++ b/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 diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index db363bf7e..c218c97ec 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/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& 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::vectorconst & lang, diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index c08424259..b377a203d 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -24,10 +24,9 @@ class cmGlobalVisualStudio10Generator : public cmGlobalVisualStudio8Generator { public: - cmGlobalVisualStudio10Generator(); - static cmGlobalGeneratorFactory* NewFactory() { - return new cmGlobalGeneratorSimpleFactory - (); } + 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) {} diff --git a/Source/cmGlobalVisualStudio10IA64Generator.cxx b/Source/cmGlobalVisualStudio10IA64Generator.cxx deleted file mode 100644 index 08a2e7a21..000000000 --- a/Source/cmGlobalVisualStudio10IA64Generator.cxx +++ /dev/null @@ -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 = ""; -} diff --git a/Source/cmGlobalVisualStudio10IA64Generator.h b/Source/cmGlobalVisualStudio10IA64Generator.h deleted file mode 100644 index 2bf76592b..000000000 --- a/Source/cmGlobalVisualStudio10IA64Generator.h +++ /dev/null @@ -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 - (); } - - ///! 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 diff --git a/Source/cmGlobalVisualStudio10Win64Generator.cxx b/Source/cmGlobalVisualStudio10Win64Generator.cxx deleted file mode 100644 index 93b5a6409..000000000 --- a/Source/cmGlobalVisualStudio10Win64Generator.cxx +++ /dev/null @@ -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 = ""; -} diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h deleted file mode 100644 index 59a34f43d..000000000 --- a/Source/cmGlobalVisualStudio10Win64Generator.h +++ /dev/null @@ -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 - (); } - - ///! 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 diff --git a/Source/cmGlobalVisualStudio11ARMGenerator.cxx b/Source/cmGlobalVisualStudio11ARMGenerator.cxx deleted file mode 100644 index b1b06818e..000000000 --- a/Source/cmGlobalVisualStudio11ARMGenerator.cxx +++ /dev/null @@ -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 = ""; -} diff --git a/Source/cmGlobalVisualStudio11ARMGenerator.h b/Source/cmGlobalVisualStudio11ARMGenerator.h deleted file mode 100644 index 8ca013f16..000000000 --- a/Source/cmGlobalVisualStudio11ARMGenerator.h +++ /dev/null @@ -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 - (); } - - ///! 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 diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 1f4693aac..ba30e18cb 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/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& 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 = ""; -} diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index 0af273707..8898c5d24 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -20,21 +20,12 @@ class cmGlobalVisualStudio11Generator: public cmGlobalVisualStudio10Generator { public: - cmGlobalVisualStudio11Generator(); - static cmGlobalGeneratorFactory* NewFactory() { - return new cmGlobalGeneratorSimpleFactory - (); } - - ///! 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 diff --git a/Source/cmGlobalVisualStudio11Win64Generator.cxx b/Source/cmGlobalVisualStudio11Win64Generator.cxx deleted file mode 100644 index aca0a4e87..000000000 --- a/Source/cmGlobalVisualStudio11Win64Generator.cxx +++ /dev/null @@ -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 = ""; -} diff --git a/Source/cmGlobalVisualStudio11Win64Generator.h b/Source/cmGlobalVisualStudio11Win64Generator.h deleted file mode 100644 index 515b2a765..000000000 --- a/Source/cmGlobalVisualStudio11Win64Generator.h +++ /dev/null @@ -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 - (); } - - ///! 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 diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 17f1c3785..7aad9b2ba 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/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& names) const { + names.push_back(vs8Win32generatorName); + names.push_back(vs8Win64generatorName); } +}; + //---------------------------------------------------------------------------- -cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() +cmGlobalGeneratorFactory* cmGlobalVisualStudio8Generator::NewFactory() +{ + return new Factory; +} + +//---------------------------------------------------------------------------- +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; + } } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 097b796cf..7b8f25489 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -23,15 +23,12 @@ class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator { public: - cmGlobalVisualStudio8Generator(); - static cmGlobalGeneratorFactory* NewFactory() { - return new cmGlobalGeneratorSimpleFactory - (); } + 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 diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx deleted file mode 100644 index a84e44c9b..000000000 --- a/Source/cmGlobalVisualStudio8Win64Generator.cxx +++ /dev/null @@ -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 = ""; -} diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h deleted file mode 100644 index 2ff2dd08c..000000000 --- a/Source/cmGlobalVisualStudio8Win64Generator.h +++ /dev/null @@ -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 - (); } - - ///! 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 diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index d12d6ee4c..87599efd3 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/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; + } -cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator() + 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."; + } + + virtual void GetGenerators(std::vector& 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::vectorconst & lang, diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h index 5da587b49..f05d3773d 100644 --- a/Source/cmGlobalVisualStudio9Generator.h +++ b/Source/cmGlobalVisualStudio9Generator.h @@ -24,18 +24,9 @@ class cmGlobalVisualStudio9Generator : public cmGlobalVisualStudio8Generator { public: - cmGlobalVisualStudio9Generator(); - static cmGlobalGeneratorFactory* NewFactory() { - return new cmGlobalGeneratorSimpleFactory - (); } - - ///! 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 diff --git a/Source/cmGlobalVisualStudio9IA64Generator.cxx b/Source/cmGlobalVisualStudio9IA64Generator.cxx deleted file mode 100644 index 6b0ed600f..000000000 --- a/Source/cmGlobalVisualStudio9IA64Generator.cxx +++ /dev/null @@ -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 = ""; -} diff --git a/Source/cmGlobalVisualStudio9IA64Generator.h b/Source/cmGlobalVisualStudio9IA64Generator.h deleted file mode 100644 index 7af61e796..000000000 --- a/Source/cmGlobalVisualStudio9IA64Generator.h +++ /dev/null @@ -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 - (); } - - ///! 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 diff --git a/Source/cmGlobalVisualStudio9Win64Generator.cxx b/Source/cmGlobalVisualStudio9Win64Generator.cxx deleted file mode 100644 index 37288b693..000000000 --- a/Source/cmGlobalVisualStudio9Win64Generator.cxx +++ /dev/null @@ -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 = ""; -} diff --git a/Source/cmGlobalVisualStudio9Win64Generator.h b/Source/cmGlobalVisualStudio9Win64Generator.h deleted file mode 100644 index c6b74a0e7..000000000 --- a/Source/cmGlobalVisualStudio9Win64Generator.h +++ /dev/null @@ -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 - (); } - - ///! 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 diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 3eda86d65..1ec88fb86 100644 --- a/Source/cmake.cxx +++ b/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(