summaryrefslogtreecommitdiffstats
path: root/cmake/QtPluginHelpers.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-10-19 19:34:53 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-10-22 23:32:23 +0000
commitdf9c7456d11dfcf74c7399ba0981a3ba3d3f5117 (patch)
tree6b0ef5c7a5e267e804b55ab45ff09cc42ce5c840 /cmake/QtPluginHelpers.cmake
parent4fed50f4ab8fa6331e2f4d1d0567dcc961e7bb01 (diff)
CMake: Add convenience custom targets to build Qt plugins
Add 3 new convenience custom targets: 'qt_plugins', 'qpa_plugins' and 'qpa_default_plugins'. Additionally, if we detect that an internal executable / test links against Gui, add a dependency on the 'qpa_default_plugins' custom target, so that if a developer configures Qt for the first time and then calls ninja 'tst_foo_check', we ensure the test will launch successfully because the default QPA plugin will also be built. Change-Id: If6dd70844b5effdf8a293f65f8785855cc85b132 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtPluginHelpers.cmake')
-rw-r--r--cmake/QtPluginHelpers.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake
index 691735afe4..2591705a9e 100644
--- a/cmake/QtPluginHelpers.cmake
+++ b/cmake/QtPluginHelpers.cmake
@@ -140,6 +140,14 @@ function(qt_internal_add_plugin target)
endif()
endif()
+ add_dependencies(qt_plugins "${target}")
+ if(arg_TYPE STREQUAL "platforms")
+ add_dependencies(qpa_plugins "${target}")
+ endif()
+ if(_default_plugin)
+ add_dependencies(qpa_default_plugins "${target}")
+ endif()
+
set_property(TARGET "${target}" PROPERTY QT_DEFAULT_PLUGIN "${_default_plugin}")
set_property(TARGET "${target}" APPEND PROPERTY EXPORT_PROPERTIES "QT_PLUGIN_CLASS_NAME;QT_PLUGIN_TYPE;QT_MODULE;QT_DEFAULT_PLUGIN")