# HG changeset patch # User Sebastien Jodogne # Date 1597142879 -7200 # Node ID de8cf5859e847bf4a7d3840b971828aa94331f21 # Parent 7b326e5ee97b77c4c4ede3037bd746eafd85f9b9 removing useless docker-build.sh from the two plugins diff -r 7b326e5ee97b -r de8cf5859e84 OrthancStone/Samples/RtViewerPlugin/CMakeLists.txt --- a/OrthancStone/Samples/RtViewerPlugin/CMakeLists.txt Tue Aug 11 10:26:01 2020 +0200 +++ b/OrthancStone/Samples/RtViewerPlugin/CMakeLists.txt Tue Aug 11 12:47:59 2020 +0200 @@ -12,7 +12,7 @@ set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() -set(STONE_BINARIES_RT_VIEWER CACHE PATH "Path to the binaries of the RtViewer \"../WebAssembly\" folder") +set(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)") @@ -74,10 +74,10 @@ ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/OrthancExplorer.js # RtViewer individual files - RT_VIEWER_WASM_JS ${STONE_BINARIES_RT_VIEWER}/RtViewerWasm.js - RT_VIEWER_WASM ${STONE_BINARIES_RT_VIEWER}/RtViewerWasm.wasm - RT_VIEWER_WASM_APP_JS ${STONE_BINARIES_RT_VIEWER}/RtViewerWasmApp.js - RT_VIEWER_INDEX_HTML ${STONE_BINARIES_RT_VIEWER}/index.html + 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 ) add_library(RtViewerPlugin SHARED diff -r 7b326e5ee97b -r de8cf5859e84 OrthancStone/Samples/RtViewerPlugin/OrthancExplorer.js --- a/OrthancStone/Samples/RtViewerPlugin/OrthancExplorer.js Tue Aug 11 10:26:01 2020 +0200 +++ b/OrthancStone/Samples/RtViewerPlugin/OrthancExplorer.js Tue Aug 11 12:47:59 2020 +0200 @@ -4,7 +4,7 @@ .attr('href', '#') .attr('data-icon', 'search') .attr('data-theme', 'e') - .text('Stone MPR RT Viewer');`` + .text('Stone MPR RT Sample Viewer');`` b.insertBefore($('#series-delete').parent().parent()); b.click(function() { diff -r 7b326e5ee97b -r de8cf5859e84 OrthancStone/Samples/RtViewerPlugin/docker-build.sh --- a/OrthancStone/Samples/RtViewerPlugin/docker-build.sh Tue Aug 11 10:26:01 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -#!/bin/bash - -set -ex - -IMAGE=jodogne/wasm-builder:1.39.17-upstream -#IMAGE=wasm-builder - -if [ "$1" != "Debug" -a "$1" != "Release" ]; then - echo "Please provide build type: Debug or Release" - exit -1 -fi - -if [ -t 1 ]; then - # TTY is available => use interactive mode - DOCKER_FLAGS='-i' -fi - -ROOT_DIR=`dirname $(readlink -f $0)`/../../.. - -mkdir -p ${ROOT_DIR}/wasm-binaries - -docker run -t ${DOCKER_FLAGS} --rm \ - --user $(id -u):$(id -g) \ - -v ${ROOT_DIR}:/source:ro \ - -v ${ROOT_DIR}/wasm-binaries:/target:rw ${IMAGE} \ - bash /source/OrthancStone/Samples/RtViewerPlugin/docker-internal.sh $1 - -ls -lR ${ROOT_DIR}/wasm-binaries/share/ diff -r 7b326e5ee97b -r de8cf5859e84 OrthancStone/Samples/RtViewerPlugin/docker-internal.sh --- a/OrthancStone/Samples/RtViewerPlugin/docker-internal.sh Tue Aug 11 10:26:01 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -#!/bin/bash -set -ex - -# Get the Orthanc framework -cd /tmp/ -hg clone https://hg.orthanc-server.com/orthanc/ - -# Make a copy of the read-only folder containing the source code into -# a writeable folder, because of "DownloadPackage.cmake" that writes -# to the "ThirdPartyDownloads" folder next to the "CMakeLists.txt" -cd /source -hg clone /source /tmp/source-writeable - - -mkdir /tmp/build -cd /tmp/build - -LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake /tmp/source-writeable/OrthancStone/Samples/RtViewerPlugin \ - -DCMAKE_BUILD_TYPE=$1 \ - -DCMAKE_INSTALL_PREFIX=/target/ \ - -DCMAKE_TOOLCHAIN_FILE=/tmp/orthanc/OrthancFramework/Resources/Toolchains/LinuxStandardBaseToolchain.cmake \ - -DORTHANC_FRAMEWORK_ROOT=/tmp/orthanc/OrthancFramework/Sources \ - -DSTATIC_BUILD=ON \ - -DSTONE_BINARIES_RT_VIEWER=/target/RtViewer/ \ - -DUSE_LEGACY_JSONCPP=ON \ - -G Ninja - -ninja -j2 install - diff -r 7b326e5ee97b -r de8cf5859e84 StoneWebViewer/Plugin/CMakeLists.txt --- a/StoneWebViewer/Plugin/CMakeLists.txt Tue Aug 11 10:26:01 2020 +0200 +++ b/StoneWebViewer/Plugin/CMakeLists.txt Tue Aug 11 12:47:59 2020 +0200 @@ -14,7 +14,7 @@ -set(STONE_BINARIES CACHE PATH "Path to the binaries of the \"../WebAssembly\" folder") +set(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)") diff -r 7b326e5ee97b -r de8cf5859e84 StoneWebViewer/Plugin/docker-build.sh --- a/StoneWebViewer/Plugin/docker-build.sh Tue Aug 11 10:26:01 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -#!/bin/bash - -set -ex - -IMAGE=jodogne/wasm-builder:1.39.17-upstream -#IMAGE=wasm-builder - -if [ "$1" != "Debug" -a "$1" != "Release" ]; then - echo "Please provide build type: Debug or Release" - exit -1 -fi - -if [ -t 1 ]; then - # TTY is available => use interactive mode - DOCKER_FLAGS='-i' -fi - -ROOT_DIR=`dirname $(readlink -f $0)`/../.. - -mkdir -p ${ROOT_DIR}/wasm-binaries - -docker run -t ${DOCKER_FLAGS} --rm \ - --user $(id -u):$(id -g) \ - -v ${ROOT_DIR}:/source:ro \ - -v ${ROOT_DIR}/wasm-binaries:/target:rw ${IMAGE} \ - bash /source/StoneWebViewer/Plugin/docker-internal.sh $1 - -ls -lR ${ROOT_DIR}/wasm-binaries/share/ diff -r 7b326e5ee97b -r de8cf5859e84 StoneWebViewer/Plugin/docker-internal.sh --- a/StoneWebViewer/Plugin/docker-internal.sh Tue Aug 11 10:26:01 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -#!/bin/bash -set -ex - -# Get the Orthanc framework -cd /tmp/ -hg clone https://hg.orthanc-server.com/orthanc/ - -# Make a copy of the read-only folder containing the source code into -# a writeable folder, because of "DownloadPackage.cmake" that writes -# to the "ThirdPartyDownloads" folder next to the "CMakeLists.txt" -cd /source -hg clone /source /tmp/source-writeable - -mkdir /tmp/build -cd /tmp/build - -LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake /tmp/source-writeable/StoneWebViewer/Plugin \ - -DCMAKE_BUILD_TYPE=$1 \ - -DCMAKE_INSTALL_PREFIX=/target/ \ - -DCMAKE_TOOLCHAIN_FILE=/tmp/orthanc/OrthancFramework/Resources/Toolchains/LinuxStandardBaseToolchain.cmake \ - -DORTHANC_FRAMEWORK_ROOT=/tmp/orthanc/OrthancFramework/Sources \ - -DSTATIC_BUILD=ON \ - -DSTONE_BINARIES=/target/StoneWebViewer/ \ - -DUSE_LEGACY_JSONCPP=ON \ - -G Ninja - -ninja -j2 install - diff -r 7b326e5ee97b -r de8cf5859e84 StoneWebViewer/WebAssembly/NOTES.txt --- a/StoneWebViewer/WebAssembly/NOTES.txt Tue Aug 11 10:26:01 2020 +0200 +++ b/StoneWebViewer/WebAssembly/NOTES.txt Tue Aug 11 12:47:59 2020 +0200 @@ -1,2 +1,33 @@ + +Building WebAssembly samples using Docker +========================================= + +The script "./docker-build.sh" can be used to quickly build the +WebAssembly samples on any GNU/Linux distribution equipped with +Docker. This avoids newcomers to install Emscripten and learn the +CMake options. Just type: + +$ ./docker-build.sh Release + +After successful build, the binaries will be installed in the +following folder (i.e. in the folder "wasm-binaries" at the root of +the source distribution): + +$ ls -l ../../wasm-binaries + + +NB: The source code of the Docker build environment can be found at +the following location: +https://github.com/jodogne/OrthancDocker/tree/master/wasm-builder + + +Native compilation (without Docker) +=================================== + +Install Emscripten: +https://emscripten.org/docs/getting_started/downloads.html + +Then, if the installation path is "~/Downloads/emsdk/": + # 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