From 850de767e9cba3faa581ceb451ce1ea265ae09b3 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 16 Dec 2020 21:48:52 +0000 Subject: ExternalProject: Silence step succeeded message when using Ninja When doing an ExternalProject superbuild with all output logged to files, the output currently looks as follows: ``` [652/904] Performing install step for 'plasma-framework' -- plasma-framework install command succeeded. See also /root/build/kde/frameworks/plasma-framework/log/plasma-framework-install-*.log [658/904] Performing build step for 'khtml' -- khtml build command succeeded. See also /root/build/kde/frameworks/khtml/log/khtml-build-*.log [659/904] Performing install step for 'khtml' -- khtml install command succeeded. See also /root/build/kde/frameworks/khtml/log/khtml-install-*.log [661/904] Performing configure step for 'krunner' -- krunner configure command succeeded. See also /root/build/kde/frameworks/krunner/log/krunner-configure-*.log [661/904] Performing build step for 'krunner' ``` More specifically, because a success line is printed for every succeeded step, we lose the advantage of Ninja's progress bar which will now also print a new line instead of updating the same link as happens when using Ninja in a normal CMake project. By silencing the success message when using the Ninja generator, Ninja's progress bar works as expected and updates inline instead of printing a new line for each progress update. With this change, the above output is reduced to a single line progress bar: ``` [661/904] Performing build step for 'krunner' ``` --- Modules/ExternalProject.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index f0ce7d4..28d21c1 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -2064,8 +2064,10 @@ if(result) message(FATAL_ERROR \"\${msg}\") endif() else() - set(msg \"${name} ${step} command succeeded. See also ${logbase}-*.log\") - message(STATUS \"\${msg}\") + if(NOT \"${CMAKE_GENERATOR}\" MATCHES \"Ninja\") + set(msg \"${name} ${step} command succeeded. See also ${logbase}-*.log\") + message(STATUS \"\${msg}\") + endif() endif() ") file(GENERATE OUTPUT "${script}" CONTENT "${code}") -- cgit v0.12