Mercurial > hg > orthanc-stone
comparison Applications/Samples/RtViewerPlugin/CMakeLists.txt @ 1538:d1806b4e4839
moving OrthancStone/Samples/ as Applications/Samples/
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 11 Aug 2020 13:24:38 +0200 |
parents | OrthancStone/Samples/RtViewerPlugin/CMakeLists.txt@de8cf5859e84 |
children | 8ddf77198ed7 |
comparison
equal
deleted
inserted
replaced
1537:de8cf5859e84 | 1538:d1806b4e4839 |
---|---|
1 cmake_minimum_required(VERSION 2.8.3) | |
2 | |
3 project(StoneWebViewerPlugin) | |
4 | |
5 set(ORTHANC_PLUGIN_VERSION "mainline") | |
6 | |
7 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline") | |
8 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") | |
9 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") | |
10 else() | |
11 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.7.2") | |
12 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") | |
13 endif() | |
14 | |
15 set(STONE_BINARIES "${CMAKE_SOURCE_DIR}/../../../wasm-binaries/RtViewer/" CACHE PATH "Path to the binaries of the \"../WebAssembly\" folder") | |
16 | |
17 # Parameters of the build | |
18 set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") | |
19 set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") | |
20 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"system\", \"hg\", \"archive\", \"web\" or \"path\")") | |
21 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework") | |
22 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"") | |
23 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"") | |
24 | |
25 | |
26 # Advanced parameters to fine-tune linking against system libraries | |
27 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") | |
28 set(ORTHANC_FRAMEWORK_STATIC OFF CACHE BOOL "If linking against the Orthanc framework system library, indicates whether this library was statically linked") | |
29 mark_as_advanced(ORTHANC_FRAMEWORK_STATIC) | |
30 | |
31 | |
32 # Download and setup the Orthanc framework | |
33 include(${CMAKE_SOURCE_DIR}/../../../OrthancStone/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake) | |
34 | |
35 include_directories(${ORTHANC_FRAMEWORK_ROOT}) | |
36 | |
37 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") | |
38 link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES}) | |
39 | |
40 else() | |
41 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake) | |
42 set(ENABLE_MODULE_IMAGES OFF) | |
43 set(ENABLE_MODULE_JOBS OFF) | |
44 set(ENABLE_MODULE_DICOM OFF) | |
45 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkConfiguration.cmake) | |
46 endif() | |
47 | |
48 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake) | |
49 | |
50 | |
51 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) | |
52 include_directories(${CMAKE_SOURCE_DIR}/Resources/OrthancSdk-1.0.0) | |
53 else () | |
54 CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H) | |
55 if (NOT HAVE_ORTHANC_H) | |
56 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK") | |
57 endif() | |
58 endif() | |
59 | |
60 | |
61 add_definitions( | |
62 -DHAS_ORTHANC_EXCEPTION=1 | |
63 -DPLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}" | |
64 -DPLUGIN_NAME="stone-rtviewer" | |
65 ) | |
66 | |
67 | |
68 EmbedResources( | |
69 # Web Viewer Folders | |
70 # IMAGES ${STONE_BINARIES_WEB_VIEWER}/img/ | |
71 # WEB_APPLICATION ${CMAKE_SOURCE_DIR}/../WebApplication | |
72 | |
73 # Explorer extension code | |
74 ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/OrthancExplorer.js | |
75 | |
76 # RtViewer individual files | |
77 RT_VIEWER_WASM_JS ${STONE_BINARIES}/RtViewerWasm.js | |
78 RT_VIEWER_WASM ${STONE_BINARIES}/RtViewerWasm.wasm | |
79 RT_VIEWER_WASM_APP_JS ${STONE_BINARIES}/RtViewerWasmApp.js | |
80 RT_VIEWER_INDEX_HTML ${STONE_BINARIES}/index.html | |
81 ) | |
82 | |
83 add_library(RtViewerPlugin SHARED | |
84 Plugin.cpp | |
85 ${AUTOGENERATED_SOURCES} | |
86 ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp | |
87 ${ORTHANC_CORE_SOURCES} | |
88 ) | |
89 | |
90 set_target_properties(RtViewerPlugin PROPERTIES | |
91 VERSION ${ORTHANC_PLUGIN_VERSION} | |
92 SOVERSION ${ORTHANC_PLUGIN_VERSION}) | |
93 | |
94 install( | |
95 TARGETS RtViewerPlugin | |
96 RUNTIME DESTINATION lib # Destination for Windows | |
97 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
98 ) |