diff options
Diffstat (limited to 'Source/cmGlobalVisualStudio9Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio9Generator.cxx | 99 |
1 files changed, 89 insertions, 10 deletions
diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index 70af50d..2082384 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -13,11 +13,99 @@ #include "cmGlobalVisualStudio9Generator.h" #include "cmLocalVisualStudio7Generator.h" #include "cmMakefile.h" +#include "cmVisualStudioWCEPlatformParser.h" #include "cmake.h" +static const char vs9generatorName[] = "Visual Studio 9 2008"; +class cmGlobalVisualStudio9Generator::Factory + : public cmGlobalGeneratorFactory +{ +public: + virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const { + if(strstr(name, vs9generatorName) != name) + { + return 0; + } + + const char* p = name + sizeof(vs9generatorName) - 1; + if(p[0] == '\0') + { + return new cmGlobalVisualStudio9Generator( + name, NULL, NULL); + } + + if(p[0] != ' ') + { + return 0; + } + + ++p; + + if(!strcmp(p, "IA64")) + { + return new cmGlobalVisualStudio9Generator( + name, "Itanium", "CMAKE_FORCE_IA64"); + } + + if(!strcmp(p, "Win64")) + { + return new cmGlobalVisualStudio9Generator( + name, "x64", "CMAKE_FORCE_WIN64"); + } + + cmVisualStudioWCEPlatformParser parser(p); + parser.ParseVersion("9.0"); + if (!parser.Found()) + { + return 0; + } + + cmGlobalVisualStudio9Generator* ret = new cmGlobalVisualStudio9Generator( + name, parser.GetArchitectureFamily(), NULL); + ret->PlatformName = p; + ret->WindowsCEVersion = parser.GetOSVersion(); + return ret; + } + + virtual void GetDocumentation(cmDocumentationEntry& entry) const { + entry.Name = vs9generatorName; + 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<std::string>& names) const { + names.push_back(vs9generatorName); + names.push_back(vs9generatorName + std::string(" Win64")); + names.push_back(vs9generatorName + std::string(" IA64")); + cmVisualStudioWCEPlatformParser parser; + parser.ParseVersion("9.0"); + const std::vector<std::string>& availablePlatforms = + parser.GetAvailablePlatforms(); + for(std::vector<std::string>::const_iterator i = + availablePlatforms.begin(); i != availablePlatforms.end(); ++i) + { + names.push_back("Visual Studio 9 2008 " + *i); + } + } +}; -cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator() +//---------------------------------------------------------------------------- +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 +130,6 @@ cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio9Generator -::GetDocumentation(cmDocumentationEntry& entry) const -{ - entry.Name = this->GetName(); - entry.Brief = "Generates Visual Studio 9 2008 project files."; - entry.Full = ""; -} - -//---------------------------------------------------------------------------- -void cmGlobalVisualStudio9Generator ::EnableLanguage(std::vector<std::string>const & lang, cmMakefile *mf, bool optional) { |