diff options
author | Patrick Gansterer <paroga@paroga.com> | 2012-11-19 18:05:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-11-19 19:56:29 (GMT) |
commit | 75ebebc39c93aab4d3a0c03560d2c9db82b574f4 (patch) | |
tree | 1f907d6b876986d0c73c7d9d5f34edaddb5126bf /Source/cmGlobalVisualStudio9Generator.cxx | |
parent | 8b62080c9db6a15649bd1673179076c096e26bec (diff) | |
download | CMake-75ebebc39c93aab4d3a0c03560d2c9db82b574f4.zip CMake-75ebebc39c93aab4d3a0c03560d2c9db82b574f4.tar.gz CMake-75ebebc39c93aab4d3a0c03560d2c9db82b574f4.tar.bz2 |
VS: Remove platform specific generator files
Move the whole logic into the base class and the factory.
Diffstat (limited to 'Source/cmGlobalVisualStudio9Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio9Generator.cxx | 63 |
1 files changed, 53 insertions, 10 deletions
diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index d12d6ee..87599ef 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; + } + + virtual void GetDocumentation(cmDocumentationEntry& entry) const { + entry.Name = "Visual Studio 9 2008"; + entry.Brief = "Generates Visual Studio 9 2008 project files."; + entry.Full = + "It is possible to append a space followed by the platform name " + "to create project files for a specific target platform. E.g. " + "\"Visual Studio 9 2008 Win64\" will create project files for " + "the x64 processor; \"Visual Studio 9 2008 IA64\" for Itanium."; + } -cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator() + virtual void GetGenerators(std::vector<std::string>& names) const { + names.push_back(vs9Win32generatorName); + names.push_back(vs9Win64generatorName); + names.push_back(vs9IA64generatorName); } +}; + +//---------------------------------------------------------------------------- +cmGlobalGeneratorFactory* cmGlobalVisualStudio9Generator::NewFactory() +{ + return new Factory; +} + +//---------------------------------------------------------------------------- +cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator( + const char* name, const char* architectureId, + const char* additionalPlatformDefinition) + : cmGlobalVisualStudio8Generator(name, architectureId, + additionalPlatformDefinition) { this->FindMakeProgramFile = "CMakeVS9FindMake.cmake"; } @@ -42,15 +94,6 @@ cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio9Generator -::GetDocumentation(cmDocumentationEntry& entry) -{ - entry.Name = cmGlobalVisualStudio9Generator::GetActualName(); - entry.Brief = "Generates Visual Studio 9 2008 project files."; - entry.Full = ""; -} - -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio9Generator ::EnableLanguage(std::vector<std::string>const & lang, cmMakefile *mf, bool optional) { |