mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-23 15:38:52 -06:00
FindPackage: Provide better debug message when <PKG_FOUND> is false
This commit is contained in:
@@ -753,6 +753,17 @@ bool cmFindPackageCommand::FindModule(bool& found)
|
|||||||
this->Makefile->AddDefinition(var, "1");
|
this->Makefile->AddDefinition(var, "1");
|
||||||
bool result = this->ReadListFile(mfile, DoPolicyScope);
|
bool result = this->ReadListFile(mfile, DoPolicyScope);
|
||||||
this->Makefile->RemoveDefinition(var);
|
this->Makefile->RemoveDefinition(var);
|
||||||
|
|
||||||
|
if (this->DebugMode) {
|
||||||
|
std::string foundVar = cmStrCat(this->Name, "_FOUND");
|
||||||
|
if (this->Makefile->IsDefinitionSet(foundVar) &&
|
||||||
|
!this->Makefile->IsOn(foundVar)) {
|
||||||
|
|
||||||
|
this->DebugBuffer = cmStrCat(
|
||||||
|
this->DebugBuffer, "The module is considered not found due to ",
|
||||||
|
foundVar, " being FALSE.");
|
||||||
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user