diff options
-rw-r--r-- | Source/CPack/cmCPackExternalGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/cpack.cxx | 6 | ||||
-rw-r--r-- | Source/CTest/cmCTestLaunch.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 4 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 15 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 24 | ||||
-rw-r--r-- | Source/cmIncludeCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 3 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 5 | ||||
-rw-r--r-- | Source/cmMakefile.h | 7 | ||||
-rw-r--r-- | Source/cmQtAutoGeneratorMocUic.cxx | 2 | ||||
-rw-r--r-- | Source/cmQtAutoGeneratorRcc.cxx | 2 | ||||
-rw-r--r-- | Source/cmake.cxx | 4 |
15 files changed, 42 insertions, 47 deletions
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx index ff69418..9dc9853 100644 --- a/Source/CPack/cmCPackExternalGenerator.cxx +++ b/Source/CPack/cmCPackExternalGenerator.cxx @@ -68,7 +68,7 @@ int cmCPackExternalGenerator::PackageFiles() return 0; } - int res = this->MakefileMap->ReadListFile(packageScript); + bool res = this->MakefileMap->ReadListFile(packageScript); if (cmSystemTools::GetErrorOccuredFlag() || !res) { return 0; diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index b205105..70a7faa 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -498,7 +498,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript( tempInstallDirectory.c_str()); this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR", tempInstallDirectory.c_str()); - int res = this->MakefileMap->ReadListFile(installScript.c_str()); + bool res = this->MakefileMap->ReadListFile(installScript); if (cmSystemTools::GetErrorOccuredFlag() || !res) { return 0; } @@ -851,7 +851,7 @@ int cmCPackGenerator::InstallCMakeProject( mf.AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", "1"); } // do installation - int res = mf.ReadListFile(installFile.c_str()); + bool res = mf.ReadListFile(installFile); // forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES // to CPack (may be used by generators like CPack RPM or DEB) // in order to transparently handle ABSOLUTE PATH @@ -927,7 +927,7 @@ bool cmCPackGenerator::ReadListFile(const char* moduleName) { bool retval; std::string fullPath = this->MakefileMap->GetModulesFile(moduleName); - retval = this->MakefileMap->ReadListFile(fullPath.c_str()); + retval = this->MakefileMap->ReadListFile(fullPath); // include FATAL_ERROR and ERROR in the return status retval = retval && (!cmSystemTools::GetErrorOccuredFlag()); return retval; diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index db9a0e7..d4c867b 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -256,7 +256,7 @@ int main(int argc, char const* const* argv) // paths, so FIND_XXX() commands can be used in scripts std::string systemFile = globalMF.GetModulesFile("CMakeDetermineSystem.cmake"); - if (!globalMF.ReadListFile(systemFile.c_str())) { + if (!globalMF.ReadListFile(systemFile)) { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Error reading CMakeDetermineSystem.cmake" << std::endl); return 1; @@ -264,7 +264,7 @@ int main(int argc, char const* const* argv) systemFile = globalMF.GetModulesFile("CMakeSystemSpecificInformation.cmake"); - if (!globalMF.ReadListFile(systemFile.c_str())) { + if (!globalMF.ReadListFile(systemFile)) { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Error reading CMakeSystemSpecificInformation.cmake" << std::endl); @@ -280,7 +280,7 @@ int main(int argc, char const* const* argv) cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, "Read CPack configuration file: " << cpackConfigFile << std::endl); - if (!globalMF.ReadListFile(cpackConfigFile.c_str())) { + if (!globalMF.ReadListFile(cpackConfigFile)) { cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Problem reading CPack config file: \"" << cpackConfigFile << "\"" << std::endl); diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 4facea2..465d619 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -619,7 +619,7 @@ void cmCTestLaunch::LoadConfig() cmMakefile mf(&gg, cm.GetCurrentSnapshot()); std::string fname = this->LogDir; fname += "CTestLaunchConfig.cmake"; - if (cmSystemTools::FileExists(fname) && mf.ReadListFile(fname.c_str())) { + if (cmSystemTools::FileExists(fname) && mf.ReadListFile(fname)) { this->SourceDir = mf.GetSafeDefinition("CTEST_SOURCE_DIRECTORY"); cmSystemTools::ConvertToUnixSlashes(this->SourceDir); } diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index aa37ff9..57841e4 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -373,7 +373,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) ctest scripting easier. */ std::string systemFile = this->Makefile->GetModulesFile("CTestScriptMode.cmake"); - if (!this->Makefile->ReadListFile(systemFile.c_str()) || + if (!this->Makefile->ReadListFile(systemFile) || cmSystemTools::GetErrorOccuredFlag()) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read:" << systemFile << "\n"); @@ -388,7 +388,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) } // finally read in the script - if (!this->Makefile->ReadListFile(script.c_str()) || + if (!this->Makefile->ReadListFile(script) || cmSystemTools::GetErrorOccuredFlag()) { // Reset the error flag so that it can run more than // one script with an error when you use ctest_run_script. diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index acbe465..e33c937 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -104,7 +104,7 @@ bool cmCTestSubdirCommand::InitialPass(std::vector<std::string> const& args, } fname += "/"; fname += testFilename; - readit = this->Makefile->ReadDependentFile(fname.c_str()); + readit = this->Makefile->ReadDependentFile(fname); } if (!readit) { std::string m = "Could not find include file: "; @@ -170,7 +170,7 @@ bool cmCTestAddSubdirectoryCommand::InitialPass( } fname += "/"; fname += testFilename; - readit = this->Makefile->ReadDependentFile(fname.c_str()); + readit = this->Makefile->ReadDependentFile(fname); } if (!readit) { std::string m = "Could not find include file: "; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 1c0d9f6..cd9cbfb 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -640,7 +640,7 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) " Reading ctest configuration file: " << fname << std::endl, command->ShouldBeQuiet()); - bool readit = mf->ReadDependentFile(fname.c_str()); + bool readit = mf->ReadDependentFile(fname); if (!readit) { std::string m = "Could not find include file: "; m += fname; @@ -2469,8 +2469,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf) bool erroroc = cmSystemTools::GetErrorOccuredFlag(); cmSystemTools::ResetErrorOccuredFlag(); - if (!mf->ReadListFile(fname.c_str()) || - cmSystemTools::GetErrorOccuredFlag()) { + if (!mf->ReadListFile(fname) || cmSystemTools::GetErrorOccuredFlag()) { cmCTestLog(this, ERROR_MESSAGE, "Problem reading custom configuration: " << fname << std::endl); @@ -2489,15 +2488,13 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf) gl.RecurseOn(); gl.FindFiles(rexpr); std::vector<std::string>& files = gl.GetFiles(); - std::vector<std::string>::iterator fileIt; - for (fileIt = files.begin(); fileIt != files.end(); ++fileIt) { + for (const std::string& file : files) { cmCTestLog(this, DEBUG, - "* Read custom CTest configuration file: " << *fileIt + "* Read custom CTest configuration file: " << file << std::endl); - if (!mf->ReadListFile(fileIt->c_str()) || - cmSystemTools::GetErrorOccuredFlag()) { + if (!mf->ReadListFile(file) || cmSystemTools::GetErrorOccuredFlag()) { cmCTestLog(this, ERROR_MESSAGE, - "Problem reading custom configuration: " << *fileIt + "Problem reading custom configuration: " << file << std::endl); } } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 85c2345..8f28179 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -355,7 +355,7 @@ bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) std::string setMakeProgram = mf->GetModulesFile(this->FindMakeProgramFile.c_str()); if (!setMakeProgram.empty()) { - mf->ReadListFile(setMakeProgram.c_str()); + mf->ReadListFile(setMakeProgram); } } if (!mf->GetDefinition("CMAKE_MAKE_PROGRAM") || @@ -522,7 +522,7 @@ void cmGlobalGenerator::EnableLanguage( if (readCMakeSystem) { fpath += "/CMakeSystem.cmake"; if (cmSystemTools::FileExists(fpath)) { - mf->ReadListFile(fpath.c_str()); + mf->ReadListFile(fpath); } } // Load the CMakeDetermineSystem.cmake file and find out @@ -551,12 +551,12 @@ void cmGlobalGenerator::EnableLanguage( #endif // Read the DetermineSystem file std::string systemFile = mf->GetModulesFile("CMakeDetermineSystem.cmake"); - mf->ReadListFile(systemFile.c_str()); + mf->ReadListFile(systemFile); // load the CMakeSystem.cmake from the binary directory // this file is configured by the CMakeDetermineSystem.cmake file fpath = rootBin; fpath += "/CMakeSystem.cmake"; - mf->ReadListFile(fpath.c_str()); + mf->ReadListFile(fpath); } if (readCMakeSystem) { @@ -603,7 +603,7 @@ void cmGlobalGenerator::EnableLanguage( // **** Load the system specific initialization if not yet loaded if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INITIALIZE_LOADED")) { fpath = mf->GetModulesFile("CMakeSystemSpecificInitialize.cmake"); - if (!mf->ReadListFile(fpath.c_str())) { + if (!mf->ReadListFile(fpath)) { cmSystemTools::Error("Could not find cmake module file: " "CMakeSystemSpecificInitialize.cmake"); } @@ -635,7 +635,7 @@ void cmGlobalGenerator::EnableLanguage( // version of CMake then try to load the configured file first // to avoid duplicate compiler tests. if (cmSystemTools::FileExists(fpath)) { - if (!mf->ReadListFile(fpath.c_str())) { + if (!mf->ReadListFile(fpath)) { cmSystemTools::Error("Could not find cmake module file: ", fpath.c_str()); } @@ -662,7 +662,7 @@ void cmGlobalGenerator::EnableLanguage( determineCompiler += "Compiler.cmake"; std::string determineFile = mf->GetModulesFile(determineCompiler.c_str()); - if (!mf->ReadListFile(determineFile.c_str())) { + if (!mf->ReadListFile(determineFile)) { cmSystemTools::Error("Could not find cmake module file: ", determineCompiler.c_str()); } @@ -696,7 +696,7 @@ void cmGlobalGenerator::EnableLanguage( fpath += "/CMake"; fpath += lang; fpath += "Compiler.cmake"; - if (!mf->ReadListFile(fpath.c_str())) { + if (!mf->ReadListFile(fpath)) { cmSystemTools::Error("Could not find cmake module file: ", fpath.c_str()); } @@ -713,7 +713,7 @@ void cmGlobalGenerator::EnableLanguage( // **** Load the system specific information if not yet loaded if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED")) { fpath = mf->GetModulesFile("CMakeSystemSpecificInformation.cmake"); - if (!mf->ReadListFile(fpath.c_str())) { + if (!mf->ReadListFile(fpath)) { cmSystemTools::Error("Could not find cmake module file: " "CMakeSystemSpecificInformation.cmake"); } @@ -793,7 +793,7 @@ void cmGlobalGenerator::EnableLanguage( if (informationFile.empty()) { cmSystemTools::Error("Could not find cmake module file: ", fpath.c_str()); - } else if (!mf->ReadListFile(informationFile.c_str())) { + } else if (!mf->ReadListFile(informationFile)) { cmSystemTools::Error("Could not process cmake module file: ", informationFile.c_str()); } @@ -814,7 +814,7 @@ void cmGlobalGenerator::EnableLanguage( testLang += lang; testLang += "Compiler.cmake"; std::string ifpath = mf->GetModulesFile(testLang.c_str()); - if (!mf->ReadListFile(ifpath.c_str())) { + if (!mf->ReadListFile(ifpath)) { cmSystemTools::Error("Could not find cmake module file: ", testLang.c_str()); } @@ -852,7 +852,7 @@ void cmGlobalGenerator::EnableLanguage( projectCompatibility += mf->GetSafeDefinition("PROJECT_NAME"); projectCompatibility += "Compatibility.cmake"; if (cmSystemTools::FileExists(projectCompatibility)) { - mf->ReadListFile(projectCompatibility.c_str()); + mf->ReadListFile(projectCompatibility); } // Inform any extra generator of the new language. if (this->ExtraGenerator) { diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 594c310..a67d09e 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -120,8 +120,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args, return true; } - bool readit = - this->Makefile->ReadDependentFile(listFile.c_str(), noPolicyScope); + bool readit = this->Makefile->ReadDependentFile(listFile, noPolicyScope); // add the location of the included file if a result variable was given if (!resultVarName.empty()) { diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 707a1b5..eddbaa9 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1364,8 +1364,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies( std::string dirInfoFile = this->GetCurrentBinaryDirectory(); dirInfoFile += cmake::GetCMakeFilesDirectory(); dirInfoFile += "/CMakeDirectoryInformation.cmake"; - if (mf->ReadListFile(dirInfoFile.c_str()) && - !cmSystemTools::GetErrorOccuredFlag()) { + if (mf->ReadListFile(dirInfoFile) && !cmSystemTools::GetErrorOccuredFlag()) { haveDirectoryInfo = true; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 3ff576e..fa1769d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -533,7 +533,8 @@ void cmMakefile::IncludeScope::EnforceCMP0011() } } -bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope) +bool cmMakefile::ReadDependentFile(const std::string& filename, + bool noPolicyScope) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetDefinition("CMAKE_CURRENT_LIST_FILE")); @@ -586,7 +587,7 @@ private: bool ReportError; }; -bool cmMakefile::ReadListFile(const char* filename) +bool cmMakefile::ReadListFile(const std::string& filename) { std::string filenametoread = cmSystemTools::CollapseFullPath( filename, this->GetCurrentSourceDirectory()); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index ec36972..abe2cd1 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -86,11 +86,10 @@ public: cmDirectoryId GetDirectoryId() const; - bool ReadListFile(const char* filename); + bool ReadListFile(const std::string& filename); - bool ReadDependentFile(const char* filename, bool noPolicyScope = true); - - bool ProcessBuildsystemFile(const char* filename); + bool ReadDependentFile(const std::string& filename, + bool noPolicyScope = true); /** * Add a function blocker to this makefile diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx index 9658e97..b22ebd5 100644 --- a/Source/cmQtAutoGeneratorMocUic.cxx +++ b/Source/cmQtAutoGeneratorMocUic.cxx @@ -1213,7 +1213,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) }; // -- Read info file - if (!makefile->ReadListFile(InfoFile().c_str())) { + if (!makefile->ReadListFile(InfoFile())) { Log().ErrorFile(GeneratorT::GEN, InfoFile(), "File processing failed"); return false; } diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx index 29dc7a0..eb46892 100644 --- a/Source/cmQtAutoGeneratorRcc.cxx +++ b/Source/cmQtAutoGeneratorRcc.cxx @@ -58,7 +58,7 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile) }; // -- Read info file - if (!makefile->ReadListFile(InfoFile().c_str())) { + if (!makefile->ReadListFile(InfoFile())) { Log().ErrorFile(GeneratorT::RCC, InfoFile(), "File processing failed"); return false; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 9fcfbde..12d39f0 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -533,7 +533,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args) mf->SetArgcArgv(args); std::string systemFile = mf->GetModulesFile("CMakeFindPackageMode.cmake"); - mf->ReadListFile(systemFile.c_str()); + mf->ReadListFile(systemFile); std::string language = mf->GetSafeDefinition("LANGUAGE"); std::string mode = mf->GetSafeDefinition("MODE"); @@ -2031,7 +2031,7 @@ int cmake::CheckBuildSystem() cm.GetCurrentSnapshot().SetDefaultDefinitions(); cmGlobalGenerator gg(&cm); cmMakefile mf(&gg, cm.GetCurrentSnapshot()); - if (!mf.ReadListFile(this->CheckBuildSystemArgument.c_str()) || + if (!mf.ReadListFile(this->CheckBuildSystemArgument) || cmSystemTools::GetErrorOccuredFlag()) { if (verbose) { std::ostringstream msg; |