find_package: Fix find module name in --debug-find output

This commit is contained in:
Brad King
2022-02-10 13:41:23 -05:00
parent 596e185409
commit 636ca7f25c
3 changed files with 6 additions and 7 deletions

View File

@@ -789,14 +789,13 @@ void cmFindPackageCommand::RestoreFindDefinitions()
bool cmFindPackageCommand::FindModule(bool& found)
{
std::string module = cmStrCat("Find", this->Name, ".cmake");
std::string moduleFileName = cmStrCat("Find", this->Name, ".cmake");
bool system = false;
std::string debugBuffer =
cmStrCat("find_package considered the following paths for ", this->Name,
".cmake\n");
std::string debugBuffer = cmStrCat(
"find_package considered the following paths for ", moduleFileName, ":\n");
std::string mfile = this->Makefile->GetModulesFile(
module, system, this->DebugMode, debugBuffer);
moduleFileName, system, this->DebugMode, debugBuffer);
if (this->DebugMode) {
if (mfile.empty()) {
debugBuffer = cmStrCat(debugBuffer, "The file was not found.\n");

View File

@@ -1,5 +1,5 @@
^CMake Debug Log at FromPATHEnv.cmake:[0-9]+ \(find_package\):
find_package considered the following paths for Resolved.cmake
find_package considered the following paths for FindResolved.cmake:
[^
]*/Modules/FindResolved.cmake

View File

@@ -1,5 +1,5 @@
^CMake Debug Log at FromPATHEnvDebugPkg.cmake:[0-9]+ \(find_package\):
find_package considered the following paths for Resolved.cmake
find_package considered the following paths for FindResolved.cmake:
[^
]*/Modules/FindResolved.cmake