Commit 21c573f6 authored by Stephen Kelly's avatar Stephen Kelly

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.
parent e21ffaf8
......@@ -506,7 +506,7 @@ int cmCPackDebGenerator::createDeb()
controlExtraList.begin(); i != controlExtraList.end(); ++i)
{
std::string filenamename =
cmsys::SystemTools::GetFilenameName(i->c_str());
cmsys::SystemTools::GetFilenameName(*i);
std::string localcopy = this->GetOption("WDIR");
localcopy += "/";
localcopy += filenamename;
......@@ -588,9 +588,9 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
// the current COMPONENT belongs to.
std::string groupVar = "CPACK_COMPONENT_" +
cmSystemTools::UpperCase(componentName) + "_GROUP";
if (NULL != GetOption(groupVar.c_str()))
if (NULL != GetOption(groupVar))
{
return std::string(GetOption(groupVar.c_str()));
return std::string(GetOption(groupVar));
}
else
{
......
This diff is collapsed.
......@@ -629,7 +629,7 @@ void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str,
// if so add a desktop link
std::string desktop = "CPACK_CREATE_DESKTOP_LINK_";
desktop += linkName;
if(this->IsSet(desktop.c_str()))
if(this->IsSet(desktop))
{
str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
str << " CreateShortCut \"$DESKTOP\\"
......
......@@ -272,9 +272,9 @@ std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix(
// the current COMPONENT belongs to.
std::string groupVar = "CPACK_COMPONENT_" +
cmSystemTools::UpperCase(componentName) + "_GROUP";
if (NULL != GetOption(groupVar.c_str()))
if (NULL != GetOption(groupVar))
{
return std::string(GetOption(groupVar.c_str()));
return std::string(GetOption(groupVar));
}
else
{
......
......@@ -326,7 +326,7 @@ int main (int argc, char const* const* argv)
cdit != definitions.Map.end();
++cdit )
{
globalMF->AddDefinition(cdit->first.c_str(), cdit->second.c_str());
globalMF->AddDefinition(cdit->first, cdit->second.c_str());
}
const char* cpackModulesPath =
......
......@@ -241,11 +241,11 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
{
// Make the generator available for the Build call below.
cm.SetGlobalGenerator(cm.CreateGlobalGenerator(
this->BuildGenerator.c_str()));
this->BuildGenerator));
cm.SetGeneratorToolset(this->BuildGeneratorToolset);
// Load the cache to make CMAKE_MAKE_PROGRAM available.
cm.GetCacheManager()->LoadCache(this->BinaryDir.c_str());
cm.GetCacheManager()->LoadCache(this->BinaryDir);
}
else
{
......@@ -295,9 +295,9 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
config = "Debug";
}
int retVal = cm.GetGlobalGenerator()->Build(
this->SourceDir.c_str(), this->BinaryDir.c_str(),
this->BuildProject.c_str(), tarIt->c_str(),
&output, this->BuildMakeProgram.c_str(),
this->SourceDir, this->BinaryDir,
this->BuildProject, *tarIt,
&output, this->BuildMakeProgram,
config,
!this->BuildNoClean,
false, remainingTime);
......
......@@ -151,7 +151,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
"\n"
"Alternatively, set CTEST_BUILD_COMMAND to build the project "
"with a custom command line.";
this->SetError(ostr.str().c_str());
this->SetError(ostr.str());
return 0;
}
}
......
......@@ -69,7 +69,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
cmOStringStream e;
e << "CMakeLists.txt file does not exist ["
<< cmakelists_file << "]";
this->SetError(e.str().c_str());
this->SetError(e.str());
return 0;
}
......
......@@ -157,7 +157,7 @@ void cmCTestCoverageHandler::CleanCoverageLogFiles(std::ostream& log)
logGlob += this->CTest->GetCurrentTag();
logGlob += "/CoverageLog*";
cmsys::Glob gl;
gl.FindFiles(logGlob.c_str());
gl.FindFiles(logGlob);
std::vector<std::string> const& files = gl.GetFiles();
for(std::vector<std::string>::const_iterator fi = files.begin();
fi != files.end(); ++fi)
......@@ -241,7 +241,7 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
bool buildSubDir = cmSystemTools::IsSubDirectory(fFile.c_str(),
fBinDir.c_str());
// Always check parent directory of the file.
std::string fileDir = cmSystemTools::GetFilenamePath(fFile.c_str());
std::string fileDir = cmSystemTools::GetFilenamePath(fFile);
std::string checkDir;
// We also need to check the binary/source directory pair.
......@@ -296,7 +296,7 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
checkDir = fSrcDir;
}
fFile = checkDir + "/" + relPath;
fFile = cmSystemTools::GetFilenamePath(fFile.c_str());
fFile = cmSystemTools::GetFilenamePath(fFile);
if ( fileDir == fFile )
{
......@@ -503,7 +503,7 @@ int cmCTestCoverageHandler::ProcessHandler()
}
const std::string fileName
= cmSystemTools::GetFilenameName(fullFileName.c_str());
= cmSystemTools::GetFilenameName(fullFileName);
std::string shortFileName =
this->CTest->GetShortPathToFile(fullFileName.c_str());
const cmCTestCoverageHandlerContainer::SingleFileCoverageVector& fcov
......@@ -947,7 +947,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
// Call gcov to get coverage data for this *.gcda file:
//
std::string fileDir = cmSystemTools::GetFilenamePath(it->c_str());
std::string fileDir = cmSystemTools::GetFilenamePath(*it);
std::string command = "\"" + gcovCommand + "\" " +
gcovExtraFlags + " " +
"-o \"" + fileDir + "\" " +
......@@ -1814,7 +1814,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
total_tested += functionsCalled;
total_untested += (totalFunctions - functionsCalled);
std::string fileName = cmSystemTools::GetFilenameName(file.c_str());
std::string fileName = cmSystemTools::GetFilenameName(file);
std::string shortFileName =
this->CTest->GetShortPathToFile(file.c_str());
......
......@@ -26,7 +26,7 @@ bool cmCTestEmptyBinaryDirectoryCommand
{
cmOStringStream ostr;
ostr << "problem removing the binary directory: " << args[0].c_str();
this->SetError(ostr.str().c_str());
this->SetError(ostr.str());
return false;
}
......
......@@ -75,7 +75,7 @@ void cmCTestGenericHandler::Initialize()
it != this->PersistentOptions.end();
++ it )
{
this->Options[it->first.c_str()] = it->second.c_str();
this->Options[it->first] = it->second.c_str();
}
}
......@@ -121,7 +121,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part,
return false;
}
if( !this->CTest->OpenOutputFile(this->CTest->GetCurrentTag(),
ostr.str().c_str(), xofs, true) )
ostr.str(), xofs, true) )
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot create resulting XML file: " << ostr.str().c_str()
......@@ -153,7 +153,7 @@ bool cmCTestGenericHandler::StartLogFile(const char* name,
ostr << "_" << this->CTest->GetCurrentTag();
}
ostr << ".log";
if( !this->CTest->OpenOutputFile("Temporary", ostr.str().c_str(), xofs) )
if( !this->CTest->OpenOutputFile("Temporary", ostr.str(), xofs) )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create log file: "
<< ostr.str().c_str() << std::endl);
......
......@@ -48,7 +48,7 @@ bool cmCTestHandlerCommand
{
cmOStringStream e;
e << "called with unknown argument \"" << args[i] << "\".";
this->SetError(e.str().c_str());
this->SetError(e.str());
return false;
}
......
......@@ -680,8 +680,8 @@ bool cmCTestLaunch::ScrapeLog(std::string const& fname)
continue;
}
if(this->Match(line.c_str(), this->RegexWarning) &&
!this->Match(line.c_str(), this->RegexWarningSuppress))
if(this->Match(line, this->RegexWarning) &&
!this->Match(line, this->RegexWarningSuppress))
{
return true;
}
......
......@@ -352,7 +352,7 @@ void cmCTestP4::SetP4Options(std::vector<char const*> &CommandOptions)
for(std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai)
{
P4Options.push_back(ai->c_str());
P4Options.push_back(*ai);
}
}
......
......@@ -56,7 +56,7 @@ bool cmCTestRunScriptCommand
&ret);
cmOStringStream str;
str << ret;
this->Makefile->AddDefinition(returnVariable.c_str(), str.str().c_str());
this->Makefile->AddDefinition(returnVariable, str.str().c_str());
}
}
return true;
......
......@@ -337,8 +337,8 @@ void cmCTestScriptHandler::CreateCMake()
// Set CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR.
// Also, some commands need Makefile->GetCurrentDirectory().
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
this->Makefile->SetStartDirectory(cwd.c_str());
this->Makefile->SetStartOutputDirectory(cwd.c_str());
this->Makefile->SetStartDirectory(cwd);
this->Makefile->SetStartOutputDirectory(cwd);
// remove all cmake commands which are not scriptable, since they can't be
// used in ctest scripts
......@@ -436,7 +436,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
for (std::map<std::string, std::string>::const_iterator it = defs.begin();
it != defs.end(); ++it)
{
this->Makefile->AddDefinition(it->first.c_str(), it->second.c_str());
this->Makefile->AddDefinition(it->first, it->second.c_str());
}
// finally read in the script
......@@ -646,7 +646,7 @@ int cmCTestScriptHandler::RunCurrentScript()
if (!this->CTestEnv.empty())
{
std::vector<std::string> envArgs;
cmSystemTools::ExpandListArgument(this->CTestEnv.c_str(),envArgs);
cmSystemTools::ExpandListArgument(this->CTestEnv,envArgs);
cmSystemTools::AppendEnv(envArgs);
}
......@@ -772,7 +772,7 @@ int cmCTestScriptHandler::PerformExtraUpdates()
++ it )
{
std::vector<std::string> cvsArgs;
cmSystemTools::ExpandListArgument(it->c_str(),cvsArgs);
cmSystemTools::ExpandListArgument(*it,cvsArgs);
if (cvsArgs.size() == 2)
{
std::string fullCommand = command;
......
......@@ -131,7 +131,7 @@ bool cmCTestStartCommand
<< " " << sourceDir << "\n"
<< "which is not an existing directory. "
<< "Set CTEST_CHECKOUT_COMMAND to a command line to create it.";
this->SetError(e.str().c_str());
this->SetError(e.str());
return false;
}
......@@ -160,7 +160,7 @@ bool cmCTestStartCommand::InitialCheckout(
{
// Use a generic VC object to run and log the command.
cmCTestVC vc(this->CTest, ofs);
vc.SetSourceDirectory(sourceDir.c_str());
vc.SetSourceDirectory(sourceDir);
if(!vc.InitialCheckout(initialCheckoutCommand))
{
return false;
......
......@@ -339,7 +339,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
std::vector<std::string> args;
cmSystemTools::ExpandListArgument(curlopt.c_str(), args);
cmSystemTools::ExpandListArgument(curlopt, args);
bool verifyPeerOff = false;
bool verifyHostOff = false;
for( std::vector<std::string>::iterator i = args.begin();
......@@ -461,7 +461,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
else
{
char md5[33];
cmSystemTools::ComputeFileMD5(local_file.c_str(), md5);
cmSystemTools::ComputeFileMD5(local_file, md5);
md5[32] = 0;
upload_as += md5;
}
......
......@@ -125,7 +125,7 @@ bool cmCTestSubdirCommand
{
std::string m = "Could not find include file: ";
m += fname;
this->SetError(m.c_str());
this->SetError(m);
return false;
}
}
......@@ -213,7 +213,7 @@ bool cmCTestAddSubdirectoryCommand
{
std::string m = "Could not find include file: ";
m += fname;
this->SetError(m.c_str());
this->SetError(m);
return false;
}
return true;
......@@ -1506,7 +1506,7 @@ std::string cmCTestTestHandler
// then try with the exe extension
else
{
failed.push_back(attempted[ai].c_str());
failed.push_back(attempted[ai]);
tempPath = attempted[ai];
tempPath += cmSystemTools::GetExecutableExtension();
if(cmSystemTools::FileExists(tempPath.c_str())
......@@ -1517,7 +1517,7 @@ std::string cmCTestTestHandler
}
else
{
failed.push_back(tempPath.c_str());
failed.push_back(tempPath);
}
}
}
......@@ -2154,7 +2154,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "ATTACHED_FILES" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);
cmSystemTools::ExpandListArgument(val, lval);
for(std::vector<std::string>::iterator f = lval.begin();
f != lval.end(); ++f)
......@@ -2165,7 +2165,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "ATTACHED_FILES_ON_FAIL" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);
cmSystemTools::ExpandListArgument(val, lval);
for(std::vector<std::string>::iterator f = lval.begin();
f != lval.end(); ++f)
......@@ -2176,7 +2176,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "RESOURCE_LOCK" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);
cmSystemTools::ExpandListArgument(val, lval);
for(std::vector<std::string>::iterator f = lval.begin();
f != lval.end(); ++f)
......@@ -2196,7 +2196,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "REQUIRED_FILES" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);
cmSystemTools::ExpandListArgument(val, lval);
for(std::vector<std::string>::iterator f = lval.begin();
f != lval.end(); ++f)
......@@ -2211,14 +2211,14 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "FAIL_REGULAR_EXPRESSION" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);
cmSystemTools::ExpandListArgument(val, lval);
std::vector<std::string>::iterator crit;
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
{
rtit->ErrorRegularExpressions.push_back(
std::pair<cmsys::RegularExpression, std::string>(
cmsys::RegularExpression(crit->c_str()),
std::string(crit->c_str())));
std::string(*crit)));
}
}
if ( key == "PROCESSORS" )
......@@ -2240,7 +2240,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "DEPENDS" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);
cmSystemTools::ExpandListArgument(val, lval);
std::vector<std::string>::iterator crit;
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
{
......@@ -2250,7 +2250,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "ENVIRONMENT" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);
cmSystemTools::ExpandListArgument(val, lval);
std::vector<std::string>::iterator crit;
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
{
......@@ -2260,7 +2260,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "LABELS" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);
cmSystemTools::ExpandListArgument(val, lval);
std::vector<std::string>::iterator crit;
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
{
......@@ -2284,14 +2284,14 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "PASS_REGULAR_EXPRESSION" )
{
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val.c_str(), lval);
cmSystemTools::ExpandListArgument(val, lval);
std::vector<std::string>::iterator crit;
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
{
rtit->RequiredRegularExpressions.push_back(
std::pair<cmsys::RegularExpression, std::string>(
cmsys::RegularExpression(crit->c_str()),
std::string(crit->c_str())));
std::string(*crit)));
}
}
if ( key == "WORKING_DIRECTORY" )
......
......@@ -122,7 +122,7 @@ bool cmParseMumpsCoverage::LoadPackages(const char* d)
glob.RecurseOn();
std::string pat = d;
pat += "/*.m";
glob.FindFiles(pat.c_str());
glob.FindFiles(pat);
std::vector<std::string>& files = glob.GetFiles();
std::vector<std::string>::iterator fileIt;
for ( fileIt = files.begin(); fileIt != files.end();
......
......@@ -19,7 +19,7 @@ cmCursesLabelWidget::cmCursesLabelWidget(int width, int height,
field_opts_off(this->Field, O_EDIT);
field_opts_off(this->Field, O_ACTIVE);
field_opts_off(this->Field, O_STATIC);
this->SetValue(name.c_str());
this->SetValue(name);
}
cmCursesLabelWidget::~cmCursesLabelWidget()
......
......@@ -74,7 +74,7 @@ void cmCursesOptionsWidget::NextOption()
{
this->CurrentOption = 0;
}
this->SetValue(this->Options[this->CurrentOption].c_str());
this->SetValue(this->Options[this->CurrentOption]);
}
void cmCursesOptionsWidget::PreviousOption()
{
......@@ -86,7 +86,7 @@ void cmCursesOptionsWidget::PreviousOption()
{
this->CurrentOption--;
}
this->SetValue(this->Options[this->CurrentOption].c_str());
this->SetValue(this->Options[this->CurrentOption]);
}
void cmCursesOptionsWidget::SetOption(const std::string& value)
......
......@@ -59,7 +59,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
}
std::vector<std::string> dirs;
cmSystemTools::SimpleGlob(glob.c_str(), dirs, (this->Type == cmCacheManager::PATH?-1:0));
cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmCacheManager::PATH?-1:0));
if ( this->CurrentIndex < dirs.size() )
{
cstr = dirs[this->CurrentIndex];
......@@ -74,7 +74,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
cstr += "/";
}
this->SetString(cstr.c_str());
this->SetString(cstr);
touchwin(w);
wrefresh(w);
form_driver(form, REQ_END_FIELD);
......
......@@ -273,7 +273,7 @@ bool cmAddCustomCommandCommand
{
// Lookup an existing command.
if(cmSourceFile* sf =
this->Makefile->GetSourceFileWithOutput(output[0].c_str()))
this->Makefile->GetSourceFileWithOutput(output[0]))
{
if(cmCustomCommand* cc = sf->GetCustomCommand())
{
......@@ -288,7 +288,7 @@ bool cmAddCustomCommandCommand
cmOStringStream e;
e << "given APPEND option with output \"" << output[0].c_str()
<< "\" which is not already a custom command output.";
this->SetError(e.str().c_str());
this->SetError(e.str());
return false;
}
......@@ -305,7 +305,7 @@ bool cmAddCustomCommandCommand
{
// Source is empty, use the target.
std::vector<std::string> no_depends;
this->Makefile->AddCustomCommandToTarget(target.c_str(), no_depends,
this->Makefile->AddCustomCommandToTarget(target, no_depends,
commandLines, cctype,
comment, working.c_str(),
escapeOldStyle);
......@@ -314,7 +314,7 @@ bool cmAddCustomCommandCommand
{
// Target is empty, use the output.
this->Makefile->AddCustomCommandToOutput(output, depends,
main_dependency.c_str(),
main_dependency,
commandLines, comment,
working.c_str(), false,
escapeOldStyle);
......@@ -324,7 +324,7 @@ bool cmAddCustomCommandCommand
{
bool okay = false;
if(cmSourceFile* sf =
this->Makefile->GetSourceFileWithOutput(output[0].c_str()))
this->Makefile->GetSourceFileWithOutput(output[0]))
{
if(cmCustomCommand* cc = sf->GetCustomCommand())
{
......@@ -337,7 +337,7 @@ bool cmAddCustomCommandCommand
cmOStringStream e;
e << "could not locate source file with a custom command producing \""
<< output[0] << "\" even though this command tried to create it!";
this->SetError(e.str().c_str());
this->SetError(e.str());
return false;
}
}
......@@ -367,7 +367,7 @@ bool cmAddCustomCommandCommand
{
e << "The SOURCE signatures of add_custom_command are no longer "
"supported.";
this->Makefile->IssueMessage(messageType, e.str().c_str());
this->Makefile->IssueMessage(messageType, e.str());
if (messageType == cmake::FATAL_ERROR)
{
return false;
......@@ -375,8 +375,8 @@ bool cmAddCustomCommandCommand
}
// Use the old-style mode for backward compatibility.
this->Makefile->AddCustomCommandOldStyle(target.c_str(), outputs, depends,
source.c_str(), commandLines,
this->Makefile->AddCustomCommandOldStyle(target, outputs, depends,
source, commandLines,
comment);
}
......@@ -397,7 +397,7 @@ cmAddCustomCommandCommand
{
std::string e = "attempted to have a file \"" + *o +
"\" in a source directory as an output of custom command.";
this->SetError(e.c_str());
this->SetError(e);
cmSystemTools::SetFatalErrorOccured();
return false;
}
......@@ -409,7 +409,7 @@ cmAddCustomCommandCommand
cmOStringStream msg;
msg << "called with OUTPUT containing a \"" << (*o)[pos]
<< "\". This character is not allowed.";
this->SetError(msg.str().c_str());
this->SetError(msg.str());
return false;
}
}
......
......@@ -34,7 +34,7 @@ bool cmAddCustomTargetCommand
e << "called with invalid target name \"" << targetName
<< "\". Target names may not contain a slash. "
<< "Use ADD_CUSTOM_COMMAND to generate files.";
this->SetError(e.str().c_str());
this->SetError(e.str());
return false;
}
......@@ -149,7 +149,7 @@ bool cmAddCustomTargetCommand
cmOStringStream msg;
msg << "called with target name containing a \"" << targetName[pos]
<< "\". This character is not allowed.";
this->SetError(msg.str().c_str());
this->SetError(msg.str());
return false;
}
......@@ -187,7 +187,7 @@ bool cmAddCustomTargetCommand
"\" 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)
{
......@@ -208,7 +208,7 @@ bool cmAddCustomTargetCommand
std::string msg;
if(!this->Makefile->EnforceUniqueName(targetName, msg, true))
{
this->SetError(msg.c_str());
this->SetError(msg);
return false;
}
}
......@@ -224,7 +224,7 @@ bool cmAddCustomTargetCommand
// Add the utility target to the makefile.
bool escapeOldStyle = !verbatim;
cmTarget* target =
this->Makefile->AddUtilityCommand(targetName.c_str(), excludeFromAll,
this->Makefile->AddUtilityCommand(targetName, excludeFromAll,
working_directory.c_str(), depends,
commandLines, escapeOldStyle, comment);
......
......@@ -38,7 +38,7 @@ bool cmAddDependenciesCommand
cmOStringStream e;
e << "Cannot add target-level dependencies to INTERFACE library "
"target \"" << target_name << "\".\n";
this->SetError(e.str().c_str());
this->SetError(e.str());
return false;
}
......@@ -46,7 +46,7 @@ bool cmAddDependenciesCommand
++s; // skip over target_name
for (; s != args.end(); ++s)
{
target->AddUtility(s->c_str(), this->Makefile);
target->AddUtility(*s, this->Makefile);
}
}
else
......
......@@ -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.";