Merge topic 'remove-redundant-c_str'

cc1139cc strings: Remove redundant calls to std::string::c_str()
This commit is contained in:
Brad King 2014-10-21 15:08:01 -04:00 committed by CMake Topic Stage
commit ae5686f8d0
74 changed files with 395 additions and 395 deletions

View File

@ -56,7 +56,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
localToplevel += "/"+ component->Name; localToplevel += "/"+ component->Name;
std::string dir = cmSystemTools::GetCurrentWorkingDirectory(); std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
// Change to local toplevel // Change to local toplevel
cmSystemTools::ChangeDirectory(localToplevel.c_str()); cmSystemTools::ChangeDirectory(localToplevel);
std::string filePrefix; std::string filePrefix;
if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"))
{ {
@ -80,7 +80,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
} }
} }
// Go back to previous dir // Go back to previous dir
cmSystemTools::ChangeDirectory(dir.c_str()); cmSystemTools::ChangeDirectory(dir);
return 1; return 1;
} }
@ -270,7 +270,7 @@ int cmCPackArchiveGenerator::PackageFiles()
DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive); DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive);
std::vector<std::string>::const_iterator fileIt; std::vector<std::string>::const_iterator fileIt;
std::string dir = cmSystemTools::GetCurrentWorkingDirectory(); std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(toplevel.c_str()); cmSystemTools::ChangeDirectory(toplevel);
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
{ {
// Get the relative path to the file // Get the relative path to the file
@ -288,7 +288,7 @@ int cmCPackArchiveGenerator::PackageFiles()
return 0; return 0;
} }
} }
cmSystemTools::ChangeDirectory(dir.c_str()); cmSystemTools::ChangeDirectory(dir);
// The destructor of cmArchiveWrite will close and finish the write // The destructor of cmArchiveWrite will close and finish the write
return 1; return 1;
} }

View File

@ -58,7 +58,7 @@ int cmCPackDebGenerator::PackageOnePack(std::string initialTopLevel,
// Begin the archive for this pack // Begin the archive for this pack
std::string localToplevel(initialTopLevel); std::string localToplevel(initialTopLevel);
std::string packageFileName( std::string packageFileName(
cmSystemTools::GetParentDirectory(toplevel.c_str()) cmSystemTools::GetParentDirectory(toplevel)
); );
std::string outputFileName( std::string outputFileName(
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
@ -186,7 +186,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne()
// The ALL GROUPS in ONE package case // The ALL GROUPS in ONE package case
std::string localToplevel(initialTopLevel); std::string localToplevel(initialTopLevel);
std::string packageFileName( std::string packageFileName(
cmSystemTools::GetParentDirectory(toplevel.c_str()) cmSystemTools::GetParentDirectory(toplevel)
); );
std::string outputFileName( std::string outputFileName(
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))
@ -540,7 +540,7 @@ int cmCPackDebGenerator::createDeb()
localcopy += filenamename; localcopy += filenamename;
// if we can copy the file, it means it does exist, let's add it: // if we can copy the file, it means it does exist, let's add it:
if( cmsys::SystemTools::CopyFileIfDifferent( if( cmsys::SystemTools::CopyFileIfDifferent(
i->c_str(), localcopy.c_str()) ) *i, localcopy) )
{ {
// debian is picky and need relative to ./ path in the tar.* // debian is picky and need relative to ./ path in the tar.*
cmd += " ./"; cmd += " ./";

View File

@ -399,7 +399,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: " cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: "
<< inFile << " -> " << filePath << std::endl); << inFile << " -> " << filePath << std::endl);
/* If the file is a symlink we will have to re-create it */ /* If the file is a symlink we will have to re-create it */
if ( cmSystemTools::FileIsSymlink(inFile.c_str())) if ( cmSystemTools::FileIsSymlink(inFile))
{ {
std::string targetFile; std::string targetFile;
std::string inFileRelative = std::string inFileRelative =
@ -429,7 +429,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
goToDir += "/"+subdir; goToDir += "/"+subdir;
cmCPackLogger(cmCPackLog::LOG_DEBUG, cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Change dir to: " << goToDir <<std::endl); "Change dir to: " << goToDir <<std::endl);
cmSystemTools::ChangeDirectory(goToDir.c_str()); cmSystemTools::ChangeDirectory(goToDir);
for (symlinkedIt=symlinkedFiles.begin(); for (symlinkedIt=symlinkedFiles.begin();
symlinkedIt != symlinkedFiles.end(); symlinkedIt != symlinkedFiles.end();
++symlinkedIt) ++symlinkedIt)
@ -448,7 +448,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
} }
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Going back to: " cmCPackLogger(cmCPackLog::LOG_DEBUG, "Going back to: "
<< curDir <<std::endl); << curDir <<std::endl);
cmSystemTools::ChangeDirectory(curDir.c_str()); cmSystemTools::ChangeDirectory(curDir);
} }
} }
} }

View File

@ -657,8 +657,8 @@ bool cmCPackNSISGenerator::GetListOfSubdirectories(const char* topdir,
cmsys_stl::string fullPath = topdir; cmsys_stl::string fullPath = topdir;
fullPath += "/"; fullPath += "/";
fullPath += dir.GetFile(static_cast<unsigned long>(fileNum)); fullPath += dir.GetFile(static_cast<unsigned long>(fileNum));
if(cmsys::SystemTools::FileIsDirectory(fullPath.c_str()) && if(cmsys::SystemTools::FileIsDirectory(fullPath) &&
!cmsys::SystemTools::FileIsSymlink(fullPath.c_str())) !cmsys::SystemTools::FileIsSymlink(fullPath))
{ {
if (!this->GetListOfSubdirectories(fullPath.c_str(), dirs)) if (!this->GetListOfSubdirectories(fullPath.c_str(), dirs))
{ {
@ -771,7 +771,7 @@ CreateComponentDescription(cmCPackComponent *component,
<< archiveFile << std::endl); << archiveFile << std::endl);
if (cmSystemTools::FileExists(archiveFile.c_str(), true)) if (cmSystemTools::FileExists(archiveFile.c_str(), true))
{ {
if (!cmSystemTools::RemoveFile(archiveFile.c_str())) if (!cmSystemTools::RemoveFile(archiveFile))
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Unable to remove archive file " << archiveFile "Unable to remove archive file " << archiveFile

View File

@ -57,7 +57,7 @@ int cmCPackRPMGenerator::PackageOnePack(std::string initialToplevel,
// Begin the archive for this pack // Begin the archive for this pack
std::string localToplevel(initialToplevel); std::string localToplevel(initialToplevel);
std::string packageFileName( std::string packageFileName(
cmSystemTools::GetParentDirectory(toplevel.c_str()) cmSystemTools::GetParentDirectory(toplevel)
); );
std::string outputFileName( std::string outputFileName(
GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"), GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
@ -166,7 +166,7 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne()
// The ALL GROUPS in ONE package case // The ALL GROUPS in ONE package case
std::string localToplevel(initialTopLevel); std::string localToplevel(initialTopLevel);
std::string packageFileName( std::string packageFileName(
cmSystemTools::GetParentDirectory(toplevel.c_str()) cmSystemTools::GetParentDirectory(toplevel)
); );
std::string outputFileName( std::string outputFileName(
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))

View File

@ -267,7 +267,7 @@ int main (int argc, char const* const* argv)
if ( cmSystemTools::FileExists(cpackConfigFile.c_str()) ) if ( cmSystemTools::FileExists(cpackConfigFile.c_str()) )
{ {
cpackConfigFile = cpackConfigFile =
cmSystemTools::CollapseFullPath(cpackConfigFile.c_str()); cmSystemTools::CollapseFullPath(cpackConfigFile);
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack configuration file: " << cpackConfigFile "Read CPack configuration file: " << cpackConfigFile
<< std::endl); << std::endl);

View File

@ -109,7 +109,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
out << "Error: cmake execution failed\n"; out << "Error: cmake execution failed\n";
out << cmakeOutString << "\n"; out << cmakeOutString << "\n";
// return to the original directory // return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
if(outstring) if(outstring)
{ {
*outstring = out.str(); *outstring = out.str();
@ -128,7 +128,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
out << "Error: cmake execution failed\n"; out << "Error: cmake execution failed\n";
out << cmakeOutString << "\n"; out << cmakeOutString << "\n";
// return to the original directory // return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
if(outstring) if(outstring)
{ {
*outstring = out.str(); *outstring = out.str();
@ -241,11 +241,11 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
out << "Internal cmake changing into directory: " out << "Internal cmake changing into directory: "
<< this->BinaryDir << std::endl; << this->BinaryDir << std::endl;
if (!cmSystemTools::FileIsDirectory(this->BinaryDir.c_str())) if (!cmSystemTools::FileIsDirectory(this->BinaryDir))
{ {
cmSystemTools::MakeDirectory(this->BinaryDir.c_str()); cmSystemTools::MakeDirectory(this->BinaryDir.c_str());
} }
cmSystemTools::ChangeDirectory(this->BinaryDir.c_str()); cmSystemTools::ChangeDirectory(this->BinaryDir);
if(this->BuildNoCMake) if(this->BuildNoCMake)
{ {
@ -374,7 +374,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
cmCTestLog(this->CTest, ERROR_MESSAGE, out.str()); cmCTestLog(this->CTest, ERROR_MESSAGE, out.str());
} }
// return to the original directory // return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
return 1; return 1;
} }
@ -391,7 +391,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
if(this->BuildRunDir.size()) if(this->BuildRunDir.size())
{ {
out << "Run test in directory: " << this->BuildRunDir << "\n"; out << "Run test in directory: " << this->BuildRunDir << "\n";
cmSystemTools::ChangeDirectory(this->BuildRunDir.c_str()); cmSystemTools::ChangeDirectory(this->BuildRunDir);
} }
out << "Running test command: \"" << fullPath << "\""; out << "Running test command: \"" << fullPath << "\"";
for(size_t k=0; k < this->TestCommandArgs.size(); ++k) for(size_t k=0; k < this->TestCommandArgs.size(); ++k)
@ -453,9 +453,9 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
// dir must exist before CollapseFullPath is called // dir must exist before CollapseFullPath is called
cmSystemTools::MakeDirectory(this->BinaryDir.c_str()); cmSystemTools::MakeDirectory(this->BinaryDir.c_str());
this->BinaryDir this->BinaryDir
= cmSystemTools::CollapseFullPath(this->BinaryDir.c_str()); = cmSystemTools::CollapseFullPath(this->BinaryDir);
this->SourceDir this->SourceDir
= cmSystemTools::CollapseFullPath(this->SourceDir.c_str()); = cmSystemTools::CollapseFullPath(this->SourceDir);
} }
else else
{ {

View File

@ -610,7 +610,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(std::ostream& os)
int numWarningsAllowed = this->MaxWarnings; int numWarningsAllowed = this->MaxWarnings;
// Identify fragments on disk. // Identify fragments on disk.
cmsys::Directory launchDir; cmsys::Directory launchDir;
launchDir.Load(this->CTestLaunchDir.c_str()); launchDir.Load(this->CTestLaunchDir);
unsigned long n = launchDir.GetNumberOfFiles(); unsigned long n = launchDir.GetNumberOfFiles();
for(unsigned long i=0; i < n; ++i) for(unsigned long i=0; i < n; ++i)
{ {
@ -649,7 +649,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os)
std::string srcdir = this->CTest->GetCTestConfiguration("SourceDirectory"); std::string srcdir = this->CTest->GetCTestConfiguration("SourceDirectory");
// make sure the source dir is in the correct case on windows // make sure the source dir is in the correct case on windows
// via a call to collapse full path. // via a call to collapse full path.
srcdir = cmSystemTools::CollapseFullPath(srcdir.c_str()); srcdir = cmSystemTools::CollapseFullPath(srcdir);
srcdir += "/"; srcdir += "/";
for ( it = ew.begin(); for ( it = ew.begin();
it != ew.end() && (numErrorsAllowed || numWarningsAllowed); it++ ) it != ew.end() && (numErrorsAllowed || numWarningsAllowed); it++ )
@ -695,7 +695,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os)
{ {
// make sure it is a full path with the correct case // make sure it is a full path with the correct case
cm->SourceFile = cmSystemTools::CollapseFullPath( cm->SourceFile = cmSystemTools::CollapseFullPath(
cm->SourceFile.c_str()); cm->SourceFile);
cmSystemTools::ReplaceString( cmSystemTools::ReplaceString(
cm->SourceFile, srcdir.c_str(), ""); cm->SourceFile, srcdir.c_str(), "");
} }
@ -822,7 +822,7 @@ cmCTestBuildHandler::LaunchHelper::LaunchHelper(cmCTestBuildHandler* handler):
launchDir += "/Build"; launchDir += "/Build";
// Clean out any existing launcher fragments. // Clean out any existing launcher fragments.
cmSystemTools::RemoveADirectory(launchDir.c_str()); cmSystemTools::RemoveADirectory(launchDir);
if(this->Handler->UseCTestLaunch) if(this->Handler->UseCTestLaunch)
{ {

View File

@ -165,7 +165,7 @@ void cmCTestCoverageHandler::CleanCoverageLogFiles(std::ostream& log)
fi != files.end(); ++fi) fi != files.end(); ++fi)
{ {
log << "Removing old coverage log: " << *fi << "\n"; log << "Removing old coverage log: " << *fi << "\n";
cmSystemTools::RemoveFile(fi->c_str()); cmSystemTools::RemoveFile(*fi);
} }
} }
@ -238,10 +238,10 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
std::string fSrcDir = cmSystemTools::CollapseFullPath(srcDir); std::string fSrcDir = cmSystemTools::CollapseFullPath(srcDir);
std::string fBinDir = cmSystemTools::CollapseFullPath(binDir); std::string fBinDir = cmSystemTools::CollapseFullPath(binDir);
std::string fFile = cmSystemTools::CollapseFullPath(file); std::string fFile = cmSystemTools::CollapseFullPath(file);
bool sourceSubDir = cmSystemTools::IsSubDirectory(fFile.c_str(), bool sourceSubDir = cmSystemTools::IsSubDirectory(fFile,
fSrcDir.c_str()); fSrcDir);
bool buildSubDir = cmSystemTools::IsSubDirectory(fFile.c_str(), bool buildSubDir = cmSystemTools::IsSubDirectory(fFile,
fBinDir.c_str()); fBinDir);
// Always check parent directory of the file. // Always check parent directory of the file.
std::string fileDir = cmSystemTools::GetFilenamePath(fFile); std::string fileDir = cmSystemTools::GetFilenamePath(fFile);
std::string checkDir; std::string checkDir;
@ -765,8 +765,8 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool IsFileInDir(const std::string &infile, const std::string &indir) bool IsFileInDir(const std::string &infile, const std::string &indir)
{ {
std::string file = cmSystemTools::CollapseFullPath(infile.c_str()); std::string file = cmSystemTools::CollapseFullPath(infile);
std::string dir = cmSystemTools::CollapseFullPath(indir.c_str()); std::string dir = cmSystemTools::CollapseFullPath(indir);
if ( if (
file.size() > dir.size() && file.size() > dir.size() &&
@ -786,7 +786,7 @@ int cmCTestCoverageHandler::HandlePHPCoverage(
{ {
cmParsePHPCoverage cov(*cont, this->CTest); cmParsePHPCoverage cov(*cont, this->CTest);
std::string coverageDir = this->CTest->GetBinaryDir() + "/xdebugCoverage"; std::string coverageDir = this->CTest->GetBinaryDir() + "/xdebugCoverage";
if(cmSystemTools::FileIsDirectory(coverageDir.c_str())) if(cmSystemTools::FileIsDirectory(coverageDir))
{ {
cov.ReadPHPCoverageDirectory(coverageDir.c_str()); cov.ReadPHPCoverageDirectory(coverageDir.c_str());
} }
@ -1010,7 +1010,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
std::string tempDir = testingDir + "/CoverageInfo"; std::string tempDir = testingDir + "/CoverageInfo";
std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory(); std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::MakeDirectory(tempDir.c_str()); cmSystemTools::MakeDirectory(tempDir.c_str());
cmSystemTools::ChangeDirectory(tempDir.c_str()); cmSystemTools::ChangeDirectory(tempDir);
int gcovStyle = 0; int gcovStyle = 0;
@ -1331,7 +1331,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
*cont->OFS << " produced in source dir: " << sourceFile *cont->OFS << " produced in source dir: " << sourceFile
<< std::endl; << std::endl;
actualSourceFile actualSourceFile
= cmSystemTools::CollapseFullPath(sourceFile.c_str()); = cmSystemTools::CollapseFullPath(sourceFile);
} }
else if ( IsFileInDir(sourceFile, cont->BinaryDir) ) else if ( IsFileInDir(sourceFile, cont->BinaryDir) )
{ {
@ -1340,7 +1340,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
*cont->OFS << " produced in binary dir: " << sourceFile *cont->OFS << " produced in binary dir: " << sourceFile
<< std::endl; << std::endl;
actualSourceFile actualSourceFile
= cmSystemTools::CollapseFullPath(sourceFile.c_str()); = cmSystemTools::CollapseFullPath(sourceFile);
} }
if ( actualSourceFile.empty() ) if ( actualSourceFile.empty() )
@ -1381,7 +1381,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
} }
} }
cmSystemTools::ChangeDirectory(currentDirectory.c_str()); cmSystemTools::ChangeDirectory(currentDirectory);
return file_count; return file_count;
} }
@ -1445,8 +1445,8 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
for ( it = files.begin(); it != files.end(); ++ it ) for ( it = files.begin(); it != files.end(); ++ it )
{ {
cmCTestLog(this->CTest, HANDLER_OUTPUT, "." << std::flush); cmCTestLog(this->CTest, HANDLER_OUTPUT, "." << std::flush);
std::string fileDir = cmSystemTools::GetFilenamePath(it->c_str()); std::string fileDir = cmSystemTools::GetFilenamePath(*it);
cmSystemTools::ChangeDirectory(fileDir.c_str()); cmSystemTools::ChangeDirectory(fileDir);
std::string command = "\"" + lcovCommand + "\" " + std::string command = "\"" + lcovCommand + "\" " +
lcovExtraFlags + " "; lcovExtraFlags + " ";
@ -1645,7 +1645,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
} }
} }
cmSystemTools::ChangeDirectory(currentDirectory.c_str()); cmSystemTools::ChangeDirectory(currentDirectory);
return file_count; return file_count;
} }
@ -1689,7 +1689,7 @@ void cmCTestCoverageHandler::FindLCovFiles(std::vector<std::string>& files)
gl.RecurseThroughSymlinksOff(); gl.RecurseThroughSymlinksOff();
std::string prevBinaryDir; std::string prevBinaryDir;
cmSystemTools::ChangeDirectory( cmSystemTools::ChangeDirectory(
this->CTest->GetCTestConfiguration("BuildDirectory").c_str()); this->CTest->GetCTestConfiguration("BuildDirectory"));
// Run profmerge to merge all *.dyn files into dpi files // Run profmerge to merge all *.dyn files into dpi files
cmSystemTools::RunSingleCommand("profmerge"); cmSystemTools::RunSingleCommand("profmerge");
@ -1732,9 +1732,9 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
std::string tempDir = testingDir + "/CoverageInfo"; std::string tempDir = testingDir + "/CoverageInfo";
std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory(); std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::MakeDirectory(tempDir.c_str()); cmSystemTools::MakeDirectory(tempDir.c_str());
cmSystemTools::ChangeDirectory(tempDir.c_str()); cmSystemTools::ChangeDirectory(tempDir);
cmSystemTools::ChangeDirectory(currentDirectory.c_str()); cmSystemTools::ChangeDirectory(currentDirectory);
std::vector<std::string>::iterator fileIt; std::vector<std::string>::iterator fileIt;
int file_count = 0; int file_count = 0;
@ -1750,7 +1750,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
} }
std::string actualSourceFile std::string actualSourceFile
= cmSystemTools::CollapseFullPath(fileName.c_str()); = cmSystemTools::CollapseFullPath(fileName);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Check coverage for file: " << actualSourceFile " Check coverage for file: " << actualSourceFile
<< std::endl); << std::endl);
@ -1838,7 +1838,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
} }
++ file_count; ++ file_count;
} }
cmSystemTools::ChangeDirectory(currentDirectory.c_str()); cmSystemTools::ChangeDirectory(currentDirectory);
return file_count; return file_count;
} }
@ -2168,7 +2168,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
file += "/"; file += "/";
file += sourceFile; file += sourceFile;
} }
file = cmSystemTools::CollapseFullPath(file.c_str()); file = cmSystemTools::CollapseFullPath(file);
bool shouldIDoCoverage bool shouldIDoCoverage
= this->ShouldIDoCoverage(file.c_str(), = this->ShouldIDoCoverage(file.c_str(),
cont->SourceDir.c_str(), cont->SourceDir.c_str(),

View File

@ -158,7 +158,7 @@ std::string cmCTestGIT::FindTopDir()
{ {
top_dir += "/"; top_dir += "/";
top_dir += cdup; top_dir += cdup;
top_dir = cmSystemTools::CollapseFullPath(top_dir.c_str()); top_dir = cmSystemTools::CollapseFullPath(top_dir);
} }
return top_dir; return top_dir;
} }

