qml_plugin.prf: moc plugin with -Muri=$$TARGETPATH

When we build qml plugins, we now depend on embedding
the uri of the plugin into its meta-data using the new
-M switch to moc for static builds.

This patch will let this happen automatically whenever you
call load(qml_plugin) from your pro file.

With this patch, you only need to rebuild your plugin
to support static applications.

Task-number: QTBUG-28357
Change-Id: I99e2fc80688fa43cf734551553f4fa0cb5ed47ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This commit is contained in:
Richard Moe Gustavsen 2013-09-02 09:50:19 +02:00 committed by The Qt Project
parent 7a47aebe9e
commit e1e2b2d8ca

View File

@ -25,6 +25,11 @@ if(win32|mac):!macx-xcode {
}
isEmpty(TARGETPATH): TARGETPATH = $$eval(QT.$${CXX_MODULE}.name)
# Insert the plugins URI into its meta data to enable usage
# of static plugins in QtDeclarative:
URI = $$replace(TARGETPATH, "/", ".")
QMAKE_MOC_OPTIONS += -Muri=$$URI
QMLTYPEFILE = $$_PRO_FILE_PWD_/plugins.qmltypes
exists($$QMLTYPEFILE): QML_FILES += $$QMLTYPEFILE