Mercurial > hg > orthanc-stone
annotate Applications/StoneWebViewer/WebAssembly/CMakeLists.txt @ 2106:5144d59d0fb2 deep-learning
integration mainline->deep-learning
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 22 Nov 2023 07:44:11 +0100 |
parents | a6d5373e471c |
children | de049fd88697 |
rev | line source |
---|---|
1589
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
1 # Stone of Orthanc |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
2077
07964689cb0b
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2076
diff
changeset
|
4 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
07964689cb0b
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2076
diff
changeset
|
5 # Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1589
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
6 # |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
7 # This program is free software: you can redistribute it and/or |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
8 # modify it under the terms of the GNU Affero General Public License |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
9 # as published by the Free Software Foundation, either version 3 of |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
10 # the License, or (at your option) any later version. |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
11 # |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, but |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
13 # WITHOUT ANY WARRANTY; without even the implied warranty of |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
15 # Affero General Public License for more details. |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
16 # |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
17 # You should have received a copy of the GNU Affero General Public License |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
19 |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1585
diff
changeset
|
20 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 cmake_minimum_required(VERSION 2.8.3) |
1592 | 22 cmake_policy(SET CMP0058 NEW) |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 project(OrthancStone) |
1731
816e1634f221
StoneWebViewer-1.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1696
diff
changeset
|
25 include(${CMAKE_SOURCE_DIR}/../Version.cmake) |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
1548
65eccce95882
unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
27 set(ORTHANC_STONE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/../../../wasm-binaries/StoneWebViewer" CACHE PATH "Where to put the WebAssembly binaries") |
65eccce95882
unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
28 |
65eccce95882
unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
29 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 # Configuration of the Emscripten compiler for WebAssembly target |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 # --------------------------------------------------------------- |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 set(USE_WASM ON CACHE BOOL "") |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
1917
9c52c0376ad7
improved definition of -Wno-unused-command-line-argument
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1912
diff
changeset
|
34 set(WASM_FLAGS "${WASM_FLAGS} -s WASM=1 -s FETCH=1 -s ASSERTIONS=1 -s DISABLE_EXCEPTION_CATCHING=0") |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 if (CMAKE_BUILD_TYPE STREQUAL "Debug") |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1") |
2048
a05b03f45289
added ORTHANC_WEBGL2_HEAP_COMPAT
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1950
diff
changeset
|
37 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s GL_DEBUG=1 -s GL_ASSERTIONS=1 -s TRACE_WEBGL_CALLS=1") |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 endif() |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 |
2048
a05b03f45289
added ORTHANC_WEBGL2_HEAP_COMPAT
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1950
diff
changeset
|
40 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ENVIRONMENT=web") |
2081
3ef91da06636
fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
41 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'") |
1549
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
42 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1") |
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
43 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_MEMORY=268435456") # 256MB + resize |
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
44 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1") |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 add_definitions( |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 -DDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 |
2069
5956d7357098
macro ORTHANC_HAS_WASM_SIMD has to be manually defined
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2055
diff
changeset
|
47 -DORTHANC_HAS_WASM_SIMD=0 |
2048
a05b03f45289
added ORTHANC_WEBGL2_HEAP_COMPAT
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1950
diff
changeset
|
48 -DORTHANC_WEBGL2_HEAP_COMPAT=0 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 ) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 |
1549
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
51 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 # Stone of Orthanc configuration |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 # --------------------------------------------------------------- |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 set(ALLOW_DOWNLOADS ON) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 |
1902 | 56 include(${CMAKE_SOURCE_DIR}/../../../OrthancStone/Resources/CMake/OrthancStoneWebAssemblyParameters.cmake) |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 SET(ENABLE_DCMTK ON) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 SET(ENABLE_DCMTK_NETWORKING OFF) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 SET(ENABLE_DCMTK_TRANSCODING OFF) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 SET(ENABLE_GOOGLE_TEST OFF) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 SET(ENABLE_LOCALE ON) # Necessary for text rendering |
2081
3ef91da06636
fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
63 SET(ENABLE_MODULE_JOBS OFF) |
1585
94edbfa64c97
enable pugixml in samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1562
diff
changeset
|
64 SET(ENABLE_PUGIXML ON) # Necessary for OsiriX annotations |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 SET(ORTHANC_SANDBOXED ON) |
2055
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
66 SET(ENABLE_PROTOBUF ON) # Necessary for deep learning |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
67 SET(ENABLE_PROTOBUF_COMPILER ON) # Necessary for deep learning |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 # this will set up the build system for Stone of Orthanc and will |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 # populate the ORTHANC_STONE_SOURCES CMake variable |
1902 | 71 include(${CMAKE_SOURCE_DIR}/../../../OrthancStone/Resources/CMake/OrthancStoneWebAssemblyConfiguration.cmake) |
1549
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
72 |
1518
433cf964838d
prevents random config. names + typofix + doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
1516
diff
changeset
|
73 if (CMAKE_BUILD_TYPE MATCHES Debug) |
433cf964838d
prevents random config. names + typofix + doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
1516
diff
changeset
|
74 # specific flags go here |
433cf964838d
prevents random config. names + typofix + doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
1516
diff
changeset
|
75 elseif (CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) |
433cf964838d
prevents random config. names + typofix + doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
1516
diff
changeset
|
76 # specific flags go here |
433cf964838d
prevents random config. names + typofix + doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
1516
diff
changeset
|
77 elseif (CMAKE_BUILD_TYPE MATCHES Release) |
433cf964838d
prevents random config. names + typofix + doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
1516
diff
changeset
|
78 # specific flags go here |
433cf964838d
prevents random config. names + typofix + doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
1516
diff
changeset
|
79 else() |
433cf964838d
prevents random config. names + typofix + doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
1516
diff
changeset
|
80 message(FATAL_ERROR "CMAKE_BUILD_TYPE must match either Debug, RelWithDebInfo or Release" ) |
433cf964838d
prevents random config. names + typofix + doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
1516
diff
changeset
|
81 endif() |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 |
1593
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
83 |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
84 # We embed a font to be used for on-screen overlays |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
85 # --------------------------------------------------------------- |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
86 |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
87 DownloadPackage( |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
88 "a24b8136b8f3bb93f166baf97d9328de" |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
89 "http://orthanc.osimis.io/ThirdPartyDownloads/ubuntu-font-family-0.83.zip" |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
90 "${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83") |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
91 |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
92 EmbedResources( |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
93 UBUNTU_FONT ${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83/Ubuntu-R.ttf |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
94 ) |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
95 |
b782f78aed42
rendering osirix annotations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1592
diff
changeset
|
96 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 ################################################################################ |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 # Create the wrapper to call C++ from JavaScript |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 # --------------------------------------------------------------- |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 |
2081
3ef91da06636
fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
103 set(LIBCLANG "libclang.so.1" CACHE PATH "Version of clang to generate the code model") |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 set(STONE_WRAPPER ${CMAKE_CURRENT_BINARY_DIR}/stone.js) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 |
1912
7947565ed2b7
use Python 3 for clang if available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1902
diff
changeset
|
106 include(FindPython3 OPTIONAL RESULT_VARIABLE HAS_CMAKE_PYTHON3) |
7947565ed2b7
use Python 3 for clang if available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1902
diff
changeset
|
107 if (HAS_CMAKE_PYTHON3 STREQUAL "NOTFOUND" OR |
7947565ed2b7
use Python 3 for clang if available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1902
diff
changeset
|
108 NOT Python3_FOUND) |
7947565ed2b7
use Python 3 for clang if available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1902
diff
changeset
|
109 # CMake <= 3.12 or Python 3 not available: Fallback to Python 2.7 |
7947565ed2b7
use Python 3 for clang if available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1902
diff
changeset
|
110 set(CLANG_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) |
7947565ed2b7
use Python 3 for clang if available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1902
diff
changeset
|
111 else() |
7947565ed2b7
use Python 3 for clang if available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1902
diff
changeset
|
112 set(CLANG_PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) |
7947565ed2b7
use Python 3 for clang if available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1902
diff
changeset
|
113 endif() |
7947565ed2b7
use Python 3 for clang if available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1902
diff
changeset
|
114 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 add_custom_command( |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 COMMAND |
1912
7947565ed2b7
use Python 3 for clang if available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1902
diff
changeset
|
117 ${CLANG_PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/ParseWebAssemblyExports.py --libclang=${LIBCLANG} ${CMAKE_SOURCE_DIR}/StoneWebViewer.cpp > ${STONE_WRAPPER} |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 DEPENDS |
1516 | 119 ${CMAKE_SOURCE_DIR}/StoneWebViewer.cpp |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 ${CMAKE_SOURCE_DIR}/ParseWebAssemblyExports.py |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 OUTPUT |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 ${STONE_WRAPPER} |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 ) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 |
2055
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
125 add_custom_command( |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
126 OUTPUT |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
127 ${AUTOGENERATED_DIR}/DeepLearningWorker.pb.h |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
128 ${AUTOGENERATED_DIR}/DeepLearningWorker.pb.cc |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
129 COMMAND ${PROTOC_EXECUTABLE} --cpp_out=${AUTOGENERATED_DIR} -I${CMAKE_SOURCE_DIR} |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
130 ${CMAKE_SOURCE_DIR}/DeepLearningWorker.proto |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
131 DEPENDS |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
132 ${CMAKE_SOURCE_DIR}/DeepLearningWorker.proto |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
133 ProtobufCompiler |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
134 ) |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
135 |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
136 add_custom_target(AutogeneratedFiles |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 DEPENDS |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 ${STONE_WRAPPER} |
2055
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
139 ${AUTOGENERATED_DIR}/DeepLearningWorker.pb.cc |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 ) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 # Define the WASM module |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 # --------------------------------------------------------------- |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 |
1824
a56bf4c534ef
display stone web viewer version in info panel
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
146 add_definitions( |
a56bf4c534ef
display stone web viewer version in info panel
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
147 -DSTONE_WEB_VIEWER_VERSION="${STONE_WEB_VIEWER_VERSION}" |
a56bf4c534ef
display stone web viewer version in info panel
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
148 ) |
a56bf4c534ef
display stone web viewer version in info panel
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
149 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 add_executable(StoneWebViewer |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 ${ORTHANC_STONE_SOURCES} |
2055
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
152 ${AUTOGENERATED_SOURCES} # Populated by "EmbedResources()" |
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
153 ${AUTOGENERATED_DIR}/DeepLearningWorker.pb.cc |
1516 | 154 StoneWebViewer.cpp |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 ) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 |
2081
3ef91da06636
fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
157 # Boost::Math begs for -std=c++14 since Boost 1.82.0 |
3ef91da06636
fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
158 set_property(TARGET StoneWebViewer PROPERTY CXX_STANDARD 14) |
3ef91da06636
fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
159 |
2076
990f396484b1
fix rendering of RT-DOSE with negative GridFrameOffsetVector
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1917
diff
changeset
|
160 DefineSourceBasenameForTarget(StoneWebViewer) |
990f396484b1
fix rendering of RT-DOSE with negative GridFrameOffsetVector
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1917
diff
changeset
|
161 |
1549
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
162 set_target_properties(StoneWebViewer |
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
163 PROPERTIES |
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
164 COMPILE_FLAGS "${WASM_FLAGS}" |
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
165 LINK_FLAGS "${WASM_LINKER_FLAGS}" |
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
166 ) |
a48ae10857b1
packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1548
diff
changeset
|
167 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 # Make sure to have the wrapper generated |
2055
d4e769a0961f
automating invokation of protobuf in deep-learning
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2049
diff
changeset
|
169 add_dependencies(StoneWebViewer AutogeneratedFiles) |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 # Declare installation files for the module |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 # --------------------------------------------------------------- |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 install( |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 TARGETS StoneWebViewer |
1548
65eccce95882
unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
177 RUNTIME DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX} |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 ) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 # Declare installation files for the companion files (web scaffolding) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 # please note that ${CMAKE_CURRENT_BINARY_DIR}/StoneWebViewer.js |
1518
433cf964838d
prevents random config. names + typofix + doc
Benjamin Golinvaux <bgo@osimis.io>
parents:
1516
diff
changeset
|
183 # (the generated JS loader for the WASM module) is handled by the `install` |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 # section above: it is considered to be the binary output of |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 # the linker. |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 # --------------------------------------------------------------- |
1555
b894072b9e2f
static JavaScript resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1549
diff
changeset
|
187 include(${CMAKE_SOURCE_DIR}/JavaScriptLibraries.cmake) |
b894072b9e2f
static JavaScript resources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1549
diff
changeset
|
188 |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 install( |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 FILES |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 ${CMAKE_CURRENT_BINARY_DIR}/StoneWebViewer.wasm |
1686
59fc37c10cfa
nicer info message at startup
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1666
diff
changeset
|
192 ${CMAKE_SOURCE_DIR}/../WebApplication/app-fixes.css |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 ${CMAKE_SOURCE_DIR}/../WebApplication/app.css |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 ${CMAKE_SOURCE_DIR}/../WebApplication/app.js |
1696
572652803929
bootstrapping the Stone Web viewer configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1686
diff
changeset
|
195 ${CMAKE_SOURCE_DIR}/../WebApplication/configuration.json |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 ${CMAKE_SOURCE_DIR}/../WebApplication/index.html |
1660
05b55b89a134
use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1656
diff
changeset
|
197 ${CMAKE_SOURCE_DIR}/../WebApplication/open-sans.css |
1652
fa9e6bf84958
integrating pdf.js into Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
198 ${CMAKE_SOURCE_DIR}/../WebApplication/pdf-viewer.js |
1562
2a4a6b967053
starting work on print
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1555
diff
changeset
|
199 ${CMAKE_SOURCE_DIR}/../WebApplication/print.js |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
200 ${STONE_WRAPPER} |
1548
65eccce95882
unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
201 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX} |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
202 ) |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
203 |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 install( |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
205 FILES |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 ${CMAKE_SOURCE_DIR}/../WebApplication/img/grid1x1.png |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 ${CMAKE_SOURCE_DIR}/../WebApplication/img/grid1x2.png |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 ${CMAKE_SOURCE_DIR}/../WebApplication/img/grid2x1.png |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 ${CMAKE_SOURCE_DIR}/../WebApplication/img/grid2x2.png |
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 ${CMAKE_SOURCE_DIR}/../WebApplication/img/loading.gif |
1662
0f161841f837
adding orthanc logo to the Stone viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1660
diff
changeset
|
211 ${CMAKE_SOURCE_DIR}/../WebApplication/img/orthanc.png |
1548
65eccce95882
unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1544
diff
changeset
|
212 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/img |
1495
fb74ed5d8c22
initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
213 ) |