root/OpenSceneGraph/trunk/CMakeModules/FindOurDCMTK.cmake @ 10423

Revision 10423, 4.9 kB (checked in by robert, 5 years ago)

Added search in /usr/local/dicom for dcmtk.

Line 
1# - find DCMTK libraries
2#
3
4#  DCMTK_INCLUDE_DIRS  - Directories to include to use DCMTK
5#  DCMTK_LIBRARIES     - Files to link against to use DCMTK
6#  DCMTK_FOUND         - If false, don't try to use DCMTK
7#  DCMTK_DIR           - (optional) Source directory for DCMTK
8#
9# DCMTK_DIR can be used to make it simpler to find the various include
10# directories and compiled libraries if you've just compiled it in the
11# source tree. Just set it to the root of the tree where you extracted
12# the source.
13#
14# Written for VXL by Amitha Perera.
15# Modified by Robert Osfied to enable support for install placements of DCMTK 3.5.4 versions onwards
16
17FIND_PATH( DCMTK_ROOT_INCLUDE_DIR dcmtk/config/osconfig.h
18    ${DCMTK_DIR}/config/include
19    ${DCMTK_DIR}/include
20    /usr/local/dicom/include
21    /usr/local/include/
22    /usr/include/
23    /usr/local/dicom/include/
24)
25
26FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
27    ${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/config
28    ${DCMTK_DIR}/config/include
29    ${DCMTK_DIR}/include
30    /usr/local/dicom/include
31    /usr/local/include/dcmtk/config
32    /usr/include/dcmtk/config
33    /usr/local/dicom/include/dcmtk/config
34)
35
36FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
37    ${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/ofstd
38    ${DCMTK_DIR}/ofstd/include
39    ${DCMTK_DIR}/include/ofstd
40    /usr/local/dicom/include/dcmtk/ofstd
41    /usr/local/include/dcmtk/ofstd
42    /usr/include/dcmtk/ofstd
43    /usr/local/dicom/include/dcmtk/ofstd
44)
45
46FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
47    ${DCMTK_DIR}/ofstd/libsrc
48    ${DCMTK_DIR}/ofstd/libsrc/Release
49    ${DCMTK_DIR}/ofstd/libsrc/Debug
50    ${DCMTK_DIR}/ofstd/Release
51    ${DCMTK_DIR}/ofstd/Debug
52    ${DCMTK_DIR}/lib
53    /usr/local/dicom/lib
54    /usr/local/lib64
55    /usr/lib64
56    /usr/local/lib
57    /usr/lib
58    /usr/local/dicom/lib
59)
60
61
62FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
63    ${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmdata
64    ${DCMTK_DIR}/dcmdata/include
65    ${DCMTK_DIR}/include/dcmdata
66    /usr/local/dicom/include/dcmtk/dcmdata
67    /usr/local/include/dcmtk/dcmdata
68    /usr/include/dcmtk/dcmdata
69    /usr/local/dicom/include/dcmtk/dcmdata
70)
71
72FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
73    ${DCMTK_DIR}/dcmdata/libsrc
74    ${DCMTK_DIR}/dcmdata/libsrc/Release
75    ${DCMTK_DIR}/dcmdata/libsrc/Debug
76    ${DCMTK_DIR}/dcmdata/Release
77    ${DCMTK_DIR}/dcmdata/Debug
78    ${DCMTK_DIR}/lib
79    /usr/local/dicom/lib
80    /usr/local/lib64
81    /usr/lib64
82    /usr/local/lib
83    /usr/lib
84    /usr/local/dicom/lib
85)
86
87
88FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
89    ${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimgle
90    ${DCMTK_DIR}/dcmimgle/include
91    ${DCMTK_DIR}/include/dcmimgle
92    /usr/local/dicom/include/dcmtk/dcmimgle
93    /usr/local/include/dcmtk/dcmimgle
94    /usr/include/dcmtk/dcmimgle
95    /usr/local/dicom/include/dcmtk/dcmimgle
96)
97
98FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
99    ${DCMTK_DIR}/dcmimgle/libsrc
100    ${DCMTK_DIR}/dcmimgle/libsrc/Release
101    ${DCMTK_DIR}/dcmimgle/libsrc/Debug
102    ${DCMTK_DIR}/dcmimgle/Release
103    ${DCMTK_DIR}/dcmimgle/Debug
104    ${DCMTK_DIR}/lib
105    /usr/local/dicom/lib
106    /usr/local/lib64
107    /usr/lib64
108    /usr/local/lib
109    /usr/lib
110    /usr/local/dicom/lib
111)
112
113FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
114    ${DCMTK_DIR}/imagectn/libsrc/Release
115    ${DCMTK_DIR}/imagectn/libsrc/
116    ${DCMTK_DIR}/imagectn/libsrc/Debug
117    /usr/local/dicom/lib
118    /usr/local/lib64
119    /usr/lib64
120    /usr/local/lib
121    /usr/lib
122    /usr/local/dicom/lib
123)
124
125FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
126    ${DCMTK_DIR}/dcmnet/libsrc/Release
127    ${DCMTK_DIR}/dcmnet/libsrc/Debug
128    ${DCMTK_DIR}/dcmnet/libsrc/
129    /usr/local/dicom/lib
130    /usr/local/lib64
131    /usr/lib64
132    /usr/local/lib
133    /usr/lib
134    /usr/local/dicom/lib
135)
136
137
138IF( DCMTK_config_INCLUDE_DIR
139    AND DCMTK_ofstd_INCLUDE_DIR
140    AND DCMTK_ofstd_LIBRARY
141    AND DCMTK_dcmdata_INCLUDE_DIR
142    AND DCMTK_dcmdata_LIBRARY
143    AND DCMTK_dcmimgle_INCLUDE_DIR
144    AND DCMTK_dcmimgle_LIBRARY )
145
146  SET( DCMTK_FOUND "YES" )
147  SET( DCMTK_INCLUDE_DIRS
148    ${DCMTK_config_INCLUDE_DIR}
149    ${DCMTK_ofstd_INCLUDE_DIR}
150    ${DCMTK_dcmdata_INCLUDE_DIR}
151    ${DCMTK_dcmimgle_INCLUDE_DIR}
152  )
153
154  SET( DCMTK_LIBRARIES
155    ${DCMTK_dcmimgle_LIBRARY}
156    ${DCMTK_dcmdata_LIBRARY}
157    ${DCMTK_ofstd_LIBRARY}
158    ${DCMTK_config_LIBRARY}
159  )
160
161  IF(DCMTK_imagedb_LIBRARY)
162   SET( DCMTK_LIBRARIES
163   ${DCMTK_LIBRARIES}
164   ${DCMTK_imagedb_LIBRARY}
165   )
166  ENDIF(DCMTK_imagedb_LIBRARY)
167
168  IF(DCMTK_dcmnet_LIBRARY)
169   SET( DCMTK_LIBRARIES
170   ${DCMTK_LIBRARIES}
171   ${DCMTK_dcmnet_LIBRARY}
172   )
173  ENDIF(DCMTK_dcmnet_LIBRARY)
174
175  IF( WIN32 )
176    SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
177  ENDIF( WIN32 )
178
179ENDIF( DCMTK_config_INCLUDE_DIR
180    AND DCMTK_ofstd_INCLUDE_DIR
181    AND DCMTK_ofstd_LIBRARY
182    AND DCMTK_dcmdata_INCLUDE_DIR
183    AND DCMTK_dcmdata_LIBRARY
184    AND DCMTK_dcmimgle_INCLUDE_DIR
185    AND DCMTK_dcmimgle_LIBRARY )
186
187IF( NOT DCMTK_FOUND )
188  SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." )
189  MARK_AS_ADVANCED( DCMTK_DIR )
190ENDIF( NOT DCMTK_FOUND )
Note: See TracBrowser for help on using the browser.