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