diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-09-22 19:32:31 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2020-09-22 19:32:31 (GMT) |
commit | b423a20ce18fe7b70014aeb3280391a717fdc866 (patch) | |
tree | ace7d5f5ce6270b073345c2fc4ad1168a5067866 /Source | |
parent | a7acafc977dbd1f8fdf453c0bda10eafabc811c5 (diff) | |
download | CMake-b423a20ce18fe7b70014aeb3280391a717fdc866.zip CMake-b423a20ce18fe7b70014aeb3280391a717fdc866.tar.gz CMake-b423a20ce18fe7b70014aeb3280391a717fdc866.tar.bz2 |
FindPackage: Provide better debug message when <PKG_FOUND> is false
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 87c0834..de3cb29 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -753,6 +753,17 @@ bool cmFindPackageCommand::FindModule(bool& found) this->Makefile->AddDefinition(var, "1"); bool result = this->ReadListFile(mfile, DoPolicyScope); 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 true; |