diff options
Diffstat (limited to 'Source/cmGlobalVisualStudio11Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.cxx | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 1f0c47a..fa134fc 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -16,13 +16,14 @@ static const char vs11generatorName[] = "Visual Studio 11 2012"; // Map generator name without year to name with year. -static const char* cmVS11GenName(const char* name, std::string& genName) +static const char* cmVS11GenName(const std::string& name, std::string& genName) { - if(strncmp(name, vs11generatorName, sizeof(vs11generatorName)-6) != 0) + if(strncmp(name.c_str(), vs11generatorName, + sizeof(vs11generatorName)-6) != 0) { return 0; } - const char* p = name + sizeof(vs11generatorName) - 6; + const char* p = name.c_str() + sizeof(vs11generatorName) - 6; if(cmHasLiteralPrefix(p, " 2012")) { p += 5; @@ -35,32 +36,29 @@ class cmGlobalVisualStudio11Generator::Factory : public cmGlobalGeneratorFactory { public: - virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const + virtual cmGlobalGenerator* CreateGlobalGenerator( + const std::string& name) const { std::string genName; const char* p = cmVS11GenName(name, genName); if(!p) { return 0; } - name = genName.c_str(); - if(strcmp(p, "") == 0) + if(!*p) { return new cmGlobalVisualStudio11Generator( - name, NULL, NULL); + genName, "", ""); } - if(strcmp(p, " Win64") == 0) + if(*p++ != ' ') + { return 0; } + if(strcmp(p, "Win64") == 0) { return new cmGlobalVisualStudio11Generator( - name, "x64", "CMAKE_FORCE_WIN64"); + genName, "x64", "CMAKE_FORCE_WIN64"); } - if(strcmp(p, " ARM") == 0) + if(strcmp(p, "ARM") == 0) { return new cmGlobalVisualStudio11Generator( - name, "ARM", NULL); - } - - if(*p++ != ' ') - { - return 0; + genName, "ARM", ""); } std::set<std::string> installedSDKs = @@ -107,8 +105,8 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory() //---------------------------------------------------------------------------- cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator( - const char* name, const char* platformName, - const char* additionalPlatformDefinition) + const std::string& name, const std::string& platformName, + const std::string& additionalPlatformDefinition) : cmGlobalVisualStudio10Generator(name, platformName, additionalPlatformDefinition) { @@ -116,12 +114,13 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator( this->ExpressEdition = cmSystemTools::ReadRegistryValue( "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0\\Setup\\VC;" "ProductDir", vc11Express, cmSystemTools::KeyWOW64_32); - this->PlatformToolset = "v110"; + this->DefaultPlatformToolset = "v110"; } //---------------------------------------------------------------------------- bool -cmGlobalVisualStudio11Generator::MatchesGeneratorName(const char* name) const +cmGlobalVisualStudio11Generator::MatchesGeneratorName( + const std::string& name) const { std::string genName; if(cmVS11GenName(name, genName)) |