make cmake registration of qt plugins make use of PLUGIN_EXTENDS

instead of assigning plugins to the first module which claims the whole
type, try to assign it to a module which the plugin claims to extend.

as we are getting stricter in that go, somebody needs to claim the
'generic', 'platformthemes', and 'platforminputcontexts' plugin types.
the natural claimant is QtGui. however, as we don't want to auto-link
any of these plugins, make them all claim that they extend a
non-existing module.
QtGui also claims 'iconengines' plugins.
the 'printsupport' plugins are also claimed by the respective module.

Change-Id: I7af7c16089f137b8d4a4ed93d1577bd85815c87b
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Oswald Buddenhagen 2014-04-02 22:19:01 +02:00 committed by The Qt Project
parent 06e4676871
commit 08672adb97
12 changed files with 30 additions and 7 deletions

View File

@ -111,15 +111,22 @@ if(build_all|CONFIG(debug, debug|release)): CMAKE_DEBUG_TYPE = debug
if(build_all|CONFIG(release, debug|release)): CMAKE_RELEASE_TYPE = release if(build_all|CONFIG(release, debug|release)): CMAKE_RELEASE_TYPE = release
contains(CONFIG, plugin) { contains(CONFIG, plugin) {
!isEmpty(PLUGIN_EXTENDS):!equals(PLUGIN_EXTENDS, -) {
count(PLUGIN_EXTENDS, 1, greaterThan): \
error("Plugin declares to extend multiple modules. We don't handle that ...")
PLUGIN_MODULE_NAME = $$PLUGIN_EXTENDS
} else {
PLUGIN_MODULE_NAME = PLUGIN_MODULE_NAME =
for (mod, QT_MODULES) { for (mod, QT_MODULES) {
types = $$replace(QT.$${mod}.plugin_types, /.*$, ) contains(QT.$${mod}.plugin_types, $$PLUGIN_TYPE) {
contains(types, $$PLUGIN_TYPE) { !isEmpty(PLUGIN_MODULE_NAME): \
error("Multiple modules claim plugin type '$$PLUGIN_TYPE' ($$mod, in addition to $$PLUGIN_MODULE_NAME)")
PLUGIN_MODULE_NAME = $$mod PLUGIN_MODULE_NAME = $$mod
break() break()
} }
} }
isEmpty(PLUGIN_MODULE_NAME): return() isEmpty(PLUGIN_MODULE_NAME): error("No module claims plugin type '$$PLUGIN_TYPE'")
}
CMAKE_MODULE_NAME = $$cmakeModuleName($$PLUGIN_MODULE_NAME) CMAKE_MODULE_NAME = $$cmakeModuleName($$PLUGIN_MODULE_NAME)

View File

@ -10,6 +10,10 @@ QMAKE_DOCS = $$PWD/doc/qtgui.qdocconf
MODULE_PLUGIN_TYPES = \ MODULE_PLUGIN_TYPES = \
platforms \ platforms \
platformthemes \
platforminputcontexts \
generic \
iconengines \
imageformats imageformats
# This is here only because the platform plugin is no module, obviously. # This is here only because the platform plugin is no module, obviously.

View File

@ -1,6 +1,7 @@
TARGET = qevdevkeyboardplugin TARGET = qevdevkeyboardplugin
PLUGIN_TYPE = generic PLUGIN_TYPE = generic
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QEvdevKeyboardPlugin PLUGIN_CLASS_NAME = QEvdevKeyboardPlugin
load(qt_plugin) load(qt_plugin)

View File

@ -1,6 +1,7 @@
TARGET = qevdevmouseplugin TARGET = qevdevmouseplugin
PLUGIN_TYPE = generic PLUGIN_TYPE = generic
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QEvdevMousePlugin PLUGIN_CLASS_NAME = QEvdevMousePlugin
load(qt_plugin) load(qt_plugin)

View File

@ -1,6 +1,7 @@
TARGET = qevdevtabletplugin TARGET = qevdevtabletplugin
PLUGIN_TYPE = generic PLUGIN_TYPE = generic
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QEvdevTabletPlugin PLUGIN_CLASS_NAME = QEvdevTabletPlugin
load(qt_plugin) load(qt_plugin)

View File

@ -1,6 +1,7 @@
TARGET = qevdevtouchplugin TARGET = qevdevtouchplugin
PLUGIN_TYPE = generic PLUGIN_TYPE = generic
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QEvdevTouchScreenPlugin PLUGIN_CLASS_NAME = QEvdevTouchScreenPlugin
load(qt_plugin) load(qt_plugin)

View File

@ -1,6 +1,7 @@
TARGET = qmeegointegration TARGET = qmeegointegration
PLUGIN_TYPE = generic PLUGIN_TYPE = generic
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QMeeGoIntegrationPlugin PLUGIN_CLASS_NAME = QMeeGoIntegrationPlugin
load(qt_plugin) load(qt_plugin)

View File

@ -1,6 +1,7 @@
TARGET = qtslibplugin TARGET = qtslibplugin
PLUGIN_TYPE = generic PLUGIN_TYPE = generic
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QTsLibPlugin PLUGIN_CLASS_NAME = QTsLibPlugin
load(qt_plugin) load(qt_plugin)

View File

@ -1,6 +1,7 @@
TARGET = composeplatforminputcontextplugin TARGET = composeplatforminputcontextplugin
PLUGIN_TYPE = platforminputcontexts PLUGIN_TYPE = platforminputcontexts
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QComposePlatformInputContextPlugin PLUGIN_CLASS_NAME = QComposePlatformInputContextPlugin
load(qt_plugin) load(qt_plugin)

View File

@ -1,6 +1,7 @@
TARGET = ibusplatforminputcontextplugin TARGET = ibusplatforminputcontextplugin
PLUGIN_TYPE = platforminputcontexts PLUGIN_TYPE = platforminputcontexts
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QIbusPlatformInputContextPlugin PLUGIN_CLASS_NAME = QIbusPlatformInputContextPlugin
load(qt_plugin) load(qt_plugin)

View File

@ -1,6 +1,7 @@
TARGET = qgtk2 TARGET = qgtk2
PLUGIN_TYPE = platformthemes PLUGIN_TYPE = platformthemes
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QGtk2ThemePlugin PLUGIN_CLASS_NAME = QGtk2ThemePlugin
load(qt_plugin) load(qt_plugin)

View File

@ -4,6 +4,9 @@ QT = core-private gui-private widgets-private
MODULE_CONFIG = needs_printsupport_plugin MODULE_CONFIG = needs_printsupport_plugin
DEFINES += QT_NO_USING_NAMESPACE DEFINES += QT_NO_USING_NAMESPACE
MODULE_PLUGIN_TYPES = \
printsupport
QMAKE_DOCS = $$PWD/doc/qtprintsupport.qdocconf QMAKE_DOCS = $$PWD/doc/qtprintsupport.qdocconf
load(qt_module) load(qt_module)