CMake: Stop-gap fix for Qml user projects

We temporarily enable automatic find_package of Qt6FooPrivate whenever
Qt6Foo is find_package'ed, because

1. Currently, Qml user projects are broken unless they set
QT_FIND_PRIVATE_MODULES=ON.

2. The fix for qtdeclarative depends on the submodule update.

3. The submodule update is blocked by QTBUG-133352.

This fixes Qml user projects for people who use latest dev in all repos.

Change-Id: I2c2907e531e908515b51eae1ea90df555e40871e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2025-01-31 08:54:49 +01:00
parent 9379b95b53
commit 4d95b6dccd

View File

@ -1028,6 +1028,10 @@ function(qt_internal_write_basic_module_package target target_private)
endif()
endif()
### Temporary measure to fix QtQml user projects. Remove, once
### https://codereview.qt-project.org/c/qt/qtdeclarative/+/620337 is merged.
set(always_load_private_module ON)
if(arg_IS_STATIC_LIB AND NOT arg_PRIVATE AND CMAKE_VERSION VERSION_LESS "3.26")
# We auto-load the private module package from the public module package if we have a static
# Qt module and CMake's version is < 3.26. This is needed for the case "Qt6Foo links against