Merge topic 'remove-c_str'

5eb4d759 Remove some unneeded c_str calls.
This commit is contained in:
Brad King 2014-11-25 10:18:49 -05:00 committed by CMake Topic Stage
commit 4987b37165
26 changed files with 59 additions and 59 deletions

View File

@ -30,7 +30,7 @@ unsigned long cmCPackComponent::GetInstalledSize(
std::string path = installDir; std::string path = installDir;
path += '/'; path += '/';
path += *fileIt; path += *fileIt;
this->TotalSize += cmSystemTools::FileLength(path.c_str()); this->TotalSize += cmSystemTools::FileLength(path);
} }
return this->TotalSize; return this->TotalSize;

View File

@ -390,7 +390,7 @@ int cmCPackDebGenerator::createDeb()
packageFiles.begin(); packageFiles.begin();
fileIt != packageFiles.end(); ++ fileIt ) fileIt != packageFiles.end(); ++ fileIt )
{ {
totalSize += cmSystemTools::FileLength(fileIt->c_str()); totalSize += cmSystemTools::FileLength(*fileIt);
} }
} }
out << "Installed-Size: " << (totalSize + 1023) / 1024 << "\n"; out << "Installed-Size: " << (totalSize + 1023) / 1024 << "\n";

View File

@ -217,7 +217,7 @@ int cmCPackGenerator::InstallProject()
{ {
std::string destDir = "DESTDIR="; std::string destDir = "DESTDIR=";
destDir += tempInstallDirectory; destDir += tempInstallDirectory;
cmSystemTools::PutEnv(destDir.c_str()); cmSystemTools::PutEnv(destDir);
} }
else else
{ {
@ -277,7 +277,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
{ {
std::string tempInstallDirectoryEnv = "CMAKE_INSTALL_PREFIX="; std::string tempInstallDirectoryEnv = "CMAKE_INSTALL_PREFIX=";
tempInstallDirectoryEnv += tempInstallDirectory; tempInstallDirectoryEnv += tempInstallDirectory;
cmSystemTools::PutEnv(tempInstallDirectoryEnv.c_str()); cmSystemTools::PutEnv(tempInstallDirectoryEnv);
std::vector<std::string> installCommandsVector; std::vector<std::string> installCommandsVector;
cmSystemTools::ExpandListArgument(installCommands,installCommandsVector); cmSystemTools::ExpandListArgument(installCommands,installCommandsVector);
std::vector<std::string>::iterator it; std::vector<std::string>::iterator it;
@ -404,7 +404,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
std::string targetFile; std::string targetFile;
std::string inFileRelative = std::string inFileRelative =
cmSystemTools::RelativePath(top.c_str(),inFile.c_str()); cmSystemTools::RelativePath(top.c_str(),inFile.c_str());
cmSystemTools::ReadSymlink(inFile.c_str(),targetFile); cmSystemTools::ReadSymlink(inFile,targetFile);
symlinkedFiles.push_back(std::pair<std::string, symlinkedFiles.push_back(std::pair<std::string,
std::string>(targetFile,inFileRelative)); std::string>(targetFile,inFileRelative));
} }
@ -437,8 +437,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: " cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: "
<< symlinkedIt->second << "--> " << symlinkedIt->second << "--> "
<< symlinkedIt->first << std::endl); << symlinkedIt->first << std::endl);
if (!cmSystemTools::CreateSymlink((symlinkedIt->first).c_str(), if (!cmSystemTools::CreateSymlink(symlinkedIt->first,
(symlinkedIt->second).c_str())) symlinkedIt->second))
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create symlink: " cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create symlink: "
<< symlinkedIt->second << "--> " << symlinkedIt->second << "--> "
@ -787,7 +787,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
* in order to put things in subdirs... * in order to put things in subdirs...
*/ */
cmSystemTools::PutEnv( cmSystemTools::PutEnv(
(std::string("DESTDIR=")+tempInstallDirectory).c_str() std::string("DESTDIR=")+tempInstallDirectory
); );
cmCPackLogger(cmCPackLog::LOG_DEBUG, cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Creating directory: '" << dir << "'" << std::endl); "- Creating directory: '" << dir << "'" << std::endl);

View File

@ -825,7 +825,7 @@ CreateComponentDescription(cmCPackComponent *component,
} }
out << std::endl; out << std::endl;
totalSize += cmSystemTools::FileLength((dirName + *fileIt).c_str()); totalSize += cmSystemTools::FileLength(dirName + *fileIt);
} }
} }

