summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2019-01-30 17:19:22 (GMT)
committerBrad King <brad.king@kitware.com>2019-01-31 14:27:54 (GMT)
commit0779bc9393efeaf1bb3bbf35619617d317d37308 (patch)
treea0b78a5475011b289a4048b20b5fe57be22e4e7f /Source/cmake.cxx
parent8ea30a44d38057fed134532f6d3b6e8626a1ccff (diff)
downloadCMake-0779bc9393efeaf1bb3bbf35619617d317d37308.zip
CMake-0779bc9393efeaf1bb3bbf35619617d317d37308.tar.gz
CMake-0779bc9393efeaf1bb3bbf35619617d317d37308.tar.bz2
ReadListFile: Accept std::string argument
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 2b627ff..8023298 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -437,7 +437,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
}
std::cout << "loading initial cache file " << path << "\n";
- this->ReadListFile(args, path.c_str());
+ this->ReadListFile(args, path);
} else if (arg.find("-P", 0) == 0) {
i++;
if (i >= args.size()) {
@@ -451,7 +451,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
// Register fake project commands that hint misuse in script mode.
GetProjectCommandsInScriptMode(this->State);
- this->ReadListFile(args, path.c_str());
+ this->ReadListFile(args, path);
} else if (arg.find("--find-package", 0) == 0) {
findPackageMode = true;
}
@@ -465,7 +465,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
void cmake::ReadListFile(const std::vector<std::string>& args,
- const char* path)
+ const std::string& path)
{
// if a generator was not yet created, temporarily create one
cmGlobalGenerator* gg = this->GetGlobalGenerator();
@@ -478,7 +478,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
}
// read in the list file to fill the cache
- if (path) {
+ if (!path.empty()) {
this->CurrentSnapshot = this->State->Reset();
std::string homeDir = this->GetHomeDirectory();
std::string homeOutputDir = this->GetHomeOutputDirectory();
@@ -499,7 +499,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
mf.SetArgcArgv(args);
}
if (!mf.ReadListFile(path)) {
- cmSystemTools::Error("Error processing file: ", path);
+ cmSystemTools::Error("Error processing file: " + path);
}
this->SetHomeDirectory(homeDir);
this->SetHomeOutputDirectory(homeOutputDir);
@@ -1606,14 +1606,14 @@ void cmake::PreLoadCMakeFiles()
if (!pre_load.empty()) {
pre_load += "/PreLoad.cmake";
if (cmSystemTools::FileExists(pre_load)) {
- this->ReadListFile(args, pre_load.c_str());
+ this->ReadListFile(args, pre_load);
}
}
pre_load = this->GetHomeOutputDirectory();
if (!pre_load.empty()) {
pre_load += "/PreLoad.cmake";
if (cmSystemTools::FileExists(pre_load)) {
- this->ReadListFile(args, pre_load.c_str());
+ this->ReadListFile(args, pre_load);
}
}
}
@@ -2613,7 +2613,7 @@ int cmake::Build(int jobs, const std::string& dir, const std::string& target,
cachePath + "/" + "CMakeFiles/" + "VerifyGlobs.cmake";
if (cmSystemTools::FileExists(globVerifyScript)) {
std::vector<std::string> args;
- this->ReadListFile(args, globVerifyScript.c_str());
+ this->ReadListFile(args, globVerifyScript);
}
}