Mercurial > hg > orthanc-stone
comparison StoneWebViewer/Plugin/CMakeLists.txt @ 1496:d450653b46d3
build stone web viewer using docker
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 25 Jun 2020 17:50:36 +0200 |
parents | fb74ed5d8c22 |
children | d8af188ab545 |
comparison
equal
deleted
inserted
replaced
1495:fb74ed5d8c22 | 1496:d450653b46d3 |
---|---|
1 cmake_minimum_required(VERSION 2.8.3) | 1 cmake_minimum_required(VERSION 2.8.3) |
2 | 2 |
3 project(StoneWebViewerPlugin) | 3 project(StoneWebViewerPlugin) |
4 | 4 |
5 set(ORTHANC_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../../orthanc CACHE PATH "") | 5 set(ORTHANC_PLUGIN_VERSION "mainline") |
6 | |
7 | |
8 set(ORTHANC_FRAMEWORK_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../../orthanc CACHE PATH "") | |
6 set(STONE_BINARIES CACHE PATH "") | 9 set(STONE_BINARIES CACHE PATH "") |
10 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") | |
7 | 11 |
8 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) | 12 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) |
9 set(ENABLE_MODULE_IMAGES OFF) | 13 set(ENABLE_MODULE_IMAGES OFF) |
10 set(ENABLE_MODULE_JOBS OFF) | 14 set(ENABLE_MODULE_JOBS OFF) |
11 set(ENABLE_MODULE_DICOM OFF) | 15 set(ENABLE_MODULE_DICOM OFF) |
12 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) | 16 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) |
13 | 17 |
14 include_directories( | 18 include_directories( |
15 ${ORTHANC_ROOT}/Core | 19 ${ORTHANC_FRAMEWORK_ROOT}/Core |
16 ${ORTHANC_ROOT}/Plugins/Samples/Common | 20 ${ORTHANC_FRAMEWORK_ROOT}/Plugins/Samples/Common |
17 ${ORTHANC_ROOT}/Plugins/Include # TODO => Fix a version | |
18 ) | 21 ) |
22 | |
23 | |
24 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) | |
25 include_directories(${CMAKE_SOURCE_DIR}/../Resources/OrthancSdk-1.0.0) | |
26 else () | |
27 CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H) | |
28 if (NOT HAVE_ORTHANC_H) | |
29 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK") | |
30 endif() | |
31 endif() | |
32 | |
19 | 33 |
20 add_definitions( | 34 add_definitions( |
21 -DHAS_ORTHANC_EXCEPTION=1 | 35 -DHAS_ORTHANC_EXCEPTION=1 |
22 -DPLUGIN_VERSION="mainline" # TODO | 36 -DPLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}" |
23 -DPLUGIN_NAME="stone-webviewer" | 37 -DPLUGIN_NAME="stone-webviewer" |
24 ) | 38 ) |
25 | 39 |
40 | |
26 EmbedResources( | 41 EmbedResources( |
42 # Folders | |
43 IMAGES ${STONE_BINARIES}/img/ | |
44 WEB_APPLICATION ${CMAKE_SOURCE_DIR}/../WebApplication | |
45 | |
46 # Individual files | |
27 ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/OrthancExplorer.js | 47 ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/OrthancExplorer.js |
28 STONE_WRAPPER ${STONE_BINARIES}/stone.js | |
29 STONE_WEB_VIEWER_JS ${STONE_BINARIES}/StoneWebViewer.js | 48 STONE_WEB_VIEWER_JS ${STONE_BINARIES}/StoneWebViewer.js |
30 STONE_WEB_VIEWER_WASM ${STONE_BINARIES}/StoneWebViewer.wasm | 49 STONE_WEB_VIEWER_WASM ${STONE_BINARIES}/StoneWebViewer.wasm |
31 WEB_APPLICATION ${CMAKE_SOURCE_DIR}/../WebApplication | 50 STONE_WRAPPER ${STONE_BINARIES}/stone.js |
32 IMAGES ${STONE_BINARIES}/img/ | |
33 ) | 51 ) |
34 | 52 |
35 add_library(StoneWebViewer SHARED | 53 add_library(StoneWebViewer SHARED |
36 Plugin.cpp | 54 Plugin.cpp |
37 ${AUTOGENERATED_SOURCES} | 55 ${AUTOGENERATED_SOURCES} |
38 ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp | 56 ${ORTHANC_FRAMEWORK_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp # TODO |
39 ${ORTHANC_CORE_SOURCES} | 57 ${ORTHANC_CORE_SOURCES} |
40 ) | 58 ) |
59 | |
60 set_target_properties(StoneWebViewer PROPERTIES | |
61 VERSION ${ORTHANC_PLUGIN_VERSION} | |
62 SOVERSION ${ORTHANC_PLUGIN_VERSION}) | |
63 | |
64 install( | |
65 TARGETS StoneWebViewer | |
66 RUNTIME DESTINATION lib # Destination for Windows | |
67 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
68 ) |