summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-25 16:25:46 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-25 16:26:10 (GMT)
commit7a4d84d8d20ea58cd5cb297b9e5decd58a80b709 (patch)
treeab07d6484bf4ff787e805622acbec4c4c5986dd3 /Source/cmFindPackageCommand.cxx
parentf0592b349773343fa7a2abd69e599a102344d4aa (diff)
parentb423a20ce18fe7b70014aeb3280391a717fdc866 (diff)
downloadCMake-7a4d84d8d20ea58cd5cb297b9e5decd58a80b709.zip
CMake-7a4d84d8d20ea58cd5cb297b9e5decd58a80b709.tar.gz
CMake-7a4d84d8d20ea58cd5cb297b9e5decd58a80b709.tar.bz2
Merge topic 'find_package_module_mode_print_debug_message'
b423a20ce1 FindPackage: Provide better debug message when <PKG_FOUND> is false a7acafc977 FindPackage: find_package(MODULE) respects CMAKE_FIND_DEBUG_MODE Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5256
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 1ff093f..51137b3 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -576,6 +576,11 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
loadedPackage = true;
}
}
+
+ if (this->DebugMode) {
+ this->DebugMessage(this->DebugBuffer);
+ this->DebugBuffer.clear();
+ }
}
this->AppendSuccessInformation();
@@ -788,6 +793,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;