summaryrefslogtreecommitdiffstats
path: root/Source/cmProjectCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-10 23:04:11 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-03-11 14:03:50 (GMT)
commit21c573f682f9eafbc8d4402f7febbb1bec1cb86a (patch)
tree8c9e0b913c7de5737a770430064ff5533a19477d /Source/cmProjectCommand.cxx
parente21ffaf8fe5499426604b4ebb9cd08798ee6107c (diff)
downloadCMake-21c573f682f9eafbc8d4402f7febbb1bec1cb86a.zip
CMake-21c573f682f9eafbc8d4402f7febbb1bec1cb86a.tar.gz
CMake-21c573f682f9eafbc8d4402f7febbb1bec1cb86a.tar.bz2
Remove some c_str() calls.
Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
Diffstat (limited to 'Source/cmProjectCommand.cxx')
-rw-r--r--Source/cmProjectCommand.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index a9ce0cc..12318c8 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -28,20 +28,20 @@ bool cmProjectCommand
srcdir += "_SOURCE_DIR";
this->Makefile->AddCacheDefinition
- (bindir.c_str(),
+ (bindir,
this->Makefile->GetCurrentOutputDirectory(),
"Value Computed by CMake", cmCacheManager::STATIC);
this->Makefile->AddCacheDefinition
- (srcdir.c_str(),
+ (srcdir,
this->Makefile->GetCurrentDirectory(),
"Value Computed by CMake", cmCacheManager::STATIC);
bindir = "PROJECT_BINARY_DIR";
srcdir = "PROJECT_SOURCE_DIR";
- this->Makefile->AddDefinition(bindir.c_str(),
+ this->Makefile->AddDefinition(bindir,
this->Makefile->GetCurrentOutputDirectory());
- this->Makefile->AddDefinition(srcdir.c_str(),
+ this->Makefile->AddDefinition(srcdir,
this->Makefile->GetCurrentDirectory());
this->Makefile->AddDefinition("PROJECT_NAME", args[0].c_str());
@@ -167,19 +167,19 @@ bool cmProjectCommand
std::string vv;
vv = args[0] + "_VERSION";
this->Makefile->AddDefinition("PROJECT_VERSION", vs.c_str());
- this->Makefile->AddDefinition(vv.c_str(), vs.c_str());
+ this->Makefile->AddDefinition(vv, vs.c_str());
vv = args[0] + "_VERSION_MAJOR";
this->Makefile->AddDefinition("PROJECT_VERSION_MAJOR", vb[0]);
- this->Makefile->AddDefinition(vv.c_str(), vb[0]);
+ this->Makefile->AddDefinition(vv, vb[0]);
vv = args[0] + "_VERSION_MINOR";
this->Makefile->AddDefinition("PROJECT_VERSION_MINOR", vb[1]);
- this->Makefile->AddDefinition(vv.c_str(), vb[1]);
+ this->Makefile->AddDefinition(vv, vb[1]);
vv = args[0] + "_VERSION_PATCH";
this->Makefile->AddDefinition("PROJECT_VERSION_PATCH", vb[2]);
- this->Makefile->AddDefinition(vv.c_str(), vb[2]);
+ this->Makefile->AddDefinition(vv, vb[2]);
vv = args[0] + "_VERSION_TWEAK";
this->Makefile->AddDefinition("PROJECT_VERSION_TWEAK", vb[3]);
- this->Makefile->AddDefinition(vv.c_str(), vb[3]);
+ this->Makefile->AddDefinition(vv, vb[3]);
}
else if(cmp0048 != cmPolicies::OLD)
{
@@ -199,7 +199,7 @@ bool cmProjectCommand
for(std::vector<std::string>::iterator i = vv.begin();
i != vv.end(); ++i)
{
- const char* v = this->Makefile->GetDefinition(i->c_str());
+ const char* v = this->Makefile->GetDefinition(*i);
if(v && *v)
{
if(cmp0048 == cmPolicies::WARN)
@@ -209,7 +209,7 @@ bool cmProjectCommand
}
else
{
- this->Makefile->AddDefinition(i->c_str(), "");
+ this->Makefile->AddDefinition(*i, "");
}
}
}
@@ -231,7 +231,7 @@ bool cmProjectCommand
}
this->Makefile->EnableLanguage(languages, false);
std::string extraInclude = "CMAKE_PROJECT_" + args[0] + "_INCLUDE";
- const char* include = this->Makefile->GetDefinition(extraInclude.c_str());
+ const char* include = this->Makefile->GetDefinition(extraInclude);
if(include)
{
std::string fullFilePath;
@@ -244,7 +244,7 @@ bool cmProjectCommand
"could not find file:\n"
" ";
m += include;
- this->SetError(m.c_str());
+ this->SetError(m);
return false;
}
}