summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6WasmMacros.cmake
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2022-08-30 17:37:31 +1000
committerLorn Potter <lorn.potter@gmail.com>2022-09-06 02:29:10 +1000
commit0f80b65a01fcb12ec44e337191273ecf4d7e12c1 (patch)
treed17402c93f11210a7295e79628d1e4410995098c /src/corelib/Qt6WasmMacros.cmake
parent76abdaafb540be90e87c6689cc64040e95147777 (diff)
wasm: handle cmake's RUNTIME_OUTPUT_DIRECTORY
Also OUTPUT_NAME Pick-to: 6.4 Fixes: QTBUG-105923 Change-Id: Iaef92b068845d69fad4f73abb7e15dcba3107265 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/corelib/Qt6WasmMacros.cmake')
-rw-r--r--src/corelib/Qt6WasmMacros.cmake34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/corelib/Qt6WasmMacros.cmake b/src/corelib/Qt6WasmMacros.cmake
index 379229bc6a..ce96c4fbec 100644
--- a/src/corelib/Qt6WasmMacros.cmake
+++ b/src/corelib/Qt6WasmMacros.cmake
@@ -8,32 +8,46 @@ function(_qt_internal_wasm_add_target_helpers target)
get_target_property(targetType "${target}" TYPE)
if("${targetType}" STREQUAL "EXECUTABLE")
- set(APPNAME ${target})
-
if(QT6_INSTALL_PREFIX)
set(WASM_BUILD_DIR "${QT6_INSTALL_PREFIX}")
elseif(QT_BUILD_DIR)
set(WASM_BUILD_DIR "${QT_BUILD_DIR}")
endif()
+ get_target_property(output_name ${target} OUTPUT_NAME)
+ if(NOT "${output_name}" STREQUAL "")
+ set(_target_output_name "${output_name}")
+ else()
+ set(_target_output_name "${target}")
+ endif()
+
+ set(APPNAME ${_target_output_name})
+
_qt_internal_test_batch_target_name(test_batch_target_name)
+ get_target_property(target_output_directory ${target} RUNTIME_OUTPUT_DIRECTORY)
+
if(QT_BUILD_TESTS_BATCHED AND target STREQUAL test_batch_target_name)
- get_target_property(batch_output_dir ${target} RUNTIME_OUTPUT_DIRECTORY)
configure_file("${WASM_BUILD_DIR}/libexec/batchedtestrunner.html"
- "${batch_output_dir}/batchedtestrunner.html" COPYONLY)
+ "${target_output_directory}/batchedtestrunner.html" COPYONLY)
configure_file("${WASM_BUILD_DIR}/libexec/batchedtestrunner.js"
- "${batch_output_dir}/batchedtestrunner.js" COPYONLY)
+ "${target_output_directory}/batchedtestrunner.js" COPYONLY)
configure_file("${WASM_BUILD_DIR}/libexec/qwasmjsruntime.js"
- "${batch_output_dir}/qwasmjsruntime.js" COPYONLY)
+ "${target_output_directory}/qwasmjsruntime.js" COPYONLY)
configure_file("${WASM_BUILD_DIR}/libexec/util.js"
- "${batch_output_dir}/util.js" COPYONLY)
+ "${target_output_directory}/util.js" COPYONLY)
else()
+ if(NOT "${target_output_directory}" STREQUAL "")
+ set(_target_directory "${target_output_directory}")
+ else()
+ set(_target_directory "${CMAKE_CURRENT_BINARY_DIR}")
+ endif()
+
configure_file("${WASM_BUILD_DIR}/plugins/platforms/wasm_shell.html"
- "${target}.html")
+ "${_target_directory}/${_target_output_name}.html")
configure_file("${WASM_BUILD_DIR}/plugins/platforms/qtloader.js"
- qtloader.js COPYONLY)
+ ${_target_directory}/qtloader.js COPYONLY)
configure_file("${WASM_BUILD_DIR}/plugins/platforms/qtlogo.svg"
- qtlogo.svg COPYONLY)
+ ${_target_directory}/qtlogo.svg COPYONLY)
endif()
if(QT_FEATURE_thread)