View File

@ -137,7 +137,7 @@ bool cmCTestHandlerCommand
} }
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory(); std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory( cmSystemTools::ChangeDirectory(
this->CTest->GetCTestConfiguration("BuildDirectory").c_str()); this->CTest->GetCTestConfiguration("BuildDirectory"));
int res = handler->ProcessHandler(); int res = handler->ProcessHandler();
if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE]) if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE])
{ {
@ -146,7 +146,7 @@ bool cmCTestHandlerCommand
this->Makefile->AddDefinition( this->Makefile->AddDefinition(
this->Values[ct_RETURN_VALUE], str.str().c_str()); this->Values[ct_RETURN_VALUE], str.str().c_str());
} }
cmSystemTools::ChangeDirectory(current_dir.c_str()); cmSystemTools::ChangeDirectory(current_dir);
return true; return true;
} }

View File

@ -48,8 +48,8 @@ cmCTestLaunch::~cmCTestLaunch()
cmsysProcess_Delete(this->Process); cmsysProcess_Delete(this->Process);
if(!this->Passthru) if(!this->Passthru)
{ {
cmSystemTools::RemoveFile(this->LogOut.c_str()); cmSystemTools::RemoveFile(this->LogOut);
cmSystemTools::RemoveFile(this->LogErr.c_str()); cmSystemTools::RemoveFile(this->LogErr);
} }
} }
@ -434,8 +434,8 @@ void cmCTestLaunch::WriteXMLAction(std::ostream& fxml)
// If file is in source tree use its relative location. // If file is in source tree use its relative location.
if(cmSystemTools::FileIsFullPath(this->SourceDir.c_str()) && if(cmSystemTools::FileIsFullPath(this->SourceDir.c_str()) &&
cmSystemTools::FileIsFullPath(source.c_str()) && cmSystemTools::FileIsFullPath(source.c_str()) &&
cmSystemTools::IsSubDirectory(source.c_str(), cmSystemTools::IsSubDirectory(source,
this->SourceDir.c_str())) this->SourceDir))
{ {
source = cmSystemTools::RelativePath(this->SourceDir.c_str(), source = cmSystemTools::RelativePath(this->SourceDir.c_str(),
source.c_str()); source.c_str());

View File

@ -1221,10 +1221,10 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
} }
} }
cmSystemTools::Delay(1000); cmSystemTools::Delay(1000);
cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str()); cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "
<< this->BoundsCheckerDPBDFile << std::endl); << this->BoundsCheckerDPBDFile << std::endl);
cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile.c_str()); cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "
<< this->BoundsCheckerXMLFile << std::endl); << this->BoundsCheckerXMLFile << std::endl);
} }
@ -1255,7 +1255,7 @@ cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
} }
if(this->LogWithPID) if(this->LogWithPID)
{ {
cmSystemTools::RemoveFile(ofile.c_str()); cmSystemTools::RemoveFile(ofile);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "<< ofile <<"\n"); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "<< ofile <<"\n");
} }
} }

View File

@ -123,7 +123,7 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test)
testRun->SetTestProperties(this->Properties[test]); testRun->SetTestProperties(this->Properties[test]);
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory(); std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(this->Properties[test]->Directory.c_str()); cmSystemTools::ChangeDirectory(this->Properties[test]->Directory);
// Lock the resources we'll be using // Lock the resources we'll be using
this->LockResources(test); this->LockResources(test);
@ -156,7 +156,7 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test)
this->Failed->push_back(this->Properties[test]->Name); this->Failed->push_back(this->Properties[test]->Name);
delete testRun; delete testRun;
} }
cmSystemTools::ChangeDirectory(current_dir.c_str()); cmSystemTools::ChangeDirectory(current_dir);
} }
//--------------------------------------------------------- //---------------------------------------------------------
@ -334,7 +334,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
{ {
if(line == "---") break; if(line == "---") break;
std::vector<cmsys::String> parts = std::vector<cmsys::String> parts =
cmSystemTools::SplitString(line.c_str(), ' '); cmSystemTools::SplitString(line, ' ');
//Format: <name> <previous_runs> <avg_cost> //Format: <name> <previous_runs> <avg_cost>
if(parts.size() < 3) break; if(parts.size() < 3) break;
@ -357,7 +357,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
} }
} }
fin.close(); fin.close();
cmSystemTools::RemoveFile(fname.c_str()); cmSystemTools::RemoveFile(fname);
} }
// Add all tests not previously listed in the file // Add all tests not previously listed in the file
@ -393,7 +393,7 @@ void cmCTestMultiProcessHandler::ReadCostData()
if(line == "---") break; if(line == "---") break;
std::vector<cmsys::String> parts = std::vector<cmsys::String> parts =
cmSystemTools::SplitString(line.c_str(), ' '); cmSystemTools::SplitString(line, ' ');
// Probably an older version of the file, will be fixed next run // Probably an older version of the file, will be fixed next run
if(parts.size() < 3) if(parts.size() < 3)
@ -621,7 +621,7 @@ void cmCTestMultiProcessHandler::MarkFinished()
{ {
std::string fname = this->CTest->GetBinaryDir() std::string fname = this->CTest->GetBinaryDir()
+ "/Testing/Temporary/CTestCheckpoint.txt"; + "/Testing/Temporary/CTestCheckpoint.txt";
cmSystemTools::RemoveFile(fname.c_str()); cmSystemTools::RemoveFile(fname);
} }
//--------------------------------------------------------- //---------------------------------------------------------
@ -639,7 +639,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
//push working dir //push working dir
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory(); std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(p.Directory.c_str()); cmSystemTools::ChangeDirectory(p.Directory);
cmCTestRunTest testRun(this->TestHandler); cmCTestRunTest testRun(this->TestHandler);
testRun.SetIndex(p.Index); testRun.SetIndex(p.Index);
@ -676,7 +676,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
cmCTestLog(this->CTest, HANDLER_OUTPUT, " "); cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
cmCTestLog(this->CTest, HANDLER_OUTPUT, p.Name.c_str() << std::endl); cmCTestLog(this->CTest, HANDLER_OUTPUT, p.Name.c_str() << std::endl);
//pop working dir //pop working dir
cmSystemTools::ChangeDirectory(current_dir.c_str()); cmSystemTools::ChangeDirectory(current_dir);
} }
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl << "Total Tests: " cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl << "Total Tests: "
@ -735,7 +735,7 @@ void cmCTestMultiProcessHandler::CheckResume()
} }
else if(cmSystemTools::FileExists(fname.c_str(), true)) else if(cmSystemTools::FileExists(fname.c_str(), true))
{ {
cmSystemTools::RemoveFile(fname.c_str()); cmSystemTools::RemoveFile(fname);
} }
} }

View File

@ -280,12 +280,12 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
// Set the working directory to the tests directory // Set the working directory to the tests directory
std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory(); std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(this->TestProperties->Directory.c_str()); cmSystemTools::ChangeDirectory(this->TestProperties->Directory);
this->DartProcessing(); this->DartProcessing();
// restore working directory // restore working directory
cmSystemTools::ChangeDirectory(oldpath.c_str()); cmSystemTools::ChangeDirectory(oldpath);
// if this is doing MemCheck then all the output needs to be put into // if this is doing MemCheck then all the output needs to be put into

View File

@ -184,7 +184,7 @@ int cmCTestScriptHandler::ProcessHandler()
{ {
// for each script run it // for each script run it
res += this->RunConfigurationScript res += this->RunConfigurationScript
(cmSystemTools::CollapseFullPath(this->ConfigurationScripts[i].c_str()), (cmSystemTools::CollapseFullPath(this->ConfigurationScripts[i]),
this->ScriptProcessScope[i]); this->ScriptProcessScope[i]);
} }
if ( res ) if ( res )
@ -482,8 +482,8 @@ int cmCTestScriptHandler::ExtractVariables()
= this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY"); = this->Makefile->GetSafeDefinition("CTEST_BINARY_DIRECTORY");
// add in translations for src and bin // add in translations for src and bin
cmSystemTools::AddKeepPath(this->SourceDir.c_str()); cmSystemTools::AddKeepPath(this->SourceDir);
cmSystemTools::AddKeepPath(this->BinaryDir.c_str()); cmSystemTools::AddKeepPath(this->BinaryDir);
this->CTestCmd this->CTestCmd
= this->Makefile->GetSafeDefinition("CTEST_COMMAND"); = this->Makefile->GetSafeDefinition("CTEST_COMMAND");
@ -743,11 +743,11 @@ int cmCTestScriptHandler::BackupDirectories()
// if for some reason those directories exist then first delete them // if for some reason those directories exist then first delete them
if (cmSystemTools::FileExists(this->BackupSourceDir.c_str())) if (cmSystemTools::FileExists(this->BackupSourceDir.c_str()))
{ {
cmSystemTools::RemoveADirectory(this->BackupSourceDir.c_str()); cmSystemTools::RemoveADirectory(this->BackupSourceDir);
} }
if (cmSystemTools::FileExists(this->BackupBinaryDir.c_str())) if (cmSystemTools::FileExists(this->BackupBinaryDir.c_str()))
{ {
cmSystemTools::RemoveADirectory(this->BackupBinaryDir.c_str()); cmSystemTools::RemoveADirectory(this->BackupBinaryDir);
} }
// first rename the src and binary directories // first rename the src and binary directories
@ -991,8 +991,8 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
// if all was succesful, delete the backup dirs to free up disk space // if all was succesful, delete the backup dirs to free up disk space
if (this->Backup) if (this->Backup)
{ {
cmSystemTools::RemoveADirectory(this->BackupSourceDir.c_str()); cmSystemTools::RemoveADirectory(this->BackupSourceDir);
cmSystemTools::RemoveADirectory(this->BackupBinaryDir.c_str()); cmSystemTools::RemoveADirectory(this->BackupBinaryDir);
} }
return 0; return 0;
@ -1033,11 +1033,11 @@ void cmCTestScriptHandler::RestoreBackupDirectories()
// if for some reason those directories exist then first delete them // if for some reason those directories exist then first delete them
if (cmSystemTools::FileExists(this->SourceDir.c_str())) if (cmSystemTools::FileExists(this->SourceDir.c_str()))
{ {
cmSystemTools::RemoveADirectory(this->SourceDir.c_str()); cmSystemTools::RemoveADirectory(this->SourceDir);
} }
if (cmSystemTools::FileExists(this->BinaryDir.c_str())) if (cmSystemTools::FileExists(this->BinaryDir.c_str()))
{ {
cmSystemTools::RemoveADirectory(this->BinaryDir.c_str()); cmSystemTools::RemoveADirectory(this->BinaryDir);
} }
// rename the src and binary directories // rename the src and binary directories
rename(this->BackupSourceDir.c_str(), this->SourceDir.c_str()); rename(this->BackupSourceDir.c_str(), this->SourceDir.c_str());
@ -1100,7 +1100,7 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce(
const std::string& directoryPath) const std::string& directoryPath)
{ {
cmsys::Directory directory; cmsys::Directory directory;
directory.Load(directoryPath.c_str()); directory.Load(directoryPath);
for(unsigned long i = 0; i < directory.GetNumberOfFiles(); ++i) for(unsigned long i = 0; i < directory.GetNumberOfFiles(); ++i)
{ {
@ -1113,26 +1113,26 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce(
std::string fullPath = directoryPath + std::string("/") + path; std::string fullPath = directoryPath + std::string("/") + path;
bool isDirectory = cmSystemTools::FileIsDirectory(fullPath.c_str()) && bool isDirectory = cmSystemTools::FileIsDirectory(fullPath) &&
!cmSystemTools::FileIsSymlink(fullPath.c_str()); !cmSystemTools::FileIsSymlink(fullPath);
if(isDirectory) if(isDirectory)
{ {
if(!cmSystemTools::RemoveADirectory(fullPath.c_str())) if(!cmSystemTools::RemoveADirectory(fullPath))
{ {
return false; return false;
} }
} }
else else
{ {
if(!cmSystemTools::RemoveFile(fullPath.c_str())) if(!cmSystemTools::RemoveFile(fullPath))
{ {
return false; return false;
} }
} }
} }
return cmSystemTools::RemoveADirectory(directoryPath.c_str()); return cmSystemTools::RemoveADirectory(directoryPath);
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------

View File

@ -124,7 +124,7 @@ bool cmCTestStartCommand
{ {
return false; return false;
} }
if(!cmSystemTools::FileIsDirectory(sourceDir.c_str())) if(!cmSystemTools::FileIsDirectory(sourceDir))
{ {
cmOStringStream e; cmOStringStream e;
e << "given source path\n" e << "given source path\n"

View File

@ -236,7 +236,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
} }
unsigned long filelen = cmSystemTools::FileLength(local_file.c_str()); unsigned long filelen = cmSystemTools::FileLength(local_file.c_str());
ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
*this->LogFile << "\tUpload file: " << local_file << " to " *this->LogFile << "\tUpload file: " << local_file << " to "
<< upload_as << std::endl; << upload_as << std::endl;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: "
@ -477,7 +477,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
} }
unsigned long filelen = cmSystemTools::FileLength(local_file.c_str()); unsigned long filelen = cmSystemTools::FileLength(local_file.c_str());
ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: "
<< local_file << " to " << local_file << " to "
<< upload_as << " Size: " << filelen << std::endl); << upload_as << " Size: " << filelen << std::endl);
@ -567,7 +567,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
<< count << std::endl); << count << std::endl);
::fclose(ftpfile); ::fclose(ftpfile);
ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
::curl_easy_setopt(curl, CURLOPT_INFILE, ftpfile); ::curl_easy_setopt(curl, CURLOPT_INFILE, ftpfile);
chunk.clear(); chunk.clear();
@ -931,13 +931,13 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
cmSystemTools::ConvertToUnixSlashes(lfname); cmSystemTools::ConvertToUnixSlashes(lfname);
lfname += "/" + *file; lfname += "/" + *file;
std::string rfname = destination + "/" + remoteprefix + *file; std::string rfname = destination + "/" + remoteprefix + *file;
cmSystemTools::CopyFileAlways(lfname.c_str(), rfname.c_str()); cmSystemTools::CopyFileAlways(lfname, rfname);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Copy file: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Copy file: "
<< lfname << " to " << lfname << " to "
<< rfname << std::endl); << rfname << std::endl);
} }
std::string tagDoneFile = destination + "/" + remoteprefix + "DONE"; std::string tagDoneFile = destination + "/" + remoteprefix + "DONE";
cmSystemTools::Touch(tagDoneFile.c_str(), true); cmSystemTools::Touch(tagDoneFile, true);
if ( problems ) if ( problems )
{ {
return false; return false;
@ -1418,20 +1418,20 @@ int cmCTestSubmitHandler::ProcessHandler()
// change to the build directory so that we can uses a relative path // change to the build directory so that we can uses a relative path
// on windows since scp dosn't support "c:" a drive in the path // on windows since scp dosn't support "c:" a drive in the path
oldWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory(); oldWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(buildDirectory.c_str()); cmSystemTools::ChangeDirectory(buildDirectory);
if ( !this->SubmitUsingSCP( if ( !this->SubmitUsingSCP(
this->CTest->GetCTestConfiguration("ScpCommand"), this->CTest->GetCTestConfiguration("ScpCommand"),
"Testing/"+this->CTest->GetCurrentTag(), files, prefix, url) ) "Testing/"+this->CTest->GetCurrentTag(), files, prefix, url) )
{ {
cmSystemTools::ChangeDirectory(oldWorkingDirectory.c_str()); cmSystemTools::ChangeDirectory(oldWorkingDirectory);
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
" Problems when submitting via SCP" " Problems when submitting via SCP"
<< std::endl); << std::endl);
ofs << " Problems when submitting via SCP" << std::endl; ofs << " Problems when submitting via SCP" << std::endl;
return -1; return -1;
} }
cmSystemTools::ChangeDirectory(oldWorkingDirectory.c_str()); cmSystemTools::ChangeDirectory(oldWorkingDirectory);
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful" cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful"
<< std::endl); << std::endl);
ofs << " Submission successful" << std::endl; ofs << " Submission successful" << std::endl;
@ -1447,7 +1447,7 @@ int cmCTestSubmitHandler::ProcessHandler()
// on windows since scp dosn't support "c:" a drive in the path // on windows since scp dosn't support "c:" a drive in the path
std::string std::string
oldWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory(); oldWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(buildDirectory.c_str()); cmSystemTools::ChangeDirectory(buildDirectory);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Change directory: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Change directory: "
<< buildDirectory << std::endl); << buildDirectory << std::endl);
@ -1457,14 +1457,14 @@ int cmCTestSubmitHandler::ProcessHandler()
prefix, prefix,
location) ) location) )
{ {
cmSystemTools::ChangeDirectory(oldWorkingDirectory.c_str()); cmSystemTools::ChangeDirectory(oldWorkingDirectory);
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
" Problems when submitting via CP" " Problems when submitting via CP"
<< std::endl); << std::endl);
ofs << " Problems when submitting via cp" << std::endl; ofs << " Problems when submitting via cp" << std::endl;
return -1; return -1;
} }
cmSystemTools::ChangeDirectory(oldWorkingDirectory.c_str()); cmSystemTools::ChangeDirectory(oldWorkingDirectory);
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful" cmCTestLog(this->CTest, HANDLER_OUTPUT, " Submission successful"
<< std::endl); << std::endl);
ofs << " Submission successful" << std::endl; ofs << " Submission successful" << std::endl;

View File

