summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio11Generator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-02-24 22:36:27 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-08 18:05:38 (GMT)
commit1a1b737c99ac0bd0d555fde2fadf77f08516a4ea (patch)
tree552432238277036e6d3f846d87276db507cb949d /Source/cmGlobalVisualStudio11Generator.cxx
parent24b5e93de2c753e94cae3b41c1ca7cddaa03e5e7 (diff)
downloadCMake-1a1b737c99ac0bd0d555fde2fadf77f08516a4ea.zip
CMake-1a1b737c99ac0bd0d555fde2fadf77f08516a4ea.tar.gz
CMake-1a1b737c99ac0bd0d555fde2fadf77f08516a4ea.tar.bz2
stringapi: Use strings for generator names
Diffstat (limited to 'Source/cmGlobalVisualStudio11Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index 1f0c47a..4caa7f2 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,27 +36,27 @@ 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)
{
return new cmGlobalVisualStudio11Generator(
- name, NULL, NULL);
+ genName, "", "");
}
if(strcmp(p, " Win64") == 0)
{
return new cmGlobalVisualStudio11Generator(
- name, "x64", "CMAKE_FORCE_WIN64");
+ genName, "x64", "CMAKE_FORCE_WIN64");
}
if(strcmp(p, " ARM") == 0)
{
return new cmGlobalVisualStudio11Generator(
- name, "ARM", NULL);
+ genName, "ARM", "");
}
if(*p++ != ' ')
@@ -107,8 +108,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)
{
@@ -121,7 +122,8 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
//----------------------------------------------------------------------------
bool
-cmGlobalVisualStudio11Generator::MatchesGeneratorName(const char* name) const
+cmGlobalVisualStudio11Generator::MatchesGeneratorName(
+ const std::string& name) const
{
std::string genName;
if(cmVS11GenName(name, genName))