summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio8Generator.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/cmGlobalVisualStudio8Generator.cxx
parent24b5e93de2c753e94cae3b41c1ca7cddaa03e5e7 (diff)
downloadCMake-1a1b737c99ac0bd0d555fde2fadf77f08516a4ea.zip
CMake-1a1b737c99ac0bd0d555fde2fadf77f08516a4ea.tar.gz
CMake-1a1b737c99ac0bd0d555fde2fadf77f08516a4ea.tar.bz2
stringapi: Use strings for generator names
Diffstat (limited to 'Source/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx29
1 files changed, 17 insertions, 12 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 2ae1bbc..08c1397 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -23,17 +23,19 @@ class cmGlobalVisualStudio8Generator::Factory
: public cmGlobalGeneratorFactory
{
public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const char* name) const {
- if(strstr(name, vs8generatorName) != name)
+ virtual cmGlobalGenerator* CreateGlobalGenerator(
+ const std::string& name) const {
+ if(strncmp(name.c_str(), vs8generatorName,
+ sizeof(vs8generatorName) - 1) != 0)
{
return 0;
}
- const char* p = name + sizeof(vs8generatorName) - 1;
+ const char* p = name.c_str() + sizeof(vs8generatorName) - 1;
if(p[0] == '\0')
{
return new cmGlobalVisualStudio8Generator(
- name, NULL, NULL);
+ name, "", "");
}
if(p[0] != ' ')
@@ -57,7 +59,7 @@ public:
}
cmGlobalVisualStudio8Generator* ret = new cmGlobalVisualStudio8Generator(
- name, p, NULL);
+ name, p, "");
ret->WindowsCEVersion = parser.GetOSVersion();
return ret;
}
@@ -90,14 +92,14 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio8Generator::NewFactory()
//----------------------------------------------------------------------------
cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
- const char* name, const char* platformName,
- const char* additionalPlatformDefinition)
+ const std::string& name, const std::string& platformName,
+ const std::string& additionalPlatformDefinition)
: cmGlobalVisualStudio71Generator(platformName)
{
this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
this->Name = name;
- if (additionalPlatformDefinition)
+ if (!additionalPlatformDefinition.empty())
{
this->AdditionalPlatformDefinition = additionalPlatformDefinition;
}
@@ -374,7 +376,7 @@ cmGlobalVisualStudio8Generator
::WriteProjectConfigurations(
std::ostream& fout, const std::string& name, cmTarget::TargetType type,
const std::set<std::string>& configsPartOfDefaultBuild,
- const char* platformMapping)
+ std::string const& platformMapping)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -382,7 +384,8 @@ cmGlobalVisualStudio8Generator
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->GetPlatformName() << ".ActiveCfg = " << *i << "|"
- << (platformMapping ? platformMapping : this->GetPlatformName())
+ << (!platformMapping.empty()?
+ platformMapping : this->GetPlatformName())
<< "\n";
std::set<std::string>::const_iterator
ci = configsPartOfDefaultBuild.find(*i);
@@ -390,7 +393,8 @@ cmGlobalVisualStudio8Generator
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->GetPlatformName() << ".Build.0 = " << *i << "|"
- << (platformMapping ? platformMapping : this->GetPlatformName())
+ << (!platformMapping.empty()?
+ platformMapping : this->GetPlatformName())
<< "\n";
}
bool needsDeploy = (type == cmTarget::EXECUTABLE ||
@@ -399,7 +403,8 @@ cmGlobalVisualStudio8Generator
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->GetPlatformName() << ".Deploy.0 = " << *i << "|"
- << (platformMapping ? platformMapping : this->GetPlatformName())
+ << (!platformMapping.empty()?
+ platformMapping : this->GetPlatformName())
<< "\n";
}
}