annotate Resources/CMake/DcmtkConfiguration.cmake @ 3038:53d583d2c775 db-changes

removing IDatabaseWrapper::LookupIdentifier()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Dec 2018 18:06:46 +0100
parents 85999ed092c5
children 0c2a8d5e0097
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1914
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
1 if (NOT DEFINED ENABLE_DCMTK_NETWORKING)
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
2 set(ENABLE_DCMTK_NETWORKING ON)
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
3 endif()
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
4
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
5 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
2338
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
6 if (USE_DCMTK_360)
1951
01de36d949c3 Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1943
diff changeset
7 SET(DCMTK_VERSION_NUMBER 360)
01de36d949c3 Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1943
diff changeset
8 SET(DCMTK_PACKAGE_VERSION "3.6.0")
01de36d949c3 Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1943
diff changeset
9 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
2384
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2383
diff changeset
10 SET(DCMTK_URL "http://www.orthanc-server.com/downloads/third-party/dcmtk-3.6.0.zip")
1951
01de36d949c3 Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1943
diff changeset
11 SET(DCMTK_MD5 "219ad631b82031806147e4abbfba4fa4")
2338
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
12 else()
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
13 SET(DCMTK_VERSION_NUMBER 362)
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
14 SET(DCMTK_PACKAGE_VERSION "3.6.2")
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
15 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.2)
2384
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2383
diff changeset
16 SET(DCMTK_URL "http://www.orthanc-server.com/downloads/third-party/dcmtk-3.6.2.tar.gz")
2338
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
17 SET(DCMTK_MD5 "d219a4152772985191c9b89d75302d12")
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
18
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
19 macro(DCMTK_UNSET)
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
20 endmacro()
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
21
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
22 macro(DCMTK_UNSET_CACHE)
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
23 endmacro()
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
24
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
25 set(DCMTK_BINARY_DIR ${DCMTK_SOURCES_DIR}/)
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
26 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/)
2376
c33ff8a7ffa9 Fix static compilation of DCMTK 3.6.2 on Fedora
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2364
diff changeset
27 set(DCMTK_WITH_THREADS ON)
c33ff8a7ffa9 Fix static compilation of DCMTK 3.6.2 on Fedora
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2364
diff changeset
28
2338
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
29 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1)
1951
01de36d949c3 Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1943
diff changeset
30 endif()
2339
6e26d363dc53 USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2338
diff changeset
31
1537
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
32 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}")
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
33 set(FirstRun OFF)
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
34 else()
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
35 set(FirstRun ON)
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
36 endif()
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
37
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
38 DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}")
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
39
2152
cbebc5d072b0 Use of DCMTK 3.6.1 dictionary of private tags in standalone builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2150
diff changeset
40
2356
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
41 if (FirstRun)
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
42 if (USE_DCMTK_360)
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
43 # If using DCMTK 3.6.0, backport the "private.dic" file from DCMTK
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
44 # 3.6.2. This adds support for more private tags, and fixes some
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
45 # import problems with Philips MRI Achieva.
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
46 if (USE_DCMTK_362_PRIVATE_DIC)
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
47 message("Using the dictionary of private tags from DCMTK 3.6.2")
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
48 configure_file(
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
49 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.2-private.dic
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
50 ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
51 COPYONLY)
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
52 else()
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
53 message("Using the dictionary of private tags from DCMTK 3.6.0")
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
54 endif()
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
55
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
56 # Patches specific to DCMTK 3.6.0
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
57 message("Applying patch to solve vulnerability in DCMTK 3.6.0")
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
58 execute_process(
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
59 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
60 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.0-dulparse-vulnerability.patch
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
61 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
62 RESULT_VARIABLE Failure
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
63 )
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
64
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
65 if (Failure)
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
66 message(FATAL_ERROR "Error while patching a file")
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
67 endif()
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
68
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
69 # This patch is not needed anymore thanks to the following commit
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
70 # (information sent by Jorg Riesmeier on Twitter on 2017-07-19):
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
71 # http://git.dcmtk.org/?p=dcmtk.git;a=commit;h=8df1f5e517b8629ae09088d0935c2a8dd333c76f
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
72 message("Applying patch for speed in DCMTK 3.6.0")
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
73 execute_process(
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
74 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
75 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.0-speed.patch
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
76 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
77 RESULT_VARIABLE Failure
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
78 )
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
79
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
80 if (Failure)
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
81 message(FATAL_ERROR "Error while patching a file")
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
82 endif()
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
83
2500
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
84 else()
2502
de6eb6d0d34d comment
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2500
diff changeset
85 # "3.6.2 CXX11 fails on Linux; patch suggestions included"
de6eb6d0d34d comment
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2500
diff changeset
86 # https://forum.dcmtk.org/viewtopic.php?f=3&t=4637
de6eb6d0d34d comment
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2500
diff changeset
87 message("Applying patch to detect mathematic primitives in DCMTK 3.6.2 with C++11")
2500
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
88 execute_process(
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
89 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
90 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.2-cmath.patch
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
91 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
92 RESULT_VARIABLE Failure
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
93 )
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
94
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
95 if (Failure)
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
96 message(FATAL_ERROR "Error while patching a file")
3b802ac81a27 dcmtk-3.6.2-cmath.patch
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2454
diff changeset
97 endif()
2339
6e26d363dc53 USE_DCMTK_362_PRIVATE_DIC flag for cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2338
diff changeset
98 endif()
2356
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
99 else()
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
100 message("The patches for DCMTK have already been applied")
2152
cbebc5d072b0 Use of DCMTK 3.6.1 dictionary of private tags in standalone builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2150
diff changeset
101 endif()
cbebc5d072b0 Use of DCMTK 3.6.1 dictionary of private tags in standalone builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2150
diff changeset
102
2515
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
103
2523
21e2ed283cd5 fix wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2522
diff changeset
104 # C_CHAR_UNSIGNED *must* be set before calling "GenerateDCMTKConfigure.cmake"
1414
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1377
diff changeset
105 IF (CMAKE_CROSSCOMPILING)
2344
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
106 if (CMAKE_COMPILER_IS_GNUCXX AND
2508
91ee08d986f9 possibility to disable zlib support in the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2502
diff changeset
107 CMAKE_SYSTEM_NAME STREQUAL "Windows") # MinGW
2344
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
108 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.")
2508
91ee08d986f9 possibility to disable zlib support in the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2502
diff changeset
109
91ee08d986f9 possibility to disable zlib support in the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2502
diff changeset
110 elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or asm.js
2513
97a74f0eac7a loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2512
diff changeset
111
2515
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
112 # Check out "../WebAssembly/ArithmeticTests/" to regenerate the
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
113 # "arith.h" file
2510
04873915beaf configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2508
diff changeset
114 configure_file(
04873915beaf configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2508
diff changeset
115 ${ORTHANC_ROOT}/Resources/WebAssembly/arith.h
04873915beaf configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2508
diff changeset
116 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/arith.h
04873915beaf configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2508
diff changeset
117 COPYONLY)
2508
91ee08d986f9 possibility to disable zlib support in the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2502
diff changeset
118
2523
21e2ed283cd5 fix wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2522
diff changeset
119 UNSET(C_CHAR_UNSIGNED CACHE)
21e2ed283cd5 fix wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2522
diff changeset
120 SET(C_CHAR_UNSIGNED 0 CACHE INTERNAL "")
21e2ed283cd5 fix wasm
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2522
diff changeset
121
2344
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
122 else()
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
123 message(FATAL_ERROR "Support your platform here")
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
124 endif()
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
125 ENDIF()
2513
97a74f0eac7a loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2512
diff changeset
126
2344
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
127
2448
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
128 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
129 SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "")
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
130 SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "")
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
131
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
132 execute_process(
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
133 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
2454
4f2474079fbf fix relative path
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2448
diff changeset
134 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.2-linux-standard-base.patch
2448
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
135 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
136 RESULT_VARIABLE Failure
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
137 )
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
138
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
139 if (FirstRun AND Failure)
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
140 message(FATAL_ERROR "Error while patching a file")
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
141 endif()
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
142 endif()
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
143
1634
c095b0ddeea6 improvement
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
144 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR})
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
145 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
146 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
147
2515
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
148
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
149 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
150 # asm.js The macros below are not properly discovered by DCMTK
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
151 # when using WebAssembly. Check out "../WebAssembly/arith.h" for
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
152 # how we produced these values. This step MUST be after
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
153 # "GenerateDCMTKConfigure" and before the generation of
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
154 # "osconfig.h".
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
155 UNSET(SIZEOF_VOID_P CACHE)
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
156 UNSET(SIZEOF_CHAR CACHE)
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
157 UNSET(SIZEOF_DOUBLE CACHE)
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
158 UNSET(SIZEOF_FLOAT CACHE)
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
159 UNSET(SIZEOF_INT CACHE)
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
160 UNSET(SIZEOF_LONG CACHE)
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
161 UNSET(SIZEOF_SHORT CACHE)
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
162 UNSET(SIZEOF_VOID_P CACHE)
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
163
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
164 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "")
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
165 SET(SIZEOF_CHAR 1 CACHE INTERNAL "")
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
166 SET(SIZEOF_DOUBLE 8 CACHE INTERNAL "")
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
167 SET(SIZEOF_FLOAT 4 CACHE INTERNAL "")
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
168 SET(SIZEOF_INT 4 CACHE INTERNAL "")
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
169 SET(SIZEOF_LONG 4 CACHE INTERNAL "")
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
170 SET(SIZEOF_SHORT 2 CACHE INTERNAL "")
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
171 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "")
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
172 endif()
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
173
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
174
1149
dd6d7fd82da9 fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1057
diff changeset
175 set(DCMTK_PACKAGE_VERSION_SUFFIX "")
1634
c095b0ddeea6 improvement
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
176 set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_VERSION_NUMBER})
1149
dd6d7fd82da9 fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1057
diff changeset
177
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
178 CONFIGURE_FILE(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
179 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
180 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
181
2338
86a99fd1bbfb switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2297
diff changeset
182 if (NOT USE_DCMTK_360)
2344
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
183 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
184 link_libraries(netapi32) # For NetWkstaUserGetInfo@12
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
185 link_libraries(iphlpapi) # For GetAdaptersInfo@8
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
186
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
187 # Configure Wine if cross-compiling for Windows
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
188 if (CMAKE_COMPILER_IS_GNUCXX)
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
189 include(${DCMTK_SOURCES_DIR}/CMake/dcmtkUseWine.cmake)
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
190 FIND_PROGRAM(WINE_WINE_PROGRAM wine)
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
191 FIND_PROGRAM(WINE_WINEPATH_PROGRAM winepath)
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
192 list(APPEND DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=-static")
8a5c8af669cb fix for osx
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2341
diff changeset
193 endif()
2340
b5a04d983647 fix mingw build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2339
diff changeset
194 endif()
b5a04d983647 fix mingw build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2339
diff changeset
195
1951
01de36d949c3 Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1943
diff changeset
196 # This step must be after the generation of "osconfig.h"
2510
04873915beaf configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2508
diff changeset
197 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
04873915beaf configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2508
diff changeset
198 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES()
04873915beaf configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2508
diff changeset
199 endif()
1951
01de36d949c3 Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1943
diff changeset
200 endif()
01de36d949c3 Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1943
diff changeset
201
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
202 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
203 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
204
1914
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
205 if (ENABLE_DCMTK_NETWORKING)
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
206 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES)
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
207 include_directories(
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
208 ${DCMTK_SOURCES_DIR}/dcmnet/include
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
209 )
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
210 endif()
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
211
2380
96b3ec054b69 reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2376
diff changeset
212 if (ENABLE_DCMTK_JPEG)
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
213 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
214 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
215 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
216 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
217 include_directories(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
218 ${DCMTK_SOURCES_DIR}/dcmjpeg/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
219 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
220 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
221 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
222 ${DCMTK_SOURCES_DIR}/dcmimgle/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
223 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
224 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
225 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/ddpiimpl.cc
1914
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
226
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
227 # Disable support for encoding JPEG (modification in Orthanc 1.0.1)
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
228 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djcodece.cc
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
229 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencsv1.cc
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
230 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencbas.cc
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
231 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencpro.cc
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
232 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djenclol.cc
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
233 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencode.cc
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
234 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencext.cc
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
235 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencsps.cc
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
236 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
237 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
238
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
239
2380
96b3ec054b69 reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2376
diff changeset
240 if (ENABLE_DCMTK_JPEG_LOSSLESS)
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
241 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
242 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libcharls DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
243 include_directories(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
244 ${DCMTK_SOURCES_DIR}/dcmjpeg/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
245 ${DCMTK_SOURCES_DIR}/dcmjpls/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
246 ${DCMTK_SOURCES_DIR}/dcmjpls/libcharls
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
247 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
248 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
249 ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djcodece.cc
1914
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
250
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
251 # Disable support for encoding JPEG-LS (modification in Orthanc 1.0.1)
501769757bf9 flag to remove network support in dcmtk, removal of unneeded sources in static builds
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1883
diff changeset
252 ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djencode.cc
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
253 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
254 list(APPEND DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
255 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djrplol.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
256 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
257 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
258
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
259
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
260 # Source for the logging facility of DCMTK
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
261 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
262 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
930
27d256e0b458 integration mainline -> mac
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 928 929
diff changeset
263 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR
1337
afaa55d42ddd FreeBSD support
jodogne
parents: 1334
diff changeset
264 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
2364
ae50eccd41b7 compilation succeeds on OpenBSD
jodogne
parents: 2356
diff changeset
265 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR
2512
4dcafa8d6633 SystemToolbox::GenerateUuid moved to Toolbox::GenerateUuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2510
diff changeset
266 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" OR
4dcafa8d6633 SystemToolbox::GenerateUuid moved to Toolbox::GenerateUuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2510
diff changeset
267 ${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
268 list(REMOVE_ITEM DCMTK_SOURCES
1951
01de36d949c3 Possibility to use forthcoming DCMTK 3.6.1 in static builds (instead of 3.6.0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1943
diff changeset
269 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
270 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
271 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
272 )
1537
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
273
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
274 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
275 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
276 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc
2340
b5a04d983647 fix mingw build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2339
diff changeset
277 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
278 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
279
2356
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
280 if (CMAKE_COMPILER_IS_GNUCXX AND
7b3b82d426ed removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2344
diff changeset
281 USE_DCMTK_360)
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
282 # This is a patch for MinGW64
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
283 execute_process(
2448
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
284 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
862d943115f9 working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2384
diff changeset
285 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.0-mingw64.patch
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
286 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
1537
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
287 RESULT_VARIABLE Failure
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
288 )
1537
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
289
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
290 if (Failure AND FirstRun)
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
291 message(FATAL_ERROR "Error while patching a file")
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
292 endif()
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
293 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
294 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
295
2513
97a74f0eac7a loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2512
diff changeset
296
2522
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
297 if (NOT USE_DCMTK_360 AND
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
298 ORTHANC_SANDBOXED)
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
299 configure_file(
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
300 ${ORTHANC_ROOT}/Resources/WebAssembly/dcdict.h
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
301 ${DCMTK_SOURCES_DIR}/dcmdata/include/dcmtk/dcmdata/dcdict.h
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
302 COPYONLY)
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
303
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
304 configure_file(
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
305 ${ORTHANC_ROOT}/Resources/WebAssembly/dcdict.cc
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
306 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdict.cc
ce2dfba9417c fix build with dcmtk 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2515
diff changeset
307 COPYONLY)
2513
97a74f0eac7a loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2512
diff changeset
308 endif()
97a74f0eac7a loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2512
diff changeset
309
97a74f0eac7a loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2512
diff changeset
310
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
311 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
312 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
313 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
314 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
315
1149
dd6d7fd82da9 fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1057
diff changeset
316 #set_source_files_properties(${DCMTK_SOURCES}
dd6d7fd82da9 fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1057
diff changeset
317 # PROPERTIES COMPILE_DEFINITIONS
1636
8c4f1de71f8d improvement
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1634
diff changeset
318 # "PACKAGE_VERSION=\"${DCMTK_PACKAGE_VERSION}\";PACKAGE_VERSION_NUMBER=\"${DCMTK_VERSION_NUMBER}\"")
1149
dd6d7fd82da9 fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1057
diff changeset
319
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
320 # This fixes crashes related to the destruction of the DCMTK OFLogger
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
321 # http://support.dcmtk.org/docs-snapshot/file_macros.html
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
322 add_definitions(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
323 -DLOG4CPLUS_DISABLE_FATAL=1
1634
c095b0ddeea6 improvement
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
324 -DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER}
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
325 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
326
2928
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
327 if (NOT ENABLE_DCMTK_LOG)
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
328 # Disable logging internal to DCMTK
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
329 # https://groups.google.com/d/msg/orthanc-users/v2SzzAmY948/VxT1QVGiBAAJ
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
330 add_definitions(
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
331 -DDCMTK_LOG4CPLUS_DISABLE_FATAL=1
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
332 -DDCMTK_LOG4CPLUS_DISABLE_ERROR=1
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
333 -DDCMTK_LOG4CPLUS_DISABLE_WARN=1
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
334 -DDCMTK_LOG4CPLUS_DISABLE_INFO=1
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
335 -DDCMTK_LOG4CPLUS_DISABLE_DEBUG=1
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
336 )
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
337 endif()
85999ed092c5 New CMake option "ENABLE_DCMTK_LOG" to disable logging internal to DCMTK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2546
diff changeset
338
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
339 include_directories(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
340 #${DCMTK_SOURCES_DIR}
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
341 ${DCMTK_SOURCES_DIR}/config/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
342 ${DCMTK_SOURCES_DIR}/ofstd/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
343 ${DCMTK_SOURCES_DIR}/oflog/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
344 ${DCMTK_SOURCES_DIR}/dcmdata/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
345 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
346
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
347 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
348
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
349 set(DCMTK_BUNDLES_LOG4CPLUS 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
350
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
351 if (STANDALONE_BUILD)
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
352 set(DCMTK_USE_EMBEDDED_DICTIONARIES 1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
353 set(DCMTK_DICTIONARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
354 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
355 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
356 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
357 )
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
358 else()
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
359 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0)
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
360 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
361
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
362 else()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
363 # The following line allows to manually add libraries at the
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
364 # command-line, which is necessary for Ubuntu/Debian packages
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
365 set(tmp "${DCMTK_LIBRARIES}")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
366 include(FindDCMTK)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
367 list(APPEND DCMTK_LIBRARIES "${tmp}")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
368
1943
bc949ea71fe6 Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1914
diff changeset
369 include_directories(${DCMTK_INCLUDE_DIRS})
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
370
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
371 add_definitions(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
372 -DHAVE_CONFIG_H=1
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
373 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
374
1943
bc949ea71fe6 Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1914
diff changeset
375 if (EXISTS "${DCMTK_config_INCLUDE_DIR}/cfunix.h")
bc949ea71fe6 Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1914
diff changeset
376 set(DCMTK_CONFIGURATION_FILE "${DCMTK_config_INCLUDE_DIR}/cfunix.h")
bc949ea71fe6 Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1914
diff changeset
377 elseif (EXISTS "${DCMTK_config_INCLUDE_DIR}/osconfig.h") # This is for Arch Linux
bc949ea71fe6 Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1914
diff changeset
378 set(DCMTK_CONFIGURATION_FILE "${DCMTK_config_INCLUDE_DIR}/osconfig.h")
2287
9f3414878c02 Fix Debian #865606 (orthanc FTBFS with libdcmtk-dev 3.6.1~20170228-2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2193
diff changeset
379 elseif (EXISTS "${DCMTK_INCLUDE_DIRS}/dcmtk/config/osconfig.h") # This is for Debian Buster
9f3414878c02 Fix Debian #865606 (orthanc FTBFS with libdcmtk-dev 3.6.1~20170228-2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2193
diff changeset
380 set(DCMTK_CONFIGURATION_FILE "${DCMTK_INCLUDE_DIRS}/dcmtk/config/osconfig.h")
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
381 else()
1883
71356f41ec2f additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
382 message(FATAL_ERROR "Please install libdcmtk*-dev")
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
383 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
384
2287
9f3414878c02 Fix Debian #865606 (orthanc FTBFS with libdcmtk-dev 3.6.1~20170228-2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2193
diff changeset
385 message("DCMTK configuration file: ${DCMTK_CONFIGURATION_FILE}")
9f3414878c02 Fix Debian #865606 (orthanc FTBFS with libdcmtk-dev 3.6.1~20170228-2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2193
diff changeset
386
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
387 # Autodetection of the version of DCMTK
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
388 file(STRINGS
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
389 "${DCMTK_CONFIGURATION_FILE}"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
390 DCMTK_VERSION_NUMBER1 REGEX
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
391 ".*PACKAGE_VERSION .*")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
392
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
393 string(REGEX REPLACE
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
394 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
395 "\\1\\2\\3"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
396 DCMTK_VERSION_NUMBER
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
397 ${DCMTK_VERSION_NUMBER1})
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
398
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
399 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
400 endif()
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
401
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
402
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
403 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER})
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
404 message("DCMTK version: ${DCMTK_VERSION_NUMBER}")
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
405
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
406
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
407 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=${DCMTK_USE_EMBEDDED_DICTIONARIES})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
408 if (NOT DCMTK_USE_EMBEDDED_DICTIONARIES)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
409 # Lookup for DICOM dictionaries, if none is specified by the user
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
410 if (DCMTK_DICTIONARY_DIR STREQUAL "")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
411 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
412 /usr/share/dcmtk
1883
71356f41ec2f additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
413 /usr/share/libdcmtk1
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
414 /usr/share/libdcmtk2
1883
71356f41ec2f additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
415 /usr/share/libdcmtk3
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
416 /usr/share/libdcmtk4
1883
71356f41ec2f additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
417 /usr/share/libdcmtk5
71356f41ec2f additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1846
diff changeset
418 /usr/share/libdcmtk6
2064
e92280e63d8d fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1951
diff changeset
419 /usr/share/libdcmtk7
e92280e63d8d fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1951
diff changeset
420 /usr/share/libdcmtk8
e92280e63d8d fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1951
diff changeset
421 /usr/share/libdcmtk9
2288
c6772af6dea3 fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2287
diff changeset
422 /usr/share/libdcmtk10
c6772af6dea3 fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2287
diff changeset
423 /usr/share/libdcmtk11
c6772af6dea3 fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2287
diff changeset
424 /usr/share/libdcmtk12
c6772af6dea3 fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2287
diff changeset
425 /usr/share/libdcmtk13
c6772af6dea3 fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2287
diff changeset
426 /usr/share/libdcmtk14
c6772af6dea3 fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2287
diff changeset
427 /usr/share/libdcmtk15
c6772af6dea3 fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2287
diff changeset
428 /usr/share/libdcmtk16
2515
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
429 /usr/share/libdcmtk17
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
430 /usr/share/libdcmtk18
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
431 /usr/share/libdcmtk19
7c8a246e8652 fix WebAssembly build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2513
diff changeset
432 /usr/share/libdcmtk20
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
433 /usr/local/share/dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
434 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
435
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
436 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
437 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
438 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
439
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
440 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
441 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
442 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
443 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
444 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
445 endif()