From defe266fd035d843fc53bdf25d4164a1f0362b83 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 16 Mar 2018 10:22:19 +0100 Subject: qml_module.prf: embed qmldir to resources in static builds only For "import MyModule", the QML engine looks for a qmldir file in $eachImportPath/MyModule. One of the built-in import paths is ":/qt-project.org/imports". This is meant for static "plugins", where the resources and the plugin are already inside the binary image. For dynamic plugins, the qmldir file is what enables the QML engine to find the plugin in the first place, so it makes no sense to embed it inside the plugin's resources. Change-Id: I29f006efb58d91f7e5212c347087535b06e8c637 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qml_module.prf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf index 4db0040dc5..dfd4c736d2 100644 --- a/mkspecs/features/qml_module.prf +++ b/mkspecs/features/qml_module.prf @@ -35,9 +35,10 @@ qml1_target { builtin_resources { URITARGET = $$replace(URI, "\\.", "_") - # Ensure the QML files are included in the resources. In static builds, - # the QML engine reads also the qmldir file from the resources. - $${URITARGET}.files = $$qmldir_file $$fq_qml_files + # In static builds, the QML engine reads also the qmldir file from the resources. + static: $${URITARGET}.files = $$qmldir_file + # Ensure the QML files are included in the resources. + $${URITARGET}.files += $$fq_qml_files # qt-project.org/imports is the path used for locating imports inside the resources $${URITARGET}.prefix = /qt-project.org/imports/$$TARGETPATH RESOURCES += $${URITARGET} -- cgit v1.2.3