View File

@ -828,7 +828,7 @@ cmCTestBuildHandler::LaunchHelper::LaunchHelper(cmCTestBuildHandler* handler):
this->WriteLauncherConfig(); this->WriteLauncherConfig();
std::string launchEnv = "CTEST_LAUNCH_LOGS="; std::string launchEnv = "CTEST_LAUNCH_LOGS=";
launchEnv += launchDir; launchEnv += launchDir;
cmSystemTools::PutEnv(launchEnv.c_str()); cmSystemTools::PutEnv(launchEnv);
} }
} }

View File

@ -884,7 +884,7 @@ struct cmCTestCoverageHandlerLocale
{ {
if(!lc_all.empty()) if(!lc_all.empty())
{ {
cmSystemTools::PutEnv(("LC_ALL=" + lc_all).c_str()); cmSystemTools::PutEnv("LC_ALL=" + lc_all);
} }
else else
{ {
@ -1491,24 +1491,24 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
lcovExtraFlags + " "; lcovExtraFlags + " ";
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Current coverage dir: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Current coverage dir: "
<< fileDir.c_str() << std::endl); << fileDir << std::endl);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, command.c_str() cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, command.c_str()
<< std::endl); << std::endl);
std::string output = ""; std::string output = "";
std::string errors = ""; std::string errors = "";
int retVal = 0; int retVal = 0;
*cont->OFS << "* Run coverage for: " << fileDir.c_str() << std::endl; *cont->OFS << "* Run coverage for: " << fileDir << std::endl;
*cont->OFS << " Command: " << command.c_str() << std::endl; *cont->OFS << " Command: " << command << std::endl;
int res = this->CTest->RunCommand(command.c_str(), &output, &errors, int res = this->CTest->RunCommand(command.c_str(), &output, &errors,
&retVal, fileDir.c_str(), 0 /*this->TimeOut*/); &retVal, fileDir.c_str(), 0 /*this->TimeOut*/);
*cont->OFS << " Output: " << output.c_str() << std::endl; *cont->OFS << " Output: " << output << std::endl;
*cont->OFS << " Errors: " << errors.c_str() << std::endl; *cont->OFS << " Errors: " << errors << std::endl;
if ( ! res ) if ( ! res )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Problem running coverage on file: " << it->c_str() << std::endl); "Problem running coverage on file: " << *it << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Command produced error: " << errors << std::endl); "Command produced error: " << errors << std::endl);
cont->Error ++; cont->Error ++;
@ -1517,7 +1517,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
if ( retVal != 0 ) if ( retVal != 0 )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Coverage command returned: " cmCTestLog(this->CTest, ERROR_MESSAGE, "Coverage command returned: "
<< retVal << " while processing: " << it->c_str() << std::endl); << retVal << " while processing: " << *it << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Command produced error: " << cont->Error << std::endl); "Command produced error: " << cont->Error << std::endl);
} }

View File

@ -234,7 +234,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
::curl_global_cleanup(); ::curl_global_cleanup();
return false; return false;
} }
unsigned long filelen = cmSystemTools::FileLength(local_file.c_str()); unsigned long filelen = cmSystemTools::FileLength(local_file);
ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
*this->LogFile << "\tUpload file: " << local_file << " to " *this->LogFile << "\tUpload file: " << local_file << " to "
@ -475,7 +475,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
::curl_global_cleanup(); ::curl_global_cleanup();
return false; return false;
} }
unsigned long filelen = cmSystemTools::FileLength(local_file.c_str()); unsigned long filelen = cmSystemTools::FileLength(local_file);
ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: "

View File

