From e1e2b2d8ca89bbd90afe3e884e95bc7372bd22d5 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 2 Sep 2013 09:50:19 +0200 Subject: [PATCH] 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 --- mkspecs/features/qml_plugin.prf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf index 28fbb392a7a..af941058db2 100644 --- a/mkspecs/features/qml_plugin.prf +++ b/mkspecs/features/qml_plugin.prf @@ -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