Mercurial > hg > orthanc
comparison Plugins/Samples/GdcmDecoder/CMakeLists.txt @ 3915:7e33516965f8 transcoding
merging sample GDCM decoder and Orthanc Web viewer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 11 May 2020 15:13:16 +0200 |
parents | b1a6f49b21dd |
children | 0e3849268a55 |
comparison
equal
deleted
inserted
replaced
3914:e14b5a7a0f75 | 3915:7e33516965f8 |
---|---|
1 # Orthanc - A Lightweight, RESTful DICOM Store | |
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
3 # Department, University Hospital of Liege, Belgium | |
4 # Copyright (C) 2017-2020 Osimis S.A., Belgium | |
5 # | |
6 # This program is free software: you can redistribute it and/or | |
7 # modify it under the terms of the GNU Affero General Public License | |
8 # as published by the Free Software Foundation, either version 3 of | |
9 # the License, or (at your option) any later version. | |
10 # | |
11 # This program is distributed in the hope that it will be useful, but | |
12 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 # Affero General Public License for more details. | |
15 # | |
16 # You should have received a copy of the GNU Affero General Public License | |
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | |
19 | |
1 cmake_minimum_required(VERSION 2.8) | 20 cmake_minimum_required(VERSION 2.8) |
2 | 21 |
3 project(GdcmDecoder) | 22 project(GdcmDecoder) |
4 | 23 |
5 SET(GDCM_DECODER_VERSION "0.0" CACHE STRING "Version of the plugin") | 24 SET(PLUGIN_VERSION "0.0" CACHE STRING "Version of the plugin") |
6 SET(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") | |
7 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") | |
8 SET(USE_SYSTEM_BOOST ON CACHE BOOL "Use the system version of boost") | |
9 | 25 |
10 set(SAMPLES_ROOT ${CMAKE_SOURCE_DIR}/..) | |
11 include(${SAMPLES_ROOT}/Common/OrthancPlugins.cmake) | |
12 include(${ORTHANC_ROOT}/Resources/CMake/BoostConfiguration.cmake) | |
13 | 26 |
14 find_package(GDCM REQUIRED) | 27 # Parameters of the build |
15 if (GDCM_FOUND) | 28 set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") |
16 include(${GDCM_USE_FILE}) | 29 set(STANDALONE_BUILD ON CACHE BOOL "Standalone build (all the resources are embedded, necessary for releases)") |
17 set(GDCM_LIBRARIES gdcmCommon gdcmMSFF) | 30 set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") |
18 else(GDCM_FOUND) | |
19 message(FATAL_ERROR "Cannot find GDCM, did you set GDCM_DIR?") | |
20 endif(GDCM_FOUND) | |
21 | 31 |
22 add_definitions(-DGDCM_DECODER_VERSION="${GDCM_DECODER_VERSION}") | 32 # Advanced parameters to fine-tune linking against system libraries |
33 set(USE_SYSTEM_GDCM ON CACHE BOOL "Use the system version of Grassroot DICOM (GDCM)") | |
34 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") | |
35 | |
36 # Setup the Orthanc framework | |
37 set(ORTHANC_ROOT ${CMAKE_SOURCE_DIR}/../../..) | |
38 | |
39 set(ORTHANC_FRAMEWORK_PLUGIN ON) | |
40 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) | |
41 | |
42 set(ENABLE_LOCALE OFF CACHE INTERNAL "") # Disable support for locales (notably in Boost) | |
43 set(ENABLE_MODULE_IMAGES OFF CACHE INTERNAL "") | |
44 set(ENABLE_MODULE_JOBS OFF CACHE INTERNAL "") | |
45 | |
46 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) | |
47 | |
48 include(GdcmConfiguration.cmake) | |
49 | |
50 | |
51 # Check that the Orthanc SDK headers are available | |
52 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) | |
53 #include_directories(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-0.9.5) | |
54 include_directories(${CMAKE_SOURCE_DIR}/../../Include) # TODO => SYNC 0.9.5 | |
55 else () | |
56 CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H) | |
57 if (NOT HAVE_ORTHANC_H) | |
58 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK") | |
59 endif() | |
60 endif() | |
61 | |
62 | |
63 include_directories(${ORTHANC_ROOT}) | |
64 | |
65 add_definitions( | |
66 -DPLUGIN_VERSION="${PLUGIN_VERSION}" | |
67 -DHAS_ORTHANC_EXCEPTION=1 | |
68 -DORTHANC_ENABLE_LOGGING_PLUGIN=1 | |
69 ) | |
23 | 70 |
24 add_library(GdcmDecoder SHARED | 71 add_library(GdcmDecoder SHARED |
25 ${BOOST_SOURCES} | |
26 GdcmDecoderCache.cpp | 72 GdcmDecoderCache.cpp |
27 GdcmImageDecoder.cpp | 73 GdcmImageDecoder.cpp |
28 OrthancImageWrapper.cpp | |
29 Plugin.cpp | 74 Plugin.cpp |
75 ${CMAKE_SOURCE_DIR}/../Common/OrthancPluginCppWrapper.cpp | |
76 ${ORTHANC_CORE_SOURCES} | |
30 ) | 77 ) |
31 | 78 |
32 target_link_libraries(GdcmDecoder ${GDCM_LIBRARIES}) | 79 target_link_libraries(GdcmDecoder ${GDCM_LIBRARIES}) |
80 | |
81 if (STATIC_BUILD OR NOT USE_SYSTEM_GDCM) | |
82 add_dependencies(GdcmDecoder GDCM) | |
83 endif() |