Commit 9dd25554 authored by Vitaly Stakhovsky's avatar Vitaly Stakhovsky

cmSystemTools::Error: consolidate parameters into single std::string

parent b76b83ef
......@@ -109,8 +109,8 @@ void cmCTestMultiProcessHandler::SetTestLoad(unsigned long load)
fake_load_value)) {
if (!cmSystemTools::StringToULong(fake_load_value.c_str(),
&this->FakeLoadForTesting)) {
cmSystemTools::Error("Failed to parse fake load value: ",
fake_load_value.c_str());
cmSystemTools::Error("Failed to parse fake load value: " +
fake_load_value);
}
}
}
......
......@@ -331,7 +331,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
}
// make sure the file exists
if (!cmSystemTools::FileExists(script)) {
cmSystemTools::Error("Cannot find file: ", script.c_str());
cmSystemTools::Error("Cannot find file: " + script);
return 1;
}
......@@ -471,8 +471,8 @@ int cmCTestScriptHandler::ExtractVariables()
msg += "\nCTEST_COMMAND = ";
msg += (!this->CTestCmd.empty()) ? this->CTestCmd.c_str() : "(Null)";
cmSystemTools::Error(
"Some required settings in the configuration file were missing:\n",
msg.c_str());
"Some required settings in the configuration file were missing:\n" +
msg);
return 4;
}
......@@ -611,8 +611,7 @@ int cmCTestScriptHandler::CheckOutSourceDir()
this->CVSCheckOut, &output, &output, &retVal, this->CTestRoot.c_str(),
this->HandlerVerbose, cmDuration::zero() /*this->TimeOut*/);
if (!res || retVal != 0) {
cmSystemTools::Error("Unable to perform cvs checkout:\n",
output.c_str());
cmSystemTools::Error("Unable to perform cvs checkout:\n" + output);
return 6;
}
}
......@@ -678,8 +677,8 @@ int cmCTestScriptHandler::PerformExtraUpdates()
fullCommand, &output, &output, &retVal, cvsArgs[0].c_str(),
this->HandlerVerbose, cmDuration::zero() /*this->TimeOut*/);
if (!res || retVal != 0) {
cmSystemTools::Error("Unable to perform extra updates:\n", eu.c_str(),
"\nWith output:\n", output.c_str());
cmSystemTools::Error("Unable to perform extra updates:\n" + eu +
"\nWith output:\n" + output);
return 0;
}
}
......@@ -721,8 +720,8 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
if (!cmSystemTools::FileExists(this->BinaryDir) &&
this->SourceDir != this->BinaryDir) {
if (!cmSystemTools::MakeDirectory(this->BinaryDir)) {
cmSystemTools::Error("Unable to create the binary directory:\n",
this->BinaryDir.c_str());
cmSystemTools::Error("Unable to create the binary directory:\n" +
this->BinaryDir);
this->RestoreBackupDirectories();
return 7;
}
......
......@@ -239,8 +239,7 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger)
cmGeneratedFileStream fout(cacheFile);
fout.SetCopyIfDifferent(true);
if (!fout) {
cmSystemTools::Error("Unable to open cache file for save. ",
cacheFile.c_str());
cmSystemTools::Error("Unable to open cache file for save. " + cacheFile);
cmSystemTools::ReportLastSystemError("");
return false;
}
......@@ -364,8 +363,8 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger)
checkCacheFile += "/cmake.check_cache";
cmsys::ofstream checkCache(checkCacheFile.c_str());
if (!checkCache) {
cmSystemTools::Error("Unable to open check cache file for write. ",
checkCacheFile.c_str());
cmSystemTools::Error("Unable to open check cache file for write. " +
checkCacheFile);
return false;
}
checkCache << "# This file is generated by cmake for dependency checking "
......
......@@ -457,8 +457,8 @@ bool cmComputeLinkInformation::Compute()
// We require a link language for the target.
if (this->LinkLanguage.empty()) {
cmSystemTools::Error(
"CMake can not determine linker language for target: ",
this->Target->GetName().c_str());
"CMake can not determine linker language for target: " +
this->Target->GetName());
return false;
}
......
......@@ -950,8 +950,8 @@ void cmCoreTryCompile::CleanupFiles(std::string const& binDir)
if (binDir.find("CMakeTmp") == std::string::npos) {
cmSystemTools::Error(
"TRY_COMPILE attempt to remove -rf directory that does not contain "
"CMakeTmp:",
binDir.c_str());
"CMakeTmp:" +
binDir);
return;
}
......
......@@ -173,8 +173,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// regex.
if (fullName.empty() &&
this->IncludeRegexComplain.find(current.FileName)) {
cmSystemTools::Error("Cannot find file \"", current.FileName.c_str(),
"\".");
cmSystemTools::Error("Cannot find file \"" + current.FileName + "\".");
return false;
}
......
......@@ -152,7 +152,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output,
if (!cmSystemTools::FileExists(cmd)) {
shortCmd = cmd;
} else if (!cmSystemTools::GetShortPath(cmd.c_str(), shortCmd)) {
cmSystemTools::Error("GetShortPath failed for ", cmd.c_str());
cmSystemTools::Error("GetShortPath failed for " + cmd);
return false;
}
shortCmd += " ";
......
......@@ -62,7 +62,7 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
std::ostream& fout = *foutPtr;
if (!fout) {
cmSystemTools::Error("Error Writing ", this->Filename.c_str());
cmSystemTools::Error("Error Writing " + this->Filename);
cmSystemTools::ReportLastSystemError("");
return;
}
......
......@@ -29,8 +29,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(std::string const& name,
{
// Check if the file opened.
if (!*this && !quiet) {
cmSystemTools::Error("Cannot open file for write: ",
this->TempName.c_str());
cmSystemTools::Error("Cannot open file for write: " + this->TempName);
cmSystemTools::ReportLastSystemError("");
}
#ifdef CMAKE_BUILD_WITH_CMAKE
......@@ -68,8 +67,7 @@ cmGeneratedFileStream& cmGeneratedFileStream::Open(std::string const& name,
// Check if the file opened.
if (!*this && !quiet) {
cmSystemTools::Error("Cannot open file for write: ",
this->TempName.c_str());
cmSystemTools::Error("Cannot open file for write: " + this->TempName);
cmSystemTools::ReportLastSystemError("");
}
return *this;
......
......@@ -25,8 +25,8 @@ bool cmGlobVerificationManager::SaveVerificationScript(const std::string& path)
cmGeneratedFileStream verifyScriptFile(scriptFile);
verifyScriptFile.SetCopyIfDifferent(true);
if (!verifyScriptFile) {
cmSystemTools::Error("Unable to open verification script file for save. ",
scriptFile.c_str());
cmSystemTools::Error("Unable to open verification script file for save. " +
scriptFile);
cmSystemTools::ReportLastSystemError("");
return false;
}
......@@ -71,8 +71,8 @@ bool cmGlobVerificationManager::SaveVerificationScript(const std::string& path)
cmsys::ofstream verifyStampFile(stampFile.c_str());
if (!verifyStampFile) {
cmSystemTools::Error("Unable to open verification stamp file for write. ",
stampFile.c_str());
cmSystemTools::Error("Unable to open verification stamp file for write. " +
stampFile);
return false;
}
verifyStampFile << "# This file is generated by CMake for checking of the "
......
......@@ -212,7 +212,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string& lang,
if (!mf->GetDefinition(langComp)) {
if (!optional) {
cmSystemTools::Error(langComp.c_str(), " not set, after EnableLanguage");
cmSystemTools::Error(langComp + " not set, after EnableLanguage");
}
return;
}
......@@ -638,8 +638,7 @@ void cmGlobalGenerator::EnableLanguage(
// to avoid duplicate compiler tests.
if (cmSystemTools::FileExists(fpath)) {
if (!mf->ReadListFile(fpath)) {
cmSystemTools::Error("Could not find cmake module file: ",
fpath.c_str());
cmSystemTools::Error("Could not find cmake module file: " + fpath);
}
// if this file was found then the language was already determined
// to be working
......@@ -664,8 +663,8 @@ void cmGlobalGenerator::EnableLanguage(
determineCompiler += "Compiler.cmake";
std::string determineFile = mf->GetModulesFile(determineCompiler);
if (!mf->ReadListFile(determineFile)) {
cmSystemTools::Error("Could not find cmake module file: ",
determineCompiler.c_str());
cmSystemTools::Error("Could not find cmake module file: " +
determineCompiler);
}
if (cmSystemTools::GetFatalErrorOccured()) {
return;
......@@ -699,8 +698,7 @@ void cmGlobalGenerator::EnableLanguage(
fpath += lang;
fpath += "Compiler.cmake";
if (!mf->ReadListFile(fpath)) {
cmSystemTools::Error("Could not find cmake module file: ",
fpath.c_str());
cmSystemTools::Error("Could not find cmake module file: " + fpath);
}
this->SetLanguageEnabledFlag(lang, mf);
needSetLanguageEnabledMaps[lang] = true;
......@@ -792,11 +790,10 @@ void cmGlobalGenerator::EnableLanguage(
fpath += "Information.cmake";
std::string informationFile = mf->GetModulesFile(fpath);
if (informationFile.empty()) {
cmSystemTools::Error("Could not find cmake module file: ",
fpath.c_str());
cmSystemTools::Error("Could not find cmake module file: " + fpath);
} else if (!mf->ReadListFile(informationFile)) {
cmSystemTools::Error("Could not process cmake module file: ",
informationFile.c_str());
cmSystemTools::Error("Could not process cmake module file: " +
informationFile);
}
}
if (needSetLanguageEnabledMaps[lang]) {
......@@ -816,8 +813,8 @@ void cmGlobalGenerator::EnableLanguage(
testLang += "Compiler.cmake";
std::string ifpath = mf->GetModulesFile(testLang);
if (!mf->ReadListFile(ifpath)) {
cmSystemTools::Error("Could not find cmake module file: ",
testLang.c_str());
cmSystemTools::Error("Could not find cmake module file: " +
testLang);
}
std::string compilerWorks = "CMAKE_";
compilerWorks += lang;
......@@ -1706,8 +1703,8 @@ void cmGlobalGenerator::CheckTargetProperties()
cmSystemTools::Error("The following variables are used in this project, "
"but they are set to NOTFOUND.\n"
"Please set them or make sure they are set and "
"tested correctly in the CMake files:\n",
notFoundVars.c_str());
"tested correctly in the CMake files:\n" +
notFoundVars);
}
}
......@@ -1851,8 +1848,8 @@ int cmGlobalGenerator::Build(int jobs, const std::string& /*unused*/,
timeout)) {
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error(
"Generator: execution of make failed. Make command was: ",
makeCommandStr.c_str());
"Generator: execution of make failed. Make command was: " +
makeCommandStr);
output += *outputPtr;
output += "\nGenerator: execution of make failed. Make command was: " +
makeCommandStr + "\n";
......
......@@ -136,16 +136,16 @@ void cmGlobalNinjaGenerator::WriteBuild(
// Make sure there is a rule.
if (rule.empty()) {
cmSystemTools::Error("No rule for WriteBuildStatement! called "
"with comment: ",
comment.c_str());
"with comment: " +
comment);
return;
}
// Make sure there is at least one output file.
if (outputs.empty()) {
cmSystemTools::Error("No output files for WriteBuildStatement! called "
"with comment: ",
comment.c_str());
"with comment: " +
comment);
return;
}
......@@ -334,16 +334,16 @@ void cmGlobalNinjaGenerator::WriteRule(
// Make sure the rule has a name.
if (name.empty()) {
cmSystemTools::Error("No name given for WriteRuleStatement! called "
"with comment: ",
comment.c_str());
"with comment: " +
comment);
return;
}
// Make sure a command is given.
if (command.empty()) {
cmSystemTools::Error("No command given for WriteRuleStatement! called "
"with comment: ",
comment.c_str());
"with comment: " +
comment);
return;
}
......@@ -376,7 +376,7 @@ void cmGlobalNinjaGenerator::WriteRule(
if (!rspfile.empty()) {
if (rspcontent.empty()) {
cmSystemTools::Error("No rspfile_content given!", comment.c_str());
cmSystemTools::Error("No rspfile_content given!" + comment);
return;
}
cmGlobalNinjaGenerator::Indent(os, 1);
......@@ -407,8 +407,8 @@ void cmGlobalNinjaGenerator::WriteVariable(std::ostream& os,
// Make sure we have a name.
if (name.empty()) {
cmSystemTools::Error("No name given for WriteVariable! called "
"with comment: ",
comment.c_str());
"with comment: " +
comment);
return;
}
......@@ -1652,8 +1652,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
} else if (cmHasLiteralPrefix(arg, "--ddi=")) {
arg_ddi = arg.substr(6);
} else {
cmSystemTools::Error("-E cmake_ninja_depends unknown argument: ",
arg.c_str());
cmSystemTools::Error("-E cmake_ninja_depends unknown argument: " + arg);
return 1;
}
}
......@@ -1687,9 +1686,8 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
cmsys::ifstream tdif(arg_tdi.c_str(), std::ios::in | std::ios::binary);
Json::Reader reader;
if (!reader.parse(tdif, tdio, false)) {
cmSystemTools::Error("-E cmake_ninja_depends failed to parse ",
arg_tdi.c_str(),
reader.getFormattedErrorMessages().c_str());
cmSystemTools::Error("-E cmake_ninja_depends failed to parse " +
arg_tdi + reader.getFormattedErrorMessages());
return 1;
}
}
......@@ -1715,8 +1713,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
std::set<std::string> defines;
cmFortranParser parser(fc, includes, defines, info);
if (!cmFortranParser_FilePush(&parser, arg_pp.c_str())) {
cmSystemTools::Error("-E cmake_ninja_depends failed to open ",
arg_pp.c_str());
cmSystemTools::Error("-E cmake_ninja_depends failed to open " + arg_pp);
return 1;
}
if (cmFortran_yyparse(parser.Scanner) != 0) {
......@@ -1751,8 +1748,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
cmGeneratedFileStream ddif(arg_ddi);
ddif << ddi;
if (!ddif) {
cmSystemTools::Error("-E cmake_ninja_depends failed to write ",
arg_ddi.c_str());
cmSystemTools::Error("-E cmake_ninja_depends failed to write " + arg_ddi);
return 1;
}
return 0;
......@@ -1795,9 +1791,8 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile(
cmsys::ifstream ddif(arg_ddi.c_str(), std::ios::in | std::ios::binary);
Json::Reader reader;
if (!reader.parse(ddif, ddio, false)) {
cmSystemTools::Error("-E cmake_ninja_dyndep failed to parse ",
arg_ddi.c_str(),
reader.getFormattedErrorMessages().c_str());
cmSystemTools::Error("-E cmake_ninja_dyndep failed to parse " + arg_ddi +
reader.getFormattedErrorMessages());
return false;
}
......@@ -1828,9 +1823,9 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile(
cmsys::ifstream ltmf(ltmn.c_str(), std::ios::in | std::ios::binary);
Json::Reader reader;
if (ltmf && !reader.parse(ltmf, ltm, false)) {
cmSystemTools::Error("-E cmake_ninja_dyndep failed to parse ",
linked_target_dir.c_str(),
reader.getFormattedErrorMessages().c_str());
cmSystemTools::Error("-E cmake_ninja_dyndep failed to parse " +
linked_target_dir +
reader.getFormattedErrorMessages());
return false;
}
if (ltm.isObject()) {
......@@ -1911,8 +1906,7 @@ int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
cmHasLiteralSuffix(arg, ".ddi")) {
arg_ddis.push_back(arg);
} else {
cmSystemTools::Error("-E cmake_ninja_dyndep unknown argument: ",
arg.c_str());
cmSystemTools::Error("-E cmake_ninja_dyndep unknown argument: " + arg);
return 1;
}
}
......@@ -1931,9 +1925,8 @@ int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
cmsys::ifstream tdif(arg_tdi.c_str(), std::ios::in | std::ios::binary);
Json::Reader reader;
if (!reader.parse(tdif, tdio, false)) {
cmSystemTools::Error("-E cmake_ninja_dyndep failed to parse ",
arg_tdi.c_str(),
reader.getFormattedErrorMessages().c_str());
cmSystemTools::Error("-E cmake_ninja_dyndep failed to parse " + arg_tdi +
reader.getFormattedErrorMessages());
return 1;
}
}
......
......@@ -205,7 +205,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
"Checking Build System", no_working_directory, true, false)) {
gt->AddSource(file->GetFullPath());
} else {
cmSystemTools::Error("Error adding rule for ", stamps[0].c_str());
cmSystemTools::Error("Error adding rule for " + stamps[0]);
}
}
......
......@@ -918,7 +918,7 @@ void cmGlobalVisualStudioGenerator::AddSymbolExportCommand(
cmdl.push_back(objs_file);
cmGeneratedFileStream fout(objs_file.c_str());
if (!fout) {
cmSystemTools::Error("could not open ", objs_file.c_str());
cmSystemTools::Error("could not open " + objs_file);
return;
}
......
......@@ -366,8 +366,8 @@ void cmLocalGenerator::ProcessEvaluationFiles(
std::back_inserter(intersection));
if (!intersection.empty()) {
cmSystemTools::Error("Files to be generated by multiple different "
"commands: ",
cmWrap('"', intersection, '"', " ").c_str());
"commands: " +
cmWrap('"', intersection, '"', " "));
return;
}
......@@ -1168,8 +1168,8 @@ void cmLocalGenerator::GetTargetFlags(
}
if (linkLanguage.empty()) {
cmSystemTools::Error(
"CMake can not determine linker language for target: ",
target->GetName().c_str());
"CMake can not determine linker language for target: " +
target->GetName());
return;
}
this->AddLanguageFlagsForLinking(flags, target, linkLanguage, buildType);
......
......@@ -232,8 +232,8 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os)
os << " depth = " << jobs << std::endl;
os << std::endl;
} else {
cmSystemTools::Error("Invalid pool defined by property 'JOB_POOLS': ",
pool.c_str());
cmSystemTools::Error("Invalid pool defined by property 'JOB_POOLS': " +
pool);
}
}
}
......
......@@ -1054,7 +1054,7 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
std::string cleanfilePath = cmSystemTools::CollapseFullPath(cleanfile);
cmsys::ofstream fout(cleanfilePath.c_str());
if (!fout) {
cmSystemTools::Error("Could not create ", cleanfilePath.c_str());
cmSystemTools::Error("Could not create " + cleanfilePath);
}
if (!files.empty()) {
fout << "file(REMOVE_RECURSE\n";
......
......@@ -118,8 +118,8 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
// If not an in source build, then create the output directory
if (this->GetCurrentBinaryDirectory() != this->GetSourceDirectory()) {
if (!cmSystemTools::MakeDirectory(this->GetCurrentBinaryDirectory())) {
cmSystemTools::Error("Error creating directory ",
this->GetCurrentBinaryDirectory().c_str());
cmSystemTools::Error("Error creating directory " +
this->GetCurrentBinaryDirectory());
}
}
......@@ -283,7 +283,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
file->GetFullPath();
return file;
} else {
cmSystemTools::Error("Error adding rule for ", makefileIn.c_str());
cmSystemTools::Error("Error adding rule for " + makefileIn);
return nullptr;
}
}
......@@ -654,8 +654,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
: target->GetLinkerLanguage(configName));
if (linkLanguage.empty()) {
cmSystemTools::Error(
"CMake can not determine linker language for target: ",
target->GetName().c_str());
"CMake can not determine linker language for target: " +
target->GetName());
return;
}
langForClCompile = linkLanguage;
......
......@@ -959,9 +959,8 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
if (file && file->GetCustomCommand() && !replace) {
// The rule file already exists.
if (commandLines != file->GetCustomCommand()->GetCommandLines()) {
cmSystemTools::Error("Attempt to add a custom rule to output \"",
outName.c_str(),
"\" which already has a custom rule.");
cmSystemTools::Error("Attempt to add a custom rule to output \"" +
outName + "\" which already has a custom rule.");
}
return file;
}
......@@ -1101,8 +1100,8 @@ void cmMakefile::AddCustomCommandOldStyle(
ti->second.AddSource(sf->GetFullPath());
} else {
cmSystemTools::Error("Attempt to add a custom rule to a target "
"that does not exist yet for target ",
target.c_str());
"that does not exist yet for target " +
target);
return;
}
}
......@@ -1189,8 +1188,7 @@ cmTarget* cmMakefile::AddUtilityCommand(
if (sf) {
sf->SetProperty("SYMBOLIC", "1");
} else {
cmSystemTools::Error("Could not get source file entry for ",
force.c_str());
cmSystemTools::Error("Could not get source file entry for " + force);
}
// Always create the byproduct sources and mark them generated.
......@@ -2445,8 +2443,9 @@ const std::string& cmMakefile::GetRequiredDefinition(
const std::string* def = GetDef(name);
if (!def) {
cmSystemTools::Error("Error required internal CMake variable not "
"set, cmake may not be built correctly.\n",
"Missing variable is:\n", name.c_str());
"set, cmake may not be built correctly.\n"
"Missing variable is:\n" +
name);
return empty;
}
return *def;
......@@ -3779,15 +3778,15 @@ int cmMakefile::ConfigureFile(const std::string& infile,
tempOutputFile += ".tmp";
cmsys::ofstream fout(tempOutputFile.c_str(), omode);
if (!fout) {
cmSystemTools::Error("Could not open file for write in copy operation ",
tempOutputFile.c_str());
cmSystemTools::Error("Could not open file for write in copy operation " +
tempOutputFile);
cmSystemTools::ReportLastSystemError("");
return 0;
}
cmsys::ifstream fin(sinfile.c_str());
if (!fin) {
cmSystemTools::Error("Could not open file for read in copy operation ",
sinfile.c_str());
cmSystemTools::Error("Could not open file for read in copy operation " +
sinfile);
return 0;
}
......
......@@ -370,8 +370,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// Make sure we have a link language.
if (linkLanguage.empty()) {
cmSystemTools::Error("Cannot determine link language for target \"",
this->GeneratorTarget->GetName().c_str(), "\".");
cmSystemTools::Error("Cannot determine link language for target \"" +
this->GeneratorTarget->GetName() + "\".");
return;
}
......
......@@ -462,8 +462,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
// Make sure we have a link language.
if (linkLanguage.empty()) {
cmSystemTools::Error("Cannot determine link language for target \"",
this->GeneratorTarget->GetName().c_str(), "\".");
cmSystemTools::Error("Cannot determine link language for target \"" +
this->GeneratorTarget->GetName() + "\".");
return;
}
......
......@@ -68,8 +68,8 @@ void cmNinjaNormalTargetGenerator::Generate()
{
if (this->TargetLinkLanguage.empty()) {
cmSystemTools::Error("CMake can not determine linker language for "
"target: ",
this->GetGeneratorTarget()->GetName().c_str());
"target: " +
this->GetGeneratorTarget()->GetName());
return;
}
......
......@@ -166,7 +166,7 @@ protected:
{
cmsys::ifstream fin(info->FullPath.c_str());
if (!fin) {
cmSystemTools::Error("error can not open ", info->FullPath.c_str());
cmSystemTools::Error("error can not open " + info->FullPath);
return;
}
......@@ -181,7 +181,7 @@ protected:
qstart = line.find('<', 8);
// if a < is not found then move on
if (qstart == std::string::npos) {
cmSystemTools::Error("unknown include directive ", line.c_str());
cmSystemTools::Error("unknown include directive " + line);
continue;
}
qend = line.find('>', qstart + 1);
......
......@@ -1425,12 +1425,12 @@ std::string cmSystemTools::RelativePath(std::string const& local,
std::string const& remote)
{
if (!cmSystemTools::FileIsFullPath(local)) {
cmSystemTools::Error("RelativePath must be passed a full path to local: ",
local.c_str());
cmSystemTools::Error("RelativePath must be passed a full path to local: " +
local);
}
if (!cmSystemTools::FileIsFullPath(remote)) {
cmSystemTools::Error("RelativePath must be passed a full path to remote: ",
remote.c_str());
cmSystemTools::Error(
"RelativePath must be passed a full path to remote: " + remote);
}
return cmsys::SystemTools::RelativePath(local, remote);
}
......@@ -1909,8 +1909,8 @@ bool extract_tar(const char* outFileName, bool verbose, bool extract)
else {
cmSystemTools::Error("Problem with archive_write_header(): ",
archive_error_string(ext));
cmSystemTools::Error("Current file: ",
cm_archive_entry_pathname(entry).c_str());
cmSystemTools::Error("Current file: " +
cm_archive_entry_pathname(entry));
break;
}
}
......
......@@ -19,7 +19,7 @@ bool cmUseMangledMesaCommand::InitialPass(std::vector<std::string> const& args,
this->SetError("called with incorrect number of arguments");
return false;
}
const char* inputDir = args[0].c_str();
const std::string& inputDir = args[0];
std::string glh = inputDir;
glh += "/";
glh += "gl.h";
......@@ -34,7 +34,7 @@ bool cmUseMangledMesaCommand::InitialPass(std::vector<std::string> const& args,
std::vector<std::string> files;
cmSystemTools::Glob(inputDir, "\\.h$", files);
if (files.empty()) {
cmSystemTools::Error("Could not open Mesa Directory ", inputDir);
cmSystemTools::Error("Could not open Mesa Directory " + inputDir);
return false;
}
cmSystemTools::MakeDirectory(destDir);
......@@ -60,8 +60,8 @@ void cmUseMangledMesaCommand::CopyAndFullPathMesaHeader(const char* source,
tempOutputFile += ".tmp";
cmsys::ofstream fout(tempOutputFile.c_str());
if (!fout) {
cmSystemTools::Error("Could not open file for write in copy operation: ",
tempOutputFile.c_str(), outdir);
cmSystemTools::Error("Could not open file for write in copy operation: " +
tempOutputFile + outdir);
cmSystemTools::ReportLastSystemError("");
return;
}
......
......@@ -1321,8 +1321,7 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
std::string error = "Could not create file: [";
error += sourcePath;
error += "] ";
cmSystemTools::Error(error.c_str(),
cmSystemTools::GetLastSystemError().c_str());
cmSystemTools::Error(error + cmSystemTools::GetLastSystemError());
}
}
}
......@@ -2514,8 +2513,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
this->GeneratorTarget->GetLinkerLanguage(configName);
if (linkLanguage.empty()) {
cmSystemTools::Error(
"CMake can not determine linker language for target: "