annotate Resources/CMake/DcmtkConfiguration.cmake @ 844:502c49adb5ad jpeg

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