Commit Graph

7 Commits

Author SHA1 Message Date
Alexandru Croitor
81ea5f1906 CMake: Prepare ground work for static Qml plugins importing
For qt_import_qml_plugins to work, it needs to have access to the Qml
plugin targets by the time find_package(Qt6Qml) is called.

To do that, we modify the generation of Qml plugin Config, Targets and
Dependencies files to go into a special 'QmlPlugins' subfolder of the
Qml package.

The Qml package will then GLOB include all the Config files in that
folder, to make them available whenever find_package(Qt6Qml) is
called.

This is similar to how the Qt plugins were glob included in the CMake
integration of Qt 5.15. In fact that glob including is missing in Qt 6
for regular Qt plugins, and should be implemented in a following
change. Currently the Qt Plugins config files that are included are
hardcoded to the list of known plugins at Qt configuration time.

As a drive-by to make this all work, the naming of the various Config
and Dependencies files has been normalized to include the Qt6 prefix.
This is done for both regular Qt plugins and Qml plugins.

Task-number: QTBUG-85961
Change-Id: Id20da72337ca2945fa330ea6fb43535e44a83292
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-12 14:20:40 +02:00
Alexandru Croitor
7119023829 Always try to find dependencies for plugins
Generated plugin CMake files should always try to call
find_dependency, especially in static builds.

pkg_check_modules sets a cache value for foo_FOUND instead of
a directory scope foo_FOUND, which means that find_dependency
will not be called in another scope, and thus fail to create
needed imported targets.

Note this makes the code be the same as in
ModuleDependencies.cmake.in.

Change-Id: I0b58b038afcb72cb27d0b433371bc9cb5e4bfec9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-14 15:02:52 +00:00
Alexandru Croitor
0ceef4cb54 Always append extra cmake modules to CMAKE_MODULE_PATH in Qt6Config
During a static build we need to use the find modules
in 3rdparty/extra-cmake-modules/find-modules when generating a
ModuleDependencies file, so that the generated find_dependency()
calls succeed. This means that the files have to be shipped with
Qt6 package, making them pseudo public API.

There is also a need to use these files when building QtWayland.

Instead of setting / unsetting CMAKE_MODULE_PATH only in module
and plugin Dependencies cmake files, just set them once when finding
Qt6.

This will allow QtWayland and QtX11Extras to easily find the required
third party packages, without having to hardcode the paths in multiple
repos.

Change-Id: I750d0421a269e5632afa1bb62498c2501d73cdb1
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-01 12:05:59 +00:00
Alexandru Croitor
ffe0889413 Fix examples find_package calls to work in prefix builds
To build examples as part of a non-installed Qt prefix build,
not-yet-installed Config files need to be found by find_package()
calls inside example projects.

Facilitate that by propagating the CMAKE_PREFIX_PATH and
QT_EXAMPLES_CMAKE_PREFIX_PATH paths in all relevant find_package()
calls where NO_DEFAULT_PATH is used.

Also adjust the inclusion of the QtFeature.cmake file to be relative
to the qt6 directory, rather than the current list directory.
This is needed to successfully find the file when parsing a Config
file from a non-installed build directory.

Change-Id: I36031279628f1f7741d8f4d7571484a6545227f7
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-21 13:10:37 +00:00
Simon Hausmann
6290efc4eb Fix building against an installed static Qt
For ICU we have multiple components, and ICU becomes a public dependency
to QtCore.

When storing the INTERFACE_QT_PACKAGE_COMPONENTS property, make sure to
store the entire list of components, not just the first component -- by
turning the semi-colon separated list into a space separated list.

When processing the components at find_dependency time, we need to
reverse that and pass COMPONENTS directly to ensure a correct parameter
expansion.

Change-Id: I24a0708520e7d5fba039395a151034aee4d4c0e2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-06-25 13:38:33 +00:00
Alexandru Croitor
fe3bd212fc Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
This changes many different CMake places to mention Qt6 instead of
Qt5.

Note that some old qt5 cmake config files in corelib are probably not
needed anymore, but I still renamed and kept them for now.

Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
2019-06-14 16:31:09 +02:00
Jean-Michaël Celerier
0900298d46 cmake: register plug-ins, create dependencies file
This commit introduces infrastructure work to allow static builds of Qt
to handle importing of plug-ins.

Change-Id: Ife0ca3ca7276ea8ec96fe0eb6adf934fad7620ec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-06-04 10:08:07 +00:00