annotate Samples/WebAssembly/CMakeLists.txt @ 1224:37bc7f115f81 broker

integration mainline->broker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 07 Dec 2019 18:45:37 +0100
parents 1f74bc3459ba
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
616
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 cmake_minimum_required(VERSION 2.8.3)
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 #####################################################################
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 ## Configuration of the Emscripten compiler for WebAssembly target
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 #####################################################################
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 set(WASM_FLAGS "-s WASM=1 -s FETCH=1")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WASM_FLAGS}")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WASM_FLAGS}")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]'")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ASSERTIONS=1 -s DISABLE_EXCEPTION_CATCHING=0")
820
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
16 #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXIT_RUNTIME=1")
616
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17
892
50cd372e2460 fix OpenGL context for fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 857
diff changeset
18 #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1")
50cd372e2460 fix OpenGL context for fonts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 857
diff changeset
19
616
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 #####################################################################
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 ## Configuration of the Orthanc framework
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #####################################################################
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 # This CMake file defines the "ORTHANC_STONE_VERSION" macro, so it
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 # must be the first inclusion
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 include(${CMAKE_SOURCE_DIR}/../../Resources/CMake/Version.cmake)
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 if (ORTHANC_STONE_VERSION STREQUAL "mainline")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 set(ORTHANC_FRAMEWORK_VERSION "mainline")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 else()
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 set(ORTHANC_FRAMEWORK_VERSION "1.5.7")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 endif()
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc source code (can be \"hg\", \"archive\", \"web\" or \"path\")")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 #####################################################################
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 ## Configuration of the Stone framework
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 #####################################################################
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 include(${CMAKE_SOURCE_DIR}/../../Resources/CMake/OrthancStoneParameters.cmake)
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake)
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 DownloadPackage(
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 "a24b8136b8f3bb93f166baf97d9328de"
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 "http://orthanc.osimis.io/ThirdPartyDownloads/ubuntu-font-family-0.83.zip"
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 "${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83")
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 set(ORTHANC_STONE_APPLICATION_RESOURCES
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 UBUNTU_FONT ${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83/Ubuntu-R.ttf
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 )
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 SET(ENABLE_GOOGLE_TEST OFF)
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 SET(ENABLE_LOCALE ON)
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 SET(ORTHANC_SANDBOXED ON)
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 SET(ENABLE_WASM ON)
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 include(${CMAKE_SOURCE_DIR}/../../Resources/CMake/OrthancStoneConfiguration.cmake)
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
857
0c0fc20a6902 macro ORTHANC_ENABLE_LOGGING_PLUGIN must be defined per app, not by stone
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
65 add_definitions(
0c0fc20a6902 macro ORTHANC_ENABLE_LOGGING_PLUGIN must be defined per app, not by stone
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
66 -DORTHANC_ENABLE_LOGGING_PLUGIN=0
0c0fc20a6902 macro ORTHANC_ENABLE_LOGGING_PLUGIN must be defined per app, not by stone
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
67 )
0c0fc20a6902 macro ORTHANC_ENABLE_LOGGING_PLUGIN must be defined per app, not by stone
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 831
diff changeset
68
616
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 #####################################################################
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 ## Build the samples
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 #####################################################################
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 add_library(OrthancStone STATIC
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 ${ORTHANC_STONE_SOURCES}
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 )
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
820
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
78
826
2de01660debe reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
79 if (ON)
820
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
80 add_executable(BasicScene
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
81 BasicScene.cpp
994
1f74bc3459ba fix build due to rename in Orthanc::DicomMap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
82 #${CMAKE_CURRENT_LIST_DIR}/../Shared/SharedBasicScene.h
895
6073c980323a wip: adapting basic scene webassembly sample
Alain Mazy <alain@mazy.be>
parents: 857
diff changeset
83 ${CMAKE_CURRENT_LIST_DIR}/../Shared/SharedBasicScene.cpp
820
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
84 )
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
85
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
86 target_link_libraries(BasicScene OrthancStone)
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
87
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
88 install(
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
89 TARGETS BasicScene
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
90 RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
91 )
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
92 endif()
616
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
820
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
94
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
95 if (ON)
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
96 add_executable(BasicMPR
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
97 BasicMPR.cpp
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
98 )
616
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99
820
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
100 target_link_libraries(BasicMPR OrthancStone)
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
101
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
102 install(
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
103 TARGETS BasicMPR
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
104 RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
105 )
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
106 endif()
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
107
616
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 install(
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 FILES
820
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
111 ${CMAKE_CURRENT_BINARY_DIR}/BasicMPR.wasm
616
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 ${CMAKE_CURRENT_BINARY_DIR}/BasicScene.wasm
820
270c31978df1 BasicMPR sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 631
diff changeset
113 ${CMAKE_SOURCE_DIR}/BasicMPR.html
616
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 ${CMAKE_SOURCE_DIR}/BasicScene.html
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 ${CMAKE_SOURCE_DIR}/Configuration.json
831
d71cf8504159 handling of GET arguments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 826
diff changeset
116 ${CMAKE_SOURCE_DIR}/app.js
616
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 ${CMAKE_SOURCE_DIR}/index.html
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 DESTINATION ${CMAKE_INSTALL_PREFIX}
97926984d5d0 WebAssembly sample using Scene2D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 )