From df3e29450a1d9d5bd18423831fdab13ba94fe876 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Feb 2022 14:07:41 -0500 Subject: find_package: Mention package name in Config mode debug output Otherwise, if there are no paths considered then the output does not specify the name of the package. --- Source/cmFindPackageCommand.cxx | 3 ++- Tests/RunCMake/CMakePresets/Debug-stderr.txt | 3 ++- Tests/RunCMake/find_package/FromPATHEnv-stderr.txt | 3 ++- Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 5f1544d..7bcb719 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1117,7 +1117,8 @@ bool cmFindPackageCommand::FindConfig() if (this->DebugMode) { this->DebugBuffer = cmStrCat(this->DebugBuffer, "find_package considered the following " - "locations for the Config module:\n"); + "locations for ", + this->Name, "'s Config module:\n"); } // Search for frameworks. diff --git a/Tests/RunCMake/CMakePresets/Debug-stderr.txt b/Tests/RunCMake/CMakePresets/Debug-stderr.txt index 7fdb8b3..d30dc58 100644 --- a/Tests/RunCMake/CMakePresets/Debug-stderr.txt +++ b/Tests/RunCMake/CMakePresets/Debug-stderr.txt @@ -1 +1,2 @@ - find_package considered the following locations for the Config module: + find_package considered the following locations for + ThisPackageHopefullyDoesNotExist's Config module: diff --git a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt index 5fe89fd..19108f4 100644 --- a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt +++ b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt @@ -65,7 +65,8 @@ none - find_package considered the following locations for the Config module: + find_package considered the following locations for Resolved's Config + module: [^ ]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake diff --git a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt index f921804..a708282 100644 --- a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt +++ b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt @@ -65,7 +65,8 @@ none - find_package considered the following locations for the Config module: + find_package considered the following locations for Resolved's Config + module: [^ ]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake -- cgit v0.12