Skip to content

Instantly share code, notes, and snippets.

@torarnv
Created January 15, 2024 12:27
Show Gist options
  • Save torarnv/418761814bb02bff21362a9b13c5eecb to your computer and use it in GitHub Desktop.
Save torarnv/418761814bb02bff21362a9b13c5eecb to your computer and use it in GitHub Desktop.
diff --git i/src/qml/Qt6QmlMacros.cmake w/src/qml/Qt6QmlMacros.cmake
index 10320a87f08..e8c9bd1b0d3 100644
--- i/src/qml/Qt6QmlMacros.cmake
+++ w/src/qml/Qt6QmlMacros.cmake
@@ -2924,7 +2924,11 @@ function(_qt_internal_qml_type_registration target)
set(type_registration_cpp_file "${target_binary_dir}/${type_registration_cpp_file_name}")
# Enable evaluation of metatypes.json source interfaces
- set_target_properties(${target} PROPERTIES QT_CONSUMES_METATYPES TRUE)
+ if(NOT TARGET qt_metatypes)
+ add_custom_target(qt_metatypes)
+ _qt_internal_assign_to_internal_targets_folder(qt_metatypes)
+ endif()
+ set_target_properties(qt_metatypes PROPERTIES QT_CONSUMES_METATYPES TRUE)
set(genex_list "$<REMOVE_DUPLICATES:$<FILTER:$<TARGET_PROPERTY:${target},SOURCES>,INCLUDE,metatypes.json$>>")
set(genex_main "$<JOIN:${genex_list},$<COMMA>>")
file(GENERATE OUTPUT "${foreign_types_file}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment