annotate Applications/Samples/WebAssembly/CMakeLists.txt @ 2123:538c7b7c6e46 deep-learning

integration mainline->deep-learning
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 Mar 2024 16:11:42 +0100
parents de049fd88697
children 2e050ec85379
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1589
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
diff changeset
1 # Stone of Orthanc
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
diff changeset
3 # Department, University Hospital of Liege, Belgium
2114
c23eef785569 update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2111
diff changeset
4 # Copyright (C) 2017-2024 Osimis S.A., Belgium
c23eef785569 update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2111
diff changeset
5 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
1589
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
diff changeset
6 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
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: 1586
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: 1586
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: 1586
diff changeset
10 # the License, or (at your option) any later version.
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
diff changeset
11 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
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: 1586
diff changeset
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
diff changeset
15 # Affero General Public License for more details.
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
diff changeset
16 #
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
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: 1586
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: 1586
diff changeset
19
8c5f9864545f adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1586
diff changeset
20
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
21 cmake_minimum_required(VERSION 2.8.3)
1592
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1591
diff changeset
22 cmake_policy(SET CMP0058 NEW)
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
23
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
24 project(OrthancStone)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
25
1735
2bb735d76726 fix CMake for wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1666
diff changeset
26 set(SAMPLES_VERSION "mainline")
2bb735d76726 fix CMake for wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1666
diff changeset
27
2bb735d76726 fix CMake for wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1666
diff changeset
28 if (SAMPLES_VERSION STREQUAL "mainline")
2bb735d76726 fix CMake for wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1666
diff changeset
29 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline")
2bb735d76726 fix CMake for wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1666
diff changeset
30 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
2bb735d76726 fix CMake for wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1666
diff changeset
31 else()
1957
3f88c239043a cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1928
diff changeset
32 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.11.2")
1735
2bb735d76726 fix CMake for wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1666
diff changeset
33 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
2bb735d76726 fix CMake for wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1666
diff changeset
34 endif()
2bb735d76726 fix CMake for wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1666
diff changeset
35
1548
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
36 set(ORTHANC_STONE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/../../../wasm-binaries/" CACHE PATH "Where to put the WebAssembly binaries")
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
37
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
38
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
39 # Configuration of the Emscripten compiler for WebAssembly target
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
40 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
41 set(USE_WASM ON CACHE BOOL "")
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
42
1666
1e6d3289b1ad enable catching of exceptions in stone web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1656
diff changeset
43 set(WASM_FLAGS "-s WASM=1 -s FETCH=1 -s ASSERTIONS=1 -s DISABLE_EXCEPTION_CATCHING=0")
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
44 if (CMAKE_BUILD_TYPE STREQUAL "Debug")
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
45 set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1")
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
46 endif()
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
47
2048
a05b03f45289 added ORTHANC_WEBGL2_HEAP_COMPAT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1957
diff changeset
48 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
49 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
50 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
51 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
52 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1")
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
53 add_definitions(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
54 -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: 2048
diff changeset
55 -DORTHANC_HAS_WASM_SIMD=0
2048
a05b03f45289 added ORTHANC_WEBGL2_HEAP_COMPAT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1957
diff changeset
56 -DORTHANC_WEBGL2_HEAP_COMPAT=0
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
57 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
58
1549
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
59
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
60 # Stone of Orthanc configuration
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
61 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
62 set(ALLOW_DOWNLOADS ON)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
63
1902
1cfd602de69d fix wasm build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
64 include(${CMAKE_SOURCE_DIR}/../../../OrthancStone/Resources/CMake/OrthancStoneWebAssemblyParameters.cmake)
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
65
1474
d1dde1f86d4a fix build of wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
66 SET(ENABLE_DCMTK OFF) # Not necessary
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
67 SET(ENABLE_GOOGLE_TEST OFF)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
68 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
69 SET(ENABLE_MODULE_JOBS OFF)
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
70 SET(ORTHANC_SANDBOXED ON)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
71
1471
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1465
diff changeset
72 # this will set up the build system for Stone of Orthanc and will
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1465
diff changeset
73 # populate the ORTHANC_STONE_SOURCES CMake variable
1902
1cfd602de69d fix wasm build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
74 include(${CMAKE_SOURCE_DIR}/../../../OrthancStone/Resources/CMake/OrthancStoneWebAssemblyConfiguration.cmake)
1471
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1465
diff changeset
75
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
76
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
77 # We embed a font to be used for on-screen overlays
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
78 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
79
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
80 DownloadPackage(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
81 "a24b8136b8f3bb93f166baf97d9328de"
2111
f8f80e432abc third party downloads from uclouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2110
diff changeset
82 "https://orthanc.uclouvain.be/downloads/third-party-downloads/ubuntu-font-family-0.83.zip"
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
83 "${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83")
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
84
1471
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1465
diff changeset
85 EmbedResources(
1586
b5417e377636 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1549
diff changeset
86 COLORMAP_HOT ${CMAKE_SOURCE_DIR}/../../Resources/Colormaps/hot.lut
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
87 UBUNTU_FONT ${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83/Ubuntu-R.ttf
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
88 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
89
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
90 add_library(OrthancStone STATIC
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
91 ${ORTHANC_STONE_SOURCES}
1471
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1465
diff changeset
92 ${AUTOGENERATED_SOURCES}
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
93 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
94
2110
352cb0fa57b2 fixed handling of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2081
diff changeset
95 if (COMMAND DefineSourceBasenameForTarget)
352cb0fa57b2 fixed handling of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2081
diff changeset
96 DefineSourceBasenameForTarget(OrthancStone)
352cb0fa57b2 fixed handling of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2081
diff changeset
97 endif()
2081
3ef91da06636 fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2077
diff changeset
98
3ef91da06636 fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2077
diff changeset
99
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
100 ################################################################################
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
101
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
102 # Define the WASM module
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
103 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
104
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
105 project(RtViewerWasm)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
106
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
107 add_executable(RtViewerWasm
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
108 RtViewer/RtViewerWasm.cpp
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
109 ../Common/RtViewerApp.cpp
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
110 ../Common/RtViewerApp.h
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
111 ../Common/RtViewerView.cpp
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
112 ../Common/RtViewerView.h
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
113 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
114
2110
352cb0fa57b2 fixed handling of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2081
diff changeset
115 if (COMMAND DefineSourceBasenameForTarget)
352cb0fa57b2 fixed handling of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2081
diff changeset
116 DefineSourceBasenameForTarget(RtViewerWasm)
352cb0fa57b2 fixed handling of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2081
diff changeset
117 endif()
2081
3ef91da06636 fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2077
diff changeset
118
1549
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
119 set_target_properties(RtViewerWasm
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
120 PROPERTIES
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
121 COMPILE_FLAGS "${WASM_FLAGS}"
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
122 LINK_FLAGS "${WASM_LINKER_FLAGS}"
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
123 )
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
124
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
125 target_link_libraries(RtViewerWasm OrthancStone)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
126
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
127 # Declare installation files for the module
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
128 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
129 install(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
130 TARGETS RtViewerWasm
1548
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
131 RUNTIME DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/RtViewer/
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
132 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
133
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
134 # Declare installation files for the companion files (web scaffolding)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
135 # please note that ${CMAKE_CURRENT_BINARY_DIR}/RtViewerWasm.js
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
136 # (the generated JS loader for the WASM module) is handled by the `install1`
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
137 # section above: it is considered to be the binary output of
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
138 # the linker.
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
139 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
140 install(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
141 FILES
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
142 ${CMAKE_SOURCE_DIR}/RtViewer/RtViewerWasmApp.js
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
143 ${CMAKE_SOURCE_DIR}/RtViewer/index.html
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
144 ${CMAKE_CURRENT_BINARY_DIR}/RtViewerWasm.wasm
1548
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
145 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/RtViewer/
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
146 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
147
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
148 ################################################################################
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
149
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
150 # Define the WASM module
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
151 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
152
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
153 project(SingleFrameViewerWasm)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
154
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
155 add_executable(SingleFrameViewerWasm
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
156 SingleFrameViewer/SingleFrameViewer.cpp
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
157 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
158
2110
352cb0fa57b2 fixed handling of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2081
diff changeset
159 if (COMMAND DefineSourceBasenameForTarget)
352cb0fa57b2 fixed handling of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2081
diff changeset
160 DefineSourceBasenameForTarget(SingleFrameViewerWasm)
352cb0fa57b2 fixed handling of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2081
diff changeset
161 endif()
2081
3ef91da06636 fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2077
diff changeset
162
1549
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
163 set_target_properties(SingleFrameViewerWasm
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
164 PROPERTIES
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
165 COMPILE_FLAGS "${WASM_FLAGS}"
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
166 LINK_FLAGS "${WASM_LINKER_FLAGS}"
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
167 )
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
168
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
169 target_link_libraries(SingleFrameViewerWasm OrthancStone)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
170
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
171 # Declare installation files for the module
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
172 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
173 install(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
174 TARGETS SingleFrameViewerWasm
1548
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
175 RUNTIME DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/SingleFrameViewer/
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
176 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
177
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
178 # Declare installation files for the companion files (web scaffolding)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
179 # please note that ${CMAKE_CURRENT_BINARY_DIR}/RtViewerWasm.js
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
180 # (the generated JS loader for the WASM module) is handled by the `install1`
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
181 # section above: it is considered to be the binary output of
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
182 # the linker.
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
183 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
184 install(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
185 FILES
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
186 ${CMAKE_SOURCE_DIR}/SingleFrameViewer/SingleFrameViewerApp.js
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
187 ${CMAKE_SOURCE_DIR}/SingleFrameViewer/index.html
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
188 ${CMAKE_CURRENT_BINARY_DIR}/SingleFrameViewerWasm.wasm
1548
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
189 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/SingleFrameViewer/
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
190 )
2081
3ef91da06636 fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2077
diff changeset
191
3ef91da06636 fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2077
diff changeset
192
3ef91da06636 fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2077
diff changeset
193 # 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
194 set_property(TARGET OrthancStone PROPERTY CXX_STANDARD 14)
3ef91da06636 fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2077
diff changeset
195 set_property(TARGET RtViewerWasm PROPERTY CXX_STANDARD 14)
3ef91da06636 fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2077
diff changeset
196 set_property(TARGET SingleFrameViewerWasm PROPERTY CXX_STANDARD 14)
3ef91da06636 fix compatibility with Emscripten 3.1.47
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2077
diff changeset
197