summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.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/cmFindPackageCommand.cxx
parent8ea30a44d38057fed134532f6d3b6e8626a1ccff (diff)
downloadCMake-0779bc9393efeaf1bb3bbf35619617d317d37308.zip
CMake-0779bc9393efeaf1bb3bbf35619617d317d37308.tar.gz
CMake-0779bc9393efeaf1bb3bbf35619617d317d37308.tar.bz2
ReadListFile: Accept std::string argument
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index f9ac310..c2e0712 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -693,7 +693,7 @@ bool cmFindPackageCommand::FindModule(bool& found)
std::string var = this->Name;
var += "_FIND_MODULE";
this->Makefile->AddDefinition(var, "1");
- bool result = this->ReadListFile(mfile.c_str(), DoPolicyScope);
+ bool result = this->ReadListFile(mfile, DoPolicyScope);
this->Makefile->RemoveDefinition(var);
return result;
}
@@ -776,7 +776,7 @@ bool cmFindPackageCommand::HandlePackageMode()
this->StoreVersionFound();
// Parse the configuration file.
- if (this->ReadListFile(this->FileFound.c_str(), DoPolicyScope)) {
+ if (this->ReadListFile(this->FileFound, DoPolicyScope)) {
// The package has been found.
found = true;
@@ -1036,7 +1036,8 @@ bool cmFindPackageCommand::FindAppBundleConfig()
return false;
}
-bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr)
+bool cmFindPackageCommand::ReadListFile(const std::string& f,
+ PolicyScopeRule psr)
{
const bool noPolicyScope = !this->PolicyScope || psr == NoPolicyScope;
if (this->Makefile->ReadDependentFile(f, noPolicyScope)) {
@@ -1590,7 +1591,7 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file,
// Load the version check file. Pass NoPolicyScope because we do
// our own policy push/pop independent of CMP0011.
bool suitable = false;
- if (this->ReadListFile(version_file.c_str(), NoPolicyScope)) {
+ if (this->ReadListFile(version_file, NoPolicyScope)) {
// Check the output variables.
bool okay = this->Makefile->IsOn("PACKAGE_VERSION_EXACT");
bool unsuitable = this->Makefile->IsOn("PACKAGE_VERSION_UNSUITABLE");