summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-06-09 17:18:46 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-06-10 21:10:34 +0200
commitdd5c860a7b5f5bf347b698b9145c45d369325e42 (patch)
tree0d1d1b8d2cc657519b740359739743f5329fe2d7
parent47c545d9837a119bded57ad13deebf839cdd1368 (diff)
CMake: Show configuration summary on first configuration
or when feature changes are detected, even when the log-level is set to NOTICE (which is the default for non-developer-builds). We want to show the summary during the first configuration so we don't force users to look into the config.summary file. We want not to show the summary upon reconfigurations, to keep regular reconfigurations as quiet as possibe, so it's easy to notice any new warnings. Amends e2a0ddbb69640c94b4ee107260a088d5c1c7e273 Amends 384dfceb532cada5f4be96430c8c7c866f40c933 Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-104127 Change-Id: I506f33b4bae9da8957e04bb69c206bf00e3f7b0e Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
-rw-r--r--cmake/QtBuildInformation.cmake43
1 files changed, 38 insertions, 5 deletions
diff --git a/cmake/QtBuildInformation.cmake b/cmake/QtBuildInformation.cmake
index a55b9310e2..6626201684 100644
--- a/cmake/QtBuildInformation.cmake
+++ b/cmake/QtBuildInformation.cmake
@@ -82,30 +82,63 @@ from the build directory \n")
set(QT_INTERNAL_BUILD_INSTRUCTIONS_SHOWN "TRUE" CACHE STRING "" FORCE)
endfunction()
+function(qt_configure_print_summary_helper summary_reports force_show)
+ # We force show the summary by temporarily (within the scope of the function) resetting the
+ # current log level.
+ if(force_show)
+ set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
+ endif()
+ message(STATUS "Configure summary:\n${__qt_configure_reports}")
+endfunction()
+
function(qt_configure_print_summary)
# Evaluate all recorded commands.
qt_configure_eval_commands()
set(summary_file "${CMAKE_BINARY_DIR}/config.summary")
file(WRITE "${summary_file}" "")
- # Show Qt-specific configure summary and any notes, wranings, etc.
+
+ get_property(features_possibly_changed GLOBAL PROPERTY _qt_dirty_build)
+
+ # Show Qt-specific configuration summary.
if(__qt_configure_reports)
- if(NOT QT_INTERNAL_SUMMARY_INSTRUCTIONS_SHOWN)
+ # We want to show the the summary file and log level messages only on first configuration
+ # or when we detect a feature change, to keep most reconfiguration output as quiet as
+ # possible. Currently feature change detection is not entirely reliable.
+ if(NOT QT_INTERNAL_SUMMARY_INSTRUCTIONS_SHOWN OR features_possibly_changed)
message("")
message(
- "-- Configuration summary has been written to ${CMAKE_BINARY_DIR}/config.summary")
+ "-- Configuration summary shown below. It has also been written to"
+ " ${CMAKE_BINARY_DIR}/config.summary")
message(
- "-- Configure with --log-level=STATUS or higher to increase the output verbosity.")
+ "-- Configure with --log-level=STATUS or higher to increase "
+ "CMake's message verbosity. "
+ "The log level does not persist across reconfigurations.")
endif()
# Need 2 flushes to ensure no interleaved input is printed due to a mix of message(STATUS)
# and message(NOTICE) calls.
execute_process(COMMAND ${CMAKE_COMMAND} -E echo " ")
- message(STATUS "Configure summary:\n${__qt_configure_reports}")
+
+ # We want to show the configuration summary only on first configuration or when we detect
+ # a feature change, to keep most reconfiguration output as quiet as possible.
+ # Currently feature change detection is not entirely reliable.
+ if(NOT QT_INTERNAL_SUMMARY_INSTRUCTIONS_SHOWN OR features_possibly_changed)
+ set(force_show_summary TRUE)
+ else()
+ set(force_show_summary FALSE)
+ endif()
+
+ qt_configure_print_summary_helper(
+ "Configuration summary:\n${__qt_configure_reports}"
+ ${force_show_summary})
+
execute_process(COMMAND ${CMAKE_COMMAND} -E echo " ")
file(APPEND "${summary_file}" "${__qt_configure_reports}")
endif()
+
+ # Show Qt specific notes, warnings, errors.
if(__qt_configure_notes)
message("${__qt_configure_notes}")
file(APPEND "${summary_file}" "${__qt_configure_notes}")