From 3e7d1a990d39132e12a82601afe1db019c258e66 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Sat, 30 Jan 2021 10:40:42 +0100 Subject: Fix cmake dependencies around qmltypes files qmltypes files are generated by qmltyperegistrar, and conditionally consumed by qmlcachegen. In turn, the C++ files generated by qmlcachegen must not declare any moc'able constructs as that would be a circular dependency via the metatypes.json files. Codify this condition as a SKIP_AUTOGEN property on the generated C++ files. Change-Id: Ied2ca6ad202dd20039bca9823ef1de4fffcf64d5 Reviewed-by: Andrei Golubev Reviewed-by: Fabian Kosmale --- src/qml/Qt6QmlMacros.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index b89f824280..d70a5c4aef 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -818,7 +818,10 @@ function(qt6_qml_type_registration target) file(TO_NATIVE_PATH "${${PROJECT_NAME}_BINARY_DIR}/bin$${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}$%PATH%" env_path_native) set(extra_env_command COMMAND set \"PATH=${env_path_native}\") endif() - add_custom_command(OUTPUT ${type_registration_cpp_file} + add_custom_command( + OUTPUT + ${type_registration_cpp_file} + ${plugin_types_file} DEPENDS ${foreign_types_file} ${target_metatypes_json_file} @@ -1007,8 +1010,12 @@ function(_qt_internal_quick_compiler_process_resources target resource_name) DEPENDS $ "${file_absolute}" + "$<$:${qmltypes}>" ) target_sources(${target} PRIVATE ${compiled_file}) + set_source_files_properties(${compiled_file} PROPERTIES + SKIP_AUTOGEN ON + ) endforeach() set(qmlcache_loader_list "${CMAKE_CURRENT_BINARY_DIR}/.rcc/qmlcache/${resource_name}/qml_loader_file_list.rsp") -- cgit v1.2.3