# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
# Assume not found.
SET(VTK_FOUND 0)
# VTK 4.0 did not provide VTKConfig.cmake.
IF("${VTK_FIND_VERSION}" VERSION_LESS 4.1)
SET(_VTK_40_ALLOW 1)
IF(VTK_FIND_VERSION)
SET(_VTK_40_ONLY 1)
ENDIF()
ENDIF()
# Construct consitent error messages for use below.
SET(VTK_DIR_DESCRIPTION "directory containing VTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation.")
IF(_VTK_40_ALLOW)
SET(VTK_DIR_DESCRIPTION "${VTK_DIR_DESCRIPTION} For VTK 4.0, this is the location of UseVTK.cmake. This is either the root of the build tree or PREFIX/include/vtk for an installation.")
ENDIF()
SET(VTK_DIR_MESSAGE "VTK not found. Set the VTK_DIR cmake cache entry to the ${VTK_DIR_DESCRIPTION}")
# Check whether VTK 4.0 has already been found.
IF(_VTK_40_ALLOW AND VTK_DIR)
IF(EXISTS ${VTK_DIR}/UseVTK.cmake AND NOT EXISTS ${VTK_DIR}/VTKConfig.cmake)
SET(VTK_FOUND 1)
INCLUDE(UseVTKConfig40)# No VTKConfig; load VTK 4.0 settings.
ENDIF()
ENDIF()
# Use the Config mode of the find_package() command to find VTKConfig.
# If this succeeds (possibly because VTK_DIR is already set), the
# command will have already loaded VTKConfig.cmake and set VTK_FOUND.
IF(NOT _VTK_40_ONLY AND NOT VTK_FOUND)
FIND_PACKAGE(VTK QUIET NO_MODULE)
ENDIF()
# Special search for VTK 4.0.
IF(_VTK_40_ALLOW AND NOT VTK_DIR)
# Old scripts may set these directories in the CMakeCache.txt file.