Change the way we detect the need of adding Qt<Module>Plugins.cmake

Currently we assume that only modules that have plugins built in the
current build tree need to generate and install the
Qt<Module>Plugins.cmake file. This approach is weak since other Qt
modules might still want to provide the plugins of the certain types,
even if the module that the plugin type belongs too didn't have plugins
initially.

The fix unblocks the formally 3rd-party plugin installation and loading
chain.

Pick-to: 6.2 6.5 6.6 6.7
Fixes: QAA-2266
Change-Id: Ifc616e26a00674371c8e2fe2ca12237d153e5707
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2024-01-30 13:03:06 +01:00
parent 9785ffe943
commit 180afc7321

View File

@ -477,8 +477,8 @@ if (__qt_qml_plugins_config_file_list AND NOT QT_SKIP_AUTO_QML_PLUGIN_INCLUSION)
endif()")
endif()
get_target_property(qt_plugins "${QT_MODULE}" QT_PLUGINS)
if(qt_plugins OR QT_MODULE_PLUGIN_INCLUDES)
get_target_property(module_plugin_types "${QT_MODULE}" MODULE_PLUGIN_TYPES)
if(module_plugin_types OR QT_MODULE_PLUGIN_INCLUDES)
list(APPEND modules_with_plugins "${QT_MODULE}")
configure_file(
"${QT_CMAKE_DIR}/QtPlugins.cmake.in"