@ -1939,7 +1939,7 @@ std::string cmCTestTestHandler::GenerateRegressionImages(
cmCTest::CleanString(measurementfile.match(5)); cmCTest::CleanString(measurementfile.match(5));
if ( cmSystemTools::FileExists(filename.c_str()) ) if ( cmSystemTools::FileExists(filename.c_str()) )
{ {
long len = cmSystemTools::FileLength(filename.c_str()); long len = cmSystemTools::FileLength(filename);
if ( len == 0 ) if ( len == 0 )
{ {
std::string k1 = measurementfile.match(1); std::string k1 = measurementfile.match(1);

View File

@ -98,7 +98,7 @@ cmCTestUpdateHandlerLocale::~cmCTestUpdateHandlerLocale()
{ {
std::string put = "LC_MESSAGES="; std::string put = "LC_MESSAGES=";
put += saveLCMessages; put += saveLCMessages;
cmSystemTools::PutEnv(put.c_str()); cmSystemTools::PutEnv(put);
} }
else else
{ {

View File

@ -78,7 +78,7 @@ public:
* information in the local vector * information in the local vector
*/ */
FileLinesType& CoverageVector = FileLinesType& CoverageVector =
this->Coverage.TotalCoverage[filename.c_str()]; this->Coverage.TotalCoverage[filename];
CoverageVector = localCoverageVector; CoverageVector = localCoverageVector;
localCoverageVector.clear(); localCoverageVector.clear();
foundFile=false; foundFile=false;
@ -98,7 +98,7 @@ public:
* FoundFile and foundSource ensure that * FoundFile and foundSource ensure that
* only the value of the line coverage is captured * only the value of the line coverage is captured
*/ */
std::string result = getValue(line,1).c_str(); std::string result = getValue(line,1);
result = result.substr(2,result.npos); result = result.substr(2,result.npos);
if(result == "\"\"") if(result == "\"\"")
{ {
@ -120,7 +120,7 @@ public:
// On exit, capture end of last file covered. // On exit, capture end of last file covered.
FileLinesType& CoverageVector = FileLinesType& CoverageVector =
this->Coverage.TotalCoverage[filename.c_str()]; this->Coverage.TotalCoverage[filename];
CoverageVector = localCoverageVector; CoverageVector = localCoverageVector;
foundFile=false; foundFile=false;
localCoverageVector.clear(); localCoverageVector.clear();

View File

@ -47,7 +47,7 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args,
cmSystemTools::GetCMakeCursesCommand()); cmSystemTools::GetCMakeCursesCommand());
// create the arguments for the cmake object // create the arguments for the cmake object
std::string whereCMake = cmSystemTools::GetProgramPath(this->Args[0].c_str()); std::string whereCMake = cmSystemTools::GetProgramPath(this->Args[0]);
whereCMake += "/cmake"; whereCMake += "/cmake";
this->Args[0] = whereCMake; this->Args[0] = whereCMake;
this->CMakeInstance->SetArgs(this->Args); this->CMakeInstance->SetArgs(this->Args);

View File

@ -1688,7 +1688,7 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::string cmCTest::Base64EncodeFile(std::string file) std::string cmCTest::Base64EncodeFile(std::string file)
{ {
long len = cmSystemTools::FileLength(file.c_str()); long len = cmSystemTools::FileLength(file);
cmsys::ifstream ifs(file.c_str(), std::ios::in cmsys::ifstream ifs(file.c_str(), std::ios::in
#ifdef _WIN32 #ifdef _WIN32
| std::ios::binary | std::ios::binary
@ -2860,7 +2860,7 @@ void cmCTest::SetConfigType(const char* ct)
cmSystemTools::ReplaceString(this->ConfigType, ".\\", ""); cmSystemTools::ReplaceString(this->ConfigType, ".\\", "");
std::string confTypeEnv std::string confTypeEnv
= "CMAKE_CONFIG_TYPE=" + this->ConfigType; = "CMAKE_CONFIG_TYPE=" + this->ConfigType;
cmSystemTools::PutEnv(confTypeEnv.c_str()); cmSystemTools::PutEnv(confTypeEnv);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -1640,7 +1640,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile)
cmSystemTools::RemoveFile(toFile); cmSystemTools::RemoveFile(toFile);
// Create the symlink. // Create the symlink.
if(!cmSystemTools::CreateSymlink(symlinkTarget.c_str(), toFile)) if(!cmSystemTools::CreateSymlink(symlinkTarget, toFile))
{ {
cmOStringStream e; cmOStringStream e;
e << this->Name << " cannot duplicate symlink \"" << fromFile e << this->Name << " cannot duplicate symlink \"" << fromFile
@ -3282,7 +3282,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
return false; return false;
} }
unsigned long file_size = cmsys::SystemTools::FileLength(filename.c_str()); unsigned long file_size = cmsys::SystemTools::FileLength(filename);
#if defined(WIN32) && defined(CMAKE_ENCODING_UTF8) #if defined(WIN32) && defined(CMAKE_ENCODING_UTF8)
url = fix_file_url_windows(url); url = fix_file_url_windows(url);

View File

@ -1475,7 +1475,7 @@ void cmFindPackageCommand::FillPrefixesBuilds()
cmSystemTools::ExpandRegistryValues(f); cmSystemTools::ExpandRegistryValues(f);
cmSystemTools::ConvertToUnixSlashes(f); cmSystemTools::ConvertToUnixSlashes(f);
if(cmSystemTools::FileIsFullPath(f.c_str()) && if(cmSystemTools::FileIsFullPath(f.c_str()) &&
cmSystemTools::FileIsDirectory(f.c_str())) cmSystemTools::FileIsDirectory(f))
{ {
paths.AddPath(f); paths.AddPath(f);
} }

View File

@ -88,7 +88,7 @@ std::string cmFindProgramCommand
{ {
std::string appName = *name + std::string(".app"); std::string appName = *name + std::string(".app");
std::string appPath = cmSystemTools::FindDirectory(appName.c_str(), std::string appPath = cmSystemTools::FindDirectory(appName,
this->SearchPaths, this->SearchPaths,
true); true);

View File

@ -329,7 +329,7 @@ static const struct MakeCIdentifierNode : public cmGeneratorExpressionNode
const GeneratorExpressionContent *, const GeneratorExpressionContent *,
cmGeneratorExpressionDAGChecker *) const cmGeneratorExpressionDAGChecker *) const
{ {
return cmSystemTools::MakeCidentifier(parameters.front().c_str()); return cmSystemTools::MakeCidentifier(parameters.front());
} }
} makeCIdentifierNode; } makeCIdentifierNode;

View File

@ -79,7 +79,7 @@ bool cmGetFilenameComponentCommand
} }
} }
} }
cmSystemTools::SplitProgramFromArgs(filename.c_str(), cmSystemTools::SplitProgramFromArgs(filename,
result, programArgs); result, programArgs);
} }
else if (args[2] == "EXT") else if (args[2] == "EXT")

