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/cmGlobalVisualStudio8Generator.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/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 17f1c37..7aad9b2 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<std::string>& names) const { + names.push_back(vs8Win32generatorName); + names.push_back(vs8Win64generatorName); } +}; + +//---------------------------------------------------------------------------- +cmGlobalGeneratorFactory* cmGlobalVisualStudio8Generator::NewFactory() +{ + return new Factory; +} + //---------------------------------------------------------------------------- -cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() +cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator( + const char* name, const char* architectureId, + const char* additionalPlatformDefinition) { this->FindMakeProgramFile = "CMakeVS8FindMake.cmake"; this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + this->Name = name; + if (architectureId) + { + this->ArchitectureId = architectureId; + } + if (additionalPlatformDefinition) + { + this->AdditionalPlatformDefinition = additionalPlatformDefinition; + } } //---------------------------------------------------------------------------- |