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

Revision 9694, 4.6 kB (checked in by robert, 6 years ago)

From Paul Melis & Robert Osfeild, improvements to find scripts to better handle diffrent installation combinations

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/include/
21    /usr/include/
22    /usr/local/dicom/include/
23)
24
25FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
26    ${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/config
27    ${DCMTK_DIR}/config/include
28    ${DCMTK_DIR}/include
29    /usr/local/include/dcmtk/config
30    /usr/include/dcmtk/config
31    /usr/local/dicom/include/dcmtk/config
32)
33
34FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
35    ${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/ofstd
36    ${DCMTK_DIR}/ofstd/include
37    ${DCMTK_DIR}/include/ofstd
38    /usr/local/include/dcmtk/ofstd
39    /usr/include/dcmtk/ofstd
40    /usr/local/dicom/include/dcmtk/ofstd
41)
42
43FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
44    ${DCMTK_DIR}/ofstd/libsrc
45    ${DCMTK_DIR}/ofstd/libsrc/Release
46    ${DCMTK_DIR}/ofstd/libsrc/Debug
47    ${DCMTK_DIR}/ofstd/Release
48    ${DCMTK_DIR}/ofstd/Debug
49    ${DCMTK_DIR}/lib
50    /usr/local/lib64
51    /usr/lib64
52    /usr/local/lib
53    /usr/lib
54    /usr/local/dicom/lib
55)
56
57
58FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
59    ${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmdata
60    ${DCMTK_DIR}/dcmdata/include
61    ${DCMTK_DIR}/include/dcmdata
62    /usr/local/include/dcmtk/dcmdata
63    /usr/include/dcmtk/dcmdata
64    /usr/local/dicom/include/dcmtk/dcmdata
65)
66
67FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
68    ${DCMTK_DIR}/dcmdata/libsrc
69    ${DCMTK_DIR}/dcmdata/libsrc/Release
70    ${DCMTK_DIR}/dcmdata/libsrc/Debug
71    ${DCMTK_DIR}/dcmdata/Release
72    ${DCMTK_DIR}/dcmdata/Debug
73    ${DCMTK_DIR}/lib
74    /usr/local/lib64
75    /usr/lib64
76    /usr/local/lib
77    /usr/lib
78    /usr/local/dicom/lib
79)
80
81
82FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
83    ${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimgle
84    ${DCMTK_DIR}/dcmimgle/include
85    ${DCMTK_DIR}/include/dcmimgle
86    /usr/local/include/dcmtk/dcmimgle
87    /usr/include/dcmtk/dcmimgle
88    /usr/local/dicom/include/dcmtk/dcmimgle
89)
90
91FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
92    ${DCMTK_DIR}/dcmimgle/libsrc
93    ${DCMTK_DIR}/dcmimgle/libsrc/Release
94    ${DCMTK_DIR}/dcmimgle/libsrc/Debug
95    ${DCMTK_DIR}/dcmimgle/Release
96    ${DCMTK_DIR}/dcmimgle/Debug
97    ${DCMTK_DIR}/lib
98    /usr/local/lib64
99    /usr/lib64
100    /usr/local/lib
101    /usr/lib
102    /usr/local/dicom/lib
103)
104
105FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
106    ${DCMTK_DIR}/imagectn/libsrc/Release
107    ${DCMTK_DIR}/imagectn/libsrc/
108    ${DCMTK_DIR}/imagectn/libsrc/Debug
109    /usr/local/lib64
110    /usr/lib64
111    /usr/local/lib
112    /usr/lib
113    /usr/local/dicom/lib
114)
115
116FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
117    ${DCMTK_DIR}/dcmnet/libsrc/Release
118    ${DCMTK_DIR}/dcmnet/libsrc/Debug
119    ${DCMTK_DIR}/dcmnet/libsrc/
120    /usr/local/lib64
121    /usr/lib64
122    /usr/local/lib
123    /usr/lib
124    /usr/local/dicom/lib
125)
126
127
128IF( DCMTK_config_INCLUDE_DIR
129    AND DCMTK_ofstd_INCLUDE_DIR
130    AND DCMTK_ofstd_LIBRARY
131    AND DCMTK_dcmdata_INCLUDE_DIR
132    AND DCMTK_dcmdata_LIBRARY
133    AND DCMTK_dcmimgle_INCLUDE_DIR
134    AND DCMTK_dcmimgle_LIBRARY )
135
136  SET( DCMTK_FOUND "YES" )
137  SET( DCMTK_INCLUDE_DIRS
138    ${DCMTK_config_INCLUDE_DIR}
139    ${DCMTK_ofstd_INCLUDE_DIR}
140    ${DCMTK_dcmdata_INCLUDE_DIR}
141    ${DCMTK_dcmimgle_INCLUDE_DIR}
142  )
143
144  SET( DCMTK_LIBRARIES
145    ${DCMTK_dcmimgle_LIBRARY}
146    ${DCMTK_dcmdata_LIBRARY}
147    ${DCMTK_ofstd_LIBRARY}
148    ${DCMTK_config_LIBRARY}
149  )
150
151  IF(DCMTK_imagedb_LIBRARY)
152   SET( DCMTK_LIBRARIES
153   ${DCMTK_LIBRARIES}
154   ${DCMTK_imagedb_LIBRARY}
155   )
156  ENDIF(DCMTK_imagedb_LIBRARY)
157
158  IF(DCMTK_dcmnet_LIBRARY)
159   SET( DCMTK_LIBRARIES
160   ${DCMTK_LIBRARIES}
161   ${DCMTK_dcmnet_LIBRARY}
162   )
163  ENDIF(DCMTK_dcmnet_LIBRARY)
164
165  IF( WIN32 )
166    SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
167  ENDIF( WIN32 )
168
169ENDIF( DCMTK_config_INCLUDE_DIR
170    AND DCMTK_ofstd_INCLUDE_DIR
171    AND DCMTK_ofstd_LIBRARY
172    AND DCMTK_dcmdata_INCLUDE_DIR
173    AND DCMTK_dcmdata_LIBRARY
174    AND DCMTK_dcmimgle_INCLUDE_DIR
175    AND DCMTK_dcmimgle_LIBRARY )
176
177IF( NOT DCMTK_FOUND )
178  SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." )
179  MARK_AS_ADVANCED( DCMTK_DIR )
180ENDIF( NOT DCMTK_FOUND )
Note: See TracBrowser for help on using the browser.