# HG changeset patch # User Sebastien Jodogne # Date 1597305455 -7200 # Node ID 65eccce9588285f97bc58bdf4665d156cec04098 # Parent bf195fc0797e162044739e96eb71bef4455d5768 unifying the default install prefix for WebAssembly diff -r bf195fc0797e -r 65eccce95882 Applications/Samples/RtViewerPlugin/CMakeLists.txt --- a/Applications/Samples/RtViewerPlugin/CMakeLists.txt Wed Aug 12 15:54:55 2020 +0200 +++ b/Applications/Samples/RtViewerPlugin/CMakeLists.txt Thu Aug 13 09:57:35 2020 +0200 @@ -12,8 +12,8 @@ set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() -set(STONE_BINARIES "${CMAKE_SOURCE_DIR}/../../../wasm-binaries/RtViewer/" CACHE PATH "Path to the binaries of the \"../WebAssembly\" folder") - +set(ORTHANC_STONE_BINARIES "${CMAKE_SOURCE_DIR}/../../../wasm-binaries/RtViewer/" CACHE PATH "Path to the binaries of the \"../WebAssembly\" folder") + # Parameters of the build set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") @@ -67,17 +67,17 @@ EmbedResources( # Web Viewer Folders - # IMAGES ${STONE_BINARIES_WEB_VIEWER}/img/ + # IMAGES ${ORTHANC_STONE_BINARIES_WEB_VIEWER}/img/ # WEB_APPLICATION ${CMAKE_SOURCE_DIR}/../WebApplication # Explorer extension code ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/OrthancExplorer.js # RtViewer individual files - RT_VIEWER_WASM_JS ${STONE_BINARIES}/RtViewerWasm.js - RT_VIEWER_WASM ${STONE_BINARIES}/RtViewerWasm.wasm - RT_VIEWER_WASM_APP_JS ${STONE_BINARIES}/RtViewerWasmApp.js - RT_VIEWER_INDEX_HTML ${STONE_BINARIES}/index.html + RT_VIEWER_WASM_JS ${ORTHANC_STONE_BINARIES}/RtViewerWasm.js + RT_VIEWER_WASM ${ORTHANC_STONE_BINARIES}/RtViewerWasm.wasm + RT_VIEWER_WASM_APP_JS ${ORTHANC_STONE_BINARIES}/RtViewerWasmApp.js + RT_VIEWER_INDEX_HTML ${ORTHANC_STONE_BINARIES}/index.html ) add_library(RtViewerPlugin SHARED diff -r bf195fc0797e -r 65eccce95882 Applications/Samples/WebAssembly/CMakeLists.txt --- a/Applications/Samples/WebAssembly/CMakeLists.txt Wed Aug 12 15:54:55 2020 +0200 +++ b/Applications/Samples/WebAssembly/CMakeLists.txt Thu Aug 13 09:57:35 2020 +0200 @@ -2,6 +2,9 @@ project(OrthancStone) +set(ORTHANC_STONE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/../../../wasm-binaries/" CACHE PATH "Where to put the WebAssembly binaries") + + # Configuration of the Emscripten compiler for WebAssembly target # --------------------------------------------------------------- set(USE_WASM ON CACHE BOOL "") @@ -81,7 +84,7 @@ # --------------------------------------------------------------- install( TARGETS RtViewerWasm - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/RtViewer/ + RUNTIME DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/RtViewer/ ) # Declare installation files for the companion files (web scaffolding) @@ -95,7 +98,7 @@ ${CMAKE_SOURCE_DIR}/RtViewer/RtViewerWasmApp.js ${CMAKE_SOURCE_DIR}/RtViewer/index.html ${CMAKE_CURRENT_BINARY_DIR}/RtViewerWasm.wasm - DESTINATION ${CMAKE_INSTALL_PREFIX}/RtViewer/ + DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/RtViewer/ ) ################################################################################ @@ -115,7 +118,7 @@ # --------------------------------------------------------------- install( TARGETS SingleFrameViewerWasm - RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/SingleFrameViewer/ + RUNTIME DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/SingleFrameViewer/ ) # Declare installation files for the companion files (web scaffolding) @@ -129,5 +132,5 @@ ${CMAKE_SOURCE_DIR}/SingleFrameViewer/SingleFrameViewerApp.js ${CMAKE_SOURCE_DIR}/SingleFrameViewer/index.html ${CMAKE_CURRENT_BINARY_DIR}/SingleFrameViewerWasm.wasm - DESTINATION ${CMAKE_INSTALL_PREFIX}/SingleFrameViewer/ + DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/SingleFrameViewer/ ) diff -r bf195fc0797e -r 65eccce95882 Applications/Samples/WebAssembly/NOTES.txt --- a/Applications/Samples/WebAssembly/NOTES.txt Wed Aug 12 15:54:55 2020 +0200 +++ b/Applications/Samples/WebAssembly/NOTES.txt Thu Aug 13 09:57:35 2020 +0200 @@ -31,4 +31,6 @@ # source ~/Downloads/emsdk/emsdk_env.sh # cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DALLOW_DOWNLOADS=ON -G Ninja -# ninja +# ninja install + +=> The binaries will be put in "../../../wasm-binaries/" diff -r bf195fc0797e -r 65eccce95882 Applications/Samples/WebAssembly/docker-internal.sh --- a/Applications/Samples/WebAssembly/docker-internal.sh Wed Aug 12 15:54:55 2020 +0200 +++ b/Applications/Samples/WebAssembly/docker-internal.sh Thu Aug 13 09:57:35 2020 +0200 @@ -21,7 +21,7 @@ cmake /tmp/source-writeable/Applications/Samples/WebAssembly \ -DCMAKE_BUILD_TYPE=$1 \ - -DCMAKE_INSTALL_PREFIX=/target \ + -DORTHANC_STONE_INSTALL_PREFIX=/target \ -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \ -DORTHANC_FRAMEWORK_ROOT=/tmp/orthanc/OrthancFramework/Sources \ -DSTATIC_BUILD=ON \ diff -r bf195fc0797e -r 65eccce95882 Applications/StoneWebViewer/Plugin/CMakeLists.txt --- a/Applications/StoneWebViewer/Plugin/CMakeLists.txt Wed Aug 12 15:54:55 2020 +0200 +++ b/Applications/StoneWebViewer/Plugin/CMakeLists.txt Thu Aug 13 09:57:35 2020 +0200 @@ -14,7 +14,7 @@ -set(STONE_BINARIES "${CMAKE_SOURCE_DIR}/../../../wasm-binaries/StoneWebViewer/" CACHE PATH "Path to the binaries of the \"../WebAssembly\" folder") +set(ORTHANC_STONE_BINARIES "${CMAKE_SOURCE_DIR}/../../../wasm-binaries/StoneWebViewer/" CACHE PATH "Path to the binaries of the \"../WebAssembly\" folder") # Parameters of the build set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") @@ -69,14 +69,14 @@ EmbedResources( # Folders - IMAGES ${STONE_BINARIES}/img/ + IMAGES ${ORTHANC_STONE_BINARIES}/img/ WEB_APPLICATION ${CMAKE_SOURCE_DIR}/../WebApplication # Individual files ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/OrthancExplorer.js - STONE_WEB_VIEWER_JS ${STONE_BINARIES}/StoneWebViewer.js - STONE_WEB_VIEWER_WASM ${STONE_BINARIES}/StoneWebViewer.wasm - STONE_WRAPPER ${STONE_BINARIES}/stone.js + STONE_WEB_VIEWER_JS ${ORTHANC_STONE_BINARIES}/StoneWebViewer.js + STONE_WEB_VIEWER_WASM ${ORTHANC_STONE_BINARIES}/StoneWebViewer.wasm + STONE_WRAPPER ${ORTHANC_STONE_BINARIES}/stone.js ) add_library(StoneWebViewer SHARED diff -r bf195fc0797e -r 65eccce95882 Applications/StoneWebViewer/WebAssembly/CMakeLists.txt --- a/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Wed Aug 12 15:54:55 2020 +0200 +++ b/Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Thu Aug 13 09:57:35 2020 +0200 @@ -2,6 +2,9 @@ project(OrthancStone) +set(ORTHANC_STONE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/../../../wasm-binaries/StoneWebViewer" CACHE PATH "Where to put the WebAssembly binaries") + + # Configuration of the Emscripten compiler for WebAssembly target # --------------------------------------------------------------- set(USE_WASM ON CACHE BOOL "") @@ -98,7 +101,7 @@ install( TARGETS StoneWebViewer - RUNTIME DESTINATION . + RUNTIME DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX} ) @@ -115,7 +118,7 @@ ${CMAKE_SOURCE_DIR}/../WebApplication/app.js ${CMAKE_SOURCE_DIR}/../WebApplication/index.html ${STONE_WRAPPER} - DESTINATION . + DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX} ) install( @@ -125,5 +128,5 @@ ${CMAKE_SOURCE_DIR}/../WebApplication/img/grid2x1.png ${CMAKE_SOURCE_DIR}/../WebApplication/img/grid2x2.png ${CMAKE_SOURCE_DIR}/../WebApplication/img/loading.gif - DESTINATION img + DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/img ) diff -r bf195fc0797e -r 65eccce95882 Applications/StoneWebViewer/WebAssembly/NOTES.txt --- a/Applications/StoneWebViewer/WebAssembly/NOTES.txt Wed Aug 12 15:54:55 2020 +0200 +++ b/Applications/StoneWebViewer/WebAssembly/NOTES.txt Thu Aug 13 09:57:35 2020 +0200 @@ -31,4 +31,6 @@ # source ~/Downloads/emsdk/emsdk_env.sh # cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DALLOW_DOWNLOADS=ON -G Ninja -# ninja +# ninja install + +=> The binaries will be put in "../../../wasm-binaries/StoneWebViewer/" diff -r bf195fc0797e -r 65eccce95882 Applications/StoneWebViewer/WebAssembly/docker-internal.sh --- a/Applications/StoneWebViewer/WebAssembly/docker-internal.sh Wed Aug 12 15:54:55 2020 +0200 +++ b/Applications/StoneWebViewer/WebAssembly/docker-internal.sh Thu Aug 13 09:57:35 2020 +0200 @@ -21,7 +21,7 @@ cmake /tmp/source-writeable/Applications/StoneWebViewer/WebAssembly \ -DCMAKE_BUILD_TYPE=$1 \ - -DCMAKE_INSTALL_PREFIX=/target/StoneWebViewer \ + -DORTHANC_STONE_INSTALL_PREFIX=/target/StoneWebViewer \ -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \ -DORTHANC_FRAMEWORK_ROOT=/tmp/orthanc/OrthancFramework/Sources \ -DSTATIC_BUILD=ON \