Fix meta types json file install for non-prefix builds

Change-Id: I76fd379dacb7db79d4ed6ca47954ae8e703842d4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Leander Beernaert 2019-12-05 16:02:26 +01:00
parent f4e80ea688
commit 05ba991d39

View File

@ -1706,9 +1706,18 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
get_target_property(target_metatypes_file ${target} QT_MODULE_META_TYPES_FILE) get_target_property(target_metatypes_file ${target} QT_MODULE_META_TYPES_FILE)
if (target_metatypes_file) if (target_metatypes_file)
set(metatypes_install_dir ${INSTALL_LIBDIR}/metatypes) set(metatypes_install_dir ${INSTALL_LIBDIR}/metatypes)
qt_copy_or_install(FILES ${target_metatypes_file} qt_install(FILES ${target_metatypes_file}
DESTINATION ${metatypes_install_dir} DESTINATION ${metatypes_install_dir}
) )
# For non prefix builds
if(NOT QT_WILL_INSTALL)
get_filename_component(file_name ${target_metatypes_file} NAME)
set(copy_destination ${QT_BUILD_DIR}/${metatypes_install_dir}/${file_name})
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND}
-E copy_if_different ${target_metatypes_file} ${copy_destination}
)
endif()
endif() endif()
endif() endif()
endfunction() endfunction()