comparison CMakeLists.txt @ 266:4e9d30c19b4b

linking against orthanc framework library
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Jun 2020 12:32:46 +0200
parents 38e9bb57f761
children fada2686f2c4
comparison
equal deleted inserted replaced
265:af7108b06b4d 266:4e9d30c19b4b
34 34
35 # Parameters of the build 35 # Parameters of the build
36 set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") 36 set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)")
37 set(STANDALONE_BUILD ON CACHE BOOL "Standalone build (all the resources are embedded, necessary for releases)") 37 set(STANDALONE_BUILD ON CACHE BOOL "Standalone build (all the resources are embedded, necessary for releases)")
38 set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") 38 set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
39 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"hg\", \"archive\", \"web\" or \"path\")") 39 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"system\", \"hg\", \"archive\", \"web\" or \"path\")")
40 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework") 40 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework")
41 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"") 41 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"")
42 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"") 42 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"")
43 43
44 # Advanced parameters to fine-tune linking against system libraries 44 # Advanced parameters to fine-tune linking against system libraries
45 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") 45 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
46 46
47 47
48 set(ENABLE_PLUGINS_VERSION_SCRIPT OFF)
49 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/VersionScript.map")
50
51
48 # Download and setup the Orthanc framework 52 # Download and setup the Orthanc framework
49 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/DownloadOrthancFramework.cmake) 53 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
50 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) 54
51 55
52 set(ENABLE_LOCALE OFF) # Disable support for locales (notably in Boost) 56 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
53 set(ENABLE_GOOGLE_TEST ON) 57 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test")
54 set(ENABLE_SQLITE ON) 58 set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)")
55 set(ENABLE_MODULE_JOBS OFF CACHE INTERNAL "") 59 mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE)
56 set(ENABLE_MODULE_DICOM OFF CACHE INTERNAL "") 60 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/GoogleTestConfiguration.cmake)
57 set(HAS_EMBEDDED_RESOURCES ON) 61
58 62 include_directories(
59 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) 63 ${CMAKE_SOURCE_DIR}/Resources/Orthanc/
60 include_directories(${ORTHANC_ROOT}) 64 )
65 link_libraries(OrthancFramework)
66 else()
67 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake)
68
69 set(ENABLE_LOCALE OFF) # Disable support for locales (notably in Boost)
70 set(ENABLE_GOOGLE_TEST ON)
71 set(ENABLE_SQLITE ON)
72 set(ENABLE_MODULE_JOBS OFF CACHE INTERNAL "")
73 set(ENABLE_MODULE_DICOM OFF CACHE INTERNAL "")
74 set(HAS_EMBEDDED_RESOURCES ON)
75
76 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
77 include_directories(${ORTHANC_ROOT}/Core)
78 endif()
61 79
62 80
63 include(${CMAKE_SOURCE_DIR}/Resources/CMake/JavaScriptLibraries.cmake) 81 include(${CMAKE_SOURCE_DIR}/Resources/CMake/JavaScriptLibraries.cmake)
64 82
65 83
87 -DWEB_VIEWER_PATH="${CMAKE_SOURCE_DIR}/WebApplication/" 105 -DWEB_VIEWER_PATH="${CMAKE_SOURCE_DIR}/WebApplication/"
88 ) 106 )
89 endif() 107 endif()
90 108
91 add_definitions( 109 add_definitions(
92 -DORTHANC_ENABLE_LOGGING_PLUGIN=1
93 -DHAS_ORTHANC_EXCEPTION=1 110 -DHAS_ORTHANC_EXCEPTION=1
94 ) 111 )
95 112
96 EmbedResources( 113 EmbedResources(
97 ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/Resources/OrthancExplorer.js 114 ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/Resources/OrthancExplorer.js
139 ${CMAKE_SOURCE_DIR}/Plugin/SeriesInformationAdapter.cpp 156 ${CMAKE_SOURCE_DIR}/Plugin/SeriesInformationAdapter.cpp
140 157
141 ${ORTHANC_CORE_SOURCES} 158 ${ORTHANC_CORE_SOURCES}
142 ) 159 )
143 160
161 include_directories(
162 ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/
163 )
164
144 add_library(OrthancWebViewer 165 add_library(OrthancWebViewer
145 SHARED 166 SHARED
146 ${AUTOGENERATED_SOURCES} 167 ${AUTOGENERATED_SOURCES}
147 ${CMAKE_SOURCE_DIR}/Plugin/DecodedImageAdapter.cpp 168 ${CMAKE_SOURCE_DIR}/Plugin/DecodedImageAdapter.cpp
148 ${CMAKE_SOURCE_DIR}/Plugin/Plugin.cpp 169 ${CMAKE_SOURCE_DIR}/Plugin/Plugin.cpp
149 ${CORE_SOURCES} 170 ${CORE_SOURCES}
150 ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp 171 ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp
151 ) 172 )
152 173
153 add_dependencies(OrthancWebViewer AutogeneratedTarget) 174 add_dependencies(OrthancWebViewer AutogeneratedTarget)
154 175
155 176