comparison StoneWebViewer/Plugin/CMakeLists.txt @ 1508:dd1d1cc0575d

use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jul 2020 08:15:08 +0200
parents 15f2edef7e7c
children 244ad1e4e76a
comparison
equal deleted inserted replaced
1507:169adf9090a6 1508:dd1d1cc0575d
2 2
3 project(StoneWebViewerPlugin) 3 project(StoneWebViewerPlugin)
4 4
5 set(ORTHANC_PLUGIN_VERSION "mainline") 5 set(ORTHANC_PLUGIN_VERSION "mainline")
6 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()
7 14
8 set(ORTHANC_FRAMEWORK_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../../orthanc/OrthancFramework CACHE PATH "") 15
9 set(STONE_BINARIES CACHE PATH "") 16
17 set(STONE_BINARIES CACHE PATH "Path to the binaries of the \"../WebAssembly\" folder")
18
19 # Parameters of the build
20 set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)")
21 set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
22 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"system\", \"hg\", \"archive\", \"web\" or \"path\")")
23 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework")
24 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"")
25 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"")
26
27
28 # Advanced parameters to fine-tune linking against system libraries
10 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") 29 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
30 set(ORTHANC_FRAMEWORK_STATIC OFF CACHE BOOL "If linking against the Orthanc framework system library, indicates whether this library was statically linked")
31 mark_as_advanced(ORTHANC_FRAMEWORK_STATIC)
11 32
12 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake)
13 set(ENABLE_MODULE_IMAGES OFF)
14 set(ENABLE_MODULE_JOBS OFF)
15 set(ENABLE_MODULE_DICOM OFF)
16 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
17 33
18 include_directories( 34 # Download and setup the Orthanc framework
19 ${ORTHANC_FRAMEWORK_ROOT}/Sources 35 include(${CMAKE_SOURCE_DIR}/../../Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
20 ${CMAKE_SOURCE_DIR}/../Resources/Orthanc 36
21 ) 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
47 include_directories(
48 ${ORTHANC_FRAMEWORK_ROOT}/Sources
49 )
50 endif()
51
52 include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/Plugins/OrthancPluginsExports.cmake)
22 53
23 54
24 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) 55 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
25 include_directories(${CMAKE_SOURCE_DIR}/../Resources/OrthancSdk-1.0.0) 56 include_directories(${CMAKE_SOURCE_DIR}/../Resources/OrthancSdk-1.0.0)
26 else () 57 else ()
51 ) 82 )
52 83
53 add_library(StoneWebViewer SHARED 84 add_library(StoneWebViewer SHARED
54 Plugin.cpp 85 Plugin.cpp
55 ${AUTOGENERATED_SOURCES} 86 ${AUTOGENERATED_SOURCES}
56 ${CMAKE_SOURCE_DIR}/../Resources/Orthanc/OrthancPluginCppWrapper.cpp 87 ${CMAKE_SOURCE_DIR}/../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp
57 ${ORTHANC_CORE_SOURCES} 88 ${ORTHANC_CORE_SOURCES}
58 ) 89 )
59 90
60 set_target_properties(StoneWebViewer PROPERTIES 91 set_target_properties(StoneWebViewer PROPERTIES
61 VERSION ${ORTHANC_PLUGIN_VERSION} 92 VERSION ${ORTHANC_PLUGIN_VERSION}