From 64d5708458d611fe6f96c0f9ad4b9ec457e807cd Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 23 Mar 2022 14:43:23 +0100 Subject: [PATCH] CMake: Enable debug verbosity for cmake auto tests and EP examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since e2a0ddbb69640c94b4ee107260a088d5c1c7e273 , if Qt is configured as a non-developer-build, some of the CMake tests that include QtSetup would have their CMAKE_MESSAGE_LOG_LEVEL set to the reduced NOTICE value. Make sure that tests always have a DEBUG level, so that if they fail in the CI, we have more info on what goes wrong. For ExternalProject examples, it is conditional on whether Qt is configured with QT_INTERNAL_VERBOSE_EXAMPLES set to ON, otherwise calling the main ninja without -v will end up cluttering the output a non default log level. Amends e2a0ddbb69640c94b4ee107260a088d5c1c7e273 Pick-to: 6.2 6.3 Change-Id: Icd3b6e0fcc6c73e4b53b6c4a6d8354c96077a050 Reviewed-by: Jörg Bornemann --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 3 +++ src/corelib/Qt6CTestMacros.cmake | 2 ++ 2 files changed, 5 insertions(+) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index a515fcd43d3..279abdb8a0b 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -1047,6 +1047,9 @@ function(qt_internal_add_example_external_project subdir) list(APPEND var_defs -D${var_with_type}=${varForGenex}) endforeach() + if(QT_INTERNAL_VERBOSE_EXAMPLES) + list(APPEND var_defs -DCMAKE_MESSAGE_LOG_LEVEL:STRING=DEBUG) + endif() set(deps "") list(REMOVE_DUPLICATES QT_EXAMPLE_DEPENDENCIES) diff --git a/src/corelib/Qt6CTestMacros.cmake b/src/corelib/Qt6CTestMacros.cmake index 8daf519bcbb..e7eaa3c26bb 100644 --- a/src/corelib/Qt6CTestMacros.cmake +++ b/src/corelib/Qt6CTestMacros.cmake @@ -63,6 +63,8 @@ function(_qt_internal_get_cmake_test_configure_options out_var) list(APPEND option_list "-DNO_DBUS=True") endif() + list(APPEND option_list "-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") + if(APPLE AND CMAKE_OSX_ARCHITECTURES) list(LENGTH CMAKE_OSX_ARCHITECTURES osx_arch_count)