summaryrefslogtreecommitdiffstats
path: root/cmake/QtPlugins.cmake.in
diff options
context:
space:
mode:
authorJean-Michaël Celerier <jean-michael.celerier@kdab.com>2019-07-05 11:55:05 +0200
committerJean-Michaël Celerier <jean-michael.celerier@kdab.com>2019-07-05 14:58:52 +0000
commita5b78a3660d9b92d12c950eddb4cb3ccc43893b1 (patch)
tree019e58a9aadc37ea5dc4afcc40fa98a2a73dca9b /cmake/QtPlugins.cmake.in
parent5769e1a2f6016cf807d20e09083b893f0c628d07 (diff)
cmake: implement default qpa plugin behavior for static builds
This is done by adding a DEFAULT_IF argument to add_qt_plugin, which accepts if-evaluated expressions. e.g. add_qt_plugin(myplugin DEFAULT_IF ${foo} STREQUAL ${bar} ... ) so that this mechanism can be reused later if necessary. Change-Id: I7eba9adaaa28e55a4f0f94cf206e868b990027e6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtPlugins.cmake.in')
-rw-r--r--cmake/QtPlugins.cmake.in16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmake/QtPlugins.cmake.in b/cmake/QtPlugins.cmake.in
index b51c7cec29..e6547508a7 100644
--- a/cmake/QtPlugins.cmake.in
+++ b/cmake/QtPlugins.cmake.in
@@ -3,7 +3,7 @@
if(NOT @BUILD_SHARED_LIBS@)
set(_module_target "@INSTALL_CMAKE_NAMESPACE@::@QT_MODULE@")
- set(_default_plugins_genex "$<GENEX_EVAL:$<TARGET_PROPERTY:QT_DEFAULT_PLUGINS>>")
+ set(_default_plugins_are_enabled "$<GENEX_EVAL:$<TARGET_PROPERTY:QT_DEFAULT_PLUGINS>>")
set(_manual_plugins_genex "$<GENEX_EVAL:$<TARGET_PROPERTY:QT_PLUGINS>>")
set(_no_plugins_genex "$<GENEX_EVAL:$<TARGET_PROPERTY:QT_NO_PLUGINS>>")
@@ -15,17 +15,17 @@ if(NOT @BUILD_SHARED_LIBS@)
continue()
endif()
- set(_user_specified_genex "$<IN_LIST:${_plugin_target},${_manual_plugins_genex}>")
+ set(_plugin_is_default "$<TARGET_PROPERTY:${_plugin_target},QT_DEFAULT_PLUGIN>")
+ set(_plugin_is_not_blacklisted "$<NOT:$<IN_LIST:${_plugin_target},${_no_plugins_genex}>>")
+ set(_plugin_is_whitelisted "$<IN_LIST:${_plugin_target},${_manual_plugins_genex}>")
string(CONCAT _plugin_condition
"$<BOOL:$<OR:"
- # Add this plugin if it\'s in the list of manual plugins or plugins for the type
- "${_user_specified_genex},"
- # Add this plugin if the default plugins haven't been disabled, the module of the plug-in
- # is either empty or equal to the module name, and the user hasn't blacklisted it
+ "${_plugin_is_whitelisted},"
"$<AND:"
- "${_default_plugins_genex},"
- "$<NOT:$<IN_LIST:${_plugin_target},${_no_plugins_genex}>>"
+ "${_default_plugins_are_enabled},"
+ "${_plugin_is_default},"
+ "${_plugin_is_not_blacklisted}"
">"
">>"
)