annotate OrthancStone/Resources/WebAssemblySharedLibrary/CMakeLists.txt @ 2048:a05b03f45289 deep-learning

added ORTHANC_WEBGL2_HEAP_COMPAT
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 08 Mar 2023 17:46:04 +0100
parents 184b0aeae1af
children 5956d7357098
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1900
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
1 # Stone of Orthanc
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
3 # Department, University Hospital of Liege, Belgium
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
4 # Copyright (C) 2017-2022 Osimis S.A., Belgium
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
5 # Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
6 #
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
7 # This program is free software: you can redistribute it and/or
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
8 # modify it under the terms of the GNU Lesser General Public License
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
9 # as published by the Free Software Foundation, either version 3 of
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
10 # the License, or (at your option) any later version.
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
11 #
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
12 # This program is distributed in the hope that it will be useful, but
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
15 # Lesser General Public License for more details.
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
16 #
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
17 # You should have received a copy of the GNU Lesser General Public
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
18 # License along with this program. If not, see
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
19 # <http://www.gnu.org/licenses/>.
563f6aa8e24c fix cmake license comments
Alain Mazy <am@osimis.io>
parents: 1899
diff changeset
20
1899
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
21
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
22
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
23 cmake_minimum_required(VERSION 2.8.3)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
24 cmake_policy(SET CMP0058 NEW)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
25
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
26 project(OrthancStoneModule)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
27
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
28
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
29 # Warning message related to WebAssembly modules: We know that 1.38.41
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
30 # DOES NOT work, but that 1.39.17 works.
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
31 message("")
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
32 message("=== IMPORTANT: Make sure to use a recent version of Emscripten (preferably >= 2.0.0) ===")
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
33 message("")
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
34
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
35
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
36 set(ORTHANC_STONE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/../../../../wasm-binaries/OrthancStoneModule" CACHE PATH "Where to put the WebAssembly binaries")
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
37
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
38
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
39 # Ask for the generation of a side module
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
40 set(WASM_FLAGS "-s SIDE_MODULE=1 -s EXPORT_ALL=1") # Must be before "Compiler.cmake"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
41
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
42
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
43 # Configuration of the Emscripten compiler for WebAssembly target
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
44 # ---------------------------------------------------------------
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
45
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
46 set(USE_WASM ON CACHE BOOL "")
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
47
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
48 set(WASM_FLAGS "${WASM_FLAGS} -s WASM=1 -s FETCH=1")
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
49 if (CMAKE_BUILD_TYPE STREQUAL "Debug")
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
50 set(WASM_FLAGS "${WASM_FLAGS} -s SAFE_HEAP=1")
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
51 endif()
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
52
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
53 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s ASSERTIONS=1 -s DISABLE_EXCEPTION_CATCHING=0")
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
54 set(WASM_LINKER_FLAGS "${WASM_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1")
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
55 add_definitions(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
56 -DDISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1
2048
a05b03f45289 added ORTHANC_WEBGL2_HEAP_COMPAT
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1901
diff changeset
57 -DORTHANC_WEBGL2_HEAP_COMPAT=0
1899
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
58 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
59
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
60
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
61 # Stone of Orthanc configuration
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
62 # ---------------------------------------------------------------
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
63
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
64 include(${CMAKE_SOURCE_DIR}/../OrthancStoneWebAssemblyParameters.cmake)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
65
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
66 SET(ENABLE_DCMTK ON)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
67 SET(ENABLE_DCMTK_NETWORKING OFF)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
68 SET(ENABLE_DCMTK_TRANSCODING OFF)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
69 SET(ENABLE_GOOGLE_TEST OFF)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
70 SET(ENABLE_LOCALE ON) # Necessary for text rendering
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
71 SET(ORTHANC_SANDBOXED ON)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
72
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
73 include(${CMAKE_SOURCE_DIR}/../OrthancStoneWebAssemblyConfiguration.cmake)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
74
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
75
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
76
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
77
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
78 ################################################################################
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
79
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
80 # The source files that register a callback cannot be part of a side
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
81 # module, and must be compiled in the main module. The following
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
82 # command can be used to identify such files:
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
83 # $ grep -lrE 'emscripten_' ../../Sources/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
84
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
85 set(SOURCES_WITH_EMSCRIPTEN_CALLBACKS
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
86 ${CMAKE_SOURCE_DIR}/../WebAssemblyOracle.cpp
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
87 ${CMAKE_SOURCE_DIR}/../WebAssemblyViewport.cpp
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
88 ${CMAKE_SOURCE_DIR}/../WebAssemblyCairoViewport.cpp
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
89 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
90
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
91 list(REMOVE_ITEM ORTHANC_STONE_SOURCES
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
92 ${SOURCES_WITH_EMSCRIPTEN_CALLBACKS}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
93 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
94
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
95 configure_file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
96 ${ORTHANC_STONE_ROOT}/../SharedLibrary/OrthancStone.h.in
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
97 ${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-stone/OrthancStone.h
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
98 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
99
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
100 configure_file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
101 ${ORTHANC_FRAMEWORK_ROOT}/../SharedLibrary/OrthancFramework.h.in
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
102 ${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-framework/OrthancFramework.h
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
103 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
104
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
105 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
106 COPY ${CMAKE_SOURCE_DIR}/../../../../OrthancStone/Sources/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
107 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-stone
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
108 NO_SOURCE_PERMISSIONS
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
109 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
110 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
111 PATTERN OrthancStone.h EXCLUDE
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
112 PATTERN "Deprecated*" EXCLUDE
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
113 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
114
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
115 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
116 COPY ${ORTHANC_FRAMEWORK_ROOT}/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
117 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-framework
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
118 NO_SOURCE_PERMISSIONS
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
119 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
120 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
121 PATTERN OrthancFramework.h EXCLUDE
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
122 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
123
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
124 add_executable(OrthancStoneModule
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
125 ${ORTHANC_STONE_SOURCES}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
126 ${AUTOGENERATED_SOURCES}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
127 ${CAIRO_SOURCES}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
128 ${PIXMAN_SOURCES}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
129 ${FREETYPE_SOURCES}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
130 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
131
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
132 set_target_properties(OrthancStoneModule
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
133 PROPERTIES
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
134 COMPILE_FLAGS "${WASM_FLAGS}"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
135 LINK_FLAGS "${WASM_LINKER_FLAGS}"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
136 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
137
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
138 # CMake does not natively handle SIDE_MODULE, and believes that
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
139 # Emscripten produces a ".js" file (whereas it creates only the
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
140 # ".wasm"). Create a dummy ".js" for target to work.
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
141 add_custom_command(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
142 TARGET OrthancStoneModule POST_BUILD
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
143 COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/OrthancStoneModule.js
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
144 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
145
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
146 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
147 COPY ${BOOST_SOURCES_DIR}/boost/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
148 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/boost/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
149 NO_SOURCE_PERMISSIONS
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
150 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
151 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
152 PATTERN "*.hpp"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
153 PATTERN "*.ipp"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
154 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
155
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
156 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
157 COPY ${JSONCPP_SOURCES_DIR}/include/json/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
158 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/json/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
159 NO_SOURCE_PERMISSIONS
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
160 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
161 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
162 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
163
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
164 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
165 COPY ${CAIRO_SOURCES_DIR}/src/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
166 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/cairo/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
167 NO_SOURCE_PERMISSIONS
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
168 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
169 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
170 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
171
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
172 set(DCMTK_MODULES
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
173 dcmdata
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
174 config
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
175 ofstd
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
176 oflog
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
177 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
178
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
179 foreach (module IN LISTS DCMTK_MODULES)
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
180 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
181 COPY ${DCMTK_SOURCES_DIR}/ofstd/include/dcmtk/${module}/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
182 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Include/dcmtk/${module}/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
183 NO_SOURCE_PERMISSIONS
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
184 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
185 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
186 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
187 endforeach()
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
188
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
189
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
190 install(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
191 TARGETS OrthancStoneModule
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
192 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/lib
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
193 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
194
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
195 install(FILES
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
196 ${CMAKE_CURRENT_BINARY_DIR}/OrthancStoneModule.wasm
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
197 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/lib
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
198 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
199
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
200 install(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
201 DIRECTORY
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
202 ${CMAKE_CURRENT_BINARY_DIR}/Include/boost
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
203 ${CMAKE_CURRENT_BINARY_DIR}/Include/cairo
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
204 ${CMAKE_CURRENT_BINARY_DIR}/Include/dcmtk
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
205 ${CMAKE_CURRENT_BINARY_DIR}/Include/json
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
206 ${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-framework
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
207 ${CMAKE_CURRENT_BINARY_DIR}/Include/orthanc-stone
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
208 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/include/
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
209 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
210
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
211 install(FILES
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
212 ${SOURCES_WITH_EMSCRIPTEN_CALLBACKS}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
213 DESTINATION ${ORTHANC_STONE_INSTALL_PREFIX}/src/orthanc-stone
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
214 )