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 c45c32af32

Task-number: QTBUG-115152
Change-Id: I120d53d44382a1ac6f62792ec1620add3e7b136c
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
This commit is contained in:
Alexandru Croitor 2023-07-20 13:58:46 +02:00
parent 4a26ae1b27
commit bc2ae5a708

View File

@ -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 "$<BOOL:$<TARGET_PROPERTY:QT_CONSUMES_METATYPES>>")