annotate Resources/CMake/DcmtkConfiguration.cmake @ 1072:1dffa9f44a94

conformance
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 28 Jul 2014 13:31:35 +0200
parents 3a26bc6e4867
children dd6d7fd82da9
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 # Lookup for DICOM dictionaries, if none is specified by the user
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
2 if (DCMTK_DICTIONARY_DIR STREQUAL "")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
3 find_path(DCMTK_DICTIONARY_DIR_AUTO dicom.dic
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
4 /usr/share/dcmtk
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
5 /usr/share/libdcmtk2
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
6 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
7
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
8 message("Autodetected path to the DICOM dictionaries: ${DCMTK_DICTIONARY_DIR_AUTO}")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
9 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR_AUTO}")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
10 else()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
11 add_definitions(-DDCMTK_DICTIONARY_DIR="${DCMTK_DICTIONARY_DIR}")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
12 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
13
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
14
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
15 if (STATIC_BUILD OR NOT USE_SYSTEM_DCMTK)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
16 SET(DCMTK_VERSION_NUMBER 360)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
17 SET(DCMTK_SOURCES_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
18 DownloadPackage(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
19 "219ad631b82031806147e4abbfba4fa4"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
20 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/dcmtk-3.6.0.zip"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
21 "${DCMTK_SOURCES_DIR}")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
22
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
23 IF(CMAKE_CROSSCOMPILING)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
24 SET(C_CHAR_UNSIGNED 1 CACHE INTERNAL "Whether char is unsigned.")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
25 ENDIF()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
26 SET(DCMTK_SOURCE_DIR ${CMAKE_BINARY_DIR}/dcmtk-3.6.0)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
27 include(${DCMTK_SOURCES_DIR}/CMake/CheckFunctionWithHeaderExists.cmake)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
28 include(${DCMTK_SOURCES_DIR}/CMake/GenerateDCMTKConfigure.cmake)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
29
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
30 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
31 set(HAVE_SSTREAM 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
32 set(HAVE_PROTOTYPE_BZERO 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
33 set(HAVE_PROTOTYPE_GETHOSTNAME 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
34 set(HAVE_PROTOTYPE_GETSOCKOPT 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
35 set(HAVE_PROTOTYPE_SETSOCKOPT 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
36 set(HAVE_PROTOTYPE_CONNECT 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
37 set(HAVE_PROTOTYPE_BIND 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
38 set(HAVE_PROTOTYPE_ACCEPT 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
39 set(HAVE_PROTOTYPE_SETSOCKNAME 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
40 set(HAVE_PROTOTYPE_GETSOCKNAME 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
41 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
42
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
43 CONFIGURE_FILE(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
44 ${DCMTK_SOURCES_DIR}/CMake/osconfig.h.in
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
45 ${DCMTK_SOURCES_DIR}/config/include/dcmtk/config/osconfig.h)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
46
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
47 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
48 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmdata/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
49 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/ofstd/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
50
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
51
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
52 if (ENABLE_JPEG)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
53 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
54 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8 DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
55 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12 DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
56 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16 DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
57 include_directories(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
58 ${DCMTK_SOURCES_DIR}/dcmjpeg/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
59 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg8
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
60 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg12
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
61 ${DCMTK_SOURCES_DIR}/dcmjpeg/libijg16
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
62 ${DCMTK_SOURCES_DIR}/dcmimgle/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
63 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
64 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
65 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/ddpiimpl.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
66 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
67 endif()
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
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
70 if (ENABLE_JPEG_LOSSLESS)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
71 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
72 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmjpls/libcharls DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
73 include_directories(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
74 ${DCMTK_SOURCES_DIR}/dcmjpeg/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
75 ${DCMTK_SOURCES_DIR}/dcmjpls/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
76 ${DCMTK_SOURCES_DIR}/dcmjpls/libcharls
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
77 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
78 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
79 ${DCMTK_SOURCES_DIR}/dcmjpls/libsrc/djcodece.cc
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(APPEND DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
82 ${DCMTK_SOURCES_DIR}/dcmjpeg/libsrc/djrplol.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 # Source for the logging facility of DCMTK
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
88 AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
89 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
930
27d256e0b458 integration mainline -> mac
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 928 929
diff changeset
90 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
91 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
92 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
93 ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
94 ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
95 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
96 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
97 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
98 ${DCMTK_SOURCES_DIR}/oflog/libsrc/unixsock.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
99 )
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 if (${CMAKE_COMPILER_IS_GNUCXX})
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
102 # This is a patch for MinGW64
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
103 execute_process(
1057
3a26bc6e4867 more generic paths in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 930
diff changeset
104 COMMAND patch -p0 -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-mingw64.patch
929
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
105 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
106 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
107 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
108
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
109 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
110
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
111 list(REMOVE_ITEM DCMTK_SOURCES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
112 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdictbi.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
113 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/mkdeftag.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
114 ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdictbi.cc
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
115 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
116
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
117 # This fixes crashes related to the destruction of the DCMTK OFLogger
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
118 # http://support.dcmtk.org/docs-snapshot/file_macros.html
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
119 add_definitions(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
120 -DLOG4CPLUS_DISABLE_FATAL=1
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
121 -DDCMTK_VERSION_NUMBER=360
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
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
124 include_directories(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
125 #${DCMTK_SOURCES_DIR}
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
126 ${DCMTK_SOURCES_DIR}/config/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
127 ${DCMTK_SOURCES_DIR}/dcmnet/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
128 ${DCMTK_SOURCES_DIR}/ofstd/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
129 ${DCMTK_SOURCES_DIR}/oflog/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
130 ${DCMTK_SOURCES_DIR}/dcmdata/include
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
131 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
132
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
133 source_group(ThirdParty\\Dcmtk REGULAR_EXPRESSION ${DCMTK_SOURCES_DIR}/.*)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
134
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
135 set(DCMTK_BUNDLES_LOG4CPLUS 1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
136
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
137 if (STANDALONE_BUILD)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
138 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=1)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
139 else()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
140 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=0)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
141 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
142
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
143 set(DCMTK_DICTIONARIES
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
144 DICTIONARY_DICOM ${DCMTK_SOURCES_DIR}/dcmdata/data/dicom.dic
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
145 DICTIONARY_PRIVATE ${DCMTK_SOURCES_DIR}/dcmdata/data/private.dic
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
146 DICTIONARY_DICONDE ${DCMTK_SOURCES_DIR}/dcmdata/data/diconde.dic
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 else()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
150 # The following line allows to manually add libraries at the
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
151 # command-line, which is necessary for Ubuntu/Debian packages
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
152 set(tmp "${DCMTK_LIBRARIES}")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
153 include(FindDCMTK)
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
154 list(APPEND DCMTK_LIBRARIES "${tmp}")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
155
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
156 include_directories(${DCMTK_INCLUDE_DIR})
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
157 link_libraries(${DCMTK_LIBRARIES})
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
158
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
159 add_definitions(
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
160 -DHAVE_CONFIG_H=1
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
161 )
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
162
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
163 if (EXISTS "${DCMTK_DIR}/config/cfunix.h")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
164 set(DCMTK_CONFIGURATION_FILE "${DCMTK_DIR}/config/cfunix.h")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
165 elseif (EXISTS "${DCMTK_DIR}/config/osconfig.h") # This is for Arch Linux
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
166 set(DCMTK_CONFIGURATION_FILE "${DCMTK_DIR}/config/osconfig.h")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
167 else()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
168 message(FATAL_ERROR "Please install libdcmtk1-dev")
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
169 endif()
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 # Autodetection of the version of DCMTK
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
172 file(STRINGS
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
173 "${DCMTK_CONFIGURATION_FILE}"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
174 DCMTK_VERSION_NUMBER1 REGEX
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
175 ".*PACKAGE_VERSION .*")
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 string(REGEX REPLACE
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
178 ".*PACKAGE_VERSION.*\"([0-9]*)\\.([0-9]*)\\.([0-9]*)\"$"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
179 "\\1\\2\\3"
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
180 DCMTK_VERSION_NUMBER
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
181 ${DCMTK_VERSION_NUMBER1})
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
182
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
183 add_definitions(-DDCMTK_USE_EMBEDDED_DICTIONARIES=0)
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 endif()
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
186
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
187 add_definitions(-DDCMTK_VERSION_NUMBER=${DCMTK_VERSION_NUMBER})
401a8273fd71 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 890
diff changeset
188 message("DCMTK version: ${DCMTK_VERSION_NUMBER}")