diff options
author | Brad King <brad.king@kitware.com> | 2013-07-01 13:27:33 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-07-01 13:27:33 (GMT) |
commit | 8a08ab051a4162539356bdcbc5e7900a84c5816a (patch) | |
tree | c48515a753d710a3b65e7d4e53e7f0e218b63221 /Source/cmGlobalVisualStudio12Generator.cxx | |
parent | 526f1e636ef206f91d04f070f1598cc1c9746e6f (diff) | |
parent | 9a76d83f6d567516fcfd63ce778072ab4d5c766a (diff) | |
download | CMake-8a08ab051a4162539356bdcbc5e7900a84c5816a.zip CMake-8a08ab051a4162539356bdcbc5e7900a84c5816a.tar.gz CMake-8a08ab051a4162539356bdcbc5e7900a84c5816a.tar.bz2 |
Merge topic 'vs12-generator'
9a76d83 VS12: Find proper MSBuild for VSProjectInSubdir test
4e5cb39 Merge branch 'master' into vs12-generator
78fdbbc FindBoost: Add -vc120 mangling for VS 12
e99d7b1 VS12: Generate flag tables from MSBuild v120 tool files
77ac9b8 VS12: Add Visual Studio 12 generator (#14251)
Diffstat (limited to 'Source/cmGlobalVisualStudio12Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio12Generator.cxx | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx new file mode 100644 index 0000000..6468b9a --- /dev/null +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -0,0 +1,111 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2011 Kitware, Inc., Insight Software Consortium + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ +#include "cmGlobalVisualStudio12Generator.h" +#include "cmLocalVisualStudio10Generator.h" +#include "cmMakefile.h" + +static const char vs12Win32generatorName[] = "Visual Studio 12"; +static const char vs12Win64generatorName[] = "Visual Studio 12 Win64"; +static const char vs12ARMgeneratorName[] = "Visual Studio 12 ARM"; + +class cmGlobalVisualStudio12Generator::Factory + : public cmGlobalGeneratorFactory +{ +public: + virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const { + if(!strcmp(name, vs12Win32generatorName)) + { + return new cmGlobalVisualStudio12Generator( + vs12Win32generatorName, NULL, NULL); + } + if(!strcmp(name, vs12Win64generatorName)) + { + return new cmGlobalVisualStudio12Generator( + vs12Win64generatorName, "x64", "CMAKE_FORCE_WIN64"); + } + if(!strcmp(name, vs12ARMgeneratorName)) + { + return new cmGlobalVisualStudio12Generator( + vs12ARMgeneratorName, "ARM", NULL); + } + return 0; + } + + virtual void GetDocumentation(cmDocumentationEntry& entry) const { + entry.Name = "Visual Studio 12"; + entry.Brief = "Generates Visual Studio 12 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 12 Win64\" will create project files for " + "the x64 processor; \"Visual Studio 12 ARM\" for ARM."; + } + + virtual void GetGenerators(std::vector<std::string>& names) const { + names.push_back(vs12Win32generatorName); + names.push_back(vs12Win64generatorName); + names.push_back(vs12ARMgeneratorName); } +}; + +//---------------------------------------------------------------------------- +cmGlobalGeneratorFactory* cmGlobalVisualStudio12Generator::NewFactory() +{ + return new Factory; +} + +//---------------------------------------------------------------------------- +cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator( + const char* name, const char* architectureId, + const char* additionalPlatformDefinition) + : cmGlobalVisualStudio11Generator(name, architectureId, + additionalPlatformDefinition) +{ + this->FindMakeProgramFile = "CMakeVS12FindMake.cmake"; + std::string vc12Express; + this->ExpressEdition = cmSystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\12.0\\Setup\\VC;" + "ProductDir", vc12Express, cmSystemTools::KeyWOW64_32); + this->PlatformToolset = "v120"; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio12Generator::WriteSLNHeader(std::ostream& fout) +{ + fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n"; + if (this->ExpressEdition) + { + fout << "# Visual Studio Express 2013 for Windows Desktop\n"; + } + else + { + fout << "# Visual Studio 2013\n"; + } +} + +//---------------------------------------------------------------------------- +cmLocalGenerator *cmGlobalVisualStudio12Generator::CreateLocalGenerator() +{ + cmLocalVisualStudio10Generator* lg = + new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS12); + lg->SetPlatformName(this->GetPlatformName()); + lg->SetGlobalGenerator(this); + return lg; +} + +//---------------------------------------------------------------------------- +bool cmGlobalVisualStudio12Generator::UseFolderProperty() +{ + // Intentionally skip over the parent class implementation and call the + // grand-parent class's implementation. Folders are not supported by the + // Express editions in VS10 and earlier, but they are in VS12 Express. + return cmGlobalVisualStudio8Generator::UseFolderProperty(); +} |