diff options
author | Øystein Heskestad <oystein.heskestad@qt.io> | 2023-09-15 16:16:31 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-09-19 22:23:08 +0000 |
commit | 1072aab53e75139601062b27e61bc702794f8a60 (patch) | |
tree | f22e2542c0a65c77af38891537187249a56379e0 /examples | |
parent | 9e2bc2317dc0491d4338c10d7f00c350b701901e (diff) |
Make standalone example copy necessary files for HTML client
The CMake-file did not copy index.html and qwebchannel.js.
Fixes: QTBUG-115779
Change-Id: I3d25e673be6f3fd8f707ccbdc9b4795dc8b66c3d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 106eb57c3b8bae6e06237e65db294c6ac80db278)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c4ec732425c2e7568e5f0e937a4f0bd788f7e719)
Diffstat (limited to 'examples')
-rw-r--r-- | examples/webchannel/standalone/CMakeLists.txt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/webchannel/standalone/CMakeLists.txt b/examples/webchannel/standalone/CMakeLists.txt index 4bbb30a..56317e5 100644 --- a/examples/webchannel/standalone/CMakeLists.txt +++ b/examples/webchannel/standalone/CMakeLists.txt @@ -41,8 +41,39 @@ target_link_libraries(standalone PUBLIC Qt::Widgets ) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/index.html + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/index.html + ${CMAKE_CURRENT_BINARY_DIR}/index.html + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/index.html + VERBATIM +) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qwebchannel.js + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/../shared/qwebchannel.js + ${CMAKE_CURRENT_BINARY_DIR}/qwebchannel.js + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../shared/qwebchannel.js + VERBATIM +) + +add_custom_target(output_target ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/index.html + ${CMAKE_CURRENT_BINARY_DIR}/qwebchannel.js +) + +add_dependencies(standalone output_target) + install(TARGETS standalone RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) + +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/index.html ${CMAKE_CURRENT_BINARY_DIR}/qwebchannel.js + DESTINATION "${INSTALL_EXAMPLEDIR}" +) |