Priority: P3: Somewhat important
Affects Version/s: 6.2.0 Beta2
Fix Version/s: None
Component/s: Build System: CMake
This issue is mostly to keep a place for the result of my investigation on how REQUIRED should affect package components.
In the qt 5.15 CMake integration, the Umbrella Qt5Config.cmake file passed REQUIRED option to the find_package components call here
In Qt 6.0-6.2-beta2, we do not pass it.
The variable is always expanded to an empty string, because it's not set. It was likely an oversight when porting the code.
It's still a bit unclear to me, but I tend to think we should NOT pass REQUIRED to the component find_package calls, because I would expect that the umbrella project Config file should get the final say on whether a component is required. It also affects the error messages shown.
There is also some inconsistency in how CMake itself handles COMPONENTS vs REQUIRED COMPONENTS signature. https://gitlab.kitware.com/cmake/cmake/-/issues/22513
The following are the error messages shown with https://codereview.qt-project.org/c/qt/qtbase/+/362871 and REQUIRED not passed to the component find_package calls.
The following are the error messages shown with https://codereview.qt-project.org/c/qt/qtbase/+/362871 and REQUIRED passed to the component find_package calls.
I'm undecided which of the error messages are more informational and would better serve users, but i'll probably keep the error messages where REQUIRED is not passed to the component find_package calls.
|For Gerrit Dashboard: QTBUG-95573|
|363167,3||CMake: Partially fix QUIETness of find_package(Qt6 COMPONENTS Foo)||dev||qt/qtbase||Status: MERGED||+2||0|
|363591,2||CMake: Partially fix QUIETness of find_package(Qt6 COMPONENTS Foo)||6.2||qt/qtbase||Status: MERGED||+2||0|