View File

@ -300,11 +300,11 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
{ {
std::string dir; std::string dir;
std::string file; std::string file;
cmSystemTools::SplitProgramPath(makeProgram.c_str(), cmSystemTools::SplitProgramPath(makeProgram,
dir, file); dir, file);
std::string saveFile = file; std::string saveFile = file;
cmSystemTools::GetShortPath(makeProgram, makeProgram); cmSystemTools::GetShortPath(makeProgram, makeProgram);
cmSystemTools::SplitProgramPath(makeProgram.c_str(), cmSystemTools::SplitProgramPath(makeProgram,
dir, file); dir, file);
makeProgram = dir; makeProgram = dir;
makeProgram += "/"; makeProgram += "/";
@ -607,7 +607,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
std::string env = envVar; std::string env = envVar;
env += "="; env += "=";
env += envVarValue; env += envVarValue;
cmSystemTools::PutEnv(env.c_str()); cmSystemTools::PutEnv(env);
} }
// if determineLanguage was called then load the file it // if determineLanguage was called then load the file it
@ -2469,7 +2469,7 @@ void cmGlobalGenerator::EnableMinGWLanguage(cmMakefile *mf)
this->FindMakeProgram(mf); this->FindMakeProgram(mf);
std::string makeProgram = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); std::string makeProgram = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
std::vector<std::string> locations; std::vector<std::string> locations;
locations.push_back(cmSystemTools::GetProgramPath(makeProgram.c_str())); locations.push_back(cmSystemTools::GetProgramPath(makeProgram));
locations.push_back("/mingw/bin"); locations.push_back("/mingw/bin");
locations.push_back("c:/mingw/bin"); locations.push_back("c:/mingw/bin");
std::string tgcc = cmSystemTools::FindProgram("gcc", locations); std::string tgcc = cmSystemTools::FindProgram("gcc", locations);

View File

