From 175e81ffbdc5d41fa58b24a5447be9219ea755da Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 18 Aug 2021 11:19:51 +0200 Subject: [PATCH] CMake: Fix wasm top-level prefix builds The wasm support files need to be both copied and installed in a top-level prefix build, to ensure that leaf repos can find them in the build dir when they are configured. Pick-to: 6.2 Fixes: QTBUG-95806 Change-Id: I8c09f04fec51cf850299d535bdf3f26542ec4aac Reviewed-by: Lorn Potter --- src/plugins/platforms/wasm/CMakeLists.txt | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/plugins/platforms/wasm/CMakeLists.txt b/src/plugins/platforms/wasm/CMakeLists.txt index 636193141c..00f86b837c 100644 --- a/src/plugins/platforms/wasm/CMakeLists.txt +++ b/src/plugins/platforms/wasm/CMakeLists.txt @@ -62,15 +62,20 @@ qt_internal_extend_target(QWasmIntegrationPlugin CONDITION QT_FEATURE_opengl #### Keys ignored in scope 4:.:.:wasm.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" -qt_copy_or_install(FILES +set(wasm_support_files wasm_shell.html - DESTINATION "${CMAKE_INSTALL_PREFIX}/plugins/platforms/" -) -qt_copy_or_install(FILES qtloader.js - DESTINATION "${CMAKE_INSTALL_PREFIX}/plugins/platforms/" -) -qt_copy_or_install(FILES qtlogo.svg - DESTINATION "${CMAKE_INSTALL_PREFIX}/plugins/platforms/" ) + +qt_copy_or_install(FILES + ${wasm_support_files} + DESTINATION "${CMAKE_INSTALL_PREFIX}/plugins/platforms" +) +# Need to copy the support files to the build dir in a top-level prefix build +# So _qt_internal_wasm_add_target_helpers finds them. +if(QT_WILL_INSTALL) + foreach(wasm_support_file ${wasm_support_files}) + file(COPY "${wasm_support_file}" DESTINATION "${QT_BUILD_DIR}/plugins/platforms") + endforeach() +endif()