diff options
author | Brad King <brad.king@kitware.com> | 2022-02-10 17:08:13 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-10 21:30:10 (GMT) |
commit | d634d203973086f32f6d26e636eb1c9cc1acc545 (patch) | |
tree | a6bd3a74fff7a4cb900a6eac7d0ab206a0949cda | |
parent | df3e29450a1d9d5bd18423831fdab13ba94fe876 (diff) | |
download | CMake-d634d203973086f32f6d26e636eb1c9cc1acc545.zip CMake-d634d203973086f32f6d26e636eb1c9cc1acc545.tar.gz CMake-d634d203973086f32f6d26e636eb1c9cc1acc545.tar.bz2 |
find_package: Avoid printing debug output header multiple times
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 15 | ||||
-rw-r--r-- | Tests/RunCMake/find_package/FromPATHEnv-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt | 4 |
3 files changed, 4 insertions, 19 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 7bcb719..a8dff95 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -237,7 +237,6 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args) // Process debug mode this->DebugMode = this->ComputeIfDebugModeWanted() || this->Makefile->GetCMakeInstance()->GetDebugFindPkgOutput(this->Name); - this->DebugBuffer.clear(); // Parse the arguments. enum Doing @@ -610,15 +609,14 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args) loadedPackage = true; } } - - if (this->DebugMode) { - this->DebugMessage(this->DebugBuffer); - this->DebugBuffer.clear(); - } } this->AppendSuccessInformation(); + if (!this->DebugBuffer.empty()) { + this->DebugMessage(this->DebugBuffer); + } + return loadedPackage; } @@ -947,11 +945,6 @@ bool cmFindPackageCommand::HandlePackageMode( result = false; } - if (this->DebugMode) { - this->DebugMessage(this->DebugBuffer); - this->DebugBuffer.clear(); - } - // package not found if (result && !found) { // warn if package required or neither quiet nor in config mode diff --git a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt index 19108f4..691d7f0 100644 --- a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt +++ b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt @@ -77,8 +77,4 @@ ]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -+ -CMake Debug Log at FromPATHEnv.cmake:[0-9]+ \(find_package\): -Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt index a708282..ef5ec33 100644 --- a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt +++ b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt @@ -77,8 +77,4 @@ ]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -+ -CMake Debug Log at FromPATHEnvDebugPkg.cmake:[0-9]+ \(find_package\): -Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\)$ |