annotate Resources/CMake/DcmtkConfiguration.cmake @ 1858:483f26479743 dcmtk-3.6.1

update to latest dcmtk snapshot
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Dec 2015 10:05:45 +0100
parents 4f2386d0f326
children 7bef560b9782
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
1 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
1633
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
2 SET(DCMTK_VERSION_NUMBER 361)
1857
4f2386d0f326 integration mainline->dcmtk-3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1785 1846
diff changeset
3 SET(DCMTK_PACKAGE_VERSION "3.6.1")
1858
483f26479743 update to latest dcmtk snapshot
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1857
diff changeset
4 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.1_20150924)
483f26479743 update to latest dcmtk snapshot
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1857
diff changeset
5 SET(DCMTK_URL "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.1_20150924.tar.gz")
483f26479743 update to latest dcmtk snapshot
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1857
diff changeset
6 SET(DCMTK_MD5 "0d60ea9e1c886124fe45122855cecd30")
1537
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
7
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
8 if (IS_DIRECTORY "${DCMTK_SOURCES_DIR}")
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
9 set(FirstRun OFF)
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
10 else()
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
11 set(FirstRun ON)
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
12 endif()
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
13
1633
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
14 # Definitions for DCMTK 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
15 macro(DCMTK_UNSET)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
16 endmacro()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
17
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
18 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/)
1638
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
19 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1)
1633
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
20 # End
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
21
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
22
1537
fbf763bb1fa3 error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1415
diff changeset
23 DownloadPackage(${DCMTK_MD5} ${DCMTK_URL} "${DCMTK_SOURCES_DIR}")
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
24
1414
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1377
diff changeset
25 IF (CMAKE_CROSSCOMPILING)
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
26 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
27 ENDIF()
1634
c095b0ddeea6 improvement
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
28 SET(DCMTK_SOURCE_DIR ${DCMTK_SOURCES_DIR})
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
29 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
30 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
31
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
32 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
33 set(HAVE_SSTREAM 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
34 set(HAVE_PROTOTYPE_BZERO 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
35 set(HAVE_PROTOTYPE_GETHOSTNAME 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
36 set(HAVE_PROTOTYPE_GETSOCKOPT 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
37 set(HAVE_PROTOTYPE_SETSOCKOPT 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
38 set(HAVE_PROTOTYPE_CONNECT 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
39 set(HAVE_PROTOTYPE_BIND 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
40 set(HAVE_PROTOTYPE_ACCEPT 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
41 set(HAVE_PROTOTYPE_SETSOCKNAME 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
42 set(HAVE_PROTOTYPE_GETSOCKNAME 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
43 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
44
1149
dd6d7fd82da9 fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1057
diff changeset
45 set(DCMTK_PACKAGE_VERSION_SUFFIX "")
1634
c095b0ddeea6 improvement
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
46 set(DCMTK_PACKAGE_VERSION_NUMBER ${DCMTK_VERSION_NUMBER})
1149
dd6d7fd82da9 fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1057
diff changeset
47
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
48 CONFIGURE_FILE(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
49 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
50 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
51
1638
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
52
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
53 execute_process(
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
54 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-speed.patch
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
55 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
56 RESULT_VARIABLE Failure
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
57 )
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
58
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
59 if (Failure AND FirstRun)
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
60 message(FATAL_ERROR "Error while patching a file")
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
61 endif()
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
62
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
63
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
64 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
65 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
66 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
67
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
68
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
69 if (ENABLE_JPEG)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
70 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
71 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
72 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
73 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
74 include_directories(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
75 ${DCMTK_SOURCES_DIR}/dcmjpeg/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
76 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
77 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
78 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
79 ${DCMTK_SOURCES_DIR}/dcmimgle/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
80 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
81 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
82 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/ddpiimpl.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
83 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
84 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
85
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
86
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
87 if (ENABLE_JPEG_LOSSLESS)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
88 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
89 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libcharls DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
90 include_directories(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
91 ${DCMTK_SOURCES_DIR}/dcmjpeg/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
92 ${DCMTK_SOURCES_DIR}/dcmjpls/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
93 ${DCMTK_SOURCES_DIR}/dcmjpls/libcharls
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
94 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
95 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
96 ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djcodece.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
97 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
98 list(APPEND DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
99 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djrplol.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
100 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
101 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
102
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
103
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
104 # Source for the logging facility of DCMTK
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
105 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
106 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
930
27d256e0b458 integration mainline -> mac
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 928 929
diff changeset
107 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR
1337
afaa55d42ddd FreeBSD support
jodogne
parents: 1334
diff changeset
108 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
109 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
110 list(REMOVE_ITEM DCMTK_SOURCES
1638
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
111 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
112 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
113 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
114 )
1361
94ffb597d297 refactoring of C-Find SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1337
diff changeset
115
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
116 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
117 list(REMOVE_ITEM DCMTK_SOURCES
1638
158e7b6f859a dcmtk 3.6.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1637
diff changeset
118 ${DCMTK_SOURCES_DIR}/oflog/libsrc/clfsap.cc
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
119 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
120 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
121 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
122
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
123 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
124 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
125 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc
1858
483f26479743 update to latest dcmtk snapshot
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1857
diff changeset
126 #${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
127 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
128
1149
dd6d7fd82da9 fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1057
diff changeset
129 #set_source_files_properties(${DCMTK_SOURCES}
dd6d7fd82da9 fix version of dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1057
diff changeset
130 # PROPERTIES COMPILE_DEFINITIONS
1636
8c4f1de71f8d improvement
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1634
diff changeset
131 # "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
132
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
133 # This fixes crashes related to the destruction of the DCMTK OFLogger
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
134 # http://support.dcmtk.org/docs-snapshot/file_macros.html
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
135 add_definitions(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
136 -DLOG4CPLUS_DISABLE_FATAL=1
1634
c095b0ddeea6 improvement
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1546
diff changeset
137 -DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER}
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
138 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
139
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
140 include_directories(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
141 #${DCMTK_SOURCES_DIR}
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
142 ${DCMTK_SOURCES_DIR}/config/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
143 ${DCMTK_SOURCES_DIR}/dcmnet/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
144 ${DCMTK_SOURCES_DIR}/ofstd/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
145 ${DCMTK_SOURCES_DIR}/oflog/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
146 ${DCMTK_SOURCES_DIR}/dcmdata/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
147 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
148
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
149 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
150
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
151 set(DCMTK_BUNDLES_LOG4CPLUS 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
152
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
153 if (STANDALONE_BUILD)
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
154 set(DCMTK_USE_EMBEDDED_DICTIONARIES 1)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
155 set(DCMTK_DICTIONARIES
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
156 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
157 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
158 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
159 )
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
160 else()
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
161 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0)
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
162 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
163
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
164 else()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
165 # The following line allows to manually add libraries at the
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
166 # command-line, which is necessary for Ubuntu/Debian packages
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
167 set(tmp "${DCMTK_LIBRARIES}")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
168 include(FindDCMTK)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
169 list(APPEND DCMTK_LIBRARIES "${tmp}")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
170
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
171 include_directories(${DCMTK_INCLUDE_DIR})
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
172
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
173 add_definitions(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
174 -DHAVE_CONFIG_H=1
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
175 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
176
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
177 if (EXISTS "${DCMTK_DIR}/config/cfunix.h")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
178 set(DCMTK_CONFIGURATION_FILE "${DCMTK_DIR}/config/cfunix.h")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
179 elseif (EXISTS "${DCMTK_DIR}/config/osconfig.h") # This is for Arch Linux
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
180 set(DCMTK_CONFIGURATION_FILE "${DCMTK_DIR}/config/osconfig.h")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
181 else()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
182 message(FATAL_ERROR "Please install libdcmtk1-dev")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
183 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
184
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
185 # Autodetection of the version of DCMTK
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
186 file(STRINGS
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
187 "${DCMTK_CONFIGURATION_FILE}"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
188 DCMTK_VERSION_NUMBER1 REGEX
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
189 ".*PACKAGE_VERSION .*")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
190
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
191 string(REGEX REPLACE
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
192 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
193 "\\1\\2\\3"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
194 DCMTK_VERSION_NUMBER
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
195 ${DCMTK_VERSION_NUMBER1})
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
196
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
197 set(DCMTK_USE_EMBEDDED_DICTIONARIES 0)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
198 endif()
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
199
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
200
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
201 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER})
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
202 message("DCMTK version: ${DCMTK_VERSION_NUMBER}")
1770
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
203
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
204
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
205 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=${DCMTK_USE_EMBEDDED_DICTIONARIES})
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
206 if (NOT DCMTK_USE_EMBEDDED_DICTIONARIES)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
207 # Lookup for DICOM dictionaries, if none is specified by the user
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
208 if (DCMTK_DICTIONARY_DIR STREQUAL "")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
209 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
210 /usr/share/dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
211 /usr/share/libdcmtk2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
212 /usr/share/libdcmtk4
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
213 /usr/local/share/dcmtk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
214 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
215
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
216 if (${DCMTK_DICTIONARY_DIR_AUTO} MATCHES "DCMTK_DICTIONARY_DIR_AUTO-NOTFOUND")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
217 message(FATAL_ERROR "Cannot locate the DICOM dictionary on this system")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
218 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
219
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
220 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
221 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
222 else()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
223 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
224 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1769
diff changeset
225 endif()