annotate Applications/StoneWebViewer/Plugin/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 StoneWebViewer/Plugin/CMakeLists.txt@de8cf5859e84
children 8ddf77198ed7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 cmake_minimum_required(VERSION 2.8.3)
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 project(StoneWebViewerPlugin)
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4
1496
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
5 set(ORTHANC_PLUGIN_VERSION "mainline")
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
6
1508
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
7 if (ORTHANC_PLUGIN_VERSION STREQUAL "mainline")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
8 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
9 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
10 else()
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
11 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.7.2")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
12 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
13 endif()
1496
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
14
1508
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
15
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
16
1537
de8cf5859e84 removing useless docker-build.sh from the two plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1530
diff changeset
17 set(STONE_BINARIES "${CMAKE_SOURCE_DIR}/../../wasm-binaries/StoneWebViewer/" CACHE PATH "Path to the binaries of the \"../WebAssembly\" folder")
1508
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
18
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
19 # Parameters of the build
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
20 set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
21 set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
22 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"system\", \"hg\", \"archive\", \"web\" or \"path\")")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
23 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
24 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
25 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
26
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
1508
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
28 # Advanced parameters to fine-tune linking against system libraries
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
29 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
30 set(ORTHANC_FRAMEWORK_STATIC OFF CACHE BOOL "If linking against the Orthanc framework system library, indicates whether this library was statically linked")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
31 mark_as_advanced(ORTHANC_FRAMEWORK_STATIC)
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
32
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
33
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
34 # Download and setup the Orthanc framework
1512
244ad1e4e76a reorganization of folders
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1508
diff changeset
35 include(${CMAKE_SOURCE_DIR}/../../OrthancStone/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
1508
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
36
1530
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1526
diff changeset
37 include_directories(${ORTHANC_FRAMEWORK_ROOT})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1526
diff changeset
38
1508
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
39 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
40 link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES})
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41
1508
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
42 else()
1530
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1526
diff changeset
43 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake)
1508
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
44 set(ENABLE_MODULE_IMAGES OFF)
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
45 set(ENABLE_MODULE_JOBS OFF)
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
46 set(ENABLE_MODULE_DICOM OFF)
1530
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1526
diff changeset
47 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkConfiguration.cmake)
1508
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
48 endif()
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
49
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
50 include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/Plugins/OrthancPluginsExports.cmake)
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
1496
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
52
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
53 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
54 include_directories(${CMAKE_SOURCE_DIR}/../Resources/OrthancSdk-1.0.0)
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
55 else ()
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
56 CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H)
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
57 if (NOT HAVE_ORTHANC_H)
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
58 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK")
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
59 endif()
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
60 endif()
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
61
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
62
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 add_definitions(
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 -DHAS_ORTHANC_EXCEPTION=1
1496
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
65 -DPLUGIN_VERSION="${ORTHANC_PLUGIN_VERSION}"
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 -DPLUGIN_NAME="stone-webviewer"
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 )
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
1496
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
69
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 EmbedResources(
1526
61023b0d39c8 Reverted the Stone Web Viewer plugin to rev. 307a805d0587
Benjamin Golinvaux <bgo@osimis.io>
parents: 1519
diff changeset
71 # Folders
61023b0d39c8 Reverted the Stone Web Viewer plugin to rev. 307a805d0587
Benjamin Golinvaux <bgo@osimis.io>
parents: 1519
diff changeset
72 IMAGES ${STONE_BINARIES}/img/
1496
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
73 WEB_APPLICATION ${CMAKE_SOURCE_DIR}/../WebApplication
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
74
1526
61023b0d39c8 Reverted the Stone Web Viewer plugin to rev. 307a805d0587
Benjamin Golinvaux <bgo@osimis.io>
parents: 1519
diff changeset
75 # Individual files
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/OrthancExplorer.js
1526
61023b0d39c8 Reverted the Stone Web Viewer plugin to rev. 307a805d0587
Benjamin Golinvaux <bgo@osimis.io>
parents: 1519
diff changeset
77 STONE_WEB_VIEWER_JS ${STONE_BINARIES}/StoneWebViewer.js
61023b0d39c8 Reverted the Stone Web Viewer plugin to rev. 307a805d0587
Benjamin Golinvaux <bgo@osimis.io>
parents: 1519
diff changeset
78 STONE_WEB_VIEWER_WASM ${STONE_BINARIES}/StoneWebViewer.wasm
61023b0d39c8 Reverted the Stone Web Viewer plugin to rev. 307a805d0587
Benjamin Golinvaux <bgo@osimis.io>
parents: 1519
diff changeset
79 STONE_WRAPPER ${STONE_BINARIES}/stone.js
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 )
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 add_library(StoneWebViewer SHARED
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 Plugin.cpp
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 ${AUTOGENERATED_SOURCES}
1508
dd1d1cc0575d use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1505
diff changeset
85 ${CMAKE_SOURCE_DIR}/../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp
1495
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 ${ORTHANC_CORE_SOURCES}
fb74ed5d8c22 initial commit of the Stone Web viewer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 )
1496
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
88
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
89 set_target_properties(StoneWebViewer PROPERTIES
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
90 VERSION ${ORTHANC_PLUGIN_VERSION}
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
91 SOVERSION ${ORTHANC_PLUGIN_VERSION})
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
92
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
93 install(
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
94 TARGETS StoneWebViewer
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
95 RUNTIME DESTINATION lib # Destination for Windows
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
96 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
d450653b46d3 build stone web viewer using docker
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1495
diff changeset
97 )