diff options
Diffstat (limited to 'Source/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 69 |
1 files changed, 66 insertions, 3 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index c3ec3f2..855727b 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -16,11 +16,74 @@ #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; + } +} + +//---------------------------------------------------------------------------- +const char* cmGlobalVisualStudio8Generator::GetPlatformName() const +{ + if (!strcmp(this->ArchitectureId, "X86")) + { + return "Win32"; + } + return this->ArchitectureId; } //---------------------------------------------------------------------------- @@ -45,9 +108,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 = ""; } |