@ -113,7 +113,7 @@ void cmOSXBundleGenerator::CreateFramework(
newName = versions; newName = versions;
newName += "/Current"; newName += "/Current";
cmSystemTools::RemoveFile(newName); cmSystemTools::RemoveFile(newName);
cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); cmSystemTools::CreateSymlink(oldName, newName);
this->Makefile->AddCMakeOutputFile(newName); this->Makefile->AddCMakeOutputFile(newName);
// foo -> Versions/Current/foo // foo -> Versions/Current/foo
@ -122,7 +122,7 @@ void cmOSXBundleGenerator::CreateFramework(
newName = contentdir; newName = contentdir;
newName += name; newName += name;
cmSystemTools::RemoveFile(newName); cmSystemTools::RemoveFile(newName);
cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); cmSystemTools::CreateSymlink(oldName, newName);
this->Makefile->AddCMakeOutputFile(newName); this->Makefile->AddCMakeOutputFile(newName);
// Resources -> Versions/Current/Resources // Resources -> Versions/Current/Resources
@ -133,7 +133,7 @@ void cmOSXBundleGenerator::CreateFramework(
newName = contentdir; newName = contentdir;
newName += "Resources"; newName += "Resources";
cmSystemTools::RemoveFile(newName); cmSystemTools::RemoveFile(newName);
cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); cmSystemTools::CreateSymlink(oldName, newName);
this->Makefile->AddCMakeOutputFile(newName); this->Makefile->AddCMakeOutputFile(newName);
} }
@ -145,7 +145,7 @@ void cmOSXBundleGenerator::CreateFramework(
newName = contentdir; newName = contentdir;
newName += "Headers"; newName += "Headers";
cmSystemTools::RemoveFile(newName); cmSystemTools::RemoveFile(newName);
cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); cmSystemTools::CreateSymlink(oldName, newName);
this->Makefile->AddCMakeOutputFile(newName); this->Makefile->AddCMakeOutputFile(newName);
} }
@ -157,7 +157,7 @@ void cmOSXBundleGenerator::CreateFramework(
newName = contentdir; newName = contentdir;
newName += "PrivateHeaders"; newName += "PrivateHeaders";
cmSystemTools::RemoveFile(newName); cmSystemTools::RemoveFile(newName);
cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); cmSystemTools::CreateSymlink(oldName, newName);
this->Makefile->AddCMakeOutputFile(newName); this->Makefile->AddCMakeOutputFile(newName);
} }
} }

View File

