aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-02-11 15:54:07 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-16 09:43:05 +0000
commit768d992d70a209e6cb15397413d6c0eb39782d34 (patch)
tree817b413b73c3a6699c0754b7b4b7e9fdf4e93ec7 /src/qml/Qt6QmlMacros.cmake
parentf84d322b0c0e5a3bb9b31ed7c8bce776c3c8cb4f (diff)
CMake: Fix docs and implementation of qt_generate_foreign_qml_types
Renamed doc file not to contain the version number like the rest of the doc files. Clarified description of what the function does. Adjusted doc page title and contents of the function. Fixed synopsis. Added Technical Preview note. Renamed function arguments for clarity. Fixed incorrect COMMENT and DEPENDS target usage. Added mention to QmlIntegration and qt_generate_foreign_qml_types on the Qml module page. Amends 96c1337aef41694c1af4863ad6f0d4d1f961363a Amends 3b1ae2f598d6013e5d262262002820d6eb76805b Fixes: QTBUG-100216 Change-Id: I5c48616a7836c4ddb3f5ca36b7e82f1364995f2f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 9e03505902ee7bda802f18ad1a34d36f96838985) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r--src/qml/Qt6QmlMacros.cmake21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index e256c46796..97e7845ba7 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -2030,22 +2030,24 @@ if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
endfunction()
endif()
-function(qt6_generate_foreign_qml_types lib_target qml_target)
-
- qt6_extract_metatypes(${lib_target})
- get_target_property(target_metatypes_json_file ${lib_target} INTERFACE_QT_META_TYPES_BUILD_FILE)
+# This function is currently in Technical Preview.
+# It's signature and behavior might change.
+function(qt6_generate_foreign_qml_types source_target destination_qml_target)
+ qt6_extract_metatypes(${source_target})
+ get_target_property(target_metatypes_json_file ${source_target}
+ INTERFACE_QT_META_TYPES_BUILD_FILE)
if (NOT target_metatypes_json_file)
message(FATAL_ERROR "Need target metatypes.json file")
endif()
- set(registration_files_base ${lib_target}_${qml_target})
+ set(registration_files_base ${source_target}_${destination_qml_target})
set(additional_sources ${registration_files_base}.cpp ${registration_files_base}.h)
add_custom_command(
OUTPUT
${additional_sources}
DEPENDS
- ${target}
+ ${source_target}
${target_metatypes_json_file}
${QT_CMAKE_EXPORT_NAMESPACE}::qmltyperegistrar
COMMAND
@@ -2054,14 +2056,13 @@ function(qt6_generate_foreign_qml_types lib_target qml_target)
"--extract"
-o ${registration_files_base}
${target_metatypes_json_file}
- COMMENT "Generate QML registration code for target ${target}"
+ COMMENT "Generate QML registration code for target ${source_target}"
)
- target_sources(${qml_target} PRIVATE ${additional_sources})
- qt6_wrap_cpp(${additional_sources} TARGET ${qml_target})
+ target_sources(${destination_qml_target} PRIVATE ${additional_sources})
+ qt6_wrap_cpp(${additional_sources} TARGET ${destination_qml_target})
endfunction()
-
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
function(qt_generate_foreign_qml_types)