summaryrefslogtreecommitdiffstats
path: root/Source/cmAddExecutableCommand.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/cmAddExecutableCommand.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/cmAddExecutableCommand.cxx')
-rw-r--r--Source/cmAddExecutableCommand.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index 62b6667..6e48e90 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -101,7 +101,7 @@ bool cmAddExecutableCommand
"\" is reserved or not valid for certain "
"CMake features, such as generator expressions, and may result "
"in undefined behavior.";
- this->Makefile->IssueMessage(messageType, e.str().c_str());
+ this->Makefile->IssueMessage(messageType, e.str());
if (messageType == cmake::FATAL_ERROR)
{
@@ -132,9 +132,9 @@ bool cmAddExecutableCommand
}
if (isAlias)
{
- if(!cmGeneratorExpression::IsValidTargetName(exename.c_str()))
+ if(!cmGeneratorExpression::IsValidTargetName(exename))
{
- this->SetError(("Invalid name for ALIAS: " + exename).c_str());
+ this->SetError("Invalid name for ALIAS: " + exename);
return false;
}
if(excludeFromAll)
@@ -151,7 +151,7 @@ bool cmAddExecutableCommand
{
cmOStringStream e;
e << "ALIAS requires exactly one target argument.";
- this->SetError(e.str().c_str());
+ this->SetError(e.str());
return false;
}
@@ -161,7 +161,7 @@ bool cmAddExecutableCommand
cmOStringStream e;
e << "cannot create ALIAS target \"" << exename
<< "\" because target \"" << aliasedName << "\" is itself an ALIAS.";
- this->SetError(e.str().c_str());
+ this->SetError(e.str());
return false;
}
cmTarget *aliasedTarget =
@@ -172,7 +172,7 @@ bool cmAddExecutableCommand
e << "cannot create ALIAS target \"" << exename
<< "\" because target \"" << aliasedName << "\" does not already "
"exist.";
- this->SetError(e.str().c_str());
+ this->SetError(e.str());
return false;
}
cmTarget::TargetType type = aliasedTarget->GetType();
@@ -182,7 +182,7 @@ bool cmAddExecutableCommand
e << "cannot create ALIAS target \"" << exename
<< "\" because target \"" << aliasedName << "\" is not an "
"executable.";
- this->SetError(e.str().c_str());
+ this->SetError(e.str());
return false;
}
if(aliasedTarget->IsImported())
@@ -190,10 +190,10 @@ bool cmAddExecutableCommand
cmOStringStream e;
e << "cannot create ALIAS target \"" << exename
<< "\" because target \"" << aliasedName << "\" is IMPORTED.";
- this->SetError(e.str().c_str());
+ this->SetError(e.str());
return false;
}
- this->Makefile->AddAlias(exename.c_str(), aliasedTarget);
+ this->Makefile->AddAlias(exename, aliasedTarget);
return true;
}
@@ -206,12 +206,12 @@ bool cmAddExecutableCommand
cmOStringStream e;
e << "cannot create imported target \"" << exename
<< "\" because another target with the same name already exists.";
- this->SetError(e.str().c_str());
+ this->SetError(e.str());
return false;
}
// Create the imported target.
- this->Makefile->AddImportedTarget(exename.c_str(), cmTarget::EXECUTABLE,
+ this->Makefile->AddImportedTarget(exename, cmTarget::EXECUTABLE,
importGlobal);
return true;
}
@@ -221,7 +221,7 @@ bool cmAddExecutableCommand
std::string msg;
if(!this->Makefile->EnforceUniqueName(exename, msg))
{
- this->SetError(msg.c_str());
+ this->SetError(msg);
return false;
}
}