diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-01-07 16:55:51 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-01-20 15:24:47 +0100 |
commit | d0071a4f871fa9c5406790cf17c5516b79ece1d7 (patch) | |
tree | f54637e30a79a9f94061cbf08ab1bf6c605858c2 /cmake/QtPostProcessHelpers.cmake | |
parent | f379938443544025511a8e60ce6034f71b19add8 (diff) |
Fix loading of Qt6*Plugin.cmake files of per-repo builds
When doing a per-repository build of Qt, as it is done for the installer
packages, the build of qtbase has no knowledge of plugins that might be
built and installed from other repositories. That means we must not
write a fixed list of known plugins when exporting Qt modules of qtbase.
In particular, qtsvg adds imageformat plugins that are supposed to be
picked up by qtbase's QtGui module when linking a project against a
statically linked Qt.
${install-prefix}/lib/cmake/Qt6Gui/Qt6GuiPlugins.cmake missed the
include statements for qtsvg's plugin config files and operated on a
fixed list of plugins, all from qtbase.
Apart from that, the Qt6::Gui target's property QT_PLUGINS did only
contain the qtbase plugins.
This patch fixes the situation in the following way:
1. All Qt6*PluginConfig.cmake files in
${install-prefix}/lib/cmake/Qt6Gui are detected and included.
2. From those file names, the target names of the plugins are
deduced. This is safe as the file name of those generated files is a
direct result of the plugin's target name.
3. The QT_PLUGINS property of the module is updated with the detected
plugin target names.
Fixes: QTBUG-89643
Change-Id: Ifc3c39aa9948277ead5ebb209ec5eff64746308b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake/QtPostProcessHelpers.cmake')
-rw-r--r-- | cmake/QtPostProcessHelpers.cmake | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake index 37213f13a5..9a36e2ada4 100644 --- a/cmake/QtPostProcessHelpers.cmake +++ b/cmake/QtPostProcessHelpers.cmake @@ -384,13 +384,6 @@ function(qt_internal_create_plugins_files) qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${INSTALL_CMAKE_NAMESPACE}${QT_MODULE}) set(QT_MODULE_PLUGIN_INCLUDES "") - get_target_property(qt_plugins "${QT_MODULE}" QT_PLUGINS) - if(qt_plugins) - foreach (pluginTarget ${qt_plugins}) - set(QT_MODULE_PLUGIN_INCLUDES "${QT_MODULE_PLUGIN_INCLUDES}include(\"\${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${pluginTarget}Config.cmake\")\n") - endforeach() - endif() - if(QT_MODULE STREQUAL "Qml") set(QT_MODULE_PLUGIN_INCLUDES "${QT_MODULE_PLUGIN_INCLUDES} file(GLOB __qt_qml_plugins_config_file_list \"\${CMAKE_CURRENT_LIST_DIR}/QmlPlugins/${INSTALL_CMAKE_NAMESPACE}*Config.cmake\") @@ -401,7 +394,8 @@ if (__qt_qml_plugins_config_file_list AND NOT QT_SKIP_AUTO_QML_PLUGIN_INCLUSION) endif()") endif() - if(QT_MODULE_PLUGIN_INCLUDES) + get_target_property(qt_plugins "${QT_MODULE}" QT_PLUGINS) + if(qt_plugins OR QT_MODULE_PLUGIN_INCLUDES) configure_file( "${QT_CMAKE_DIR}/QtPlugins.cmake.in" "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${QT_MODULE}Plugins.cmake" |