summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2020-12-16 21:48:52 (GMT)
committerDaan De Meyer <daan.j.demeyer@gmail.com>2020-12-17 17:32:57 (GMT)
commit850de767e9cba3faa581ceb451ce1ea265ae09b3 (patch)
treef46454749973e8ab9dfc062da40229be7bf6d990 /Modules/ExternalProject.cmake
parent0f61fac6f028214d64ef6a407c6b98d4503ee2fe (diff)
downloadCMake-850de767e9cba3faa581ceb451ce1ea265ae09b3.zip
CMake-850de767e9cba3faa581ceb451ce1ea265ae09b3.tar.gz
CMake-850de767e9cba3faa581ceb451ce1ea265ae09b3.tar.bz2
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' ```
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake6
1 files 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}")