@ -178,7 +178,7 @@ std::string cmQtAutoGenerators::ListQt5RccInputs(cmSourceFile* sf,
command.push_back("--list"); command.push_back("--list");
std::string absFile = cmsys::SystemTools::GetRealPath( std::string absFile = cmsys::SystemTools::GetRealPath(
sf->GetFullPath().c_str()); sf->GetFullPath());
command.push_back(absFile); command.push_back(absFile);
@ -394,7 +394,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
{ {
cmSourceFile* sf = *fileIt; cmSourceFile* sf = *fileIt;
std::string absFile = cmsys::SystemTools::GetRealPath( std::string absFile = cmsys::SystemTools::GetRealPath(
sf->GetFullPath().c_str()); sf->GetFullPath());
std::string ext = sf->GetExtension(); std::string ext = sf->GetExtension();
@ -2322,8 +2322,8 @@ bool cmQtAutoGenerators::InputFilesNewerThanQrc(const std::string& qrcFile,
it != files.end(); ++it) it != files.end(); ++it)
{ {
int inputNewerThanQrc = 0; int inputNewerThanQrc = 0;
bool success = cmsys::SystemTools::FileTimeCompare(it->c_str(), bool success = cmsys::SystemTools::FileTimeCompare(*it,
rccOutput.c_str(), rccOutput,
&inputNewerThanQrc); &inputNewerThanQrc);
if (!success || inputNewerThanQrc >= 0) if (!success || inputNewerThanQrc >= 0)
{ {
@ -2356,7 +2356,7 @@ bool cmQtAutoGenerators::GenerateQrc()
int sourceNewerThanQrc = 0; int sourceNewerThanQrc = 0;
bool generateQrc = !cmsys::SystemTools::FileTimeCompare(*si, bool generateQrc = !cmsys::SystemTools::FileTimeCompare(*si,
rcc_output_file.c_str(), rcc_output_file,
&sourceNewerThanQrc); &sourceNewerThanQrc);
generateQrc = generateQrc || (sourceNewerThanQrc >= 0); generateQrc = generateQrc || (sourceNewerThanQrc >= 0);
generateQrc = generateQrc || this->InputFilesNewerThanQrc(*si, generateQrc = generateQrc || this->InputFilesNewerThanQrc(*si,

View File

@ -43,7 +43,7 @@ bool cmSetCommand
if (!currValue || strcmp(currValue,args[1].c_str())) if (!currValue || strcmp(currValue,args[1].c_str()))
{ {
putEnvArg += args[1]; putEnvArg += args[1];
cmSystemTools::PutEnv(putEnvArg.c_str()); cmSystemTools::PutEnv(putEnvArg);
} }
return true; return true;
} }
@ -51,7 +51,7 @@ bool cmSetCommand
// if it will be cleared, then clear it if it isn;t already clear // if it will be cleared, then clear it if it isn;t already clear
if (currValue) if (currValue)
{ {
cmSystemTools::PutEnv(putEnvArg.c_str()); cmSystemTools::PutEnv(putEnvArg);
} }
return true; return true;
} }

View File

@ -780,7 +780,7 @@ bool cmStringCommand
const std::string& variableName = args[2]; const std::string& variableName = args[2];
this->Makefile->AddDefinition(variableName, this->Makefile->AddDefinition(variableName,
cmSystemTools::MakeCidentifier(input.c_str()).c_str()); cmSystemTools::MakeCidentifier(input).c_str());
return true; return true;
} }

View File

@ -1409,7 +1409,7 @@ void cmSystemTools::AppendEnv(std::vector<std::string> const& env)
for(std::vector<std::string>::const_iterator eit = env.begin(); for(std::vector<std::string>::const_iterator eit = env.begin();
eit != env.end(); ++eit) eit != env.end(); ++eit)
{ {
cmSystemTools::PutEnv(eit->c_str()); cmSystemTools::PutEnv(*eit);
} }
} }
@ -2333,7 +2333,7 @@ bool cmSystemTools::GuessLibrarySOName(std::string const& fullPath,
{ {
return false; return false;
} }
if(!cmSystemTools::ReadSymlink(fullPath.c_str(), soname)) if(!cmSystemTools::ReadSymlink(fullPath, soname))
{ {
return false; return false;
} }

View File

@ -4713,7 +4713,7 @@ const char* cmTarget::GetExportMacro() const
{ {
std::string in = this->GetName(); std::string in = this->GetName();
in += "_EXPORTS"; in += "_EXPORTS";
this->ExportMacro = cmSystemTools::MakeCindentifier(in.c_str()); this->ExportMacro = cmSystemTools::MakeCindentifier(in);
} }
return this->ExportMacro.c_str(); return this->ExportMacro.c_str();
} }

View File

@ -1135,13 +1135,13 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator *gg)
{ {
env += this->CCEnvironment; env += this->CCEnvironment;
} }
cmSystemTools::PutEnv(env.c_str()); cmSystemTools::PutEnv(env);
env = "CXX="; env = "CXX=";
if(this->CXXEnvironment.size()) if(this->CXXEnvironment.size())
{ {
env += this->CXXEnvironment; env += this->CXXEnvironment;
} }
cmSystemTools::PutEnv(env.c_str()); cmSystemTools::PutEnv(env);
} }
// set the new // set the new

View File

@ -215,7 +215,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
else if(a.find("=") != a.npos) else if(a.find("=") != a.npos)
{ {
// Set environment variable. // Set environment variable.
cmSystemTools::PutEnv(a.c_str()); cmSystemTools::PutEnv(a);
} }
else else
{ {
@ -549,7 +549,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
"' because existing path cannot be removed: " << emsg << "\n"; "' because existing path cannot be removed: " << emsg << "\n";
return 1; return 1;
} }
if(!cmSystemTools::CreateSymlink(args[2].c_str(), args[3].c_str())) if(!cmSystemTools::CreateSymlink(args[2], args[3]))
{ {
std::string emsg = cmSystemTools::GetLastSystemError(); std::string emsg = cmSystemTools::GetLastSystemError();
std::cerr << std::cerr <<
@ -893,7 +893,7 @@ bool cmcmd::SymlinkInternal(std::string const& file, std::string const& link)
return cmSystemTools::CopyFileAlways(file.c_str(), link.c_str()); return cmSystemTools::CopyFileAlways(file.c_str(), link.c_str());
#else #else
std::string linktext = cmSystemTools::GetFilenameName(file); std::string linktext = cmSystemTools::GetFilenameName(file);
return cmSystemTools::CreateSymlink(linktext.c_str(), link.c_str()); return cmSystemTools::CreateSymlink(linktext, link);
#endif #endif
} }