annotate Applications/Samples/WebAssembly/CMakeLists.txt @ 1978:95449b0e064a

pixel probe is working
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 29 Oct 2022 16:56:16 +0200
parents 3f88c239043a
children a05b03f45289 07964689cb0b
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
1871
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
4 # Copyright (C) 2017-2022 Osimis S.A., Belgium
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
5 # Copyright (C) 2021-2022 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
1549
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
48 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'")
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
49 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
50 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
51 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
52 add_definitions(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
53 -DDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
54 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
55
1549
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
56
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
57 # Stone of Orthanc configuration
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
58 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
59 set(ALLOW_DOWNLOADS ON)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
60
1902
1cfd602de69d fix wasm build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
61 include(${CMAKE_SOURCE_DIR}/../../../OrthancStone/Resources/CMake/OrthancStoneWebAssemblyParameters.cmake)
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
62
1474
d1dde1f86d4a fix build of wasm samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1471
diff changeset
63 SET(ENABLE_DCMTK OFF) # Not necessary
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
64 SET(ENABLE_GOOGLE_TEST OFF)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
65 SET(ENABLE_LOCALE ON) # Necessary for text rendering
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
66 SET(ORTHANC_SANDBOXED ON)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
67
1471
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1465
diff changeset
68 # 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
69 # populate the ORTHANC_STONE_SOURCES CMake variable
1902
1cfd602de69d fix wasm build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
70 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
71
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
72
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
73 # We embed a font to be used for on-screen overlays
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
74 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
75
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
76 DownloadPackage(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
77 "a24b8136b8f3bb93f166baf97d9328de"
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
78 "http://orthanc.osimis.io/ThirdPartyDownloads/ubuntu-font-family-0.83.zip"
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
79 "${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83")
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
80
1471
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1465
diff changeset
81 EmbedResources(
1586
b5417e377636 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1549
diff changeset
82 COLORMAP_HOT ${CMAKE_SOURCE_DIR}/../../Resources/Colormaps/hot.lut
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
83 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
84 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
85
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
86 add_library(OrthancStone STATIC
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
87 ${ORTHANC_STONE_SOURCES}
1471
28c64c246312 working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1465
diff changeset
88 ${AUTOGENERATED_SOURCES}
1464
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
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
91 ################################################################################
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
92
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
93 # Define the WASM module
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
94 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
95
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
96 project(RtViewerWasm)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
97
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
98 add_executable(RtViewerWasm
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
99 RtViewer/RtViewerWasm.cpp
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
100 ../Common/RtViewerApp.cpp
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
101 ../Common/RtViewerApp.h
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
102 ../Common/RtViewerView.cpp
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
103 ../Common/RtViewerView.h
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
1549
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
106 set_target_properties(RtViewerWasm
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
107 PROPERTIES
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
108 COMPILE_FLAGS "${WASM_FLAGS}"
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
109 LINK_FLAGS "${WASM_LINKER_FLAGS}"
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
110 )
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
111
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
112 target_link_libraries(RtViewerWasm OrthancStone)
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 # Declare installation files for the module
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
115 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
116 install(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
117 TARGETS RtViewerWasm
1548
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
118 RUNTIME DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/RtViewer/
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
119 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
120
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
121 # Declare installation files for the companion files (web scaffolding)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
122 # please note that ${CMAKE_CURRENT_BINARY_DIR}/RtViewerWasm.js
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
123 # (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
124 # section above: it is considered to be the binary output of
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
125 # the linker.
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 install(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
128 FILES
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
129 ${CMAKE_SOURCE_DIR}/RtViewer/RtViewerWasmApp.js
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
130 ${CMAKE_SOURCE_DIR}/RtViewer/index.html
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
131 ${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
132 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/RtViewer/
1464
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
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
135 ################################################################################
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
136
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
137 # Define the WASM module
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
138 # ---------------------------------------------------------------
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 project(SingleFrameViewerWasm)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
141
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
142 add_executable(SingleFrameViewerWasm
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
143 SingleFrameViewer/SingleFrameViewer.cpp
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
144 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
145
1549
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
146 set_target_properties(SingleFrameViewerWasm
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
147 PROPERTIES
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
148 COMPILE_FLAGS "${WASM_FLAGS}"
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
149 LINK_FLAGS "${WASM_LINKER_FLAGS}"
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
150 )
a48ae10857b1 packaging of the WebAssembly module
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1548
diff changeset
151
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
152 target_link_libraries(SingleFrameViewerWasm OrthancStone)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
153
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
154 # Declare installation files for the module
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
155 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
156 install(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
157 TARGETS SingleFrameViewerWasm
1548
65eccce95882 unifying the default install prefix for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1542
diff changeset
158 RUNTIME DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/SingleFrameViewer/
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
159 )
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
160
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
161 # Declare installation files for the companion files (web scaffolding)
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
162 # please note that ${CMAKE_CURRENT_BINARY_DIR}/RtViewerWasm.js
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
163 # (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
164 # section above: it is considered to be the binary output of
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
165 # the linker.
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
166 # ---------------------------------------------------------------
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
167 install(
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
168 FILES
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
169 ${CMAKE_SOURCE_DIR}/SingleFrameViewer/SingleFrameViewerApp.js
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
170 ${CMAKE_SOURCE_DIR}/SingleFrameViewer/index.html
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
171 ${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
172 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/SingleFrameViewer/
1464
4647636334aa dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1422
diff changeset
173 )