diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-08-06 14:56:51 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-08-06 15:09:12 +0200 |
commit | 139961fc510fc9d26cb2545e54a3f4a3eeb87149 (patch) | |
tree | 38882aca3ff783ad5569b702f0362e6908744b37 /src/qml/Qt6QmlMacros.cmake | |
parent | 4da53ed1d6433730d0604b948ba3b5abeabd1eb0 (diff) |
CMake: Partially fix static qtdeclarative builds when using qmake
Mimics e1e2b2d8ca89bbd90afe3e884e95bc7372bd22d5 in qtbase.
Moc needs to be passed the URI as an argument, so that
QQmlImportsPrivate::populatePluginPairVector doesn't fail finding the
statically compiled QtQuick plugin.
Fixes the following error
static plugin for module "QtQuick" with name "QtQuick2Plugin"
has no metadata URI
import QtQuick 2.0
^
This doesn't completely fix static qtdeclarative builds though.
Task-number: QTBUG-85865
Change-Id: I1b43c3cd97b35c7222e05ecf6dcbaa16050f920f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index 5d81fd7be6..24a5eb533b 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -225,6 +225,10 @@ function(qt6_add_qml_module target) target_sources(${target} PRIVATE ${arg_SOURCES}) endif() + # Insert the plugins URI into its meta data to enable usage + # of static plugins in QtDeclarative (like in mkspecs/features/qml_plugin.prf). + set_property(TARGET "${target}" APPEND PROPERTY AUTOMOC_MOC_OPTIONS "-Muri=${arg_URI}") + # Tracker so we can generate unique resource names for multiple # target_qml_files() calls. set_target_properties(${target} PROPERTIES QT6_QML_MODULE_ADD_QML_FILES_COUNT 1) |