diff options
author | Øystein Heskestad <oystein.heskestad@qt.io> | 2023-09-15 16:16:31 +0200 |
---|---|---|
committer | Øystein Heskestad <oystein.heskestad@qt.io> | 2023-09-19 16:19:09 +0200 |
commit | 106eb57c3b8bae6e06237e65db294c6ac80db278 (patch) | |
tree | b64f1f4e0ffd49f93fd4286039ea174fbb8fcdc6 | |
parent | 4e2ed61dbf16f9a644c3d179ede1502271d39718 (diff) |
Make standalone example copy necessary files for HTML client
The CMake-file did not copy index.html and qwebchannel.js.
Pick-to: 6.6 6.5
Fixes: QTBUG-115779
Change-Id: I3d25e673be6f3fd8f707ccbdc9b4795dc8b66c3d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-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}" +) |