From 02dca56ee15d5e96b70afa02e15c2543177d2eda Mon Sep 17 00:00:00 2001 From: Moros Smith Date: Sun, 18 Aug 2024 10:49:35 -0400 Subject: [PATCH] rename output html file to index.html to ease deployment --- CMakeLists.txt | 14 ++++ emscripten_shell.html | 148 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100644 emscripten_shell.html diff --git a/CMakeLists.txt b/CMakeLists.txt index 623753c..c42dd86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,6 +260,20 @@ if (EMSCRIPTEN) endif() set_target_properties(${OutputExecutable} PROPERTIES LINK_FLAGS "--shell-file ${CMAKE_CURRENT_SOURCE_DIR}/emscripten_shell.html") + + add_custom_command( + TARGET ${OutputExecutable} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E remove -f ${CMAKE_BINARY_DIR}/bin/index.html + ) + + add_custom_command( + TARGET ${OutputExecutable} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E rename ${CMAKE_BINARY_DIR}/bin/${OutputExecutable}.html ${CMAKE_BINARY_DIR}/bin/index.html + ) endif() # Emscripten ###################################################################### diff --git a/emscripten_shell.html b/emscripten_shell.html new file mode 100644 index 0000000..5c4ff2c --- /dev/null +++ b/emscripten_shell.html @@ -0,0 +1,148 @@ + + + + + + Hamster + + + + +
+ +
+ + + {{{ SCRIPT }}} + + + \ No newline at end of file