diff options
author | Brad King <brad.king@kitware.com> | 2014-11-17 14:40:51 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-11-17 14:40:51 (GMT) |
commit | e943fa8a19a1fbe190e6fe0591d2b509e07b9878 (patch) | |
tree | 074f1f8c35e11d087b053deac690c77c2ac21c55 /Source | |
parent | c61efbd684337bafc6388a3e4daff23492d9992d (diff) | |
parent | f5afb90d7c0ff756dedc3d473c0fb60dee004d82 (diff) | |
download | CMake-e943fa8a19a1fbe190e6fe0591d2b509e07b9878.zip CMake-e943fa8a19a1fbe190e6fe0591d2b509e07b9878.tar.gz CMake-e943fa8a19a1fbe190e6fe0591d2b509e07b9878.tar.bz2 |
Merge topic 'vs14-is-2015'
f5afb90d VS: Rename VS 14 generator to 'Visual Studio 14 2015'
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio14Generator.cxx | 40 | ||||
-rw-r--r-- | Source/cmake.cxx | 2 |
2 files changed, 31 insertions, 11 deletions
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index d001f93..fe702c0 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -13,21 +13,36 @@ #include "cmLocalVisualStudio10Generator.h" #include "cmMakefile.h" -static const char vs14generatorName[] = "Visual Studio 14"; +static const char vs14generatorName[] = "Visual Studio 14 2015"; + +// Map generator name without year to name with year. +static const char* cmVS14GenName(const std::string& name, std::string& genName) +{ + if(strncmp(name.c_str(), vs14generatorName, + sizeof(vs14generatorName)-6) != 0) + { + return 0; + } + const char* p = name.c_str() + sizeof(vs14generatorName) - 6; + if(cmHasLiteralPrefix(p, " 2015")) + { + p += 5; + } + genName = std::string(vs14generatorName) + p; + return p; +} class cmGlobalVisualStudio14Generator::Factory : public cmGlobalGeneratorFactory { public: virtual cmGlobalGenerator* CreateGlobalGenerator( - const std::string& genName) const + const std::string& name) const { - if(strncmp(genName.c_str(), vs14generatorName, - sizeof(vs14generatorName) - 1) != 0) - { - return 0; - } - const char* p = genName.c_str() + sizeof(vs14generatorName) - 1; + std::string genName; + const char* p = cmVS14GenName(name, genName); + if(!p) + { return 0; } if(!*p) { return new cmGlobalVisualStudio14Generator( @@ -51,7 +66,7 @@ public: virtual void GetDocumentation(cmDocumentationEntry& entry) const { entry.Name = vs14generatorName; - entry.Brief = "Generates Visual Studio 14 project files."; + entry.Brief = "Generates Visual Studio 14 (VS 2015) project files."; } virtual void GetGenerators(std::vector<std::string>& names) const @@ -85,7 +100,12 @@ bool cmGlobalVisualStudio14Generator::MatchesGeneratorName( const std::string& name) const { - return name == this->GetName(); + std::string genName; + if(cmVS14GenName(name, genName)) + { + return genName == this->GetName(); + } + return false; } //---------------------------------------------------------------------------- diff --git a/Source/cmake.cxx b/Source/cmake.cxx index dc1b113..fb04376 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1401,7 +1401,7 @@ int cmake::ActualConfigure() {"10.0", "Visual Studio 10 2010"}, {"11.0", "Visual Studio 11 2012"}, {"12.0", "Visual Studio 12 2013"}, - {"14.0", "Visual Studio 14"}, + {"14.0", "Visual Studio 14 2015"}, {0, 0}}; for(int i=0; version[i].MSVersion != 0; i++) { |