comparison Samples/build-wasm-SingleFrameViewer.sh @ 1395:62dc0d737e7b

build script for wasm sample + updated instructions + fixed Sdl sample for Orthanc listening on other ports that 8042
author Alain Mazy <alain@mazy.be>
date Wed, 29 Apr 2020 18:11:49 +0200
parents
children dd2b75ee644b
comparison
equal deleted inserted replaced
1394:a8ac7e3de0e8 1395:62dc0d737e7b
1 #!/bin/bash
2 #
3 # usage:
4 # to build the sample in Debug:
5 # ./build-wasm-SingleFrameViewer.sh
6 #
7 # to build the sample in Debug:
8 # ./build-wasm-SingleFrameViewer.sh Release
9
10 set -e
11
12 if [ ! -d "WebAssembly" ]; then
13 echo "This script must be run from the Samples folder one level below orthanc-stone"
14 exit 1
15 fi
16
17
18 currentDir=$(pwd)
19 samplesRootDir=$(pwd)
20 devrootDir=$(pwd)/../../
21
22 buildType=${1:-RelWithDebInfo}
23 buildFolderName="$devrootDir/out/build-stone-wasm-SingleFrameViewer-$buildType"
24 installFolderName="$devrootDir/out/install-stone-wasm-SingleFrameViewer-$buildType"
25
26 mkdir -p $buildFolderName
27 # change current folder to the build folder
28 pushd $buildFolderName
29
30 # configure the environment to use Emscripten
31 source ~/apps/emsdk/emsdk_env.sh
32
33 emcmake cmake -G "Ninja" \
34 -DCMAKE_BUILD_TYPE=$buildType \
35 -DCMAKE_INSTALL_PREFIX=$installFolderName \
36 -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON \
37 $samplesRootDir/WebAssembly/SingleFrameViewer
38
39 # perform build + installation
40 ninja install
41
42 # restore the original working folder
43 popd
44
45 echo "If all went well, the output files can be found in $installFolderName:"
46
47 ls $installFolderName