summaryrefslogtreecommitdiffstats
path: root/cmake/QtSetup.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-06-09 18:52:56 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-06-10 21:10:34 +0200
commitb3d0325a8dca56d3163451a417edfe6015a4ffe0 (patch)
treea38f02952a13e0381793ccd4769b31c2ef6ef0de /cmake/QtSetup.cmake
parentdd5c860a7b5f5bf347b698b9145c45d369325e42 (diff)
CMake: Ensure top-level builds are affected by our chosen log level
This will hide the configuration summary and cmake feature summary and found packages output upon reconfiguration. Pick-to: 6.2 6.3 6.4 Task-number: QTBUG-104128 Change-Id: I42270b99e45076052ec176df4652661cae10ac0c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'cmake/QtSetup.cmake')
-rw-r--r--cmake/QtSetup.cmake26
1 files changed, 15 insertions, 11 deletions
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake
index a0674df0a9..60b0bd0209 100644
--- a/cmake/QtSetup.cmake
+++ b/cmake/QtSetup.cmake
@@ -23,18 +23,22 @@ if(FEATURE_developer_build)
set(_default_build_type "Debug")
endif()
-# Decide whether output should be verbose or not.
-# Default to verbose (--log-level=STATUS) in a developer-build and
-# non-verbose (--log-level=NOTICE) otherwise.
-# If a custom CMAKE_MESSAGE_LOG_LEVEL was specified, it takes priority.
-# Passing an explicit --log-level=Foo has the highest priority.
-if(NOT CMAKE_MESSAGE_LOG_LEVEL)
- if(FEATURE_developer_build OR QT_FEATURE_developer_build)
- set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
- else()
- set(CMAKE_MESSAGE_LOG_LEVEL "NOTICE")
+function(qt_internal_set_message_log_level out_var)
+ # Decide whether output should be verbose or not.
+ # Default to verbose (--log-level=STATUS) in a developer-build and
+ # non-verbose (--log-level=NOTICE) otherwise.
+ # If a custom CMAKE_MESSAGE_LOG_LEVEL was specified, it takes priority.
+ # Passing an explicit --log-level=Foo has the highest priority.
+ if(NOT CMAKE_MESSAGE_LOG_LEVEL)
+ if(FEATURE_developer_build OR QT_FEATURE_developer_build)
+ set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
+ else()
+ set(CMAKE_MESSAGE_LOG_LEVEL "NOTICE")
+ endif()
+ set(${out_var} "${CMAKE_MESSAGE_LOG_LEVEL}" PARENT_SCOPE)
endif()
-endif()
+endfunction()
+qt_internal_set_message_log_level(CMAKE_MESSAGE_LOG_LEVEL)
# Reset content of extra build internal vars for each inclusion of QtSetup.
unset(QT_EXTRA_BUILD_INTERNALS_VARS)