Mercurial > hg > orthanc
annotate OrthancFramework/Resources/CMake/DcmtkConfigurationStatic-3.6.2.cmake @ 5666:aa231c18b9d2 find-refactoring
adding computed tags
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 04 Jul 2024 18:31:54 +0200 |
parents | f7adfb22e20e |
children |
rev | line source |
---|---|
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
5640
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
4 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5434
diff
changeset
|
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
7 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
8 # This program is free software: you can redistribute it and/or |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
9 # modify it under the terms of the GNU Lesser General Public License |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
10 # as published by the Free Software Foundation, either version 3 of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
11 # the License, or (at your option) any later version. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
12 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
13 # This program is distributed in the hope that it will be useful, but |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
14 # WITHOUT ANY WARRANTY; without even the implied warranty of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
16 # Lesser General Public License for more details. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
17 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
18 # You should have received a copy of the GNU Lesser General Public |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
19 # License along with this program. If not, see |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
20 # <http://www.gnu.org/licenses/>. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
21 |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
22 |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 SET(DCMTK_VERSION_NUMBER 362) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 SET(DCMTK_PACKAGE_VERSION "3.6.2") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.2) |
5434
aa1c09fa6632
changed location of third-party downloads
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5271
diff
changeset
|
26 SET(DCMTK_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/dcmtk-3.6.2.tar.gz") |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 SET(DCMTK_MD5 "d219a4152772985191c9b89d75302d12") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 macro(DCMTK_UNSET) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 endmacro() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 macro(DCMTK_UNSET_CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 endmacro() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 set(DCMTK_BINARY_DIR ${DCMTK_SOURCES_DIR}/) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/) |
3594
0654d0838de8
disable thread support in DCMTK if wasm/asm.js
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3593
diff
changeset
|
37 |
0654d0838de8
disable thread support in DCMTK if wasm/asm.js
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3593
diff
changeset
|
38 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
0654d0838de8
disable thread support in DCMTK if wasm/asm.js
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3593
diff
changeset
|
39 set(DCMTK_WITH_THREADS OFF) # Disable thread support in wasm/asm.js |
0654d0838de8
disable thread support in DCMTK if wasm/asm.js
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3593
diff
changeset
|
40 else() |
0654d0838de8
disable thread support in DCMTK if wasm/asm.js
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3593
diff
changeset
|
41 set(DCMTK_WITH_THREADS ON) |
0654d0838de8
disable thread support in DCMTK if wasm/asm.js
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3593
diff
changeset
|
42 endif() |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 set(FirstRun OFF) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 else() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 set(FirstRun ON) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 if (FirstRun) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 # "3.6.2 CXX11 fails on Linux; patch suggestions included" |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 # https://forum.dcmtk.org/viewtopic.php?f=3&t=4637 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 message("Applying patch to detect mathematic primitives in DCMTK 3.6.2 with C++11") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 execute_process( |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
4045 | 61 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.2.patch |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 RESULT_VARIABLE Failure |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 ) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 if (Failure) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 message(FATAL_ERROR "Error while patching a file") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 endif() |
3593
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
69 |
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
70 configure_file( |
4045 | 71 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-dcdict_orthanc.cc |
3593
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
72 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdict_orthanc.cc |
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
73 COPYONLY) |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 else() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 message("The patches for DCMTK have already been applied") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 # C_CHAR_UNSIGNED *must* be set before calling "GenerateDCMTKConfigure.cmake" |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 IF (CMAKE_CROSSCOMPILING) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 if (CMAKE_COMPILER_IS_GNUCXX AND |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 CMAKE_SYSTEM_NAME STREQUAL "Windows") # MinGW |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or asm.js |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 # Check out "../WebAssembly/ArithmeticTests/" to regenerate the |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 # "arith.h" file |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 configure_file( |
4045 | 90 ${CMAKE_CURRENT_LIST_DIR}/WebAssembly/arith.h |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/arith.h |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 COPYONLY) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 UNSET(C_CHAR_UNSIGNED CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 SET(C_CHAR_UNSIGNED 0 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 else() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 message(FATAL_ERROR "Support your platform here") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 ENDIF() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 |
3593
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
107 if (FirstRun) |
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
108 execute_process( |
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
109 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
4045 | 110 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.2-linux-standard-base.patch |
3593
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
111 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
112 RESULT_VARIABLE Failure |
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
113 ) |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 |
3593
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
115 if (Failure) |
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
116 message(FATAL_ERROR "Error while patching a file") |
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
117 endif() |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 |
3593
0301f59450fe
improved the patch for loading DICOM dictionary from memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3316
diff
changeset
|
121 |
3274
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR}) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 # asm.js The macros below are not properly discovered by DCMTK |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 # when using WebAssembly. Check out "../WebAssembly/arith.h" for |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 # how we produced these values. This step MUST be after |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 # "GenerateDCMTKConfigure" and before the generation of |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 # "osconfig.h". |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 UNSET(SIZEOF_VOID_P CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 UNSET(SIZEOF_CHAR CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 UNSET(SIZEOF_DOUBLE CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 UNSET(SIZEOF_FLOAT CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 UNSET(SIZEOF_INT CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 UNSET(SIZEOF_LONG CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 UNSET(SIZEOF_SHORT CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 UNSET(SIZEOF_VOID_P CACHE) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 SET(SIZEOF_CHAR 1 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 SET(SIZEOF_DOUBLE 8 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 SET(SIZEOF_FLOAT 4 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 SET(SIZEOF_INT 4 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 SET(SIZEOF_LONG 4 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 SET(SIZEOF_SHORT 2 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 set(DCMTK_PACKAGE_VERSION_SUFFIX "") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_VERSION_NUMBER}) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 CONFIGURE_FILE( |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 link_libraries(netapi32) # For NetWkstaUserGetInfo@12 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 link_libraries(iphlpapi) # For GetAdaptersInfo@8 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 # Configure Wine if cross-compiling for Windows |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 if (CMAKE_COMPILER_IS_GNUCXX) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 include(${DCMTK_SOURCES_DIR}/CMake/dcmtkUseWine.cmake) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 FIND_PROGRAM(WINE_WINE_PROGRAM wine) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 FIND_PROGRAM(WINE_WINEPATH_PROGRAM winepath) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 list(APPEND DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=-static") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 # This step must be after the generation of "osconfig.h" |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 # Source for the logging facility of DCMTK |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" OR |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 ${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 list(REMOVE_ITEM DCMTK_SOURCES |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 ) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 list(REMOVE_ITEM DCMTK_SOURCES |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
197 ) |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 endif() |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
199 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
200 |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
201 #set_source_files_properties(${DCMTK_SOURCES} |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
202 # PROPERTIES COMPILE_DEFINITIONS |
95b0536be2c3
preparing for dcmtk 3.6.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
203 # "PACKAGE_VERSION=\"${DCMTK_PACKAGE_VERSION}\";PACKAGE_VERSION_NUMBER=\"${DCMTK_VERSION_NUMBER}\"") |
3316
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
204 |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
205 |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
206 # Starting with DCMTK 3.6.2, the Nagle algorithm is not disabled by |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
207 # default since this does not seem to be appropriate (anymore) for |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
208 # most modern operating systems. In order to change this default, the |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
209 # environment variable NO_TCPDELAY can be set to "1" (see envvars.txt |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
210 # for details). Alternatively, the macro DISABLE_NAGLE_ALGORITHM can |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
211 # be defined to change this setting at compilation time (see |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
212 # macros.txt for details). |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
213 # https://forum.dcmtk.org/viewtopic.php?t=4632 |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
214 add_definitions( |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
215 -DDISABLE_NAGLE_ALGORITHM=1 |
4b1017928fc4
Fix performance issue in DICOM protocol by disabling Nagle's algorithm
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3279
diff
changeset
|
216 ) |