From bc2ae5a70800ee18a99b1b20c41e46d4bbcb09ef Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 20 Jul 2023 13:58:46 +0200 Subject: [PATCH] CMake: Fix installed metatypes not being propagated to other repos The install-time code path that's supposed to propagate and install the metatypes files was never executed, because of a wrong PARENT_SCOPE assignment and because the code was overriding the meta type file name retrieved from a property with an empty non-existent argument. This caused build failures in qtdeclarative when qmlcachegen generated invalid cpp code without having access to the qtbase foreign types. This only happened in prefix builds. Use the appropriate variable for the PARENT_SCOPE assignment and remove the incorrect file name assignment. Amends c45c32af32e5b7501065f294de67a5e6a3d1f62a Task-number: QTBUG-115152 Change-Id: I120d53d44382a1ac6f62792ec1620add3e7b136c Reviewed-by: Amir Masoud Abdol --- src/corelib/Qt6CoreMacros.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index f4fd32f717..590dcf063e 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -954,7 +954,7 @@ function(_qt_internal_should_install_metatypes target) if(NOT target_type STREQUAL "EXECUTABLE" AND arg_INTERNAL_INSTALL) set(should_install TRUE) endif() - set(${out_var} "${should_install}" PARENT_SCOPE) + set(${arg_OUT_VAR} "${should_install}" PARENT_SCOPE) endfunction() function(_qt_internal_get_metatypes_install_dir internal_install_dir arch_data_dir out_var) @@ -1056,8 +1056,6 @@ function(_qt_internal_assign_install_metatypes_files_and_properties target) message(FATAL_ERROR "INSTALL_DIR must be specified") endif() - set(metatypes_file_name "${arg_METATYPES_FILE_NAME}") - # Set up consumption of files via INTERFACE_SOURCES. set(consumes_metatypes "$>")