changeset 1548:65eccce95882

unifying the default install prefix for WebAssembly
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 13 Aug 2020 09:57:35 +0200
parents bf195fc0797e
children a48ae10857b1
files Applications/Samples/RtViewerPlugin/CMakeLists.txt Applications/Samples/WebAssembly/CMakeLists.txt Applications/Samples/WebAssembly/NOTES.txt Applications/Samples/WebAssembly/docker-internal.sh Applications/StoneWebViewer/Plugin/CMakeLists.txt Applications/StoneWebViewer/WebAssembly/CMakeLists.txt Applications/StoneWebViewer/WebAssembly/NOTES.txt Applications/StoneWebViewer/WebAssembly/docker-internal.sh
diffstat 8 files changed, 33 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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/
   )
--- 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/"
--- 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 \
--- 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
--- 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
   )
--- 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/"
--- 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 \