@ -93,12 +93,12 @@ bool cmCTestSubdirCommand
fname += *it; fname += *it;
} }
if ( !cmSystemTools::FileIsDirectory(fname.c_str()) ) if ( !cmSystemTools::FileIsDirectory(fname) )
{ {
// No subdirectory? So what... // No subdirectory? So what...
continue; continue;
} }
cmSystemTools::ChangeDirectory(fname.c_str()); cmSystemTools::ChangeDirectory(fname);
const char* testFilename; const char* testFilename;
if( cmSystemTools::FileExists("CTestTestfile.cmake") ) if( cmSystemTools::FileExists("CTestTestfile.cmake") )
{ {
@ -120,7 +120,7 @@ bool cmCTestSubdirCommand
bool readit = bool readit =
this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(),
fname.c_str()); fname.c_str());
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
if(!readit) if(!readit)
{ {
std::string m = "Could not find include file: "; std::string m = "Could not find include file: ";
@ -129,7 +129,7 @@ bool cmCTestSubdirCommand
return false; return false;
} }
} }
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
return true; return true;
} }
@ -175,7 +175,7 @@ bool cmCTestAddSubdirectoryCommand
} }
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
std::string fname = cwd; std::string fname = cwd;
fname += "/"; fname += "/";
fname += args[1]; fname += args[1];
@ -185,7 +185,7 @@ bool cmCTestAddSubdirectoryCommand
// No subdirectory? So what... // No subdirectory? So what...
return true; return true;
} }
cmSystemTools::ChangeDirectory(fname.c_str()); cmSystemTools::ChangeDirectory(fname);
const char* testFilename; const char* testFilename;
if( cmSystemTools::FileExists("CTestTestfile.cmake") ) if( cmSystemTools::FileExists("CTestTestfile.cmake") )
{ {
@ -200,7 +200,7 @@ bool cmCTestAddSubdirectoryCommand
else else
{ {
// No CTestTestfile? Who cares... // No CTestTestfile? Who cares...
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
return true; return true;
} }
fname += "/"; fname += "/";
@ -208,7 +208,7 @@ bool cmCTestAddSubdirectoryCommand
bool readit = bool readit =
this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(), this->Makefile->ReadListFile(this->Makefile->GetCurrentListFile(),
fname.c_str()); fname.c_str());
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
if(!readit) if(!readit)
{ {
std::string m = "Could not find include file: "; std::string m = "Could not find include file: ";
@ -1498,9 +1498,9 @@ std::string cmCTestTestHandler
{ {
// first check without exe extension // first check without exe extension
if(cmSystemTools::FileExists(attempted[ai].c_str()) if(cmSystemTools::FileExists(attempted[ai].c_str())
&& !cmSystemTools::FileIsDirectory(attempted[ai].c_str())) && !cmSystemTools::FileIsDirectory(attempted[ai]))
{ {
fullPath = cmSystemTools::CollapseFullPath(attempted[ai].c_str()); fullPath = cmSystemTools::CollapseFullPath(attempted[ai]);
resultingConfig = attemptedConfigs[ai]; resultingConfig = attemptedConfigs[ai];
} }
// then try with the exe extension // then try with the exe extension
@ -1510,9 +1510,9 @@ std::string cmCTestTestHandler
tempPath = attempted[ai]; tempPath = attempted[ai];
tempPath += cmSystemTools::GetExecutableExtension(); tempPath += cmSystemTools::GetExecutableExtension();
if(cmSystemTools::FileExists(tempPath.c_str()) if(cmSystemTools::FileExists(tempPath.c_str())
&& !cmSystemTools::FileIsDirectory(tempPath.c_str())) && !cmSystemTools::FileIsDirectory(tempPath))
{ {
fullPath = cmSystemTools::CollapseFullPath(tempPath.c_str()); fullPath = cmSystemTools::CollapseFullPath(tempPath);
resultingConfig = attemptedConfigs[ai]; resultingConfig = attemptedConfigs[ai];
} }
else else
@ -1746,7 +1746,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed()
std::string dirName = this->CTest->GetBinaryDir() + "/Testing/Temporary"; std::string dirName = this->CTest->GetBinaryDir() + "/Testing/Temporary";
cmsys::Directory directory; cmsys::Directory directory;
if (directory.Load(dirName.c_str()) == 0) if (directory.Load(dirName) == 0)
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to read the contents of " cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to read the contents of "
<< dirName << std::endl); << dirName << std::endl);
@ -1754,7 +1754,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed()
} }
int numFiles = static_cast<int> int numFiles = static_cast<int>
(cmsys::Directory::GetNumberOfFilesInDirectory(dirName.c_str())); (cmsys::Directory::GetNumberOfFilesInDirectory(dirName));
std::string pattern = "LastTestsFailed"; std::string pattern = "LastTestsFailed";
std::string logName = ""; std::string logName = "";
@ -1777,7 +1777,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed()
// if multiple matching logs were found we use the most recently // if multiple matching logs were found we use the most recently
// modified one. // modified one.
int res; int res;
cmSystemTools::FileTimeCompare(logName.c_str(), fileName.c_str(), &res); cmSystemTools::FileTimeCompare(logName, fileName, &res);
if (res == -1) if (res == -1)
{ {
logName = fileName; logName = fileName;

View File

@ -31,7 +31,7 @@ bool cmParseCacheCoverage::LoadCoverageData(const char* d)
{ {
std::string file = dir.GetFile(i); std::string file = dir.GetFile(i);
if(file != "." && file != ".." if(file != "." && file != ".."
&& !cmSystemTools::FileIsDirectory(file.c_str())) && !cmSystemTools::FileIsDirectory(file))
{ {
std::string path = d; std::string path = d;
path += "/"; path += "/";

View File

@ -30,7 +30,7 @@ bool cmParseGTMCoverage::LoadCoverageData(const char* d)
{ {
std::string file = dir.GetFile(i); std::string file = dir.GetFile(i);
if(file != "." && file != ".." if(file != "." && file != ".."
&& !cmSystemTools::FileIsDirectory(file.c_str())) && !cmSystemTools::FileIsDirectory(file))
{ {
std::string path = d; std::string path = d;
path += "/"; path += "/";

View File

@ -239,7 +239,7 @@ bool cmParsePHPCoverage::ReadPHPCoverageDirectory(const char* d)
{ {
std::string file = dir.GetFile(i); std::string file = dir.GetFile(i);
if(file != "." && file != ".." if(file != "." && file != ".."
&& !cmSystemTools::FileIsDirectory(file.c_str())) && !cmSystemTools::FileIsDirectory(file))
{ {
std::string path = d; std::string path = d;
path += "/"; path += "/";

View File

@ -69,7 +69,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
cstr = cstr.substr(0, cstr.size()-1); cstr = cstr.substr(0, cstr.size()-1);
} }
if ( cmSystemTools::FileIsDirectory(cstr.c_str()) ) if ( cmSystemTools::FileIsDirectory(cstr) )
{ {
cstr += "/"; cstr += "/";
} }

View File

@ -300,7 +300,7 @@ bool cmAddCustomCommandCommand
if(!working.empty()) if(!working.empty())
{ {
const char* build_dir = this->Makefile->GetCurrentOutputDirectory(); const char* build_dir = this->Makefile->GetCurrentOutputDirectory();
working = cmSystemTools::CollapseFullPath(working.c_str(), build_dir); working = cmSystemTools::CollapseFullPath(working, build_dir);
} }
// Choose which mode of the command to use. // Choose which mode of the command to use.

View File

@ -218,7 +218,7 @@ bool cmAddCustomTargetCommand
{ {
const char* build_dir = this->Makefile->GetCurrentOutputDirectory(); const char* build_dir = this->Makefile->GetCurrentOutputDirectory();
working_directory = working_directory =
cmSystemTools::CollapseFullPath(working_directory.c_str(), build_dir); cmSystemTools::CollapseFullPath(working_directory, build_dir);
} }
// Add the utility target to the makefile. // Add the utility target to the makefile.

View File

@ -61,7 +61,7 @@ bool cmAddSubDirectoryCommand::InitialPass
srcPath += "/"; srcPath += "/";
srcPath += srcArg; srcPath += srcArg;
} }
if(!cmSystemTools::FileIsDirectory(srcPath.c_str())) if(!cmSystemTools::FileIsDirectory(srcPath))
{ {
std::string error = "given source \""; std::string error = "given source \"";
error += srcArg; error += srcArg;
@ -69,7 +69,7 @@ bool cmAddSubDirectoryCommand::InitialPass
this->SetError(error); this->SetError(error);
return false; return false;
} }
srcPath = cmSystemTools::CollapseFullPath(srcPath.c_str()); srcPath = cmSystemTools::CollapseFullPath(srcPath);
// Compute the full path to the binary directory. // Compute the full path to the binary directory.
std::string binPath; std::string binPath;
@ -78,7 +78,7 @@ bool cmAddSubDirectoryCommand::InitialPass
// No binary directory was specified. If the source directory is // No binary directory was specified. If the source directory is
// not a subdirectory of the current directory then it is an // not a subdirectory of the current directory then it is an
// error. // error.
if(!cmSystemTools::IsSubDirectory(srcPath.c_str(), if(!cmSystemTools::IsSubDirectory(srcPath,
this->Makefile->GetCurrentDirectory())) this->Makefile->GetCurrentDirectory()))
{ {
cmOStringStream e; cmOStringStream e;
@ -118,7 +118,7 @@ bool cmAddSubDirectoryCommand::InitialPass
binPath += binArg; binPath += binArg;
} }
} }
binPath = cmSystemTools::CollapseFullPath(binPath.c_str()); binPath = cmSystemTools::CollapseFullPath(binPath);
// Add the subdirectory using the computed full paths. // Add the subdirectory using the computed full paths.
this->Makefile->AddSubDirectory(srcPath, binPath, this->Makefile->AddSubDirectory(srcPath, binPath,

View File

@ -208,7 +208,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method,
return -1; return -1;
} }
::curl_easy_setopt(curl, CURLOPT_PUT, 1); ::curl_easy_setopt(curl, CURLOPT_PUT, 1);
file = cmsys::SystemTools::Fopen(putFile.c_str(), "rb"); file = cmsys::SystemTools::Fopen(putFile, "rb");
::curl_easy_setopt(curl, CURLOPT_INFILE, file); ::curl_easy_setopt(curl, CURLOPT_INFILE, file);
//fall through to append GET fields //fall through to append GET fields
case cmCTest::HTTP_GET: case cmCTest::HTTP_GET:
@ -524,7 +524,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
std::string testingDir = this->BinaryDir + "/Testing"; std::string testingDir = this->BinaryDir + "/Testing";
if ( cmSystemTools::FileExists(testingDir.c_str()) ) if ( cmSystemTools::FileExists(testingDir.c_str()) )
{ {
if ( !cmSystemTools::FileIsDirectory(testingDir.c_str()) ) if ( !cmSystemTools::FileIsDirectory(testingDir) )
{ {
cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir
<< " is in the place of the testing directory" << std::endl); << " is in the place of the testing directory" << std::endl);
@ -809,7 +809,7 @@ bool cmCTest::UpdateCTestConfiguration()
if ( !this->GetCTestConfiguration("BuildDirectory").empty() ) if ( !this->GetCTestConfiguration("BuildDirectory").empty() )
{ {
this->BinaryDir = this->GetCTestConfiguration("BuildDirectory"); this->BinaryDir = this->GetCTestConfiguration("BuildDirectory");
cmSystemTools::ChangeDirectory(this->BinaryDir.c_str()); cmSystemTools::ChangeDirectory(this->BinaryDir);
} }
this->TimeOut = atoi(this->GetCTestConfiguration("TimeOut").c_str()); this->TimeOut = atoi(this->GetCTestConfiguration("TimeOut").c_str());
if ( this->ProduceXML ) if ( this->ProduceXML )
@ -884,7 +884,7 @@ bool cmCTest::OpenOutputFile(const std::string& path,
} }
if ( cmSystemTools::FileExists(testingDir.c_str()) ) if ( cmSystemTools::FileExists(testingDir.c_str()) )
{ {
if ( !cmSystemTools::FileIsDirectory(testingDir.c_str()) ) if ( !cmSystemTools::FileIsDirectory(testingDir) )
{ {
cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir cmCTestLog(this, ERROR_MESSAGE, "File " << testingDir
<< " is in the place of the testing directory" << " is in the place of the testing directory"
@ -1061,17 +1061,17 @@ int cmCTest::ProcessTests()
if ( !notest ) if ( !notest )
{ {
std::string notes_dir = this->BinaryDir + "/Testing/Notes"; std::string notes_dir = this->BinaryDir + "/Testing/Notes";
if ( cmSystemTools::FileIsDirectory(notes_dir.c_str()) ) if ( cmSystemTools::FileIsDirectory(notes_dir) )
{ {
cmsys::Directory d; cmsys::Directory d;
d.Load(notes_dir.c_str()); d.Load(notes_dir);
unsigned long kk; unsigned long kk;
for ( kk = 0; kk < d.GetNumberOfFiles(); kk ++ ) for ( kk = 0; kk < d.GetNumberOfFiles(); kk ++ )
{ {
const char* file = d.GetFile(kk); const char* file = d.GetFile(kk);
std::string fullname = notes_dir + "/" + file; std::string fullname = notes_dir + "/" + file;
if ( cmSystemTools::FileExists(fullname.c_str()) && if ( cmSystemTools::FileExists(fullname.c_str()) &&
!cmSystemTools::FileIsDirectory(fullname.c_str()) ) !cmSystemTools::FileIsDirectory(fullname) )
{ {
if ( this->NotesFiles.size() > 0 ) if ( this->NotesFiles.size() > 0 )
{ {
@ -1294,7 +1294,7 @@ int cmCTest::RunTest(std::vector<const char*> argv,
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
"Test timeout computed to be: " << timeout << "\n"); "Test timeout computed to be: " << timeout << "\n");
if(cmSystemTools::SameFile( if(cmSystemTools::SameFile(
argv[0], cmSystemTools::GetCTestCommand().c_str()) && argv[0], cmSystemTools::GetCTestCommand()) &&
!this->ForceNewCTestProcess) !this->ForceNewCTestProcess)
{ {
cmCTest inst; cmCTest inst;
@ -1342,7 +1342,7 @@ int cmCTest::RunTest(std::vector<const char*> argv,
{ {
*log << *output; *log << *output;
} }
cmSystemTools::ChangeDirectory(oldpath.c_str()); cmSystemTools::ChangeDirectory(oldpath);
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
"Internal cmCTest object used to run test." << std::endl "Internal cmCTest object used to run test." << std::endl
@ -1681,7 +1681,7 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file)
return ""; return "";
} }
std::string base64 = this->Base64EncodeFile(tarFile); std::string base64 = this->Base64EncodeFile(tarFile);
cmSystemTools::RemoveFile(tarFile.c_str()); cmSystemTools::RemoveFile(tarFile);
return base64; return base64;
} }
@ -2628,10 +2628,10 @@ std::string cmCTest::GetShortPathToFile(const char* cfname)
{ {
const std::string& sourceDir const std::string& sourceDir
= cmSystemTools::CollapseFullPath( = cmSystemTools::CollapseFullPath(
this->GetCTestConfiguration("SourceDirectory").c_str()); this->GetCTestConfiguration("SourceDirectory"));
const std::string& buildDir const std::string& buildDir
= cmSystemTools::CollapseFullPath( = cmSystemTools::CollapseFullPath(
this->GetCTestConfiguration("BuildDirectory").c_str()); this->GetCTestConfiguration("BuildDirectory"));
std::string fname = cmSystemTools::CollapseFullPath(cfname); std::string fname = cmSystemTools::CollapseFullPath(cfname);
// Find relative paths to both directories // Find relative paths to both directories

View File

@ -189,7 +189,7 @@ void cmCacheManager::CleanCMakeFiles(const std::string& path)
for(std::vector<std::string>::iterator i = files.begin(); for(std::vector<std::string>::iterator i = files.begin();
i != files.end(); ++i) i != files.end(); ++i)
{ {
cmSystemTools::RemoveFile(i->c_str()); cmSystemTools::RemoveFile(*i);
} }
} }
@ -336,7 +336,7 @@ bool cmCacheManager::LoadCache(const std::string& path,
cmSystemTools::ConvertToUnixSlashes(currentcwd); cmSystemTools::ConvertToUnixSlashes(currentcwd);
currentcwd += "/CMakeCache.txt"; currentcwd += "/CMakeCache.txt";
oldcwd += "/CMakeCache.txt"; oldcwd += "/CMakeCache.txt";
if(!cmSystemTools::SameFile(oldcwd.c_str(), currentcwd.c_str())) if(!cmSystemTools::SameFile(oldcwd, currentcwd))
{ {
std::string message = std::string message =
std::string("The current CMakeCache.txt directory ") + std::string("The current CMakeCache.txt directory ") +
@ -586,13 +586,13 @@ bool cmCacheManager::DeleteCache(const std::string& path)
cacheFile += "/CMakeCache.txt"; cacheFile += "/CMakeCache.txt";
if(cmSystemTools::FileExists(cacheFile.c_str())) if(cmSystemTools::FileExists(cacheFile.c_str()))
{ {
cmSystemTools::RemoveFile(cacheFile.c_str()); cmSystemTools::RemoveFile(cacheFile);
// now remove the files in the CMakeFiles directory // now remove the files in the CMakeFiles directory
// this cleans up language cache files // this cleans up language cache files
cmakeFiles += cmake::GetCMakeFilesDirectory(); cmakeFiles += cmake::GetCMakeFilesDirectory();
if(cmSystemTools::FileIsDirectory(cmakeFiles.c_str())) if(cmSystemTools::FileIsDirectory(cmakeFiles))
{ {
cmSystemTools::RemoveADirectory(cmakeFiles.c_str()); cmSystemTools::RemoveADirectory(cmakeFiles);
} }
} }
return true; return true;

View File

@ -675,7 +675,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
// This is not a CMake target. Use the name given. // This is not a CMake target. Use the name given.
if(cmSystemTools::FileIsFullPath(item.c_str())) if(cmSystemTools::FileIsFullPath(item.c_str()))
{ {
if(cmSystemTools::FileIsDirectory(item.c_str())) if(cmSystemTools::FileIsDirectory(item))
{ {
// This is a directory. // This is a directory.
this->AddDirectoryItem(item); this->AddDirectoryItem(item);
@ -1937,10 +1937,10 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
// Do not add any path inside the source or build tree. // Do not add any path inside the source or build tree.
const char* topSourceDir = this->Makefile->GetHomeDirectory(); const char* topSourceDir = this->Makefile->GetHomeDirectory();
const char* topBinaryDir = this->Makefile->GetHomeOutputDirectory(); const char* topBinaryDir = this->Makefile->GetHomeOutputDirectory();
if(!cmSystemTools::ComparePath(ri->c_str(), topSourceDir) && if(!cmSystemTools::ComparePath(*ri, topSourceDir) &&
!cmSystemTools::ComparePath(ri->c_str(), topBinaryDir) && !cmSystemTools::ComparePath(*ri, topBinaryDir) &&
!cmSystemTools::IsSubDirectory(ri->c_str(), topSourceDir) && !cmSystemTools::IsSubDirectory(*ri, topSourceDir) &&
!cmSystemTools::IsSubDirectory(ri->c_str(), topBinaryDir)) !cmSystemTools::IsSubDirectory(*ri, topBinaryDir))
{ {
std::string d = *ri; std::string d = *ri;
if (!rootPath.empty() && d.find(rootPath) == 0) if (!rootPath.empty() && d.find(rootPath) == 0)

View File

@ -32,7 +32,7 @@ bool cmConfigureFileCommand
this->InputFile += inFile; this->InputFile += inFile;
// If the input location is a directory, error out. // If the input location is a directory, error out.
if(cmSystemTools::FileIsDirectory(this->InputFile.c_str())) if(cmSystemTools::FileIsDirectory(this->InputFile))
{ {
cmOStringStream e; cmOStringStream e;
e << "input location\n" e << "input location\n"
@ -51,7 +51,7 @@ bool cmConfigureFileCommand
this->OutputFile += outFile; this->OutputFile += outFile;
// If the output location is already a directory put the file in it. // If the output location is already a directory put the file in it.
if(cmSystemTools::FileIsDirectory(this->OutputFile.c_str())) if(cmSystemTools::FileIsDirectory(this->OutputFile))
{ {
this->OutputFile += "/"; this->OutputFile += "/";
this->OutputFile += cmSystemTools::GetFilenameName(inFile); this->OutputFile += cmSystemTools::GetFilenameName(inFile);

View File

@ -233,7 +233,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{ {
// remove any CMakeCache.txt files so we will have a clean test // remove any CMakeCache.txt files so we will have a clean test
std::string ccFile = this->BinaryDirectory + "/CMakeCache.txt"; std::string ccFile = this->BinaryDirectory + "/CMakeCache.txt";
cmSystemTools::RemoveFile(ccFile.c_str()); cmSystemTools::RemoveFile(ccFile);
// Choose sources. // Choose sources.
if(!useSources) if(!useSources)
@ -279,7 +279,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
sourceDirectory = this->BinaryDirectory.c_str(); sourceDirectory = this->BinaryDirectory.c_str();
// now create a CMakeLists.txt file in that directory // now create a CMakeLists.txt file in that directory
FILE *fout = cmsys::SystemTools::Fopen(outFileName.c_str(),"w"); FILE *fout = cmsys::SystemTools::Fopen(outFileName,"w");
if (!fout) if (!fout)
{ {
cmOStringStream e; cmOStringStream e;
@ -514,8 +514,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if ((res==0) && (copyFile.size())) if ((res==0) && (copyFile.size()))
{ {
if(this->OutputFile.empty() || if(this->OutputFile.empty() ||
!cmSystemTools::CopyFileAlways(this->OutputFile.c_str(), !cmSystemTools::CopyFileAlways(this->OutputFile,
copyFile.c_str())) copyFile))
{ {
cmOStringStream emsg; cmOStringStream emsg;
emsg << "Cannot copy output executable\n" emsg << "Cannot copy output executable\n"
@ -580,10 +580,10 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
std::string fullPath = binDir; std::string fullPath = binDir;
fullPath += "/"; fullPath += "/";
fullPath += dir.GetFile(static_cast<unsigned long>(fileNum)); fullPath += dir.GetFile(static_cast<unsigned long>(fileNum));
if(cmSystemTools::FileIsDirectory(fullPath.c_str())) if(cmSystemTools::FileIsDirectory(fullPath))
{ {
this->CleanupFiles(fullPath.c_str()); this->CleanupFiles(fullPath.c_str());
cmSystemTools::RemoveADirectory(fullPath.c_str()); cmSystemTools::RemoveADirectory(fullPath);
} }
else else
{ {
@ -599,7 +599,7 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
} }
if(retry.Count == 0) if(retry.Count == 0)
#else #else
if(!cmSystemTools::RemoveFile(fullPath.c_str())) if(!cmSystemTools::RemoveFile(fullPath))
#endif #endif
{ {
std::string m = "Remove failed on file: " + fullPath; std::string m = "Remove failed on file: " + fullPath;
@ -649,7 +649,7 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName)
command += tmpOutputFile; command += tmpOutputFile;
if(cmSystemTools::FileExists(command.c_str())) if(cmSystemTools::FileExists(command.c_str()))
{ {
tmpOutputFile = cmSystemTools::CollapseFullPath(command.c_str()); tmpOutputFile = cmSystemTools::CollapseFullPath(command);
this->OutputFile = tmpOutputFile; this->OutputFile = tmpOutputFile;
return; return;
} }

View File

@ -94,7 +94,7 @@ bool cmDepends::Check(const char *makeFile, const char *internalFile,
// Get the CWD but do not call CollapseFullPath because // Get the CWD but do not call CollapseFullPath because
// we only need it to cd back, and the form does not matter // we only need it to cd back, and the form does not matter
oldcwd = cmSystemTools::GetCurrentWorkingDirectory(false); oldcwd = cmSystemTools::GetCurrentWorkingDirectory(false);
cmSystemTools::ChangeDirectory(this->CompileDirectory.c_str()); cmSystemTools::ChangeDirectory(this->CompileDirectory);
} }
// Check whether dependencies must be regenerated. // Check whether dependencies must be regenerated.
@ -111,7 +111,7 @@ bool cmDepends::Check(const char *makeFile, const char *internalFile,
// Restore working directory. // Restore working directory.
if(oldcwd != ".") if(oldcwd != ".")
{ {
cmSystemTools::ChangeDirectory(oldcwd.c_str()); cmSystemTools::ChangeDirectory(oldcwd);
} }
return okay; return okay;

View File

@ -668,7 +668,7 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
if(cmDependsFortran::ModulesDiffer(mod_upper.c_str(), stamp.c_str(), if(cmDependsFortran::ModulesDiffer(mod_upper.c_str(), stamp.c_str(),
compilerId.c_str())) compilerId.c_str()))
{ {
if(!cmSystemTools::CopyFileAlways(mod_upper.c_str(), stamp.c_str())) if(!cmSystemTools::CopyFileAlways(mod_upper, stamp))
{ {
std::cerr << "Error copying Fortran module from \"" std::cerr << "Error copying Fortran module from \""
<< mod_upper << "\" to \"" << stamp << mod_upper << "\" to \"" << stamp
@ -683,7 +683,7 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
if(cmDependsFortran::ModulesDiffer(mod_lower.c_str(), stamp.c_str(), if(cmDependsFortran::ModulesDiffer(mod_lower.c_str(), stamp.c_str(),
compilerId.c_str())) compilerId.c_str()))
{ {
if(!cmSystemTools::CopyFileAlways(mod_lower.c_str(), stamp.c_str())) if(!cmSystemTools::CopyFileAlways(mod_lower, stamp))
{ {
std::cerr << "Error copying Fortran module from \"" std::cerr << "Error copying Fortran module from \""
<< mod_lower << "\" to \"" << stamp << mod_lower << "\" to \"" << stamp

View File

@ -276,7 +276,7 @@ void cmExtraCodeBlocksGenerator
it->second[0]->GetMakefile()->GetHomeDirectory(), it->second[0]->GetMakefile()->GetHomeDirectory(),
jt->c_str()); jt->c_str());
std::vector<std::string> splitted; std::vector<std::string> splitted;
cmSystemTools::SplitPath(relative.c_str(), splitted, false); cmSystemTools::SplitPath(relative, splitted, false);
// Split filename from path // Split filename from path
std::string fileName = *(splitted.end()-1); std::string fileName = *(splitted.end()-1);
splitted.erase(splitted.end() - 1, splitted.end()); splitted.erase(splitted.end() - 1, splitted.end());

View File

@ -124,8 +124,8 @@ void cmExtraEclipseCDT4Generator::Generate()
"Enable CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT instead."); "Enable CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT instead.");
} }
if (cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(), if (cmSystemTools::IsSubDirectory(this->HomeOutputDirectory,
this->HomeDirectory.c_str())) this->HomeDirectory))
{ {
mf->IssueMessage(cmake::WARNING, "The build directory is a subdirectory " mf->IssueMessage(cmake::WARNING, "The build directory is a subdirectory "
"of the source directory.\n" "of the source directory.\n"
@ -495,8 +495,8 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
std::string linkSourceDirectory = this->GetEclipsePath( std::string linkSourceDirectory = this->GetEclipsePath(
mf->GetStartDirectory()); mf->GetStartDirectory());
// .project dir can't be subdir of a linked resource dir // .project dir can't be subdir of a linked resource dir
if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(), if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory,
linkSourceDirectory.c_str())) linkSourceDirectory))
{ {
this->AppendLinkedResource(fout, sourceLinkedResourceName, this->AppendLinkedResource(fout, sourceLinkedResourceName,
this->GetEclipsePath(linkSourceDirectory), this->GetEclipsePath(linkSourceDirectory),
@ -590,7 +590,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
++fileIt) ++fileIt)
{ {
std::string fullPath = (*fileIt)->GetFullPath(); std::string fullPath = (*fileIt)->GetFullPath();
if (!cmSystemTools::FileIsDirectory(fullPath.c_str())) if (!cmSystemTools::FileIsDirectory(fullPath))
{ {
std::string linkName4 = linkName3; std::string linkName4 = linkName3;
linkName4 += "/"; linkName4 += "/";
@ -635,8 +635,8 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
// a linked resource must not point to a parent directory of .project or // a linked resource must not point to a parent directory of .project or
// .project itself // .project itself
if ((baseDir != linkSourceDirectory) && if ((baseDir != linkSourceDirectory) &&
!cmSystemTools::IsSubDirectory(baseDir.c_str(), !cmSystemTools::IsSubDirectory(baseDir,
linkSourceDirectory.c_str())) linkSourceDirectory))
{ {
std::string linkName = "[Subprojects]/"; std::string linkName = "[Subprojects]/";
linkName += it->first; linkName += it->first;
@ -663,7 +663,7 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
{ {
if (!inc->empty()) if (!inc->empty())
{ {
std::string dir = cmSystemTools::CollapseFullPath(inc->c_str()); std::string dir = cmSystemTools::CollapseFullPath(*inc);
// handle framework include dirs on OSX, the remainder after the // handle framework include dirs on OSX, the remainder after the
// Frameworks/ part has to be stripped // Frameworks/ part has to be stripped
@ -819,7 +819,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// exlude source directory from output search path // exlude source directory from output search path
// - only if not named the same as an output directory // - only if not named the same as an output directory
if (!cmSystemTools::FileIsDirectory( if (!cmSystemTools::FileIsDirectory(
std::string(this->HomeOutputDirectory + "/" + *it).c_str())) std::string(this->HomeOutputDirectory + "/" + *it)))
{ {
excludeFromOut += this->EscapeForXML(*it) + "/|"; excludeFromOut += this->EscapeForXML(*it) + "/|";
} }

View File

@ -1504,7 +1504,7 @@ bool cmFileCopier::Run(std::vector<std::string> const& args)
{ {
// Split the input file into its directory and name components. // Split the input file into its directory and name components.
std::vector<std::string> fromPathComponents; std::vector<std::string> fromPathComponents;
cmSystemTools::SplitPath(files[i].c_str(), fromPathComponents); cmSystemTools::SplitPath(files[i], fromPathComponents);
std::string fromName = *(fromPathComponents.end()-1); std::string fromName = *(fromPathComponents.end()-1);
std::string fromDir = cmSystemTools::JoinPath(fromPathComponents.begin(), std::string fromDir = cmSystemTools::JoinPath(fromPathComponents.begin(),
fromPathComponents.end()-1); fromPathComponents.end()-1);
@ -2203,7 +2203,7 @@ bool cmFileInstaller::HandleInstallDestination()
return false; return false;
} }
} }
if ( !cmSystemTools::FileIsDirectory(destination.c_str()) ) if ( !cmSystemTools::FileIsDirectory(destination) )
{ {
std::string errstring = "INSTALL destination: " + destination + std::string errstring = "INSTALL destination: " + destination +
" is not a directory."; " is not a directory.";
@ -2553,14 +2553,14 @@ bool cmFileCommand::HandleRemove(std::vector<std::string> const& args,
fileName += "/" + *i; fileName += "/" + *i;
} }
if(cmSystemTools::FileIsDirectory(fileName.c_str()) && if(cmSystemTools::FileIsDirectory(fileName) &&
!cmSystemTools::FileIsSymlink(fileName.c_str()) && recurse) !cmSystemTools::FileIsSymlink(fileName) && recurse)
{ {
cmSystemTools::RemoveADirectory(fileName.c_str()); cmSystemTools::RemoveADirectory(fileName);
} }
else else
{ {
cmSystemTools::RemoveFile(fileName.c_str()); cmSystemTools::RemoveFile(fileName);
} }
} }
return true; return true;
@ -2584,7 +2584,7 @@ bool cmFileCommand::HandleCMakePathCommand(std::vector<std::string>
#else #else
char pathSep = ':'; char pathSep = ':';
#endif #endif
std::vector<cmsys::String> path = cmSystemTools::SplitString(i->c_str(), std::vector<cmsys::String> path = cmSystemTools::SplitString(*i,
pathSep); pathSep);
i++; i++;
const char* var = i->c_str(); const char* var = i->c_str();
@ -3241,7 +3241,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
// Open file for reading: // Open file for reading:
// //
FILE *fin = cmsys::SystemTools::Fopen(filename.c_str(), "rb"); FILE *fin = cmsys::SystemTools::Fopen(filename, "rb");
if(!fin) if(!fin)
{ {
std::string errStr = "UPLOAD cannot open file '"; std::string errStr = "UPLOAD cannot open file '";

View File

@ -182,9 +182,9 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
// already inside. Skip the unrooted path if it is relative to // already inside. Skip the unrooted path if it is relative to
// a user home directory or is empty. // a user home directory or is empty.
std::string rootedDir; std::string rootedDir;
if(cmSystemTools::IsSubDirectory(ui->c_str(), ri->c_str()) if(cmSystemTools::IsSubDirectory(*ui, *ri)
|| (stagePrefix || (stagePrefix
&& cmSystemTools::IsSubDirectory(ui->c_str(), stagePrefix))) && cmSystemTools::IsSubDirectory(*ui, stagePrefix)))
{ {
rootedDir = *ui; rootedDir = *ui;
} }
@ -195,7 +195,7 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
rootedDir += "/"; rootedDir += "/";
// Append the original path with its old root removed. // Append the original path with its old root removed.
rootedDir += cmSystemTools::SplitPathRootComponent(ui->c_str()); rootedDir += cmSystemTools::SplitPathRootComponent(*ui);
} }
// Store the new path. // Store the new path.
@ -428,7 +428,7 @@ void cmFindCommon::AddPathInternal(std::string const& in_path,
// Convert to clean full path. // Convert to clean full path.
std::string fullPath = std::string fullPath =
cmSystemTools::CollapseFullPath(in_path.c_str(), relbase); cmSystemTools::CollapseFullPath(in_path, relbase);
// Insert the path if has not already been emitted. // Insert the path if has not already been emitted.
if(this->SearchPathsEmitted.insert(fullPath).second) if(this->SearchPathsEmitted.insert(fullPath).second)

View File

@ -107,7 +107,7 @@ void cmFindLibraryCommand::AddArchitecturePath(
// Follow "lib<suffix>". // Follow "lib<suffix>".
std::string next_dir = cur_dir + suffix; std::string next_dir = cur_dir + suffix;
if(cmSystemTools::FileIsDirectory(next_dir.c_str())) if(cmSystemTools::FileIsDirectory(next_dir))
{ {
next_dir += dir.substr(pos+3); next_dir += dir.substr(pos+3);
std::string::size_type next_pos = pos+3+strlen(suffix)+1; std::string::size_type next_pos = pos+3+strlen(suffix)+1;
@ -115,7 +115,7 @@ void cmFindLibraryCommand::AddArchitecturePath(
} }
// Follow "lib". // Follow "lib".
if(cmSystemTools::FileIsDirectory(cur_dir.c_str())) if(cmSystemTools::FileIsDirectory(cur_dir))
{ {
this->AddArchitecturePath(dir, pos+3+1, suffix, false); this->AddArchitecturePath(dir, pos+3+1, suffix, false);
} }
@ -124,13 +124,13 @@ void cmFindLibraryCommand::AddArchitecturePath(
{ {
// Check for <dir><suffix>/. // Check for <dir><suffix>/.
std::string cur_dir = dir + suffix + "/"; std::string cur_dir = dir + suffix + "/";
if(cmSystemTools::FileIsDirectory(cur_dir.c_str())) if(cmSystemTools::FileIsDirectory(cur_dir))
{ {
this->SearchPaths.push_back(cur_dir); this->SearchPaths.push_back(cur_dir);
} }
// Now add the original unchanged path // Now add the original unchanged path
if(cmSystemTools::FileIsDirectory(dir.c_str())) if(cmSystemTools::FileIsDirectory(dir))
{ {
this->SearchPaths.push_back(dir); this->SearchPaths.push_back(dir);
} }
@ -353,7 +353,7 @@ bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path,
if(cmSystemTools::FileExists(this->TestPath.c_str(), true)) if(cmSystemTools::FileExists(this->TestPath.c_str(), true))
{ {
this->BestPath = this->BestPath =
cmSystemTools::CollapseFullPath(this->TestPath.c_str()); cmSystemTools::CollapseFullPath(this->TestPath);
cmSystemTools::ConvertToUnixSlashes(this->BestPath); cmSystemTools::ConvertToUnixSlashes(this->BestPath);
return true; return true;
} }
@ -382,7 +382,7 @@ bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path,
{ {
this->TestPath = path; this->TestPath = path;
this->TestPath += origName; this->TestPath += origName;
if(!cmSystemTools::FileIsDirectory(this->TestPath.c_str())) if(!cmSystemTools::FileIsDirectory(this->TestPath))
{ {
// This is a matching file. Check if it is better than the // This is a matching file. Check if it is better than the
// best name found so far. Earlier prefixes are preferred, // best name found so far. Earlier prefixes are preferred,
@ -506,9 +506,9 @@ std::string cmFindLibraryCommand::FindFrameworkLibraryNamesPerDir()
fwPath = *di; fwPath = *di;
fwPath += *ni; fwPath += *ni;
fwPath += ".framework"; fwPath += ".framework";
if(cmSystemTools::FileIsDirectory(fwPath.c_str())) if(cmSystemTools::FileIsDirectory(fwPath))
{ {
return cmSystemTools::CollapseFullPath(fwPath.c_str()); return cmSystemTools::CollapseFullPath(fwPath);
} }
} }
} }
@ -532,9 +532,9 @@ std::string cmFindLibraryCommand::FindFrameworkLibraryDirsPerName()
fwPath = *di; fwPath = *di;
fwPath += *ni; fwPath += *ni;
fwPath += ".framework"; fwPath += ".framework";
if(cmSystemTools::FileIsDirectory(fwPath.c_str())) if(cmSystemTools::FileIsDirectory(fwPath))
{ {
return cmSystemTools::CollapseFullPath(fwPath.c_str()); return cmSystemTools::CollapseFullPath(fwPath);
} }
} }
} }

View File

@ -1335,7 +1335,7 @@ public:
void cmFindPackageCommand::LoadPackageRegistryDir(std::string const& dir) void cmFindPackageCommand::LoadPackageRegistryDir(std::string const& dir)
{ {
cmsys::Directory files; cmsys::Directory files;
if(!files.Load(dir.c_str())) if(!files.Load(dir))
{ {
return; return;
} }
@ -1347,7 +1347,7 @@ void cmFindPackageCommand::LoadPackageRegistryDir(std::string const& dir)
fname += "/"; fname += "/";
fname += files.GetFile(i); fname += files.GetFile(i);
if(!cmSystemTools::FileIsDirectory(fname.c_str())) if(!cmSystemTools::FileIsDirectory(fname))
{ {
// Hold this file hostage until it behaves. // Hold this file hostage until it behaves.
cmFindPackageCommandHoldFile holdFile(fname.c_str()); cmFindPackageCommandHoldFile holdFile(fname.c_str());
@ -1379,7 +1379,7 @@ bool cmFindPackageCommand::CheckPackageRegistryEntry(std::istream& is)
if(cmSystemTools::FileExists(fname.c_str())) if(cmSystemTools::FileExists(fname.c_str()))
{ {
// The path exists. Look for the package here. // The path exists. Look for the package here.
if(!cmSystemTools::FileIsDirectory(fname.c_str())) if(!cmSystemTools::FileIsDirectory(fname))
{ {
fname = cmSystemTools::GetFilenamePath(fname); fname = cmSystemTools::GetFilenamePath(fname);
} }
@ -1419,7 +1419,7 @@ void cmFindPackageCommand::AddPrefixesBuilds()
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))
{ {
this->AddPathInternal(f, FullPath); this->AddPathInternal(f, FullPath);
} }
@ -1847,7 +1847,7 @@ private:
// Construct a list of matches. // Construct a list of matches.
std::vector<std::string> matches; std::vector<std::string> matches;
cmsys::Directory d; cmsys::Directory d;
d.Load(parent.c_str()); d.Load(parent);
for(unsigned long i=0; i < d.GetNumberOfFiles(); ++i) for(unsigned long i=0; i < d.GetNumberOfFiles(); ++i)
{ {
const char* fname = d.GetFile(i); const char* fname = d.GetFile(i);
@ -1901,7 +1901,7 @@ private:
// Construct a list of matches. // Construct a list of matches.
std::vector<std::string> matches; std::vector<std::string> matches;
cmsys::Directory d; cmsys::Directory d;
d.Load(parent.c_str()); d.Load(parent);
for(unsigned long i=0; i < d.GetNumberOfFiles(); ++i) for(unsigned long i=0; i < d.GetNumberOfFiles(); ++i)
{ {
const char* fname = d.GetFile(i); const char* fname = d.GetFile(i);
@ -1955,7 +1955,7 @@ private:
// Look for matching files. // Look for matching files.
std::vector<std::string> matches; std::vector<std::string> matches;
cmsys::Directory d; cmsys::Directory d;
d.Load(parent.c_str()); d.Load(parent);
for(unsigned long i=0; i < d.GetNumberOfFiles(); ++i) for(unsigned long i=0; i < d.GetNumberOfFiles(); ++i)
{ {
const char* fname = d.GetFile(i); const char* fname = d.GetFile(i);
@ -2007,7 +2007,7 @@ private:
for(std::vector<std::string>::const_iterator fi = files.begin(); for(std::vector<std::string>::const_iterator fi = files.begin();
fi != files.end(); ++fi) fi != files.end(); ++fi)
{ {
if(cmSystemTools::FileIsDirectory(fi->c_str())) if(cmSystemTools::FileIsDirectory(*fi))
{ {
if(this->Consider(*fi, lister)) if(this->Consider(*fi, lister))
{ {
@ -2035,7 +2035,7 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
} }
// Skip this if the prefix does not exist. // Skip this if the prefix does not exist.
if(!cmSystemTools::FileIsDirectory(prefix_in.c_str())) if(!cmSystemTools::FileIsDirectory(prefix_in))
{ {
return false; return false;
} }

View File

@ -136,7 +136,7 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file,
std::vector<std::string> files = globIt.GetFiles(); std::vector<std::string> files = globIt.GetFiles();
if(files.size()) if(files.size())
{ {
std::string fheader = cmSystemTools::CollapseFullPath(files[0].c_str()); std::string fheader = cmSystemTools::CollapseFullPath(files[0]);
if(this->IncludeFileInPath) if(this->IncludeFileInPath)
{ {
return fheader; return fheader;

View File

@ -97,7 +97,7 @@ std::string cmFindProgramCommand
std::string executable = GetBundleExecutable(appPath); std::string executable = GetBundleExecutable(appPath);
if (!executable.empty()) if (!executable.empty())
{ {
return cmSystemTools::CollapseFullPath(executable.c_str()); return cmSystemTools::CollapseFullPath(executable);
} }
} }
} }

View File

@ -152,7 +152,7 @@ void cmGeneratedFileStreamBase::Open(const char* name)
#endif #endif
// Make sure the temporary file that will be used is not present. // Make sure the temporary file that will be used is not present.
cmSystemTools::RemoveFile(this->TempName.c_str()); cmSystemTools::RemoveFile(this->TempName);
std::string dir = cmSystemTools::GetFilenamePath(this->TempName); std::string dir = cmSystemTools::GetFilenamePath(this->TempName);
cmSystemTools::MakeDirectory(dir.c_str()); cmSystemTools::MakeDirectory(dir.c_str());
@ -174,7 +174,7 @@ bool cmGeneratedFileStreamBase::Close()
if(!this->Name.empty() && if(!this->Name.empty() &&
this->Okay && this->Okay &&
(!this->CopyIfDifferent || (!this->CopyIfDifferent ||
cmSystemTools::FilesDiffer(this->TempName.c_str(), resname.c_str()))) cmSystemTools::FilesDiffer(this->TempName, resname)))
{ {
// The destination is to be replaced. Rename the temporary to the // The destination is to be replaced. Rename the temporary to the
// destination atomically. // destination atomically.
@ -185,7 +185,7 @@ bool cmGeneratedFileStreamBase::Close()
{ {
this->RenameFile(gzname.c_str(), resname.c_str()); this->RenameFile(gzname.c_str(), resname.c_str());
} }
cmSystemTools::RemoveFile(gzname.c_str()); cmSystemTools::RemoveFile(gzname);
} }
else else
{ {
@ -198,7 +198,7 @@ bool cmGeneratedFileStreamBase::Close()
// Else, the destination was not replaced. // Else, the destination was not replaced.
// //
// Always delete the temporary file. We never want it to stay around. // Always delete the temporary file. We never want it to stay around.
cmSystemTools::RemoveFile(this->TempName.c_str()); cmSystemTools::RemoveFile(this->TempName);
return replaced; return replaced;
} }

View File

@ -1253,7 +1253,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
std::string tgtName = parameters.front(); std::string tgtName = parameters.front();
cmGeneratorTarget* gt = cmGeneratorTarget* gt =
context->Makefile->FindGeneratorTargetToUse(tgtName.c_str()); context->Makefile->FindGeneratorTargetToUse(tgtName);
if (!gt) if (!gt)
{ {
cmOStringStream e; cmOStringStream e;

View File

@ -772,8 +772,8 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
std::string tLocation = t->GetLocationForBuild(); std::string tLocation = t->GetLocationForBuild();
tLocation = cmSystemTools::GetFilenamePath(tLocation); tLocation = cmSystemTools::GetFilenamePath(tLocation);
std::string depLocation = cmSystemTools::GetFilenamePath(dep); std::string depLocation = cmSystemTools::GetFilenamePath(dep);
depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str()); depLocation = cmSystemTools::CollapseFullPath(depLocation);
tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str()); tLocation = cmSystemTools::CollapseFullPath(tLocation);
if(depLocation == tLocation) if(depLocation == tLocation)
{ {
this->Target->AddUtility(util); this->Target->AddUtility(util);

View File

@ -49,7 +49,7 @@ bool cmGetDirectoryPropertyCommand
} }
// The local generators are associated with collapsed paths. // The local generators are associated with collapsed paths.
sd = cmSystemTools::CollapseFullPath(sd.c_str()); sd = cmSystemTools::CollapseFullPath(sd);
// lookup the makefile from the directory name // lookup the makefile from the directory name
cmLocalGenerator *lg = cmLocalGenerator *lg =

View File

@ -97,11 +97,11 @@ bool cmGetFilenameComponentCommand
// If the path given is relative evaluate it relative to the // If the path given is relative evaluate it relative to the
// current source directory. // current source directory.
result = cmSystemTools::CollapseFullPath( result = cmSystemTools::CollapseFullPath(
filename.c_str(), this->Makefile->GetCurrentDirectory()); filename, this->Makefile->GetCurrentDirectory());
if(args[2] == "REALPATH") if(args[2] == "REALPATH")
{ {
// Resolve symlinks if possible // Resolve symlinks if possible
result = cmSystemTools::GetRealPath(result.c_str()); result = cmSystemTools::GetRealPath(result);
} }
} }
else else

View File

@ -259,7 +259,7 @@ bool cmGetPropertyCommand::HandleDirectoryMode()
} }
// The local generators are associated with collapsed paths. // The local generators are associated with collapsed paths.
dir = cmSystemTools::CollapseFullPath(dir.c_str()); dir = cmSystemTools::CollapseFullPath(dir);
// Lookup the generator. // Lookup the generator.
if(cmLocalGenerator* lg = if(cmLocalGenerator* lg =

View File

@ -300,7 +300,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
cmSystemTools::SplitProgramPath(makeProgram.c_str(), cmSystemTools::SplitProgramPath(makeProgram.c_str(),
dir, file); dir, file);
std::string saveFile = file; std::string saveFile = file;
cmSystemTools::GetShortPath(makeProgram.c_str(), makeProgram); cmSystemTools::GetShortPath(makeProgram, makeProgram);
cmSystemTools::SplitProgramPath(makeProgram.c_str(), cmSystemTools::SplitProgramPath(makeProgram.c_str(),
dir, file); dir, file);
makeProgram = dir; makeProgram = dir;
@ -691,7 +691,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
compilerLangFile += "/CMake"; compilerLangFile += "/CMake";
compilerLangFile += lang; compilerLangFile += lang;
compilerLangFile += "Compiler.cmake"; compilerLangFile += "Compiler.cmake";
cmSystemTools::RemoveFile(compilerLangFile.c_str()); cmSystemTools::RemoveFile(compilerLangFile);
if(!this->CMakeInstance->GetIsInTryCompile()) if(!this->CMakeInstance->GetIsInTryCompile())
{ {
this->PrintCompilerAdvice(noCompiler, lang, this->PrintCompilerAdvice(noCompiler, lang,
@ -758,7 +758,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
compilerLangFile += "/CMake"; compilerLangFile += "/CMake";
compilerLangFile += lang; compilerLangFile += lang;
compilerLangFile += "Compiler.cmake"; compilerLangFile += "Compiler.cmake";
cmSystemTools::RemoveFile(compilerLangFile.c_str()); cmSystemTools::RemoveFile(compilerLangFile);
} }
} // end if in try compile } // end if in try compile
} // end need test language } // end need test language
@ -1735,7 +1735,7 @@ int cmGlobalGenerator::Build(
* Run an executable command and put the stdout in output. * Run an executable command and put the stdout in output.
*/ */
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(bindir.c_str()); cmSystemTools::ChangeDirectory(bindir);
output += "Change Dir: "; output += "Change Dir: ";
output += bindir; output += bindir;
output += "\n"; output += "\n";
@ -1765,7 +1765,7 @@ int cmGlobalGenerator::Build(
output += "\nGenerator: execution of make clean failed.\n"; output += "\nGenerator: execution of make clean failed.\n";
// return to the original directory // return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
return 1; return 1;
} }
output += *outputPtr; output += *outputPtr;
@ -1792,7 +1792,7 @@ int cmGlobalGenerator::Build(
+ makeCommandStr + "\n"; + makeCommandStr + "\n";
// return to the original directory // return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
return 1; return 1;
} }
output += *outputPtr; output += *outputPtr;
@ -1806,7 +1806,7 @@ int cmGlobalGenerator::Build(
retVal = 1; retVal = 1;
} }
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
return retVal; return retVal;
} }
@ -2723,7 +2723,7 @@ cmGlobalGenerator::GetDirectoryContent(std::string const& dir, bool needDisk)
{ {
// Load the directory content from disk. // Load the directory content from disk.
cmsys::Directory d; cmsys::Directory d;
if(d.Load(dir.c_str())) if(d.Load(dir))
{ {
unsigned long n = d.GetNumberOfFiles(); unsigned long n = d.GetNumberOfFiles();
for(unsigned long i = 0; i < n; ++i) for(unsigned long i = 0; i < n; ++i)
@ -2830,8 +2830,8 @@ void cmGlobalGenerator::CheckRuleHashes(std::string const& pfile,
{ {
// The rule has changed. Delete the output so it will be // The rule has changed. Delete the output so it will be
// built again. // built again.
fname = cmSystemTools::CollapseFullPath(fname.c_str(), home.c_str()); fname = cmSystemTools::CollapseFullPath(fname, home.c_str());
cmSystemTools::RemoveFile(fname.c_str()); cmSystemTools::RemoveFile(fname);
} }
} }
else else
@ -2843,7 +2843,7 @@ void cmGlobalGenerator::CheckRuleHashes(std::string const& pfile,
// that if the feature is turned back on and the rule has // that if the feature is turned back on and the rule has
// changed the file is still rebuilt. // changed the file is still rebuilt.
std::string fpath = std::string fpath =
cmSystemTools::CollapseFullPath(fname.c_str(), home.c_str()); cmSystemTools::CollapseFullPath(fname, home.c_str());
if(cmSystemTools::FileExists(fpath.c_str())) if(cmSystemTools::FileExists(fpath.c_str()))
{ {
RuleHash hash; RuleHash hash;
@ -2860,7 +2860,7 @@ void cmGlobalGenerator::WriteRuleHashes(std::string const& pfile)
// Now generate a new persistence file with the current hashes. // Now generate a new persistence file with the current hashes.
if(this->RuleHashes.empty()) if(this->RuleHashes.empty())
{ {
cmSystemTools::RemoveFile(pfile.c_str()); cmSystemTools::RemoveFile(pfile);
} }
else else
{ {
@ -2965,7 +2965,7 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
} }
else else
{ {
cmSystemTools::RemoveFile(file.c_str()); cmSystemTools::RemoveFile(file);
} }
} }

View File

@ -222,7 +222,7 @@ bool cmGlobalKdevelopGenerator
it!=files.end(); it++) it!=files.end(); it++)
{ {
// get the full path to the file // get the full path to the file
tmp=cmSystemTools::CollapseFullPath(it->c_str(), projectDir.c_str()); tmp=cmSystemTools::CollapseFullPath(*it, projectDir.c_str());
// just select the first source file // just select the first source file
if (fileToOpen.empty()) if (fileToOpen.empty())
{ {
@ -274,7 +274,7 @@ void cmGlobalKdevelopGenerator
// kdevelop blacklist so they are not monitored for added or removed files // kdevelop blacklist so they are not monitored for added or removed files
// since this is handled by adding files to the cmake files // since this is handled by adding files to the cmake files
cmsys::Directory d; cmsys::Directory d;
if (d.Load(projectDir.c_str())) if (d.Load(projectDir))
{ {
size_t numf = d.GetNumberOfFiles(); size_t numf = d.GetNumberOfFiles();
for (unsigned int i = 0; i < numf; i++) for (unsigned int i = 0; i < numf; i++)
@ -285,7 +285,7 @@ void cmGlobalKdevelopGenerator
std::string tmp = projectDir; std::string tmp = projectDir;
tmp += "/"; tmp += "/";
tmp += nextFile; tmp += nextFile;
if (cmSystemTools::FileIsDirectory(tmp.c_str())) if (cmSystemTools::FileIsDirectory(tmp))
{ {
tmp += "/CMakeCache.txt"; tmp += "/CMakeCache.txt";
if ((nextFile == "CMakeFiles") if ((nextFile == "CMakeFiles")

View File

@ -771,7 +771,7 @@ void cmGlobalNinjaGenerator::AddCXXCompileCommand(
if (!cmSystemTools::FileIsFullPath(sourceFileName.c_str())) if (!cmSystemTools::FileIsFullPath(sourceFileName.c_str()))
{ {
sourceFileName = cmSystemTools::CollapseFullPath( sourceFileName = cmSystemTools::CollapseFullPath(
sourceFileName.c_str(), sourceFileName,
this->GetCMakeInstance()->GetHomeOutputDirectory()); this->GetCMakeInstance()->GetHomeOutputDirectory());
} }
@ -851,7 +851,7 @@ cmGlobalNinjaGenerator
case cmTarget::STATIC_LIBRARY: case cmTarget::STATIC_LIBRARY:
case cmTarget::MODULE_LIBRARY: case cmTarget::MODULE_LIBRARY:
outputs.push_back(ng->ConvertToNinjaPath( outputs.push_back(ng->ConvertToNinjaPath(
target->GetFullPath(configName, false, realname).c_str())); target->GetFullPath(configName, false, realname)));
break; break;
case cmTarget::OBJECT_LIBRARY: case cmTarget::OBJECT_LIBRARY:
@ -970,7 +970,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
typedef std::vector<std::string>::const_iterator vect_it; typedef std::vector<std::string>::const_iterator vect_it;
for(vect_it j = files.begin(); j != files.end(); ++j) for(vect_it j = files.begin(); j != files.end(); ++j)
{ {
knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); knownDependencies.insert( ng->ConvertToNinjaPath( *j ) );
} }
//get list files which are implicit dependencies as well and will be phony //get list files which are implicit dependencies as well and will be phony
//for rebuild manifest //for rebuild manifest
@ -978,7 +978,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
typedef std::vector<std::string>::const_iterator vect_it; typedef std::vector<std::string>::const_iterator vect_it;
for(vect_it j = lf.begin(); j != lf.end(); ++j) for(vect_it j = lf.begin(); j != lf.end(); ++j)
{ {
knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); knownDependencies.insert( ng->ConvertToNinjaPath( *j ) );
} }
} }
knownDependencies.insert( "CMakeCache.txt" ); knownDependencies.insert( "CMakeCache.txt" );
@ -994,7 +994,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
typedef std::vector<std::string>::const_iterator vect_it; typedef std::vector<std::string>::const_iterator vect_it;
for(vect_it j = files.begin(); j != files.end(); ++j) for(vect_it j = files.begin(); j != files.end(); ++j)
{ {
knownDependencies.insert( ng->ConvertToNinjaPath( j->c_str() ) ); knownDependencies.insert( ng->ConvertToNinjaPath( *j ) );
} }
} }
@ -1002,7 +1002,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
i != this->TargetAliases.end(); i != this->TargetAliases.end();
++i) ++i)
{ {
knownDependencies.insert( ng->ConvertToNinjaPath(i->first.c_str()) ); knownDependencies.insert( ng->ConvertToNinjaPath(i->first) );
} }
//remove all source files we know will exist. //remove all source files we know will exist.
@ -1011,7 +1011,7 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
i != this->AssumedSourceDependencies.end(); i != this->AssumedSourceDependencies.end();
++i) ++i)
{ {
knownDependencies.insert( ng->ConvertToNinjaPath(i->first.c_str()) ); knownDependencies.insert( ng->ConvertToNinjaPath(i->first) );
} }
//insert outputs from all WirteBuild commands //insert outputs from all WirteBuild commands
@ -1051,9 +1051,9 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
{ {
//verify the file is in the build directory //verify the file is in the build directory
std::string const absDepPath = cmSystemTools::CollapseFullPath( std::string const absDepPath = cmSystemTools::CollapseFullPath(
i->c_str(), rootBuildDirectory.c_str()); *i, rootBuildDirectory.c_str());
bool const inBuildDir = cmSystemTools::IsSubDirectory(absDepPath.c_str(), bool const inBuildDir = cmSystemTools::IsSubDirectory(absDepPath,
rootBuildDirectory.c_str()); rootBuildDirectory);
if(inBuildDir) if(inBuildDir)
{ {
cmNinjaDeps deps(1,*i); cmNinjaDeps deps(1,*i);
@ -1129,7 +1129,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
for(std::vector<std::string>::const_iterator fi = lf.begin(); for(std::vector<std::string>::const_iterator fi = lf.begin();
fi != lf.end(); ++fi) fi != lf.end(); ++fi)
{ {
implicitDeps.push_back(ng->ConvertToNinjaPath(fi->c_str())); implicitDeps.push_back(ng->ConvertToNinjaPath(*fi));
} }
} }
implicitDeps.push_back("CMakeCache.txt"); implicitDeps.push_back("CMakeCache.txt");

View File

@ -90,7 +90,7 @@ bool cmIncludeCommand
} }
std::string fname_abs = std::string fname_abs =
cmSystemTools::CollapseFullPath(fname.c_str(), cmSystemTools::CollapseFullPath(fname,
this->Makefile->GetStartDirectory()); this->Makefile->GetStartDirectory());
cmGlobalGenerator *gg = this->Makefile->GetLocalGenerator() cmGlobalGenerator *gg = this->Makefile->GetLocalGenerator()

View File

@ -167,7 +167,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
script += "/"; script += "/";
script += args[i]; script += args[i];
} }
if(cmSystemTools::FileIsDirectory(script.c_str())) if(cmSystemTools::FileIsDirectory(script))
{ {
this->SetError("given a directory as value of SCRIPT argument."); this->SetError("given a directory as value of SCRIPT argument.");
return false; return false;
@ -1111,7 +1111,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
// Make sure the name is a directory. // Make sure the name is a directory.
if(cmSystemTools::FileExists(dir.c_str()) && if(cmSystemTools::FileExists(dir.c_str()) &&
!cmSystemTools::FileIsDirectory(dir.c_str())) !cmSystemTools::FileIsDirectory(dir))
{ {
cmOStringStream e; cmOStringStream e;
e << args[0] << " given non-directory \"" e << args[0] << " given non-directory \""
@ -1393,7 +1393,7 @@ bool cmInstallCommand::MakeFilesFullPath(const char* modeName,
} }
// Make sure the file is not a directory. // Make sure the file is not a directory.
if(gpos == file.npos && cmSystemTools::FileIsDirectory(file.c_str())) if(gpos == file.npos && cmSystemTools::FileIsDirectory(file))
{ {
cmOStringStream e; cmOStringStream e;
e << modeName << " given directory \"" << (*fileIt) << "\" to install."; e << modeName << " given directory \"" << (*fileIt) << "\" to install.";

View File

@ -221,19 +221,19 @@ void cmLocalGenerator::SetupPathConversions()
std::string outdir; std::string outdir;
outdir = outdir =
cmSystemTools::CollapseFullPath(this->Makefile->GetHomeDirectory()); cmSystemTools::CollapseFullPath(this->Makefile->GetHomeDirectory());
cmSystemTools::SplitPath(outdir.c_str(), this->HomeDirectoryComponents); cmSystemTools::SplitPath(outdir, this->HomeDirectoryComponents);
outdir = outdir =
cmSystemTools::CollapseFullPath(this->Makefile->GetStartDirectory()); cmSystemTools::CollapseFullPath(this->Makefile->GetStartDirectory());
cmSystemTools::SplitPath(outdir.c_str(), this->StartDirectoryComponents); cmSystemTools::SplitPath(outdir, this->StartDirectoryComponents);
outdir = cmSystemTools::CollapseFullPath outdir = cmSystemTools::CollapseFullPath
(this->Makefile->GetHomeOutputDirectory()); (this->Makefile->GetHomeOutputDirectory());
cmSystemTools::SplitPath(outdir.c_str(), cmSystemTools::SplitPath(outdir,
this->HomeOutputDirectoryComponents); this->HomeOutputDirectoryComponents);
outdir = cmSystemTools::CollapseFullPath outdir = cmSystemTools::CollapseFullPath
(this->Makefile->GetStartOutputDirectory()); (this->Makefile->GetStartOutputDirectory());
cmSystemTools::SplitPath(outdir.c_str(), cmSystemTools::SplitPath(outdir,
this->StartOutputDirectoryComponents); this->StartOutputDirectoryComponents);
} }
@ -1247,7 +1247,7 @@ cmLocalGenerator::ConvertToOutputForExistingCommon(const std::string& remote,
cmSystemTools::FileExists(remote.c_str())) cmSystemTools::FileExists(remote.c_str()))
{ {
std::string tmp; std::string tmp;
if(cmSystemTools::GetShortPath(remote.c_str(), tmp)) if(cmSystemTools::GetShortPath(remote, tmp))
{ {
return this->Convert(tmp, NONE, format, true); return this->Convert(tmp, NONE, format, true);
} }
@ -1371,7 +1371,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
{ {
std::string frameworkDir = *i; std::string frameworkDir = *i;
frameworkDir += "/../"; frameworkDir += "/../";
frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str()); frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir);
if(emitted.insert(frameworkDir).second) if(emitted.insert(frameworkDir).second)
{ {
if (sysFwSearchFlag && target && if (sysFwSearchFlag && target &&
@ -1613,10 +1613,10 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
{ {
// Emit this directory only if it is a subdirectory of the // Emit this directory only if it is a subdirectory of the
// top-level source or binary tree. // top-level source or binary tree.
if(cmSystemTools::ComparePath(i->c_str(), topSourceDir) || if(cmSystemTools::ComparePath(*i, topSourceDir) ||
cmSystemTools::ComparePath(i->c_str(), topBinaryDir) || cmSystemTools::ComparePath(*i, topBinaryDir) ||
cmSystemTools::IsSubDirectory(i->c_str(), topSourceDir) || cmSystemTools::IsSubDirectory(*i, topSourceDir) ||
cmSystemTools::IsSubDirectory(i->c_str(), topBinaryDir)) cmSystemTools::IsSubDirectory(*i, topBinaryDir))
{ {
if(emitted.insert(*i).second) if(emitted.insert(*i).second)
{ {
@ -2109,11 +2109,11 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
{ {
tLocation = target->GetLocation(config); tLocation = target->GetLocation(config);
tLocation = cmSystemTools::GetFilenamePath(tLocation); tLocation = cmSystemTools::GetFilenamePath(tLocation);
tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str()); tLocation = cmSystemTools::CollapseFullPath(tLocation);
} }
std::string depLocation = cmSystemTools::GetFilenamePath( std::string depLocation = cmSystemTools::GetFilenamePath(
std::string(inName)); std::string(inName));
depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str()); depLocation = cmSystemTools::CollapseFullPath(depLocation);
if(depLocation != tLocation) if(depLocation != tLocation)
{ {
// it is a full path to a depend that has the same name // it is a full path to a depend that has the same name
@ -2743,7 +2743,7 @@ std::string cmLocalGenerator::Convert(const std::string& source,
result); result);
break; break;
case FULL: case FULL:
result = cmSystemTools::CollapseFullPath(result.c_str()); result = cmSystemTools::CollapseFullPath(result);
break; break;
case NONE: case NONE:
break; break;
@ -2807,7 +2807,7 @@ std::string cmLocalGenerator::Convert(RelativeRoot remote,
if(!local.empty() && (!optional || this->UseRelativePaths)) if(!local.empty() && (!optional || this->UseRelativePaths))
{ {
std::vector<std::string> components; std::vector<std::string> components;
cmSystemTools::SplitPath(local.c_str(), components); cmSystemTools::SplitPath(local, components);
std::string result = this->ConvertToRelativePath(components, remotePath); std::string result = this->ConvertToRelativePath(components, remotePath);
return this->ConvertToOutputFormat(result, output); return this->ConvertToOutputFormat(result, output);
} }
@ -2827,7 +2827,7 @@ std::string cmLocalGenerator::FindRelativePathTopSource()
{ {
std::string parentTop = parent->FindRelativePathTopSource(); std::string parentTop = parent->FindRelativePathTopSource();
if(cmSystemTools::IsSubDirectory( if(cmSystemTools::IsSubDirectory(
this->Makefile->GetStartDirectory(), parentTop.c_str())) this->Makefile->GetStartDirectory(), parentTop))
{ {
return parentTop; return parentTop;
} }
@ -2847,7 +2847,7 @@ std::string cmLocalGenerator::FindRelativePathTopBinary()
{ {
std::string parentTop = parent->FindRelativePathTopBinary(); std::string parentTop = parent->FindRelativePathTopBinary();
if(cmSystemTools::IsSubDirectory( if(cmSystemTools::IsSubDirectory(
this->Makefile->GetStartOutputDirectory(), parentTop.c_str())) this->Makefile->GetStartOutputDirectory(), parentTop))
{ {
return parentTop; return parentTop;
} }
@ -2933,12 +2933,12 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
// Identify the longest shared path component between the remote // Identify the longest shared path component between the remote
// path and the local path. // path and the local path.
std::vector<std::string> remote; std::vector<std::string> remote;
cmSystemTools::SplitPath(in_remote.c_str(), remote); cmSystemTools::SplitPath(in_remote, remote);
unsigned int common=0; unsigned int common=0;
while(common < remote.size() && while(common < remote.size() &&
common < local.size() && common < local.size() &&
cmSystemTools::ComparePath(remote[common].c_str(), cmSystemTools::ComparePath(remote[common],
local[common].c_str())) local[common]))
{ {
++common; ++common;
} }

View File

@ -352,7 +352,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandDeps(
i != deps.end(); ++i) { i != deps.end(); ++i) {
std::string dep; std::string dep;
if (this->GetRealDependency(*i, this->GetConfigName(), dep)) if (this->GetRealDependency(*i, this->GetConfigName(), dep))
ninjaDeps.push_back(ConvertToNinjaPath(dep.c_str())); ninjaDeps.push_back(ConvertToNinjaPath(dep));
} }
} }

View File

@ -74,7 +74,7 @@ public:
map_to_ninja_path(cmLocalNinjaGenerator *LocalGen) map_to_ninja_path(cmLocalNinjaGenerator *LocalGen)
: LocalGenerator(LocalGen) {} : LocalGenerator(LocalGen) {}
std::string operator()(const std::string &path) { std::string operator()(const std::string &path) {
return LocalGenerator->ConvertToNinjaPath(path.c_str()); return LocalGenerator->ConvertToNinjaPath(path);
} }
}; };

View File

@ -700,7 +700,7 @@ cmLocalUnixMakefileGenerator3
// name. This is needed to avoid funny quoting problems on // name. This is needed to avoid funny quoting problems on
// lines with shell redirection operators. // lines with shell redirection operators.
std::string scmd; std::string scmd;
if(cmSystemTools::GetShortPath(cmd.c_str(), scmd)) if(cmSystemTools::GetShortPath(cmd, scmd))
{ {
return this->Convert(scmd, NONE, SHELL); return this->Convert(scmd, NONE, SHELL);
} }
@ -1733,7 +1733,7 @@ void cmLocalUnixMakefileGenerator3::CheckMultipleOutputs(bool verbose)
<< depender << "\" does not exist." << std::endl; << depender << "\" does not exist." << std::endl;
cmSystemTools::Stdout(msg.str().c_str()); cmSystemTools::Stdout(msg.str().c_str());
} }
cmSystemTools::RemoveFile(dependee.c_str()); cmSystemTools::RemoveFile(dependee);
} }
} }
} }
@ -1988,7 +1988,7 @@ void cmLocalUnixMakefileGenerator3::ClearDependencies(cmMakefile* mf,
// Remove the internal dependency check file to force // Remove the internal dependency check file to force
// regeneration. // regeneration.
std::string internalDependFile = dir + "/depend.internal"; std::string internalDependFile = dir + "/depend.internal";
cmSystemTools::RemoveFile(internalDependFile.c_str()); cmSystemTools::RemoveFile(internalDependFile);
} }
} }

View File

@ -329,9 +329,9 @@ std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath)
} }
path = path + fname; path = path + fname;
if(cmSystemTools::FileExists(path.c_str(), true) if(cmSystemTools::FileExists(path.c_str(), true)
&& !cmSystemTools::FileIsDirectory(path.c_str())) && !cmSystemTools::FileIsDirectory(path))
{ {
std::string fp = cmSystemTools::CollapseFullPath(path.c_str()); std::string fp = cmSystemTools::CollapseFullPath(path);
this->DirectoryToFileToPathMap[extraPath? extraPath: ""][fname] = fp; this->DirectoryToFileToPathMap[extraPath? extraPath: ""][fname] = fp;
return fp; return fp;
} }
@ -346,9 +346,9 @@ std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath)
} }
path = path + fname; path = path + fname;
if(cmSystemTools::FileExists(path.c_str(), true) if(cmSystemTools::FileExists(path.c_str(), true)
&& !cmSystemTools::FileIsDirectory(path.c_str())) && !cmSystemTools::FileIsDirectory(path))
{ {
std::string fp = cmSystemTools::CollapseFullPath(path.c_str()); std::string fp = cmSystemTools::CollapseFullPath(path);
this->DirectoryToFileToPathMap[extraPath][fname] = fp; this->DirectoryToFileToPathMap[extraPath][fname] = fp;
return fp; return fp;
} }

View File

@ -1832,7 +1832,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
{ {
if(!cmSystemTools::IsOff(files[cc].c_str())) if(!cmSystemTools::IsOff(files[cc].c_str()))
{ {
files[cc] = cmSystemTools::CollapseFullPath(files[cc].c_str()); files[cc] = cmSystemTools::CollapseFullPath(files[cc]);
} }
if ( cc > 0 ) if ( cc > 0 )
{ {
@ -1937,11 +1937,11 @@ void cmMakefile::CheckForUnused(const char* reason,
bt.push_back(lfc); bt.push_back(lfc);
} }
if (this->CheckSystemVars || if (this->CheckSystemVars ||
cmSystemTools::IsSubDirectory(path.c_str(), cmSystemTools::IsSubDirectory(path,
this->GetHomeDirectory()) || this->GetHomeDirectory()) ||
(cmSystemTools::IsSubDirectory(path.c_str(), (cmSystemTools::IsSubDirectory(path,
this->GetHomeOutputDirectory()) && this->GetHomeOutputDirectory()) &&
!cmSystemTools::IsSubDirectory(path.c_str(), !cmSystemTools::IsSubDirectory(path,
cmake::GetCMakeFilesDirectory()))) cmake::GetCMakeFilesDirectory())))
{ {
cmOStringStream msg; cmOStringStream msg;
@ -2878,7 +2878,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
bt.push_back(lfc); bt.push_back(lfc);
msg << "uninitialized variable \'" << lookup << "\'"; msg << "uninitialized variable \'" << lookup << "\'";
this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
msg.str().c_str(), bt); msg.str(), bt);
} }
} }
} }
@ -3556,7 +3556,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
{ {
this->Internal->IsSourceFileTryCompile = fast; this->Internal->IsSourceFileTryCompile = fast;
// does the binary directory exist ? If not create it... // does the binary directory exist ? If not create it...
if (!cmSystemTools::FileIsDirectory(bindir.c_str())) if (!cmSystemTools::FileIsDirectory(bindir))
{ {
cmSystemTools::MakeDirectory(bindir.c_str()); cmSystemTools::MakeDirectory(bindir.c_str());
} }
@ -3564,7 +3564,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
// change to the tests directory and run cmake // change to the tests directory and run cmake
// use the cmake object instead of calling cmake // use the cmake object instead of calling cmake
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(bindir.c_str()); cmSystemTools::ChangeDirectory(bindir);
// make sure the same generator is used // make sure the same generator is used
// use this program as the cmake to be run, it should not // use this program as the cmake to be run, it should not
@ -3579,7 +3579,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
cmSystemTools::Error( cmSystemTools::Error(
"Internal CMake error, TryCompile bad GlobalGenerator"); "Internal CMake error, TryCompile bad GlobalGenerator");
// return to the original directory // return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
this->Internal->IsSourceFileTryCompile = false; this->Internal->IsSourceFileTryCompile = false;
return 1; return 1;
} }
@ -3653,7 +3653,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
cmSystemTools::Error( cmSystemTools::Error(
"Internal CMake error, TryCompile configure of cmake failed"); "Internal CMake error, TryCompile configure of cmake failed");
// return to the original directory // return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
this->Internal->IsSourceFileTryCompile = false; this->Internal->IsSourceFileTryCompile = false;
return 1; return 1;
} }
@ -3663,7 +3663,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
cmSystemTools::Error( cmSystemTools::Error(
"Internal CMake error, TryCompile generation of cmake failed"); "Internal CMake error, TryCompile generation of cmake failed");
// return to the original directory // return to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
this->Internal->IsSourceFileTryCompile = false; this->Internal->IsSourceFileTryCompile = false;
return 1; return 1;
} }
@ -3677,7 +3677,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
output, output,
this); this);
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
this->Internal->IsSourceFileTryCompile = false; this->Internal->IsSourceFileTryCompile = false;
return ret; return ret;
} }
@ -4036,7 +4036,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
{ {
cmSystemTools::SetPermissions(soutfile.c_str(), perm); cmSystemTools::SetPermissions(soutfile.c_str(), perm);
} }
cmSystemTools::RemoveFile(tempOutputFile.c_str()); cmSystemTools::RemoveFile(tempOutputFile);
} }
return res; return res;
} }
@ -5208,7 +5208,7 @@ HaveCFeatureAvailable(cmTarget const* target, const std::string& feature) const
cmOStringStream e; cmOStringStream e;
e << "The C_STANDARD property on target \"" << target->GetName() e << "The C_STANDARD property on target \"" << target->GetName()
<< "\" contained an invalid value: \"" << existingCStandard << "\"."; << "\" contained an invalid value: \"" << existingCStandard << "\".";
this->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
return false; return false;
} }
@ -5459,7 +5459,7 @@ AddRequiredTargetCFeature(cmTarget *target, const std::string& feature) const
cmOStringStream e; cmOStringStream e;
e << "The C_STANDARD property on target \"" << target->GetName() e << "The C_STANDARD property on target \"" << target->GetName()
<< "\" contained an invalid value: \"" << existingCStandard << "\"."; << "\" contained an invalid value: \"" << existingCStandard << "\".";
this->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
return false; return false;
} }
} }

View File

@ -466,7 +466,7 @@ public:
this->cmStartDirectory = dir; this->cmStartDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory); cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
this->cmStartDirectory = this->cmStartDirectory =
cmSystemTools::CollapseFullPath(this->cmStartDirectory.c_str()); cmSystemTools::CollapseFullPath(this->cmStartDirectory);
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->cmStartDirectory.c_str()); this->cmStartDirectory.c_str());
} }
@ -479,7 +479,7 @@ public:
this->StartOutputDirectory = lib; this->StartOutputDirectory = lib;
cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
this->StartOutputDirectory = this->StartOutputDirectory =
cmSystemTools::CollapseFullPath(this->StartOutputDirectory.c_str()); cmSystemTools::CollapseFullPath(this->StartOutputDirectory);
cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str()); cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str());
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->StartOutputDirectory.c_str()); this->StartOutputDirectory.c_str());

View File

@ -1577,7 +1577,7 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags(std::string const& l)
{ {
std::string frameworkDir = *i; std::string frameworkDir = *i;
frameworkDir += "/../"; frameworkDir += "/../";
frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str()); frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir);
emitted.insert(frameworkDir); emitted.insert(frameworkDir);
} }
} }

View File

@ -375,14 +375,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
cmTarget& target = *this->GetTarget(); cmTarget& target = *this->GetTarget();
const std::string cfgName = this->GetConfigName(); const std::string cfgName = this->GetConfigName();
std::string targetOutput = ConvertToNinjaPath( std::string targetOutput = ConvertToNinjaPath(
target.GetFullPath(cfgName).c_str()); target.GetFullPath(cfgName));
std::string targetOutputReal = ConvertToNinjaPath( std::string targetOutputReal = ConvertToNinjaPath(
target.GetFullPath(cfgName, target.GetFullPath(cfgName,
/*implib=*/false, /*implib=*/false,
/*realpath=*/true).c_str()); /*realpath=*/true));
std::string targetOutputImplib = ConvertToNinjaPath( std::string targetOutputImplib = ConvertToNinjaPath(
target.GetFullPath(cfgName, target.GetFullPath(cfgName,
/*implib=*/true).c_str()); /*implib=*/true));
if (target.IsAppBundleOnApple()) if (target.IsAppBundleOnApple())
{ {
@ -394,11 +394,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
targetOutput = outpath; targetOutput = outpath;
targetOutput += "/"; targetOutput += "/";
targetOutput += this->TargetNameOut; targetOutput += this->TargetNameOut;
targetOutput = this->ConvertToNinjaPath(targetOutput.c_str()); targetOutput = this->ConvertToNinjaPath(targetOutput);
targetOutputReal = outpath; targetOutputReal = outpath;
targetOutputReal += "/"; targetOutputReal += "/";
targetOutputReal += this->TargetNameReal; targetOutputReal += this->TargetNameReal;
targetOutputReal = this->ConvertToNinjaPath(targetOutputReal.c_str()); targetOutputReal = this->ConvertToNinjaPath(targetOutputReal);
} }
else if (target.IsFrameworkOnApple()) else if (target.IsFrameworkOnApple())
{ {
@ -531,7 +531,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
if (mf->IsOn("CMAKE_COMPILER_IS_MINGW")) if (mf->IsOn("CMAKE_COMPILER_IS_MINGW"))
{ {
const std::string objPath = GetTarget()->GetSupportDirectory(); const std::string objPath = GetTarget()->GetSupportDirectory();
vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath.c_str()); vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath);
EnsureDirectoryExists(objPath); EnsureDirectoryExists(objPath);
// ar.exe can't handle backslashes in rsp files (implicitly used by gcc) // ar.exe can't handle backslashes in rsp files (implicitly used by gcc)
std::string& linkLibraries = vars["LINK_LIBRARIES"]; std::string& linkLibraries = vars["LINK_LIBRARIES"];

View File

@ -277,7 +277,7 @@ std::string
cmNinjaTargetGenerator cmNinjaTargetGenerator
::GetSourceFilePath(cmSourceFile const* source) const ::GetSourceFilePath(cmSourceFile const* source) const
{ {
return ConvertToNinjaPath(source->GetFullPath().c_str()); return ConvertToNinjaPath(source->GetFullPath());
} }
std::string std::string
@ -298,7 +298,7 @@ cmNinjaTargetGenerator
std::string cmNinjaTargetGenerator::GetTargetOutputDir() const std::string cmNinjaTargetGenerator::GetTargetOutputDir() const
{ {
std::string dir = this->Target->GetDirectory(this->GetConfigName()); std::string dir = this->Target->GetDirectory(this->GetConfigName());
return ConvertToNinjaPath(dir.c_str()); return ConvertToNinjaPath(dir);
} }
std::string std::string
@ -346,11 +346,11 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
} }
vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat( vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
ConvertToNinjaPath(pdbPath.c_str()), ConvertToNinjaPath(pdbPath),
cmLocalGenerator::SHELL); cmLocalGenerator::SHELL);
vars["TARGET_COMPILE_PDB"] = vars["TARGET_COMPILE_PDB"] =
this->GetLocalGenerator()->ConvertToOutputFormat( this->GetLocalGenerator()->ConvertToOutputFormat(
ConvertToNinjaPath(compilePdbPath.c_str()), ConvertToNinjaPath(compilePdbPath),
cmLocalGenerator::SHELL); cmLocalGenerator::SHELL);
EnsureParentDirectoryExists(pdbPath); EnsureParentDirectoryExists(pdbPath);
@ -564,7 +564,7 @@ cmNinjaTargetGenerator
std::string def = this->GeneratorTarget->GetModuleDefinitionFile(config); std::string def = this->GeneratorTarget->GetModuleDefinitionFile(config);
if(!def.empty()) if(!def.empty())
{ {
this->ModuleDefinitionFile = this->ConvertToNinjaPath(def.c_str()); this->ModuleDefinitionFile = this->ConvertToNinjaPath(def);
} }
this->GetBuildFileStream() << "\n"; this->GetBuildFileStream() << "\n";
@ -628,11 +628,11 @@ cmNinjaTargetGenerator
std::string objectDir = this->Target->GetSupportDirectory(); std::string objectDir = this->Target->GetSupportDirectory();
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
ConvertToNinjaPath(objectDir.c_str()), ConvertToNinjaPath(objectDir),
cmLocalGenerator::SHELL); cmLocalGenerator::SHELL);
std::string objectFileDir = cmSystemTools::GetFilenamePath(objectFileName); std::string objectFileDir = cmSystemTools::GetFilenamePath(objectFileName);
vars["OBJECT_FILE_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( vars["OBJECT_FILE_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
ConvertToNinjaPath(objectFileDir.c_str()), ConvertToNinjaPath(objectFileDir),
cmLocalGenerator::SHELL); cmLocalGenerator::SHELL);
this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetTarget(), vars); this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetTarget(), vars);
@ -650,7 +650,7 @@ cmNinjaTargetGenerator
if (!cmSystemTools::FileIsFullPath(sourceFileName.c_str())) if (!cmSystemTools::FileIsFullPath(sourceFileName.c_str()))
{ {
escapedSourceFileName = cmSystemTools::CollapseFullPath( escapedSourceFileName = cmSystemTools::CollapseFullPath(
escapedSourceFileName.c_str(), escapedSourceFileName,
this->GetGlobalGenerator()->GetCMakeInstance()-> this->GetGlobalGenerator()->GetCMakeInstance()->
GetHomeOutputDirectory()); GetHomeOutputDirectory());
} }
@ -754,7 +754,7 @@ void
cmNinjaTargetGenerator cmNinjaTargetGenerator
::EnsureParentDirectoryExists(const std::string& path) const ::EnsureParentDirectoryExists(const std::string& path) const
{ {
EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str())); EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path));
} }
@ -775,14 +775,14 @@ cmNinjaTargetGenerator::MacOSXContentGeneratorType::operator()(
// Get the input file location. // Get the input file location.
std::string input = source.GetFullPath(); std::string input = source.GetFullPath();
input = input =
this->Generator->GetLocalGenerator()->ConvertToNinjaPath(input.c_str()); this->Generator->GetLocalGenerator()->ConvertToNinjaPath(input);
// Get the output file location. // Get the output file location.
std::string output = macdir; std::string output = macdir;
output += "/"; output += "/";
output += cmSystemTools::GetFilenameName(input); output += cmSystemTools::GetFilenameName(input);
output = output =
this->Generator->GetLocalGenerator()->ConvertToNinjaPath(output.c_str()); this->Generator->GetLocalGenerator()->ConvertToNinjaPath(output);
// Write a build statement to copy the content into the bundle. // Write a build statement to copy the content into the bundle.
this->Generator->GetGlobalGenerator()->WriteMacOSXContentBuild(input, this->Generator->GetGlobalGenerator()->WriteMacOSXContentBuild(input,

View File

@ -112,7 +112,7 @@ void cmOSXBundleGenerator::CreateFramework(
oldName = frameworkVersion; oldName = frameworkVersion;
newName = versions; newName = versions;
newName += "/Current"; newName += "/Current";
cmSystemTools::RemoveFile(newName.c_str()); cmSystemTools::RemoveFile(newName);
cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str());
this->Makefile->AddCMakeOutputFile(newName); this->Makefile->AddCMakeOutputFile(newName);
@ -121,7 +121,7 @@ void cmOSXBundleGenerator::CreateFramework(
oldName += name; oldName += name;
newName = contentdir; newName = contentdir;
newName += name; newName += name;
cmSystemTools::RemoveFile(newName.c_str()); cmSystemTools::RemoveFile(newName);
cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str());
this->Makefile->AddCMakeOutputFile(newName); this->Makefile->AddCMakeOutputFile(newName);
@ -132,7 +132,7 @@ void cmOSXBundleGenerator::CreateFramework(
oldName = "Versions/Current/Resources"; oldName = "Versions/Current/Resources";
newName = contentdir; newName = contentdir;
newName += "Resources"; newName += "Resources";
cmSystemTools::RemoveFile(newName.c_str()); cmSystemTools::RemoveFile(newName);
cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str());
this->Makefile->AddCMakeOutputFile(newName); this->Makefile->AddCMakeOutputFile(newName);
} }
@ -144,7 +144,7 @@ void cmOSXBundleGenerator::CreateFramework(
oldName = "Versions/Current/Headers"; oldName = "Versions/Current/Headers";
newName = contentdir; newName = contentdir;
newName += "Headers"; newName += "Headers";
cmSystemTools::RemoveFile(newName.c_str()); cmSystemTools::RemoveFile(newName);
cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str());
this->Makefile->AddCMakeOutputFile(newName); this->Makefile->AddCMakeOutputFile(newName);
} }
@ -156,7 +156,7 @@ void cmOSXBundleGenerator::CreateFramework(
oldName = "Versions/Current/PrivateHeaders"; oldName = "Versions/Current/PrivateHeaders";
newName = contentdir; newName = contentdir;
newName += "PrivateHeaders"; newName += "PrivateHeaders";
cmSystemTools::RemoveFile(newName.c_str()); cmSystemTools::RemoveFile(newName);
cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str());
this->Makefile->AddCMakeOutputFile(newName); this->Makefile->AddCMakeOutputFile(newName);
} }

View File

@ -140,7 +140,7 @@ bool cmOrderDirectoriesConstraint::FileMayConflict(std::string const& dir,
{ {
// The file conflicts only if it is not the same as the original // The file conflicts only if it is not the same as the original
// file due to a symlink or hardlink. // file due to a symlink or hardlink.
return !cmSystemTools::SameFile(this->FullPath.c_str(), file.c_str()); return !cmSystemTools::SameFile(this->FullPath, file);
} }
// Check if the file will be built by cmake. // Check if the file will be built by cmake.

View File

@ -488,7 +488,7 @@ void cmQtAutoGenerators::SetupSourceFiles(cmTarget const* 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());
bool skipMoc = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC")); bool skipMoc = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED")); bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"));
@ -766,7 +766,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* 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());
if (!skipped.insert(absFile).second) if (!skipped.insert(absFile).second)
{ {
@ -890,7 +890,7 @@ void cmQtAutoGenerators::SetupAutoRccTarget(cmTarget const* target)
if (ext == "qrc") if (ext == "qrc")
{ {
std::string absFile = cmsys::SystemTools::GetRealPath( std::string absFile = cmsys::SystemTools::GetRealPath(
sf->GetFullPath().c_str()); sf->GetFullPath());
bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")); bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"));
if (!skip) if (!skip)
@ -1013,7 +1013,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
const std::string& config) const std::string& config)
{ {
std::string filename( std::string filename(
cmSystemTools::CollapseFullPath(targetDirectory.c_str())); cmSystemTools::CollapseFullPath(targetDirectory));
cmSystemTools::ConvertToUnixSlashes(filename); cmSystemTools::ConvertToUnixSlashes(filename);
filename += "/AutogenInfo.cmake"; filename += "/AutogenInfo.cmake";
@ -1158,7 +1158,7 @@ bool cmQtAutoGenerators::ReadOldMocDefinitionsFile(cmMakefile* makefile,
const std::string& targetDirectory) const std::string& targetDirectory)
{ {
std::string filename( std::string filename(
cmSystemTools::CollapseFullPath(targetDirectory.c_str())); cmSystemTools::CollapseFullPath(targetDirectory));
cmSystemTools::ConvertToUnixSlashes(filename); cmSystemTools::ConvertToUnixSlashes(filename);
filename += "/AutomocOldMocDefinitions.cmake"; filename += "/AutomocOldMocDefinitions.cmake";
@ -1176,7 +1176,7 @@ cmQtAutoGenerators::WriteOldMocDefinitionsFile(
const std::string& targetDirectory) const std::string& targetDirectory)
{ {
std::string filename( std::string filename(
cmSystemTools::CollapseFullPath(targetDirectory.c_str())); cmSystemTools::CollapseFullPath(targetDirectory));
cmSystemTools::ConvertToUnixSlashes(filename); cmSystemTools::ConvertToUnixSlashes(filename);
filename += "/AutomocOldMocDefinitions.cmake"; filename += "/AutomocOldMocDefinitions.cmake";
@ -1222,7 +1222,7 @@ void cmQtAutoGenerators::Init()
{ {
// Go up twice to get to the framework root // Go up twice to get to the framework root
std::vector<std::string> pathComponents; std::vector<std::string> pathComponents;
cmsys::SystemTools::SplitPath(path.c_str(), pathComponents); cmsys::SystemTools::SplitPath(path, pathComponents);
std::string frameworkPath =cmsys::SystemTools::JoinPath( std::string frameworkPath =cmsys::SystemTools::JoinPath(
pathComponents.begin(), pathComponents.end() - 2); pathComponents.begin(), pathComponents.end() - 2);
frameworkPaths.insert(frameworkPath); frameworkPaths.insert(frameworkPath);
@ -1484,7 +1484,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
} }
const std::string absPath = cmsys::SystemTools::GetFilenamePath( const std::string absPath = cmsys::SystemTools::GetFilenamePath(
cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/'; cmsys::SystemTools::GetRealPath(absFilename)) + '/';
const std::string scannedFileBasename = cmsys::SystemTools:: const std::string scannedFileBasename = cmsys::SystemTools::
GetFilenameWithoutLastExtension(absFilename); GetFilenameWithoutLastExtension(absFilename);
std::string macroName; std::string macroName;
@ -1672,7 +1672,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
} }
const std::string absPath = cmsys::SystemTools::GetFilenamePath( const std::string absPath = cmsys::SystemTools::GetFilenamePath(
cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/'; cmsys::SystemTools::GetRealPath(absFilename)) + '/';
const std::string scannedFileBasename = cmsys::SystemTools:: const std::string scannedFileBasename = cmsys::SystemTools::
GetFilenameWithoutLastExtension(absFilename); GetFilenameWithoutLastExtension(absFilename);
@ -1802,7 +1802,7 @@ void cmQtAutoGenerators::ParseForUic(const std::string& absFilename,
std::string::size_type matchOffset = 0; std::string::size_type matchOffset = 0;
const std::string realName = const std::string realName =
cmsys::SystemTools::GetRealPath(absFilename.c_str()); cmsys::SystemTools::GetRealPath(absFilename);
matchOffset = 0; matchOffset = 0;
if ((strstr(contentsString.c_str(), "ui_") != NULL) if ((strstr(contentsString.c_str(), "ui_") != NULL)
@ -1836,7 +1836,7 @@ cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename,
const std::string basename = const std::string basename =
cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename); cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename);
const std::string absPath = cmsys::SystemTools::GetFilenamePath( const std::string absPath = cmsys::SystemTools::GetFilenamePath(
cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/'; cmsys::SystemTools::GetRealPath(absFilename)) + '/';
for(std::vector<std::string>::const_iterator ext = headerExtensions.begin(); for(std::vector<std::string>::const_iterator ext = headerExtensions.begin();
ext != headerExtensions.end(); ext != headerExtensions.end();
@ -1904,8 +1904,8 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
{ {
const std::string mocFilePath = this->Builddir + mocFileName; const std::string mocFilePath = this->Builddir + mocFileName;
int sourceNewerThanMoc = 0; int sourceNewerThanMoc = 0;
bool success = cmsys::SystemTools::FileTimeCompare(sourceFile.c_str(), bool success = cmsys::SystemTools::FileTimeCompare(sourceFile,
mocFilePath.c_str(), mocFilePath,
&sourceNewerThanMoc); &sourceNewerThanMoc);
if (this->GenerateAll || !success || sourceNewerThanMoc >= 0) if (this->GenerateAll || !success || sourceNewerThanMoc >= 0)
{ {
@ -1968,7 +1968,7 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
std::cerr << "AUTOGEN: error: process for " << mocFilePath <<" failed:\n" std::cerr << "AUTOGEN: error: process for " << mocFilePath <<" failed:\n"
<< output << std::endl; << output << std::endl;
this->RunMocFailed = true; this->RunMocFailed = true;
cmSystemTools::RemoveFile(mocFilePath.c_str()); cmSystemTools::RemoveFile(mocFilePath);
} }
return true; return true;
} }
@ -1984,14 +1984,14 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
} }
const std::string path = cmsys::SystemTools::GetFilenamePath( const std::string path = cmsys::SystemTools::GetFilenamePath(
realName.c_str()) + '/'; realName) + '/';
std::string ui_output_file = "ui_" + uiFileName + ".h"; std::string ui_output_file = "ui_" + uiFileName + ".h";
std::string ui_input_file = path + uiFileName + ".ui"; std::string ui_input_file = path + uiFileName + ".ui";
int sourceNewerThanUi = 0; int sourceNewerThanUi = 0;
bool success = cmsys::SystemTools::FileTimeCompare(ui_input_file.c_str(), bool success = cmsys::SystemTools::FileTimeCompare(ui_input_file,
(this->Builddir + ui_output_file).c_str(), this->Builddir + ui_output_file,
&sourceNewerThanUi); &sourceNewerThanUi);
if (this->GenerateAll || !success || sourceNewerThanUi >= 0) if (this->GenerateAll || !success || sourceNewerThanUi >= 0)
{ {
@ -2042,7 +2042,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
std::cerr << "AUTOUIC: error: process for " << ui_output_file << std::cerr << "AUTOUIC: error: process for " << ui_output_file <<
" failed:\n" << output << std::endl; " failed:\n" << output << std::endl;
this->RunUicFailed = true; this->RunUicFailed = true;
cmSystemTools::RemoveFile(ui_output_file.c_str()); cmSystemTools::RemoveFile(ui_output_file);
return false; return false;
} }
return true; return true;
@ -2075,8 +2075,8 @@ bool cmQtAutoGenerators::GenerateQrc()
+ ".dir/qrc_" + basename + ".cpp"; + ".dir/qrc_" + basename + ".cpp";
int sourceNewerThanQrc = 0; int sourceNewerThanQrc = 0;
bool success = cmsys::SystemTools::FileTimeCompare(si->c_str(), bool success = cmsys::SystemTools::FileTimeCompare(*si,
rcc_output_file.c_str(), rcc_output_file,
&sourceNewerThanQrc); &sourceNewerThanQrc);
if (this->GenerateAll || !success || sourceNewerThanQrc >= 0) if (this->GenerateAll || !success || sourceNewerThanQrc >= 0)
{ {
@ -2118,7 +2118,7 @@ bool cmQtAutoGenerators::GenerateQrc()
std::cerr << "AUTORCC: error: process for " << rcc_output_file << std::cerr << "AUTORCC: error: process for " << rcc_output_file <<
" failed:\n" << output << std::endl; " failed:\n" << output << std::endl;
this->RunRccFailed = true; this->RunRccFailed = true;
cmSystemTools::RemoveFile(rcc_output_file.c_str()); cmSystemTools::RemoveFile(rcc_output_file);
return false; return false;
} }
} }

View File

@ -204,7 +204,7 @@ bool cmSetPropertyCommand::HandleDirectoryMode()
} }
// The local generators are associated with collapsed paths. // The local generators are associated with collapsed paths.
dir = cmSystemTools::CollapseFullPath(dir.c_str()); dir = cmSystemTools::CollapseFullPath(dir);
// Lookup the generator. // Lookup the generator.
if(cmLocalGenerator* lg = if(cmLocalGenerator* lg =

View File

@ -179,7 +179,7 @@ bool cmSourceFile::FindFullPath(std::string* error)
tryPath += "/"; tryPath += "/";
} }
tryPath += this->Location.GetName(); tryPath += this->Location.GetName();
tryPath = cmSystemTools::CollapseFullPath(tryPath.c_str(), *di); tryPath = cmSystemTools::CollapseFullPath(tryPath, *di);
if(this->TryFullPath(tryPath, "")) if(this->TryFullPath(tryPath, ""))
{ {
return true; return true;

View File

@ -63,7 +63,7 @@ cmSourceFileLocation
if (cmSystemTools::FileIsFullPath(this->Directory.c_str())) if (cmSystemTools::FileIsFullPath(this->Directory.c_str()))
{ {
this->Directory this->Directory
= cmSystemTools::CollapseFullPath(this->Directory.c_str()); = cmSystemTools::CollapseFullPath(this->Directory);
} }
this->Name = cmSystemTools::GetFilenameName(name); this->Name = cmSystemTools::GetFilenameName(name);
this->UpdateExtension(name); this->UpdateExtension(name);
@ -92,7 +92,7 @@ void cmSourceFileLocation::DirectoryUseSource()
{ {
this->Directory = this->Directory =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
this->Directory.c_str(), this->Makefile->GetCurrentDirectory()); this->Directory, this->Makefile->GetCurrentDirectory());
this->AmbiguousDirectory = false; this->AmbiguousDirectory = false;
} }
} }
@ -105,7 +105,7 @@ void cmSourceFileLocation::DirectoryUseBinary()
{ {
this->Directory = this->Directory =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
this->Directory.c_str(), this->Makefile->GetCurrentOutputDirectory()); this->Directory, this->Makefile->GetCurrentOutputDirectory());
this->AmbiguousDirectory = false; this->AmbiguousDirectory = false;
} }
} }
@ -280,10 +280,10 @@ bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc)
// Compare possible directory combinations. // Compare possible directory combinations.
std::string const& srcDir = std::string const& srcDir =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
this->Directory.c_str(), this->Makefile->GetCurrentDirectory()); this->Directory, this->Makefile->GetCurrentDirectory());
std::string const& binDir = std::string const& binDir =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
this->Directory.c_str(), this->Makefile->GetCurrentOutputDirectory()); this->Directory, this->Makefile->GetCurrentOutputDirectory());
if(srcDir != loc.Directory && if(srcDir != loc.Directory &&
binDir != loc.Directory) binDir != loc.Directory)
{ {
@ -295,10 +295,10 @@ bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc)
// Compare possible directory combinations. // Compare possible directory combinations.
std::string const& srcDir = std::string const& srcDir =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
loc.Directory.c_str(), loc.Makefile->GetCurrentDirectory()); loc.Directory, loc.Makefile->GetCurrentDirectory());
std::string const& binDir = std::string const& binDir =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
loc.Directory.c_str(), loc.Makefile->GetCurrentOutputDirectory()); loc.Directory, loc.Makefile->GetCurrentOutputDirectory());
if(srcDir != this->Directory && if(srcDir != this->Directory &&
binDir != this->Directory) binDir != this->Directory)
{ {

View File

@ -42,7 +42,7 @@ bool cmSubdirCommand
std::string srcPath = std::string srcPath =
std::string(this->Makefile->GetCurrentDirectory()) + std::string(this->Makefile->GetCurrentDirectory()) +
"/" + i->c_str(); "/" + i->c_str();
if (cmSystemTools::FileIsDirectory(srcPath.c_str())) if (cmSystemTools::FileIsDirectory(srcPath))
{ {
std::string binPath = std::string binPath =
std::string(this->Makefile->GetCurrentOutputDirectory()) + std::string(this->Makefile->GetCurrentOutputDirectory()) +
@ -51,7 +51,7 @@ bool cmSubdirCommand
excludeFromAll, preorder, false); excludeFromAll, preorder, false);
} }
// otherwise it is a full path // otherwise it is a full path
else if ( cmSystemTools::FileIsDirectory(i->c_str()) ) else if ( cmSystemTools::FileIsDirectory(*i) )
{ {
// we must compute the binPath from the srcPath, we just take the last // we must compute the binPath from the srcPath, we just take the last
// element from the source path and use that // element from the source path and use that

View File

@ -97,7 +97,7 @@ cm_archive_entry_pathname(struct archive_entry *entry)
{ {
#if cmsys_STL_HAS_WSTRING #if cmsys_STL_HAS_WSTRING
return cmsys::Encoding::ToNarrow( return cmsys::Encoding::ToNarrow(
archive_entry_pathname_w(entry)).c_str(); archive_entry_pathname_w(entry));
#else #else
return archive_entry_pathname(entry); return archive_entry_pathname(entry);
#endif #endif
@ -881,7 +881,7 @@ std::string cmSystemTools::FileExistsInParentDirectories(const char* fname,
break; break;
} }
prevDir = dir; prevDir = dir;
dir = cmSystemTools::GetParentDirectory(dir.c_str()); dir = cmSystemTools::GetParentDirectory(dir);
} }
return ""; return "";
} }
@ -1014,7 +1014,7 @@ void cmSystemTools::Glob(const std::string& directory,
cmsys::Directory d; cmsys::Directory d;
cmsys::RegularExpression reg(regexp.c_str()); cmsys::RegularExpression reg(regexp.c_str());
if (d.Load(directory.c_str())) if (d.Load(directory))
{ {
size_t numf; size_t numf;
unsigned int i; unsigned int i;
@ -1044,7 +1044,7 @@ void cmSystemTools::GlobDirs(const std::string& path,
std::string finishPath = path.substr(pos+2); std::string finishPath = path.substr(pos+2);
cmsys::Directory d; cmsys::Directory d;
if (d.Load(startPath.c_str())) if (d.Load(startPath))
{ {
for (unsigned int i = 0; i < d.GetNumberOfFiles(); ++i) for (unsigned int i = 0; i < d.GetNumberOfFiles(); ++i)
{ {
@ -1054,7 +1054,7 @@ void cmSystemTools::GlobDirs(const std::string& path,
std::string fname = startPath; std::string fname = startPath;
fname +="/"; fname +="/";
fname += d.GetFile(i); fname += d.GetFile(i);
if(cmSystemTools::FileIsDirectory(fname.c_str())) if(cmSystemTools::FileIsDirectory(fname))
{ {
fname += finishPath; fname += finishPath;
cmSystemTools::GlobDirs(fname, files); cmSystemTools::GlobDirs(fname, files);
@ -1168,7 +1168,7 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
bool res = false; bool res = false;
cmsys::Directory d; cmsys::Directory d;
if (d.Load(path.c_str())) if (d.Load(path))
{ {
for (unsigned int i = 0; i < d.GetNumberOfFiles(); ++i) for (unsigned int i = 0; i < d.GetNumberOfFiles(); ++i)
{ {
@ -1182,11 +1182,11 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
} }
fname += d.GetFile(i); fname += d.GetFile(i);
std::string sfname = d.GetFile(i); std::string sfname = d.GetFile(i);
if ( type > 0 && cmSystemTools::FileIsDirectory(fname.c_str()) ) if ( type > 0 && cmSystemTools::FileIsDirectory(fname) )
{ {
continue; continue;
} }
if ( type < 0 && !cmSystemTools::FileIsDirectory(fname.c_str()) ) if ( type < 0 && !cmSystemTools::FileIsDirectory(fname) )
{ {
continue; continue;
} }
@ -1354,8 +1354,8 @@ std::string cmSystemTools::CollapseCombinedPath(std::string const& dir,
std::vector<std::string> dirComponents; std::vector<std::string> dirComponents;
std::vector<std::string> fileComponents; std::vector<std::string> fileComponents;
cmSystemTools::SplitPath(dir.c_str(), dirComponents); cmSystemTools::SplitPath(dir, dirComponents);
cmSystemTools::SplitPath(file.c_str(), fileComponents); cmSystemTools::SplitPath(file, fileComponents);
if(fileComponents.empty()) if(fileComponents.empty())
{ {
@ -2176,7 +2176,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
if(cmSystemTools::FindProgramPath(argv0, exe, errorMsg)) if(cmSystemTools::FindProgramPath(argv0, exe, errorMsg))
{ {
// remove symlinks // remove symlinks
exe = cmSystemTools::GetRealPath(exe.c_str()); exe = cmSystemTools::GetRealPath(exe);
exe_dir = exe_dir =
cmSystemTools::GetFilenamePath(exe); cmSystemTools::GetFilenamePath(exe);
} }
@ -2227,7 +2227,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
cmsys::ifstream fin(src_dir_txt.c_str()); cmsys::ifstream fin(src_dir_txt.c_str());
std::string src_dir; std::string src_dir;
if(fin && cmSystemTools::GetLineFromStream(fin, src_dir) && if(fin && cmSystemTools::GetLineFromStream(fin, src_dir) &&
cmSystemTools::FileIsDirectory(src_dir.c_str())) cmSystemTools::FileIsDirectory(src_dir))
{ {
cmSystemToolsCMakeRoot = src_dir; cmSystemToolsCMakeRoot = src_dir;
} }
@ -2237,7 +2237,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt"; src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt";
cmsys::ifstream fin2(src_dir_txt.c_str()); cmsys::ifstream fin2(src_dir_txt.c_str());
if(fin2 && cmSystemTools::GetLineFromStream(fin2, src_dir) && if(fin2 && cmSystemTools::GetLineFromStream(fin2, src_dir) &&
cmSystemTools::FileIsDirectory(src_dir.c_str())) cmSystemTools::FileIsDirectory(src_dir))
{ {
cmSystemToolsCMakeRoot = src_dir; cmSystemToolsCMakeRoot = src_dir;
} }
@ -2333,7 +2333,7 @@ bool cmSystemTools::GuessLibrarySOName(std::string const& fullPath,
#endif #endif
// If the file is not a symlink we have no guess for its soname. // If the file is not a symlink we have no guess for its soname.
if(!cmSystemTools::FileIsSymlink(fullPath.c_str())) if(!cmSystemTools::FileIsSymlink(fullPath))
{ {
return false; return false;
} }

View File

@ -2171,7 +2171,7 @@ cmTarget::GetIncludeDirectories(const std::string& config) const
it = impl->Libraries.begin(); it = impl->Libraries.begin();
it != impl->Libraries.end(); ++it) it != impl->Libraries.end(); ++it)
{ {
std::string libDir = cmSystemTools::CollapseFullPath(it->c_str()); std::string libDir = cmSystemTools::CollapseFullPath(*it);
static cmsys::RegularExpression static cmsys::RegularExpression
frameworkCheck("(.*\\.framework)(/Versions/[^/]+)?/[^/]+$"); frameworkCheck("(.*\\.framework)(/Versions/[^/]+)?/[^/]+$");
@ -4555,7 +4555,7 @@ bool cmTarget::ComputeOutputDir(const std::string& config,
// specified as a relative path. Treat a relative path as // specified as a relative path. Treat a relative path as
// relative to the current output directory for this makefile. // relative to the current output directory for this makefile.
out = (cmSystemTools::CollapseFullPath out = (cmSystemTools::CollapseFullPath
(out.c_str(), this->Makefile->GetStartOutputDirectory())); (out, this->Makefile->GetStartOutputDirectory()));
// The generator may add the configuration's subdirectory. // The generator may add the configuration's subdirectory.
if(!conf.empty()) if(!conf.empty())
@ -4621,7 +4621,7 @@ bool cmTarget::ComputePDBOutputDir(const std::string& kind,
// specified as a relative path. Treat a relative path as // specified as a relative path. Treat a relative path as
// relative to the current output directory for this makefile. // relative to the current output directory for this makefile.
out = (cmSystemTools::CollapseFullPath out = (cmSystemTools::CollapseFullPath
(out.c_str(), this->Makefile->GetStartOutputDirectory())); (out, this->Makefile->GetStartOutputDirectory()));
// The generator may add the configuration's subdirectory. // The generator may add the configuration's subdirectory.
if(!conf.empty()) if(!conf.empty())
@ -5286,7 +5286,7 @@ cmTarget::GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const
{ {
continue; continue;
} }
cmTarget *objLib = this->Makefile->FindTargetToUse(objLibName.c_str()); cmTarget *objLib = this->Makefile->FindTargetToUse(objLibName);
if(objLib) if(objLib)
{ {
objlibs.push_back(objLib); objlibs.push_back(objLib);

View File

@ -239,7 +239,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
copyDest += "-"; copyDest += "-";
copyDest += this->RunResultVariable; copyDest += this->RunResultVariable;
copyDest += cmSystemTools::GetFilenameExtension(this->OutputFile); copyDest += cmSystemTools::GetFilenameExtension(this->OutputFile);
cmSystemTools::CopyFileAlways(this->OutputFile.c_str(), copyDest.c_str()); cmSystemTools::CopyFileAlways(this->OutputFile, copyDest);
std::string resultFileName = this->Makefile->GetHomeOutputDirectory(); std::string resultFileName = this->Makefile->GetHomeOutputDirectory();
resultFileName += "/TryRunResults.cmake"; resultFileName += "/TryRunResults.cmake";

View File

@ -647,7 +647,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
{ {
directoriesSet = true; directoriesSet = true;
std::string path = arg.substr(2); std::string path = arg.substr(2);
path = cmSystemTools::CollapseFullPath(path.c_str()); path = cmSystemTools::CollapseFullPath(path);
cmSystemTools::ConvertToUnixSlashes(path); cmSystemTools::ConvertToUnixSlashes(path);
this->SetHomeDirectory(path); this->SetHomeDirectory(path);
} }
@ -663,7 +663,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
{ {
directoriesSet = true; directoriesSet = true;
std::string path = arg.substr(2); std::string path = arg.substr(2);
path = cmSystemTools::CollapseFullPath(path.c_str()); path = cmSystemTools::CollapseFullPath(path);
cmSystemTools::ConvertToUnixSlashes(path); cmSystemTools::ConvertToUnixSlashes(path);
this->SetHomeOutputDirectory(path); this->SetHomeOutputDirectory(path);
} }
@ -723,7 +723,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
else if(arg.find("--graphviz=",0) == 0) else if(arg.find("--graphviz=",0) == 0)
{ {
std::string path = arg.substr(strlen("--graphviz=")); std::string path = arg.substr(strlen("--graphviz="));
path = cmSystemTools::CollapseFullPath(path.c_str()); path = cmSystemTools::CollapseFullPath(path);
cmSystemTools::ConvertToUnixSlashes(path); cmSystemTools::ConvertToUnixSlashes(path);
this->GraphVizFile = path; this->GraphVizFile = path;
if ( this->GraphVizFile.empty() ) if ( this->GraphVizFile.empty() )
@ -1212,7 +1212,7 @@ int cmake::DoPreConfigureChecks()
cacheStart += "/CMakeLists.txt"; cacheStart += "/CMakeLists.txt";
std::string currentStart = this->GetHomeDirectory(); std::string currentStart = this->GetHomeDirectory();
currentStart += "/CMakeLists.txt"; currentStart += "/CMakeLists.txt";
if(!cmSystemTools::SameFile(cacheStart.c_str(), currentStart.c_str())) if(!cmSystemTools::SameFile(cacheStart, currentStart))
{ {
std::string message = "The source \""; std::string message = "The source \"";
message += currentStart; message += currentStart;
@ -1948,7 +1948,7 @@ void cmake::UpdateConversionPathTable()
{ {
// two entries per line // two entries per line
table >> a; table >> b; table >> a; table >> b;
cmSystemTools::AddTranslationPath( a.c_str(), b.c_str()); cmSystemTools::AddTranslationPath( a, b);
} }
} }
} }
@ -2043,7 +2043,7 @@ int cmake::CheckBuildSystem()
pi != products.end(); ++pi) pi != products.end(); ++pi)
{ {
if(!(cmSystemTools::FileExists(pi->c_str()) || if(!(cmSystemTools::FileExists(pi->c_str()) ||
cmSystemTools::FileIsSymlink(pi->c_str()))) cmSystemTools::FileIsSymlink(*pi)))
{ {
if(verbose) if(verbose)
{ {
@ -2166,7 +2166,7 @@ void cmake::TruncateOutputLog(const char* fname)
} }
if ( !this->CacheManager->GetCacheValue("CMAKE_CACHEFILE_DIR") ) if ( !this->CacheManager->GetCacheValue("CMAKE_CACHEFILE_DIR") )
{ {
cmSystemTools::RemoveFile(fullPath.c_str()); cmSystemTools::RemoveFile(fullPath);
return; return;
} }
off_t fsize = st.st_size; off_t fsize = st.st_size;
@ -2392,7 +2392,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
std::string resultFile; std::string resultFile;
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
std::string destPath = cwd + "/__cmake_systeminformation"; std::string destPath = cwd + "/__cmake_systeminformation";
cmSystemTools::RemoveADirectory(destPath.c_str()); cmSystemTools::RemoveADirectory(destPath);
if (!cmSystemTools::MakeDirectory(destPath.c_str())) if (!cmSystemTools::MakeDirectory(destPath.c_str()))
{ {
std::cerr << "Error: --system-information must be run from a " std::cerr << "Error: --system-information must be run from a "
@ -2474,7 +2474,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
} }
// now run cmake on the CMakeLists file // now run cmake on the CMakeLists file
cmSystemTools::ChangeDirectory(destPath.c_str()); cmSystemTools::ChangeDirectory(destPath);
std::vector<std::string> args2; std::vector<std::string> args2;
args2.push_back(args[0]); args2.push_back(args[0]);
args2.push_back(destPath); args2.push_back(destPath);
@ -2490,12 +2490,12 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
} }
// change back to the original directory // change back to the original directory
cmSystemTools::ChangeDirectory(cwd.c_str()); cmSystemTools::ChangeDirectory(cwd);
// echo results to stdout if needed // echo results to stdout if needed
if (writeToStdout) if (writeToStdout)
{ {
FILE* fin = cmsys::SystemTools::Fopen(resultFile.c_str(), "r"); FILE* fin = cmsys::SystemTools::Fopen(resultFile, "r");
if(fin) if(fin)
{ {
const int bufferSize = 4096; const int bufferSize = 4096;
@ -2514,7 +2514,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
} }
// clean up the directory // clean up the directory
cmSystemTools::RemoveADirectory(destPath.c_str()); cmSystemTools::RemoveADirectory(destPath);
return 0; return 0;
} }
@ -2770,7 +2770,7 @@ int cmake::Build(const std::string& dir,
const std::vector<std::string>& nativeOptions, const std::vector<std::string>& nativeOptions,
bool clean) bool clean)
{ {
if(!cmSystemTools::FileIsDirectory(dir.c_str())) if(!cmSystemTools::FileIsDirectory(dir))
{ {
std::cerr << "Error: " << dir << " is not a directory\n"; std::cerr << "Error: " << dir << " is not a directory\n";
return 1; return 1;

View File

@ -128,7 +128,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Copy directory content // Copy directory content
if (args[1] == "copy_directory" && args.size() == 4) if (args[1] == "copy_directory" && args.size() == 4)
{ {
if(!cmSystemTools::CopyADirectory(args[2].c_str(), args[3].c_str())) if(!cmSystemTools::CopyADirectory(args[2], args[3]))
{ {
std::cerr << "Error copying directory from \"" std::cerr << "Error copying directory from \""
<< args[2] << "\" to \"" << args[3] << args[2] << "\" to \"" << args[3]
@ -155,7 +155,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Compare files // Compare files
if (args[1] == "compare_files" && args.size() == 4) if (args[1] == "compare_files" && args.size() == 4)
{ {
if(cmSystemTools::FilesDiffer(args[2].c_str(), args[3].c_str())) if(cmSystemTools::FilesDiffer(args[2], args[3]))
{ {
std::cerr << "Files \"" std::cerr << "Files \""
<< args[2] << "\" to \"" << args[3] << args[2] << "\" to \"" << args[3]
@ -269,8 +269,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
else if (args[1] == "remove_directory" && args.size() == 3) else if (args[1] == "remove_directory" && args.size() == 3)
{ {
if(cmSystemTools::FileIsDirectory(args[2].c_str()) && if(cmSystemTools::FileIsDirectory(args[2]) &&
!cmSystemTools::RemoveADirectory(args[2].c_str())) !cmSystemTools::RemoveADirectory(args[2]))
{ {
std::cerr << "Error removing directory \"" << args[2] std::cerr << "Error removing directory \"" << args[2]
<< "\".\n"; << "\".\n";
@ -293,7 +293,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{ {
// Complain if the file could not be removed, still exists, // Complain if the file could not be removed, still exists,
// and the -f option was not given. // and the -f option was not given.
if(!cmSystemTools::RemoveFile(args[cc].c_str()) && !force && if(!cmSystemTools::RemoveFile(args[cc]) && !force &&
cmSystemTools::FileExists(args[cc].c_str())) cmSystemTools::FileExists(args[cc].c_str()))
{ {
return 1; return 1;
@ -309,7 +309,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{ {
// Complain if the file could not be removed, still exists, // Complain if the file could not be removed, still exists,
// and the -f option was not given. // and the -f option was not given.
if(!cmSystemTools::Touch(args[cc].c_str(), true)) if(!cmSystemTools::Touch(args[cc], true))
{ {
return 1; return 1;
} }
@ -323,7 +323,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{ {
// Complain if the file could not be removed, still exists, // Complain if the file could not be removed, still exists,
// and the -f option was not given. // and the -f option was not given.
if(!cmSystemTools::Touch(args[cc].c_str(), false)) if(!cmSystemTools::Touch(args[cc], false))
{ {
return 1; return 1;
} }
@ -453,10 +453,10 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// basically remove the directory // basically remove the directory
std::string dirName = args[2]; std::string dirName = args[2];
dirName += "/Progress"; dirName += "/Progress";
cmSystemTools::RemoveADirectory(dirName.c_str()); cmSystemTools::RemoveADirectory(dirName);
// is the last argument a filename that exists? // is the last argument a filename that exists?
FILE *countFile = cmsys::SystemTools::Fopen(args[3].c_str(),"r"); FILE *countFile = cmsys::SystemTools::Fopen(args[3],"r");
int count; int count;
if (countFile) if (countFile)
{ {
@ -476,7 +476,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// write the count into the directory // write the count into the directory
std::string fName = dirName; std::string fName = dirName;
fName += "/count.txt"; fName += "/count.txt";
FILE *progFile = cmsys::SystemTools::Fopen(fName.c_str(),"w"); FILE *progFile = cmsys::SystemTools::Fopen(fName,"w");
if (progFile) if (progFile)
{ {
fprintf(progFile,"%i\n",count); fprintf(progFile,"%i\n",count);
@ -497,7 +497,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// read the count // read the count
fName = dirName; fName = dirName;
fName += "/count.txt"; fName += "/count.txt";
progFile = cmsys::SystemTools::Fopen(fName.c_str(),"r"); progFile = cmsys::SystemTools::Fopen(fName,"r");
int count = 0; int count = 0;
if (!progFile) if (!progFile)
{ {
@ -517,7 +517,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
fName = dirName; fName = dirName;
fName += "/"; fName += "/";
fName += args[i]; fName += args[i];
progFile = cmsys::SystemTools::Fopen(fName.c_str(),"w"); progFile = cmsys::SystemTools::Fopen(fName,"w");
if (progFile) if (progFile)
{ {
fprintf(progFile,"empty"); fprintf(progFile,"empty");
@ -525,7 +525,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
} }
} }
int fileNum = static_cast<int> int fileNum = static_cast<int>
(cmsys::Directory::GetNumberOfFilesInDirectory(dirName.c_str())); (cmsys::Directory::GetNumberOfFilesInDirectory(dirName));
if (count > 0) if (count > 0)
{ {
// print the progress // print the progress
@ -660,10 +660,10 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Create a local generator configured for the directory in // Create a local generator configured for the directory in
// which dependencies will be scanned. // which dependencies will be scanned.
homeDir = cmSystemTools::CollapseFullPath(homeDir.c_str()); homeDir = cmSystemTools::CollapseFullPath(homeDir);
startDir = cmSystemTools::CollapseFullPath(startDir.c_str()); startDir = cmSystemTools::CollapseFullPath(startDir);
homeOutDir = cmSystemTools::CollapseFullPath(homeOutDir.c_str()); homeOutDir = cmSystemTools::CollapseFullPath(homeOutDir);
startOutDir = cmSystemTools::CollapseFullPath(startOutDir.c_str()); startOutDir = cmSystemTools::CollapseFullPath(startOutDir);
cm.SetHomeDirectory(homeDir); cm.SetHomeDirectory(homeDir);
cm.SetStartDirectory(startDir); cm.SetStartDirectory(startDir);
cm.SetHomeOutputDirectory(homeOutDir); cm.SetHomeOutputDirectory(homeOutDir);
@ -885,9 +885,9 @@ int cmcmd::SymlinkExecutable(std::vector<std::string>& args)
bool cmcmd::SymlinkInternal(std::string const& file, std::string const& link) bool cmcmd::SymlinkInternal(std::string const& file, std::string const& link)
{ {
if(cmSystemTools::FileExists(link.c_str()) || if(cmSystemTools::FileExists(link.c_str()) ||
cmSystemTools::FileIsSymlink(link.c_str())) cmSystemTools::FileIsSymlink(link))
{ {
cmSystemTools::RemoveFile(link.c_str()); cmSystemTools::RemoveFile(link);
} }
#if defined(_WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
return cmSystemTools::CopyFileAlways(file.c_str(), link.c_str()); return cmSystemTools::CopyFileAlways(file.c_str(), link.c_str());
@ -1318,7 +1318,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
} }
std::string manifestFile = targetName; std::string manifestFile = targetName;
manifestFile += ".embed.manifest"; manifestFile += ".embed.manifest";
std::string fullPath= cmSystemTools::CollapseFullPath(manifestFile.c_str()); std::string fullPath= cmSystemTools::CollapseFullPath(manifestFile);
fout << type << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID " fout << type << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID "
"*/ 24 /* RT_MANIFEST */ " << "\"" << fullPath << "\""; "*/ 24 /* RT_MANIFEST */ " << "\"" << fullPath << "\"";
fout.close(); fout.close();