From 7d86cf02c1f3341056ea9463e93ad336e0e63a52 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 4 Aug 2021 12:23:14 +0200 Subject: CMake: Partially fix QUIETness of find_package(Qt6 COMPONENTS Foo) When Qt5Config.cmake was ported to Qt6, the assignment of _Qt6_FIND_PARTS_QUIET was accidentally left out. Make sure that when find_package(Qt6 QUIET COMPONENTS Foo) is called, the underlying component find_package(Qt6Foo) call gets a QUIET option as well. This will silence short-form warnings like -- Could NOT find Qt6Foo (missing: Qt6Foo_DIR) It currently won't silence any warnings produced by the transitive find_package calls in QtModuleDependencies.cmake. That will require a separate change. Remove usage of _Qt6_FIND_PARTS_REQUIRED which was always empty. See details of QTBUG-95573 why it's currently not used. Pick-to: 6.2 Task-number: QTBUG-95573 Change-Id: I3822c068eecbe84c306a1b04f4187278d35ec3d5 Reviewed-by: Joerg Bornemann --- cmake/QtConfig.cmake.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmake/QtConfig.cmake.in') diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index c44a17995e..24c5cdd782 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -89,6 +89,11 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Dependencies.cmake endif() endif() +set(_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_QUIET) +if(@INSTALL_CMAKE_NAMESPACE@_FIND_QUIETLY) + set(_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_QUIET QUIET) +endif() + set(__qt_use_no_default_path_for_qt_packages "NO_DEFAULT_PATH") if(QT_DISABLE_NO_DEFAULT_PATH_IN_QT_PACKAGES) set(__qt_use_no_default_path_for_qt_packages "") @@ -97,7 +102,6 @@ endif() foreach(module ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS}) find_package(@INSTALL_CMAKE_NAMESPACE@${module} ${_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_QUIET} - ${_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_REQUIRED} PATHS ${_qt_cmake_dir} ${_qt_additional_packages_prefix_path} -- cgit v1.2.3