diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-02-01 16:25:12 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-02-02 12:21:36 +0100 |
commit | 0c530f28733f15f86c1d83fd9d7542b3e3131d1d (patch) | |
tree | dbc4d083cc838eff6b820c117e188af4abae8313 | |
parent | 3f40fee66408ec7740bda7c3e7f99d90735e2440 (diff) |
Add 'MANUAL_MOC_JSON_FILES' support by 'qt6_qml_type_registration'
Pass the 'qt6_qml_type_registration' function's 'MANUAL_MOC_JSON_FILES'
argument to 'qt6_extract_metatypes', if specified.
Align the 'qmltyperegistrar' test to modifications in the
'qt_manual_moc' and 'qt6_qml_type_registration' functions.
Task-number: QTBUG-84906
Change-Id: I6b23526e1cc4633f55536871cbb7bc6d891f1dea
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index d70a5c4aef..9e559f8755 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -682,8 +682,10 @@ endif() # target is a plugin, or ${target}.qmltypes in all other cases # This function is currently in Technical Preview. # It's signature and behavior might change. +# MANUAL_MOC_JSON_FILES specifies a list of json files, generated by manual moc call, +# to extract metatypes. function(qt6_qml_type_registration target) - + cmake_parse_arguments(arg "" "" "MANUAL_MOC_JSON_FILES" ${ARGN}) get_target_property(import_name ${target} QT_QML_MODULE_URI) if (NOT import_name) message(FATAL_ERROR "Target ${target} is not a QML module") @@ -710,6 +712,9 @@ function(qt6_qml_type_registration target) set(meta_types_json_args "INSTALL_DIR" "${qml_install_dir}/lib/metatypes") endif() + if(arg_MANUAL_MOC_JSON_FILES) + list(APPEND meta_types_json_args "MANUAL_MOC_JSON_FILES" ${arg_MANUAL_MOC_JSON_FILES}) + endif() qt6_extract_metatypes(${target} ${meta_types_json_args}) get_target_property(import_version ${target} QT_QML_MODULE_VERSION) |