annotate OrthancStone/Resources/WebAssemblySharedLibrary/CMakeLists.txt @ 2077:07964689cb0b

upgrade to year 2023
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Jul 2023 21:20:22 +0200
parents 184b0aeae1af
children fdb012c86a75 c23eef785569
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
2077
07964689cb0b upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1901
diff changeset
4 # Copyright (C) 2017-2023 Osimis S.A., Belgium
07964689cb0b upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1901
diff changeset
5 # Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
1900
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
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
57 )
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 # 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
61 # ---------------------------------------------------------------
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 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
64
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
65 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
66 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
67 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
68 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
69 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
70 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
71
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
72 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
73
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 # 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
80 # 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
81 # 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
82 # $ 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
83
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
84 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
85 ${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
86 ${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
87 ${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
88 )
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 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
91 ${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
92 )
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 configure_file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
95 ${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
96 ${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
97 )
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 configure_file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
100 ${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
101 ${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
102 )
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 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
105 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
106 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
107 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
108 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
109 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
110 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
111 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
112 )
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 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
115 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
116 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
117 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
118 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
119 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
120 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
121 )
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 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
124 ${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
125 ${AUTOGENERATED_SOURCES}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
126 ${CAIRO_SOURCES}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
127 ${PIXMAN_SOURCES}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
128 ${FREETYPE_SOURCES}
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
129 )
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 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
132 PROPERTIES
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
133 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
134 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
135 )
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 # 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
138 # 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
139 # ".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
140 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
141 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
142 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
143 )
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 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
146 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
147 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
148 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
149 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
150 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
151 PATTERN "*.hpp"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
152 PATTERN "*.ipp"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
153 )
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 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
156 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
157 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
158 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
159 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
160 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
161 )
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 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
164 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
165 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
166 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
167 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
168 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
169 )
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 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
172 dcmdata
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
173 config
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
174 ofstd
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
175 oflog
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
176 )
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 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
179 file(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
180 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
181 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
182 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
183 FILES_MATCHING
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
184 PATTERN "*.h"
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
185 )
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
186 endforeach()
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
187
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 install(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
190 TARGETS OrthancStoneModule
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
191 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
192 )
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 install(FILES
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
195 ${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
196 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
197 )
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 install(
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
200 DIRECTORY
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
201 ${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
202 ${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
203 ${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
204 ${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
205 ${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
206 ${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
207 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
208 )
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 install(FILES
917500c46fe0 moved the Platform folder from the Applications folder to the Stone library itself
Alain Mazy <am@osimis.io>
parents:
diff changeset
211 ${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
212 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
213 )