summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio8Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-11-20 16:48:05 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-11-20 16:48:05 (GMT)
commitd82200df2652c913244ba09c15e9059ef1048aa2 (patch)
treef6c3a610e48f2be5a822f9d6ee77c699bf079156 /Source/cmGlobalVisualStudio8Generator.cxx
parent9e73b3a09536aa818793810cb083313b5750db78 (diff)
parent75ebebc39c93aab4d3a0c03560d2c9db82b574f4 (diff)
downloadCMake-d82200df2652c913244ba09c15e9059ef1048aa2.zip
CMake-d82200df2652c913244ba09c15e9059ef1048aa2.tar.gz
CMake-d82200df2652c913244ba09c15e9059ef1048aa2.tar.bz2
Merge topic 'generator-factory'
75ebebc VS: Remove platform specific generator files 8b62080 VS: Remove EnableLanguage from platform-specific generators 5bdf011 VS: Remove GetPlatformName from platform-specific generators 8d42ab4 VS: Fix ArchitectureId of Visual Studio 10 IA64 generator 6f439b3 VS: Remove AddPlatformDefinitions from platform-specific generators 5170a88 Make cmGlobalGenerator::GetDocumentation() a static function 04ff866 Allow a GeneratorFactory handling of more than one generator 984ebc3 Search generator in cmake::ExtraGenerators before in cmake::Generators 30a6950 Add cmGlobalGeneratorFactory::GetGenerators() e8f8414 Introduce the abstract class cmGlobalGeneratorFactory
Diffstat (limited to 'Source/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx69
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 = "";
}