mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-07 04:02:23 +03:00
cmFindPackageCommand: Avoid temporarily saving non-existent result
This commit is contained in:
1 parent
8d6b76771d
commit
592e95bbea
1 file changed
+4
-2
@@ -1437,7 +1437,7 @@ bool cmFindPackageCommand::HandlePackageMode(
|
||||
// The file location was cached. Look for the correct file.
|
||||
std::string file;
|
||||
if (this->FindConfigFile(dir, file)) {
|
||||
this->FileFound = file;
|
||||
this->FileFound = std::move(file);
|
||||
fileFound = true;
|
||||
}
|
||||
def = this->Makefile->GetDefinition(this->Variable);
|
||||
@@ -2409,7 +2409,9 @@ bool cmFindPackageCommand::CheckDirectory(std::string const& dir)
|
||||
}
|
||||
|
||||
// Look for the file in this directory.
|
||||
if (this->FindConfigFile(d, this->FileFound)) {
|
||||
std::string file;
|
||||
if (this->FindConfigFile(d, file)) {
|
||||
this->FileFound = std::move(file);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user