diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake index b5250a4717..ade09cb2a1 100644 --- a/cmake/QtPluginHelpers.cmake +++ b/cmake/QtPluginHelpers.cmake @@ -133,11 +133,10 @@ function(qt_internal_add_plugin target) _qt_plugin_install_package_suffix "${plugin_install_package_suffix}") endif() - # TODO: This is a bit too coarse for generic plugins. - # The generic plugins should also be enabled by default, once QTBUG-87861 is fixed. + # The generic plugins should be enabled by default. # But platform plugins should always be disabled by default, and only one is enabled # based on the platform (condition specified in arg_DEFAULT_IF). - if(plugin_type_escaped STREQUAL "generic" OR plugin_type_escaped STREQUAL "platforms") + if(plugin_type_escaped STREQUAL "platforms") set(_default_plugin 0) else() set(_default_plugin 1) diff --git a/src/plugins/generic/evdevkeyboard/CMakeLists.txt b/src/plugins/generic/evdevkeyboard/CMakeLists.txt index 81508badf0..c6411cd76a 100644 --- a/src/plugins/generic/evdevkeyboard/CMakeLists.txt +++ b/src/plugins/generic/evdevkeyboard/CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QEvdevKeyboardPlugin OUTPUT_NAME qevdevkeyboardplugin TYPE generic + DEFAULT_IF FALSE SOURCES main.cpp PUBLIC_LIBRARIES diff --git a/src/plugins/generic/evdevmouse/CMakeLists.txt b/src/plugins/generic/evdevmouse/CMakeLists.txt index 9241155f9b..39741fbe25 100644 --- a/src/plugins/generic/evdevmouse/CMakeLists.txt +++ b/src/plugins/generic/evdevmouse/CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QEvdevMousePlugin OUTPUT_NAME qevdevmouseplugin TYPE generic + DEFAULT_IF FALSE SOURCES main.cpp PUBLIC_LIBRARIES diff --git a/src/plugins/generic/evdevtablet/CMakeLists.txt b/src/plugins/generic/evdevtablet/CMakeLists.txt index 61e26a0587..da553f9b47 100644 --- a/src/plugins/generic/evdevtablet/CMakeLists.txt +++ b/src/plugins/generic/evdevtablet/CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QEvdevTabletPlugin OUTPUT_NAME qevdevtabletplugin TYPE generic + DEFAULT_IF FALSE SOURCES main.cpp PUBLIC_LIBRARIES diff --git a/src/plugins/generic/evdevtouch/CMakeLists.txt b/src/plugins/generic/evdevtouch/CMakeLists.txt index fbdff8d7a6..ce0b931e9c 100644 --- a/src/plugins/generic/evdevtouch/CMakeLists.txt +++ b/src/plugins/generic/evdevtouch/CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QEvdevTouchScreenPlugin OUTPUT_NAME qevdevtouchplugin TYPE generic + DEFAULT_IF FALSE SOURCES main.cpp PUBLIC_LIBRARIES diff --git a/src/plugins/generic/libinput/CMakeLists.txt b/src/plugins/generic/libinput/CMakeLists.txt index d7c434391e..a37b898d5a 100644 --- a/src/plugins/generic/libinput/CMakeLists.txt +++ b/src/plugins/generic/libinput/CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QLibInputPlugin OUTPUT_NAME qlibinputplugin TYPE generic + DEFAULT_IF FALSE SOURCES main.cpp PUBLIC_LIBRARIES diff --git a/src/plugins/generic/tslib/.prev_CMakeLists.txt b/src/plugins/generic/tslib/.prev_CMakeLists.txt index ce1c6b952f..6804ac848c 100644 --- a/src/plugins/generic/tslib/.prev_CMakeLists.txt +++ b/src/plugins/generic/tslib/.prev_CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QTsLibPlugin OUTPUT_NAME qtslibplugin TYPE generic + DEFAULT_IF FALSE SOURCES main.cpp PUBLIC_LIBRARIES diff --git a/src/plugins/generic/tslib/CMakeLists.txt b/src/plugins/generic/tslib/CMakeLists.txt index 7d234a2456..b151805108 100644 --- a/src/plugins/generic/tslib/CMakeLists.txt +++ b/src/plugins/generic/tslib/CMakeLists.txt @@ -9,6 +9,7 @@ qt_find_package(Tslib) # special case qt_internal_add_plugin(QTsLibPlugin OUTPUT_NAME qtslibplugin TYPE generic + DEFAULT_IF FALSE SOURCES main.cpp PUBLIC_LIBRARIES diff --git a/src/plugins/generic/tuiotouch/CMakeLists.txt b/src/plugins/generic/tuiotouch/CMakeLists.txt index 57c77ff000..ede5c5408a 100644 --- a/src/plugins/generic/tuiotouch/CMakeLists.txt +++ b/src/plugins/generic/tuiotouch/CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QTuioTouchPlugin OUTPUT_NAME qtuiotouchplugin TYPE generic + DEFAULT_IF FALSE SOURCES main.cpp qoscbundle.cpp qoscbundle_p.h diff --git a/src/plugins/platforminputcontexts/compose/.prev_CMakeLists.txt b/src/plugins/platforminputcontexts/compose/.prev_CMakeLists.txt index e4a4856bf5..1128a4a47c 100644 --- a/src/plugins/platforminputcontexts/compose/.prev_CMakeLists.txt +++ b/src/plugins/platforminputcontexts/compose/.prev_CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QComposePlatformInputContextPlugin OUTPUT_NAME composeplatforminputcontextplugin TYPE platforminputcontexts + DEFAULT_IF FALSE SOURCES qcomposeplatforminputcontext.cpp qcomposeplatforminputcontext.h qcomposeplatforminputcontextmain.cpp diff --git a/src/plugins/platforminputcontexts/compose/CMakeLists.txt b/src/plugins/platforminputcontexts/compose/CMakeLists.txt index 90a149f7ac..3d1ebb35a8 100644 --- a/src/plugins/platforminputcontexts/compose/CMakeLists.txt +++ b/src/plugins/platforminputcontexts/compose/CMakeLists.txt @@ -10,6 +10,7 @@ pkg_get_variable(PKG_X11_PREFIX x11 prefix) # special case qt_internal_add_plugin(QComposePlatformInputContextPlugin OUTPUT_NAME composeplatforminputcontextplugin TYPE platforminputcontexts + DEFAULT_IF FALSE SOURCES qcomposeplatforminputcontext.cpp qcomposeplatforminputcontext.h qcomposeplatforminputcontextmain.cpp diff --git a/src/plugins/platforminputcontexts/ibus/CMakeLists.txt b/src/plugins/platforminputcontexts/ibus/CMakeLists.txt index 686f028c6a..2c1a2adb02 100644 --- a/src/plugins/platforminputcontexts/ibus/CMakeLists.txt +++ b/src/plugins/platforminputcontexts/ibus/CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QIbusPlatformInputContextPlugin OUTPUT_NAME ibusplatforminputcontextplugin TYPE platforminputcontexts + DEFAULT_IF FALSE SOURCES main.cpp qibusinputcontextproxy.cpp qibusinputcontextproxy.h diff --git a/src/plugins/platformthemes/gtk3/.prev_CMakeLists.txt b/src/plugins/platformthemes/gtk3/.prev_CMakeLists.txt index 764675101c..cc77607ab2 100644 --- a/src/plugins/platformthemes/gtk3/.prev_CMakeLists.txt +++ b/src/plugins/platformthemes/gtk3/.prev_CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QGtk3ThemePlugin OUTPUT_NAME qgtk3 TYPE platformthemes + DEFAULT_IF FALSE SOURCES main.cpp qgtk3dialoghelpers.cpp qgtk3dialoghelpers.h diff --git a/src/plugins/platformthemes/gtk3/CMakeLists.txt b/src/plugins/platformthemes/gtk3/CMakeLists.txt index 042282faf6..f83f48e13e 100644 --- a/src/plugins/platformthemes/gtk3/CMakeLists.txt +++ b/src/plugins/platformthemes/gtk3/CMakeLists.txt @@ -10,6 +10,7 @@ qt_find_package(X11) # special case qt_internal_add_plugin(QGtk3ThemePlugin OUTPUT_NAME qgtk3 TYPE platformthemes + DEFAULT_IF FALSE SOURCES main.cpp qgtk3dialoghelpers.cpp qgtk3dialoghelpers.h diff --git a/src/plugins/platformthemes/xdgdesktopportal/CMakeLists.txt b/src/plugins/platformthemes/xdgdesktopportal/CMakeLists.txt index 2466253af9..caaf0de7b2 100644 --- a/src/plugins/platformthemes/xdgdesktopportal/CMakeLists.txt +++ b/src/plugins/platformthemes/xdgdesktopportal/CMakeLists.txt @@ -7,6 +7,7 @@ qt_internal_add_plugin(QXdgDesktopPortalThemePlugin OUTPUT_NAME qxdgdesktopportal TYPE platformthemes + DEFAULT_IF FALSE SOURCES main.cpp qxdgdesktopportalfiledialog.cpp qxdgdesktopportalfiledialog_p.h diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 12b52a6c18..f2d5c7562d 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -3913,6 +3913,10 @@ def write_plugin(cm_fh, scope, *, indent: int = 0) -> str: if "static" in scope.get("CONFIG"): extra.append("STATIC") + plugin_extends = scope.get_string("PLUGIN_EXTENDS") + if plugin_type != "platform" and plugin_extends == "-": + extra.append("DEFAULT_IF FALSE") + forward_target_info(scope, extra) write_main_part(