summaryrefslogtreecommitdiffstats
path: root/cmake/QtPostProcessHelpers.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-07-01 14:45:54 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-07-05 13:04:09 +0200
commit7d6f1ee5a75cae9d122a3f0c7b3a6d03f380535e (patch)
tree540d8c5467745acdb4a2f9e1f643163f47e6279f /cmake/QtPostProcessHelpers.cmake
parentff4be4cf30ec470ab00290c629bb1bc311b77e22 (diff)
CMake: Create and include plugin packages in shared builds
Previously QtModulePlugins.cmake files were only created and included in static library Qt builds. Having the targets available in shared library builds would be useful for custom project deployment purposes. One could query the location of the plugins or use various generator expressions referencing their location. Ensure we always generate and include the QtModulePlugins.cmake files regardless of the build type. Allow opting out of including the files by setting QT_SKIP_AUTO_PLUGIN_INCLUSION to ON, just like we allow for Qml plugins with QT_SKIP_AUTO_QML_PLUGIN_INCLUSION. Pick-to: 6.4 Fixes: QTBUG-94066 Change-Id: I69a5dc17762a8e43265578fc33b82b5c4b7a1f5c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtPostProcessHelpers.cmake')
-rw-r--r--cmake/QtPostProcessHelpers.cmake13
1 files changed, 5 insertions, 8 deletions
diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake
index 544f02c9d8..a655c11614 100644
--- a/cmake/QtPostProcessHelpers.cmake
+++ b/cmake/QtPostProcessHelpers.cmake
@@ -401,14 +401,11 @@ function(qt_internal_create_depends_files)
endforeach()
endfunction()
-# This function creates the Qt<Module>Plugins.cmake used to list all
-# the plug-in target files.
-function(qt_internal_create_plugins_files)
- # The plugins cmake configuration is only needed for static builds. Dynamic builds don't need
- # the application to link against plugins at build time.
- if(QT_BUILD_SHARED_LIBS)
- return()
- endif()
+# This function creates Qt<Module>Plugins.cmake files used to include all
+# the plugin Config files that belong to that module.
+function(qt_internal_create_plugins_auto_inclusion_files)
+ # For static library builds, the plugin targets need to be available for linking.
+ # For shared library builds, the plugin targets are useful for deployment purposes.
qt_internal_get_qt_repo_known_modules(repo_known_modules)
set(modules_with_plugins "")