diff options
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index d19de21..031123a 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -812,7 +812,7 @@ void cmake::SetArgs(const std::vector<std::string>& args) } // no option assume it is the path to the source or an existing build else { - this->SetDirectoriesFromFile(arg.c_str()); + this->SetDirectoriesFromFile(arg); } } @@ -855,7 +855,7 @@ cmake::LogLevel cmake::StringToLogLevel(const std::string& levelStr) return (it != levels.cend()) ? it->second : LogLevel::LOG_UNDEFINED; } -void cmake::SetDirectoriesFromFile(const char* arg) +void cmake::SetDirectoriesFromFile(const std::string& arg) { // Check if the argument refers to a CMakeCache.txt or // CMakeLists.txt file. @@ -1755,7 +1755,7 @@ int cmake::Generate() this->GlobalGenerator->Generate(); if (!this->GraphVizFile.empty()) { std::cout << "Generate graphviz: " << this->GraphVizFile << std::endl; - this->GenerateGraphViz(this->GraphVizFile.c_str()); + this->GenerateGraphViz(this->GraphVizFile); } if (this->WarnUnusedCli) { this->RunCheckForUnusedVariables(); @@ -2263,7 +2263,7 @@ void cmake::MarkCliAsUsed(const std::string& variable) this->UsedCliVariables[variable] = true; } -void cmake::GenerateGraphViz(const char* fileName) const +void cmake::GenerateGraphViz(const std::string& fileName) const { #ifdef CMAKE_BUILD_WITH_CMAKE cmGraphVizWriter gvWriter(this->GetGlobalGenerator()); @@ -2273,8 +2273,7 @@ void cmake::GenerateGraphViz(const char* fileName) const std::string fallbackSettingsFile = this->GetHomeDirectory(); fallbackSettingsFile += "/CMakeGraphVizOptions.cmake"; - gvWriter.ReadSettings(settingsFile.c_str(), fallbackSettingsFile.c_str()); - + gvWriter.ReadSettings(settingsFile, fallbackSettingsFile); gvWriter.WritePerTargetFiles(fileName); gvWriter.WriteTargetDependersFiles(fileName); gvWriter.WriteGlobalFile(fileName); @@ -2652,7 +2651,7 @@ int cmake::Build(int jobs, const std::string& dir, // directories, which is required for running the generation step. std::string homeOrig = this->GetHomeDirectory(); std::string homeOutputOrig = this->GetHomeOutputDirectory(); - this->SetDirectoriesFromFile(cachePath.c_str()); + this->SetDirectoriesFromFile(cachePath); this->AddProjectCommands(); |