summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio11Generator.cxx
diff options
context:
space:
mode:
authorPatrick Gansterer <paroga@paroga.com>2012-11-19 18:05:55 (GMT)
committerBrad King <brad.king@kitware.com>2012-11-19 19:56:29 (GMT)
commit75ebebc39c93aab4d3a0c03560d2c9db82b574f4 (patch)
tree1f907d6b876986d0c73c7d9d5f34edaddb5126bf /Source/cmGlobalVisualStudio11Generator.cxx
parent8b62080c9db6a15649bd1673179076c096e26bec (diff)
downloadCMake-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/cmGlobalVisualStudio11Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx64
1 files changed, 54 insertions, 10 deletions
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index 1f4693a..ba30e18 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -13,8 +13,61 @@
#include "cmLocalVisualStudio10Generator.h"
#include "cmMakefile.h"
+static const char vs11Win32generatorName[] = "Visual Studio 11";
+static const char vs11Win64generatorName[] = "Visual Studio 11 Win64";
+static const char vs11ARMgeneratorName[] = "Visual Studio 11 ARM";
+
+class cmGlobalVisualStudio11Generator::Factory
+ : public cmGlobalGeneratorFactory
+{
+public:
+ virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
+ if(!strcmp(name, vs11Win32generatorName))
+ {
+ return new cmGlobalVisualStudio11Generator(
+ vs11Win32generatorName, NULL, NULL);
+ }
+ if(!strcmp(name, vs11Win64generatorName))
+ {
+ return new cmGlobalVisualStudio11Generator(
+ vs11Win64generatorName, "x64", "CMAKE_FORCE_WIN64");
+ }
+ if(!strcmp(name, vs11ARMgeneratorName))
+ {
+ return new cmGlobalVisualStudio11Generator(
+ vs11ARMgeneratorName, "ARM", NULL);
+ }
+ return 0;
+ }
+
+ virtual void GetDocumentation(cmDocumentationEntry& entry) const {
+ entry.Name = "Visual Studio 11";
+ entry.Brief = "Generates Visual Studio 11 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 11 Win64\" will create project files for "
+ "the x64 processor; \"Visual Studio 11 ARM\" for ARM.";
+ }
+
+ virtual void GetGenerators(std::vector<std::string>& names) const {
+ names.push_back(vs11Win32generatorName);
+ names.push_back(vs11Win64generatorName);
+ names.push_back(vs11ARMgeneratorName); }
+};
+
//----------------------------------------------------------------------------
-cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator()
+cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory()
+{
+ return new Factory;
+}
+
+//----------------------------------------------------------------------------
+cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
+ const char* name, const char* architectureId,
+ const char* additionalPlatformDefinition)
+ : cmGlobalVisualStudio10Generator(name, architectureId,
+ additionalPlatformDefinition)
{
this->FindMakeProgramFile = "CMakeVS11FindMake.cmake";
std::string vc11Express;
@@ -40,12 +93,3 @@ cmLocalGenerator *cmGlobalVisualStudio11Generator::CreateLocalGenerator()
lg->SetGlobalGenerator(this);
return lg;
}
-
-//----------------------------------------------------------------------------
-void cmGlobalVisualStudio11Generator
-::GetDocumentation(cmDocumentationEntry& entry)
-{
- entry.Name = cmGlobalVisualStudio11Generator::GetActualName();
- entry.Brief = "Generates Visual Studio 11 project files.";
- entry.Full = "";
-}