Skip to content

Commit

Permalink
Copy Emscripten boilerplate also next to the built executable.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Oct 22, 2019
1 parent 0c7eb33 commit 08a2558
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ target_link_libraries(MyApplication PRIVATE
Magnum::GL
Magnum::Magnum)

# For Emscripten copy the boilerplate next to the executable so it can be run
# directly from the build dir; provide an install target as well
if(CORRADE_TARGET_EMSCRIPTEN)
add_custom_command(TARGET MyApplication POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MAGNUM_EMSCRIPTENAPPLICATION_JS}
${MAGNUM_WEBAPPLICATION_CSS}
${CMAKE_CURRENT_SOURCE_DIR}/MyApplication.html
$<TARGET_FILE_DIR:MyApplication>)

install(TARGETS MyApplication DESTINATION ${MAGNUM_DEPLOY_PREFIX})
install(FILES
MyApplication.html
Expand Down

0 comments on commit 08a2558

Please sign in to comment.