-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindVVTK.cmake
165 lines (151 loc) · 4.65 KB
/
FindVVTK.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# $Id$
include( FindPackageHandleStandardArgs )
include( VistaFindUtils )
if( NOT VVTK_FOUND )
# VTK hides it config file quite well, so we have to search it explicitely
set( _SEARCH_PREFIXES )
if( EXISTS "$ENV{${_PACKAGE_NAME_UPPER}_ROOT}" )
list( APPEND _SEARCH_PREFIXES
"$ENV{${_PACKAGE_NAME_UPPER}_ROOT}/${VISTA_HWARCH}/lib/*"
"$ENV{${_PACKAGE_NAME_UPPER}_ROOT}/lib/*"
)
endif( EXISTS "$ENV{${_PACKAGE_NAME_UPPER}_ROOT}" )
foreach( _PATH ${VISTA_PACKAGE_SEARCH_PATHS} )
file( TO_CMAKE_PATH ${_PATH} _PATH )
list( APPEND _SEARCH_PREFIXES
"${_PATH}/VTK*/${VISTA_HWARCH}/lib/*"
"${_PATH}/VTK*/lib/*"
"${_PATH}/VTK/*/${VISTA_HWARCH}/lib/*"
"${_PATH}/VTK/*/lib/*"
"${_PATH}/vtk*/${VISTA_HWARCH}/lib/*"
"${_PATH}/vtk*/lib/*"
"${_PATH}/vtk/*/${VISTA_HWARCH}/lib/*"
"${_PATH}/vtk/*/lib/*"
)
endforeach( _PATH ${VISTA_PACKAGE_SEARCH_PATHS} )
foreach( _PATH ${_SEARCH_PREFIXES} )
file( GLOB _TMP_FILES "${_PATH}/VTKConfig.cmake" )
foreach( _FILE ${_TMP_FILES} )
file( TO_CMAKE_PATH ${_FILE} _FOUND_FILE )
string( REPLACE "/VTKConfig.cmake" "" _FOUND_PATH ${_FOUND_FILE} )
file( TO_CMAKE_PATH ${_FOUND_PATH} _FOUND_PATH )
list( APPEND VTK_CONFIG_DIRS ${_FOUND_PATH} )
endforeach( _FILE ${_TMP_FILES} )
endforeach( _PATH ${_PREFIX_PATHES} )
if( VTK_CONFIG_DIRS )
list( REMOVE_DUPLICATES VTK_CONFIG_DIRS )
endif( VTK_CONFIG_DIRS )
find_package( VTK ${VVTK_FIND_VERSION} PATHS ${VTK_DIR} ${VTK_CONFIG_DIRS} )
if( VTK_FOUND )
# a VTKConfig.cmake has been found and loaded
# check if debug libraries are available
set( _TMP_VTK_DEBUG_LIB "_TMP_VTK_DEBUG_LIB-NOTFOUND" CACHE INTERNAL "" FORCE )
find_library( _TMP_VTK_DEBUG_LIB "vtkCommonD" PATH ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH )
if( _TMP_VTK_DEBUG_LIB )
set( _DEBUG_AVAILABLE TRUE )
else( _TMP_VTK_DEBUG_LIB )
set( _DEBUG_AVAILABLE FALSE )
endif( _TMP_VTK_DEBUG_LIB )
set( _TMP_VTK_DEBUG_LIB "_TMP_VTK_DEBUG_LIB-NOTFOUND" CACHE INTERNAL "" FORCE )
if( _DEBUG_AVAILABLE )
set( VTK_LIBRARIES optimized vtkCommon
optimized vtkDICOMParser
optimized vtkexoIIc
optimized vtkexpat
optimized vtkFiltering
optimized vtkfreetype
optimized vtkftgl
optimized vtkGenericFiltering
optimized vtkGeovis
optimized vtkGraphics
optimized vtkHybrid
optimized vtkImaging
optimized vtkInfovis
optimized vtkIO
optimized vtkjpeg
optimized vtklibxml2
optimized vtkNetCDF
optimized vtkpng
optimized vtkRendering
optimized vtksys
optimized vtktiff
optimized vtkViews
optimized vtkVolumeRendering
optimized vtksqlite
optimized vtkmetaio
optimized vtkverdict
optimized vtkproj4
optimized vtkWidgets
optimized vtkzlib
debug vtkCommonD
debug vtkDICOMParserD
debug vtkexoIIcD
debug vtkexpatD
debug vtkFilteringD
debug vtkfreetypeD
debug vtkftglD
debug vtkGenericFilteringD
debug vtkGeovisD
debug vtkGraphicsD
debug vtkHybridD
debug vtkImagingD
debug vtkInfovisD
debug vtkIOD
debug vtkjpegD
debug vtklibxml2D
debug vtkNetCDFD
debug vtkpngD
debug vtkRenderingD
debug vtksysD
debug vtktiffD
debug vtkViewsD
debug vtkVolumeRenderingD
debug vtksqliteD
debug vtkmetaioD
debug vtkverdictD
debug vtkproj4D
debug vtkWidgetsD
debug vtkzlibD
)
else( _DEBUG_AVAILABLE ) # no debug libraries available
set( VTK_LIBRARIES vtkCommon
vtkDICOMParser
vtkexoIIc
vtkexpat
vtkFiltering
vtkfreetype
vtkftgl
vtkGenericFiltering
vtkGeovis
vtkGraphics
vtkHybrid
vtkImaging
vtkInfovis
vtkIO
vtkjpeg
vtklibxml2
vtkNetCDF
vtkpng
vtkRendering
vtksys
vtktiff
vtkViews
vtkVolumeRendering
vtksqlite
vtkmetaio
vtkverdict
vtkproj4
vtkWidgets
vtkzlib
)
endif( _DEBUG_AVAILABLE )
# VTK's dlls are in the VTK_RUNTIME_LIBRARY_DIRS, so we have to add this to the library dirs
# to find them
set( VTK_LIBRARY_DIRS ${VTK_LIBRARY_DIRS} ${VTK_RUNTIME_LIBRARY_DIRS} )
set( VTK_ROOT_DIR ${VTK_INSTALL_PREFIX} )
# note that there is also a VTK_USE_FILE, which will automatically be called
# by vista_use_package
endif( VTK_FOUND )
endif( NOT VVTK_FOUND )
find_package_handle_standard_args( VVTK "VTK could not be found" VTK_ROOT_DIR )
set( VTK_FOUND ${VVTK_FOUND} )