annotate Resources/CMake/DcmtkConfiguration.cmake @ 850:9ee2e7a5efaf jpeg

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