mirror of
https://github.com/Kitware/CMake.git
synced 2026-07-01 20:27:24 +00:00
cmFindPackage: Fix PACKAGE_VERSION not being set when rebuilding
This commit is contained in:
@@ -1671,6 +1671,12 @@ bool cmFindPackageCommand::HandlePackageMode(
|
||||
"fileFound is true but FileFound is empty!");
|
||||
fileFound = false;
|
||||
}
|
||||
|
||||
if (fileFound) {
|
||||
this->CurrentPackageInfo->Directory =
|
||||
cmSystemTools::GetFilenamePath(this->FileFound);
|
||||
this->CurrentPackageInfo->Version = this->VersionFound;
|
||||
}
|
||||
}
|
||||
|
||||
std::string const foundVar = cmStrCat(this->Name, "_FOUND");
|
||||
@@ -1975,8 +1981,6 @@ bool cmFindPackageCommand::FindConfig()
|
||||
std::string init;
|
||||
if (found) {
|
||||
init = cmSystemTools::GetFilenamePath(this->FileFound);
|
||||
this->CurrentPackageInfo->Directory = init;
|
||||
this->CurrentPackageInfo->Version = this->VersionFound;
|
||||
} else {
|
||||
init = this->Variable + "-NOTFOUND";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user