diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-03-01 17:11:03 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-03-04 00:21:44 +0100 |
commit | e2a0ddbb69640c94b4ee107260a088d5c1c7e273 (patch) | |
tree | f855cfd46e75f156e6966e6ae6197ddbca4a2afe /cmake/QtBuildInformation.cmake | |
parent | 0deff80eabd577f3514d255e32f74502c914dfe1 (diff) |
CMake: Make configure less verbose by default
Only show the more verbose configure output when configuring
with -developer-build (which matches --log-level=STATUS)
Otherwise in a non-developer build, restrict the output
to NOTICE+ message (includes WARNINGs and ERRORs).
Developers can still pass a custom log level when configuring.
For example -DCMAKE_MESSAGE_LOG_LEVEL=STATUS or
--log-level=STATUS.
The former method will be cached, while the latter is only applied
to the current configure invocation.
Also show the build instructions hint message only when configuring
for the first time.
[ChangeLog][CMake][configure] The configure output verbosity of
non developer-builds of Qt is now reduced by default. Pass
"-- --log-level=STATUS" to configure to make it verbose again.
Pick-to: 6.2 6.3
Change-Id: I7583a9c92142e0b1d7c5411b06403f40d8ebaf20
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake/QtBuildInformation.cmake')
-rw-r--r-- | cmake/QtBuildInformation.cmake | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/cmake/QtBuildInformation.cmake b/cmake/QtBuildInformation.cmake index 0104978c40..1b20a71afa 100644 --- a/cmake/QtBuildInformation.cmake +++ b/cmake/QtBuildInformation.cmake @@ -38,18 +38,30 @@ function(qt_print_build_instructions) set(local_install_prefix "${CMAKE_STAGING_PREFIX}") endif() - message("Qt is now configured for building. Just run '${build_command}'\n") + set(msg "") + + list(APPEND msg "Qt is now configured for building. Just run '${build_command}'\n") if(QT_WILL_INSTALL) - message("Once everything is built, you must run '${install_command}'") - message("Qt will be installed into '${CMAKE_INSTALL_PREFIX}'") + list(APPEND msg "Once everything is built, you must run '${install_command}'") + list(APPEND msg "Qt will be installed into '${CMAKE_INSTALL_PREFIX}'") else() - message("Once everything is built, Qt is installed. You should NOT run '${install_command}'") - message("Note that this build cannot be deployed to other machines or devices.") + list(APPEND msg + "Once everything is built, Qt is installed. You should NOT run '${install_command}'") + list(APPEND msg + "Note that this build cannot be deployed to other machines or devices.") endif() - message("\nTo configure and build other Qt modules, you can use the following convenience script: + list(APPEND msg + "\nTo configure and build other Qt modules, you can use the following convenience script: ${local_install_prefix}/${INSTALL_BINDIR}/${configure_module_command}") - message("\nIf reconfiguration fails for some reason, try removing 'CMakeCache.txt' \ + list(APPEND msg "\nIf reconfiguration fails for some reason, try removing 'CMakeCache.txt' \ from the build directory \n") + list(JOIN msg "\n" msg) + + if(NOT QT_INTERNAL_BUILD_INSTRUCTIONS_SHOWN) + message(STATUS "${msg}") + endif() + + set(QT_INTERNAL_BUILD_INSTRUCTIONS_SHOWN "TRUE" CACHE STRING "" FORCE) endfunction() function(qt_configure_print_summary) @@ -60,7 +72,7 @@ function(qt_configure_print_summary) file(WRITE "${summary_file}" "") # Show Qt-specific configure summary and any notes, wranings, etc. if(__qt_configure_reports) - message("Configure summary:\n${__qt_configure_reports}") + message(STATUS "Configure summary:\n${__qt_configure_reports}") file(APPEND "${summary_file}" "${__qt_configure_reports}") endif() if(__qt_configure_notes) |