Mercurial > hg > orthanc
annotate Resources/CMake/DcmtkConfiguration.cmake @ 2514:38d666a40860
fix msvc
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 29 Mar 2018 08:55:32 +0200 |
parents | 97a74f0eac7a |
children | 7c8a246e8652 |
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 | 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 | 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 | 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 | 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 | 85 # "3.6.2 CXX11 fails on Linux; patch suggestions included" |
86 # https://forum.dcmtk.org/viewtopic.php?f=3&t=4637 | |
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 |
1414 | 103 IF (CMAKE_CROSSCOMPILING) |
2344 | 104 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
|
105 CMAKE_SYSTEM_NAME STREQUAL "Windows") # MinGW |
2344 | 106 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
|
107 |
91ee08d986f9
possibility to disable zlib support in the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2502
diff
changeset
|
108 elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or asm.js |
2510
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
109 # Check out "../WebAssembly/arith.h" |
2513
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
110 UNSET(SIZEOF_VOID_P CACHE) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
111 UNSET(SIZEOF_CHAR CACHE) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
112 UNSET(SIZEOF_DOUBLE CACHE) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
113 UNSET(SIZEOF_FLOAT CACHE) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
114 UNSET(SIZEOF_INT CACHE) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
115 UNSET(SIZEOF_LONG CACHE) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
116 UNSET(SIZEOF_SHORT CACHE) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
117 UNSET(SIZEOF_VOID_P CACHE) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
118 UNSET(C_CHAR_UNSIGNED CACHE) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
119 |
2510
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
120 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "") |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
121 SET(SIZEOF_CHAR 1 CACHE INTERNAL "") |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
122 SET(SIZEOF_DOUBLE 8 CACHE INTERNAL "") |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
123 SET(SIZEOF_FLOAT 4 CACHE INTERNAL "") |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
124 SET(SIZEOF_INT 4 CACHE INTERNAL "") |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
125 SET(SIZEOF_LONG 4 CACHE INTERNAL "") |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
126 SET(SIZEOF_SHORT 2 CACHE INTERNAL "") |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
127 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "") |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
128 SET(C_CHAR_UNSIGNED 0 CACHE INTERNAL "") |
2513
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
129 |
2510
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
130 configure_file( |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
131 ${ORTHANC_ROOT}/Resources/WebAssembly/arith.h |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
132 ${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
|
133 COPYONLY) |
2508
91ee08d986f9
possibility to disable zlib support in the Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2502
diff
changeset
|
134 |
2344 | 135 else() |
136 message(FATAL_ERROR "Support your platform here") | |
137 endif() | |
929 | 138 ENDIF() |
2513
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
139 |
2344 | 140 |
2448
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
141 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
142 SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "") |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
143 SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "") |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
144 |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
145 execute_process( |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
146 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
2454 | 147 ${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
|
148 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
149 RESULT_VARIABLE Failure |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
150 ) |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
151 |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
152 if (FirstRun AND Failure) |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
153 message(FATAL_ERROR "Error while patching a file") |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
154 endif() |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
155 endif() |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
156 |
1634 | 157 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR}) |
929 | 158 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) |
159 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) | |
160 | |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
161 set(DCMTK_PACKAGE_VERSION_SUFFIX "") |
1634 | 162 set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_VERSION_NUMBER}) |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
163 |
929 | 164 CONFIGURE_FILE( |
165 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in | |
166 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) | |
167 | |
2338
86a99fd1bbfb
switch to just-released dcmtk 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2297
diff
changeset
|
168 if (NOT USE_DCMTK_360) |
2344 | 169 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
170 link_libraries(netapi32) # For NetWkstaUserGetInfo@12 | |
171 link_libraries(iphlpapi) # For GetAdaptersInfo@8 | |
172 | |
173 # Configure Wine if cross-compiling for Windows | |
174 if (CMAKE_COMPILER_IS_GNUCXX) | |
175 include(${DCMTK_SOURCES_DIR}/CMake/dcmtkUseWine.cmake) | |
176 FIND_PROGRAM(WINE_WINE_PROGRAM wine) | |
177 FIND_PROGRAM(WINE_WINEPATH_PROGRAM winepath) | |
178 list(APPEND DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=-static") | |
179 endif() | |
2340 | 180 endif() |
181 | |
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
|
182 # 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
|
183 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
184 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES() |
04873915beaf
configuration of DCMTK for WebAssembly
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2508
diff
changeset
|
185 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
|
186 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
|
187 |
929 | 188 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES) |
189 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES) | |
190 | |
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
|
191 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
|
192 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
|
193 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
|
194 ${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
|
195 ) |
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
|
196 endif() |
929 | 197 |
2380
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2376
diff
changeset
|
198 if (ENABLE_DCMTK_JPEG) |
929 | 199 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc DCMTK_SOURCES) |
200 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 DCMTK_SOURCES) | |
201 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 DCMTK_SOURCES) | |
202 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 DCMTK_SOURCES) | |
203 include_directories( | |
204 ${DCMTK_SOURCES_DIR}/dcmjpeg/include | |
205 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 | |
206 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 | |
207 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 | |
208 ${DCMTK_SOURCES_DIR}/dcmimgle/include | |
209 ) | |
210 list(REMOVE_ITEM DCMTK_SOURCES | |
211 ${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
|
212 |
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
|
213 # 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
|
214 ${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
|
215 ${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
|
216 ${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
|
217 ${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
|
218 ${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
|
219 ${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
|
220 ${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
|
221 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djencsps.cc |
929 | 222 ) |
223 endif() | |
224 | |
225 | |
2380
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2376
diff
changeset
|
226 if (ENABLE_DCMTK_JPEG_LOSSLESS) |
929 | 227 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libsrc DCMTK_SOURCES) |
228 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libcharls DCMTK_SOURCES) | |
229 include_directories( | |
230 ${DCMTK_SOURCES_DIR}/dcmjpeg/include | |
231 ${DCMTK_SOURCES_DIR}/dcmjpls/include | |
232 ${DCMTK_SOURCES_DIR}/dcmjpls/libcharls | |
233 ) | |
234 list(REMOVE_ITEM DCMTK_SOURCES | |
235 ${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
|
236 |
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
|
237 # 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
|
238 ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djencode.cc |
929 | 239 ) |
240 list(APPEND DCMTK_SOURCES | |
241 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djrplol.cc | |
242 ) | |
243 endif() | |
244 | |
245 | |
246 # Source for the logging facility of DCMTK | |
247 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES) | |
248 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR | |
930 | 249 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
1337 | 250 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
2364 | 251 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR |
2512
4dcafa8d6633
SystemToolbox::GenerateUuid moved to Toolbox::GenerateUuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2510
diff
changeset
|
252 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" OR |
4dcafa8d6633
SystemToolbox::GenerateUuid moved to Toolbox::GenerateUuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2510
diff
changeset
|
253 ${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten") |
929 | 254 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
|
255 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
929 | 256 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc |
257 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc | |
258 ) | |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
259 |
929 | 260 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
261 list(REMOVE_ITEM DCMTK_SOURCES | |
262 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc | |
2340 | 263 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
929 | 264 ) |
265 | |
2356
7b3b82d426ed
removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2344
diff
changeset
|
266 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
|
267 DCMTK_PATCH_MINGW64 AND |
7b3b82d426ed
removal of unneeded patch for speed in DCMTK 3.6.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2344
diff
changeset
|
268 USE_DCMTK_360) |
929 | 269 # This is a patch for MinGW64 |
270 execute_process( | |
2448
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
271 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
862d943115f9
working on linux standard base
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
272 ${ORTHANC_ROOT}/Resources/Patches/dcmtk-3.6.0-mingw64.patch |
929 | 273 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
274 RESULT_VARIABLE Failure |
929 | 275 ) |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
276 |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
277 if (Failure AND FirstRun) |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
278 message(FATAL_ERROR "Error while patching a file") |
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1415
diff
changeset
|
279 endif() |
929 | 280 endif() |
281 endif() | |
282 | |
2513
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
283 |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
284 if (USE_DCMTK_360) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
285 # Removing this file is required with DCMTK 3.6.0 |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
286 list(REMOVE_ITEM DCMTK_SOURCES |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
287 |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
288 ) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
289 else() |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
290 if (ORTHANC_SANDBOXED) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
291 configure_file( |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
292 ${ORTHANC_ROOT}/Resources/WebAssembly/dcdict.h |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
293 ${DCMTK_SOURCES_DIR}/dcmdata/include/dcmtk/dcmdata/dcdict.h |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
294 COPYONLY) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
295 |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
296 configure_file( |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
297 ${ORTHANC_ROOT}/Resources/WebAssembly/dcdict.cc |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
298 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdict.cc |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
299 COPYONLY) |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
300 endif() |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
301 endif() |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
302 |
97a74f0eac7a
loading DICOM dictionaries in sandboxed environments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2512
diff
changeset
|
303 |
929 | 304 list(REMOVE_ITEM DCMTK_SOURCES |
305 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc | |
306 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc | |
307 ) | |
308 | |
1149
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
309 #set_source_files_properties(${DCMTK_SOURCES} |
dd6d7fd82da9
fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1057
diff
changeset
|
310 # PROPERTIES COMPILE_DEFINITIONS |
1636 | 311 # "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
|
312 |
929 | 313 # This fixes crashes related to the destruction of the DCMTK OFLogger |
314 # http://support.dcmtk.org/docs-snapshot/file_macros.html | |
315 add_definitions( | |
316 -DLOG4CPLUS_DISABLE_FATAL=1 | |
1634 | 317 -DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER} |
929 | 318 ) |
319 | |
320 include_directories( | |
321 #${DCMTK_SOURCES_DIR} | |
322 ${DCMTK_SOURCES_DIR}/config/include | |
323 ${DCMTK_SOURCES_DIR}/ofstd/include | |
324 ${DCMTK_SOURCES_DIR}/oflog/include | |
325 ${DCMTK_SOURCES_DIR}/dcmdata/include | |
326 ) | |
327 | |
328 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*) | |
329 | |
330 set(DCMTK_BUNDLES_LOG4CPLUS 1) | |
331 | |
332 if (STANDALONE_BUILD) | |
1770 | 333 set(DCMTK_USE_EMBEDDED_DICTIONARIES 1) |
334 set(DCMTK_DICTIONARIES | |
335 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic | |
336 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic | |
337 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic | |
338 ) | |
929 | 339 else() |
1770 | 340 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0) |
929 | 341 endif() |
342 | |
343 else() | |
344 # The following line allows to manually add libraries at the | |
345 # command-line, which is necessary for Ubuntu/Debian packages | |
346 set(tmp "${DCMTK_LIBRARIES}") | |
347 include(FindDCMTK) | |
348 list(APPEND DCMTK_LIBRARIES "${tmp}") | |
349 | |
1943
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
350 include_directories(${DCMTK_INCLUDE_DIRS}) |
929 | 351 |
352 add_definitions( | |
353 -DHAVE_CONFIG_H=1 | |
354 ) | |
355 | |
1943
bc949ea71fe6
Fix of Debian bug #818512 ("FTBFS: Please install libdcmtk*-dev")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1914
diff
changeset
|
356 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
|
357 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
|
358 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
|
359 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
|
360 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
|
361 set(DCMTK_CONFIGURATION_FILE "${DCMTK_INCLUDE_DIRS}/dcmtk/config/osconfig.h") |
929 | 362 else() |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
363 message(FATAL_ERROR "Please install libdcmtk*-dev") |
929 | 364 endif() |
365 | |
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
|
366 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
|
367 |
929 | 368 # Autodetection of the version of DCMTK |
369 file(STRINGS | |
370 "${DCMTK_CONFIGURATION_FILE}" | |
371 DCMTK_VERSION_NUMBER1 REGEX | |
372 ".*PACKAGE_VERSION .*") | |
373 | |
374 string(REGEX REPLACE | |
375 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$" | |
376 "\\1\\2\\3" | |
377 DCMTK_VERSION_NUMBER | |
378 ${DCMTK_VERSION_NUMBER1}) | |
379 | |
1770 | 380 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0) |
381 endif() | |
929 | 382 |
383 | |
384 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER}) | |
385 message("DCMTK version: ${DCMTK_VERSION_NUMBER}") | |
1770 | 386 |
387 | |
388 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=${DCMTK_USE_EMBEDDED_DICTIONARIES}) | |
389 if (NOT DCMTK_USE_EMBEDDED_DICTIONARIES) | |
390 # Lookup for DICOM dictionaries, if none is specified by the user | |
391 if (DCMTK_DICTIONARY_DIR STREQUAL "") | |
392 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic | |
393 /usr/share/dcmtk | |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
394 /usr/share/libdcmtk1 |
1770 | 395 /usr/share/libdcmtk2 |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
396 /usr/share/libdcmtk3 |
1770 | 397 /usr/share/libdcmtk4 |
1883
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
398 /usr/share/libdcmtk5 |
71356f41ec2f
additional locations for dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1846
diff
changeset
|
399 /usr/share/libdcmtk6 |
2064
e92280e63d8d
fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1951
diff
changeset
|
400 /usr/share/libdcmtk7 |
e92280e63d8d
fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1951
diff
changeset
|
401 /usr/share/libdcmtk8 |
e92280e63d8d
fix Debian #829608
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1951
diff
changeset
|
402 /usr/share/libdcmtk9 |
2288
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
403 /usr/share/libdcmtk10 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
404 /usr/share/libdcmtk11 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
405 /usr/share/libdcmtk12 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
406 /usr/share/libdcmtk13 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
407 /usr/share/libdcmtk14 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
408 /usr/share/libdcmtk15 |
c6772af6dea3
fix to find DICOM dictionaries in Debian Butter
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2287
diff
changeset
|
409 /usr/share/libdcmtk16 |
1770 | 410 /usr/local/share/dcmtk |
411 ) | |
412 | |
413 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND") | |
414 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system") | |
415 endif() | |
416 | |
417 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}") | |
418 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}") | |
419 else() | |
420 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}") | |
421 endif() | |
422 endif() |