annotate OrthancFramework/Resources/CMake/DcmtkConfigurationStatic-3.6.6.cmake @ 4899:3ab57510f6dd proto-filter-instance-returning-error-code

integration mainline->proto-filter-instance-returning-error-code
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 20 Feb 2022 12:59:30 +0100
parents 43e613a7756b
children 0ea402b4d901
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4470
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 # Orthanc - A Lightweight, RESTful DICOM Store
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 # Department, University Hospital of Liege, Belgium
4870
43e613a7756b upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4831
diff changeset
4 # Copyright (C) 2017-2022 Osimis S.A., Belgium
43e613a7756b upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4831
diff changeset
5 # Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
4470
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 #
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 # This program is free software: you can redistribute it and/or
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 # modify it under the terms of the GNU Lesser General Public License
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 # as published by the Free Software Foundation, either version 3 of
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 # the License, or (at your option) any later version.
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 #
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful, but
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 # Lesser General Public License for more details.
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 #
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 # You should have received a copy of the GNU Lesser General Public
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 # License along with this program. If not, see
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 # <http://www.gnu.org/licenses/>.
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 SET(DCMTK_VERSION_NUMBER 366)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 SET(DCMTK_PACKAGE_VERSION "3.6.6")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.6)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 SET(DCMTK_URL "http://orthanc.osimis.io/ThirdPartyDownloads/dcmtk-3.6.6.tar.gz")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 SET(DCMTK_MD5 "f815879d315b916366a9da71339c7575")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 macro(DCMTK_UNSET)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 endmacro()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 macro(DCMTK_UNSET_CACHE)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 endmacro()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 set(DCMTK_BINARY_DIR ${DCMTK_SOURCES_DIR}/)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 set(DCMTK_WITH_THREADS OFF) # Disable thread support in wasm/asm.js
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 else()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 set(DCMTK_WITH_THREADS ON)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 set(FirstRun OFF)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 else()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 set(FirstRun ON)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 if (FirstRun)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 # Apply the patches
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 execute_process(
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-3.6.6.patch
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 RESULT_VARIABLE Failure
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 )
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 if (Failure)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 message(FATAL_ERROR "Error while patching a file")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 configure_file(
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 ${CMAKE_CURRENT_LIST_DIR}/../Patches/dcmtk-dcdict_orthanc.cc
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdict_orthanc.cc
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 COPYONLY)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 else()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 message("The patches for DCMTK have already been applied")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 include_directories(
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 ${DCMTK_SOURCES_DIR}/dcmiod/include
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 )
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 # C_CHAR_UNSIGNED *must* be set before calling "GenerateDCMTKConfigure.cmake"
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 IF (CMAKE_CROSSCOMPILING)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 if (CMAKE_COMPILER_IS_GNUCXX AND
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 CMAKE_SYSTEM_NAME STREQUAL "Windows") # MinGW
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or asm.js
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 # Check out "../WebAssembly/ArithmeticTests/" to regenerate the
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 # "arith.h" file
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 configure_file(
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 ${CMAKE_CURRENT_LIST_DIR}/WebAssembly/arith.h
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/arith.h
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 COPYONLY)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 UNSET(C_CHAR_UNSIGNED CACHE)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 SET(C_CHAR_UNSIGNED 0 CACHE INTERNAL "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 else()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 message(FATAL_ERROR "Support your platform here")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 ENDIF()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 SET(DCMTK_ENABLE_CHARSET_CONVERSION "iconv" CACHE STRING "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 SET(HAVE_SYS_GETTID 0 CACHE INTERNAL "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR})
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # WebAssembly or
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 # asm.js The macros below are not properly discovered by DCMTK
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 # when using WebAssembly. Check out "../WebAssembly/arith.h" for
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 # how we produced these values. This step MUST be after
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 # "GenerateDCMTKConfigure" and before the generation of
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 # "osconfig.h".
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 UNSET(SIZEOF_VOID_P CACHE)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 UNSET(SIZEOF_CHAR CACHE)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 UNSET(SIZEOF_DOUBLE CACHE)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 UNSET(SIZEOF_FLOAT CACHE)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 UNSET(SIZEOF_INT CACHE)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 UNSET(SIZEOF_LONG CACHE)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 UNSET(SIZEOF_SHORT CACHE)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 UNSET(SIZEOF_VOID_P CACHE)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 SET(SIZEOF_CHAR 1 CACHE INTERNAL "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 SET(SIZEOF_DOUBLE 8 CACHE INTERNAL "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 SET(SIZEOF_FLOAT 4 CACHE INTERNAL "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 SET(SIZEOF_INT 4 CACHE INTERNAL "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 SET(SIZEOF_LONG 4 CACHE INTERNAL "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 SET(SIZEOF_SHORT 2 CACHE INTERNAL "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 SET(SIZEOF_VOID_P 4 CACHE INTERNAL "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 set(DCMTK_PACKAGE_VERSION_SUFFIX "")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_VERSION_NUMBER})
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 CONFIGURE_FILE(
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 link_libraries(netapi32) # For NetWkstaUserGetInfo@12
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 link_libraries(iphlpapi) # For GetAdaptersInfo@8
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 # Configure Wine if cross-compiling for Windows
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 if (CMAKE_COMPILER_IS_GNUCXX)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 include(${DCMTK_SOURCES_DIR}/CMake/dcmtkUseWine.cmake)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 FIND_PROGRAM(WINE_WINE_PROGRAM wine)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 FIND_PROGRAM(WINE_WINEPATH_PROGRAM winepath)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 list(APPEND DCMTK_TRY_COMPILE_REQUIRED_CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=-static")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 # This step must be after the generation of "osconfig.h"
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 # Source for the logging facility of DCMTK
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" OR
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 ${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 list(REMOVE_ITEM DCMTK_SOURCES
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 )
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 list(REMOVE_ITEM DCMTK_SOURCES
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 )
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 # Starting with DCMTK 3.6.2, the Nagle algorithm is not disabled by
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 # default since this does not seem to be appropriate (anymore) for
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 # most modern operating systems. In order to change this default, the
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 # environment variable NO_TCPDELAY can be set to "1" (see envvars.txt
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 # for details). Alternatively, the macro DISABLE_NAGLE_ALGORITHM can
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 # be defined to change this setting at compilation time (see
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 # macros.txt for details).
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 # https://forum.dcmtk.org/viewtopic.php?t=4632
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 add_definitions(
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 -DDISABLE_NAGLE_ALGORITHM=1
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 )
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 # For compatibility with Windows XP, avoid using fiber-local-storage
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 # in log4cplus, but use thread-local-storage instead. Otherwise,
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 # Windows XP complains about missing "FlsGetValue()" in KERNEL32.dll
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 add_definitions(
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 -DDCMTK_LOG4CPLUS_AVOID_WIN32_FLS
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 )
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 if (CMAKE_COMPILER_IS_GNUCXX OR # MinGW
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 "${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") # MSVC for 32bit (*)
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 # (*) With multithreaded logging enabled, Visual Studio 2008 fails
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 # with error: ".\dcmtk-3.6.6\oflog\libsrc\globinit.cc(422) : error
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 # C2664: 'dcmtk::log4cplus::thread::impl::tls_init' : cannot
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 # convert parameter 1 from 'void (__stdcall *)(void *)' to
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 # 'dcmtk::log4cplus::thread::impl::tls_init_cleanup_func_type'"
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 # None of the functions with this name in scope match the target type
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 add_definitions(
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 -DDCMTK_LOG4CPLUS_SINGLE_THREADED
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 )
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 endif()
06d164d8a0fd upgrade to dcmtk 3.6.6
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 endif()