diff options
author | Brad King <brad.king@kitware.com> | 2022-02-10 18:41:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-10 21:30:09 (GMT) |
commit | 636ca7f25c3016805bf0214bc563f30728d9de0b (patch) | |
tree | 9833b159f0aca91016bd99d8281649a816dc5f60 | |
parent | 596e18540988a7c6a426c5997d0008444773fc02 (diff) | |
download | CMake-636ca7f25c3016805bf0214bc563f30728d9de0b.zip CMake-636ca7f25c3016805bf0214bc563f30728d9de0b.tar.gz CMake-636ca7f25c3016805bf0214bc563f30728d9de0b.tar.bz2 |
find_package: Fix find module name in --debug-find output
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 9 | ||||
-rw-r--r-- | Tests/RunCMake/find_package/FromPATHEnv-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt | 2 |
3 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index d29201b..5f1544d 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -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"); diff --git a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt index 55b6a7a..5fe89fd 100644 --- a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt +++ b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt @@ -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 diff --git a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt index e3685bc..f921804 100644 --- a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt +++ b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt @@ -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 |