2001-05-23 19:34:19 +04:00
#
# Find the native VTK includes and library
#
2001-12-21 22:40:33 +03:00
# This module defines:
2001-09-19 22:52:59 +04:00
#
2002-01-08 01:29:06 +03:00
# VTK_INSTALL_PATH - Where is the installed version of VTK.
# USE_BUILT_VTK - Should a built-from-source version of VTK be used.
2001-12-21 22:40:33 +03:00
#
2002-01-08 01:29:06 +03:00
# VTK_BINARY_PATH - Where is (one of) the binary tree(s).
# USE_INSTALLED_VTK - Should an installed version of VTK be used
2001-12-21 22:40:33 +03:00
#
2002-01-08 01:29:06 +03:00
# USE_VTK_FILE - (internal)
# Full path and location to the UseVTK.cmake file.
# This value changes each time USE_BUILT_VTK or
# USE_INSTALLED_VTK is modified, and only if ONE of
# these setting is set to ON.
2001-09-19 22:52:59 +04:00
#
#
2001-12-21 22:40:33 +03:00
# Look for a binary tree (built from source)
2001-09-21 01:31:38 +04:00
#
2001-09-21 19:48:36 +04:00
FIND_PATH ( VTK_BINARY_PATH UseVTK.cmake
2001-12-21 22:40:33 +03:00
[ H K E Y _ C U R R E N T _ U S E R \ \ S o f t w a r e \ \ K i t w a r e \ \ C M a k e S e t u p \ \ S e t t i n g s \ \ S t a r t P a t h ; W h e r e B u i l d 1 ]
[ H K E Y _ C U R R E N T _ U S E R \ \ S o f t w a r e \ \ K i t w a r e \ \ C M a k e S e t u p \ \ S e t t i n g s \ \ S t a r t P a t h ; W h e r e B u i l d 2 ]
[ H K E Y _ C U R R E N T _ U S E R \ \ S o f t w a r e \ \ K i t w a r e \ \ C M a k e S e t u p \ \ S e t t i n g s \ \ S t a r t P a t h ; W h e r e B u i l d 3 ]
[ H K E Y _ C U R R E N T _ U S E R \ \ S o f t w a r e \ \ K i t w a r e \ \ C M a k e S e t u p \ \ S e t t i n g s \ \ S t a r t P a t h ; W h e r e B u i l d 4 ]
[ H K E Y _ C U R R E N T _ U S E R \ \ S o f t w a r e \ \ K i t w a r e \ \ C M a k e S e t u p \ \ S e t t i n g s \ \ S t a r t P a t h ; W h e r e B u i l d 5 ]
[ H K E Y _ C U R R E N T _ U S E R \ \ S o f t w a r e \ \ K i t w a r e \ \ C M a k e S e t u p \ \ S e t t i n g s \ \ S t a r t P a t h ; W h e r e B u i l d 6 ]
[ H K E Y _ C U R R E N T _ U S E R \ \ S o f t w a r e \ \ K i t w a r e \ \ C M a k e S e t u p \ \ S e t t i n g s \ \ S t a r t P a t h ; W h e r e B u i l d 7 ]
[ H K E Y _ C U R R E N T _ U S E R \ \ S o f t w a r e \ \ K i t w a r e \ \ C M a k e S e t u p \ \ S e t t i n g s \ \ S t a r t P a t h ; W h e r e B u i l d 8 ]
[ H K E Y _ C U R R E N T _ U S E R \ \ S o f t w a r e \ \ K i t w a r e \ \ C M a k e S e t u p \ \ S e t t i n g s \ \ S t a r t P a t h ; W h e r e B u i l d 9 ]
[ H K E Y _ C U R R E N T _ U S E R \ \ S o f t w a r e \ \ K i t w a r e \ \ C M a k e S e t u p \ \ S e t t i n g s \ \ S t a r t P a t h ; W h e r e B u i l d 1 0 ]
. . / V T K B I N
. . / v t k b i n
V T K B I N
v t k b i n
$ E N V { H O M E } / V T K B I N
$ E N V { H O M E } / v t k b i n
)
2002-01-08 01:29:06 +03:00
#
# If we found a built tree, USE_BUILT_VTK allows the user to
# use it or not. Defaults to ON.
#
IF ( VTK_BINARY_PATH )
SET ( USE_BUILT_VTK 1 CACHE BOOL
" U s e a built ( versus installed ) v e r s i o n o f V T K . B e s u r e t h a t V T K _ B I N A R Y _ P A T H i s c o r r e c t . " )
ENDIF ( VTK_BINARY_PATH )
2001-12-21 22:40:33 +03:00
#
# Look for an installed tree
#
FIND_PATH ( VTK_INSTALL_PATH include/vtk/UseVTK.cmake
/ u s r / l o c a l
/ u s r
[ H K E Y _ L O C A L _ M A C H I N E \ \ S O F T W A R E \ \ K i t w a r e \ \ V T K \ \ N i g h t l y ]
[ H K E Y _ L O C A L _ M A C H I N E \ \ S O F T W A R E \ \ K i t w a r e \ \ V T K \ \ 4 3 ]
[ H K E Y _ L O C A L _ M A C H I N E \ \ S O F T W A R E \ \ K i t w a r e \ \ V T K \ \ 4 2 ]
[ H K E Y _ L O C A L _ M A C H I N E \ \ S O F T W A R E \ \ K i t w a r e \ \ V T K \ \ 4 1 ]
[ H K E Y _ L O C A L _ M A C H I N E \ \ S O F T W A R E \ \ K i t w a r e \ \ V T K \ \ 4 0 ]
)
2001-09-21 01:31:38 +04:00
2001-12-21 22:40:33 +03:00
#
# If we found an installed tree, USE_INSTALLED_VTK allows the user to
# use it or not.
#
2002-01-08 01:29:06 +03:00
# Defaults to OFF if a built tree was found before (see above), ON otherwise.
2001-12-21 22:40:33 +03:00
#
IF ( VTK_INSTALL_PATH )
2002-01-08 01:29:06 +03:00
IF ( USE_BUILT_VTK )
SET ( USE_INSTALLED_VTK 0 CACHE BOOL
" U s e a n installed ( versus built from source ) v e r s i o n o f V T K . B e s u r e t h a t V T K _ I N S T A L L _ P A T H i s c o r r e c t . " )
ELSE ( USE_BUILT_VTK )
SET ( USE_INSTALLED_VTK 1 CACHE BOOL
" U s e a n installed ( versus built from source ) v e r s i o n o f V T K . B e s u r e t h a t V T K _ I N S T A L L _ P A T H i s c o r r e c t . " )
ENDIF ( USE_BUILT_VTK )
2001-12-21 22:40:33 +03:00
ENDIF ( VTK_INSTALL_PATH )
2001-05-23 19:34:19 +04:00
2001-12-21 22:40:33 +03:00
#
# Set the USE_VTK_FILE only if one of USE_BUILT_VTK or USE_INSTALLED_VTK
2002-01-08 01:29:06 +03:00
# is ON.
2001-12-21 22:40:33 +03:00
#
IF ( USE_BUILT_VTK )
IF ( NOT USE_INSTALLED_VTK )
2002-01-08 01:29:06 +03:00
IF ( EXISTS "${VTK_BINARY_PATH}/UseVTK.cmake" )
SET ( USE_VTK_FILE "${VTK_BINARY_PATH}/UseVTK.cmake" )
ENDIF ( EXISTS "${VTK_BINARY_PATH}/UseVTK.cmake" )
2001-12-21 22:40:33 +03:00
ENDIF ( NOT USE_INSTALLED_VTK )
ELSE ( USE_BUILT_VTK )
IF ( USE_INSTALLED_VTK )
2002-01-08 01:29:06 +03:00
IF ( EXISTS "${VTK_INSTALL_PATH}/include/vtk/UseVTK.cmake" )
SET ( USE_VTK_FILE "${VTK_INSTALL_PATH}/include/vtk/UseVTK.cmake" )
ENDIF ( EXISTS "${VTK_INSTALL_PATH}/include/vtk/UseVTK.cmake" )
2001-12-21 22:40:33 +03:00
ENDIF ( USE_INSTALLED_VTK )
ENDIF ( USE_BUILT_VTK )
2001-05-23 19:34:19 +04:00
2002-01-08 01:29:06 +03:00
#
# Display a warning if both settings are set to ON.
# Otherwise display a warning if VTK was not found.
#
IF ( USE_BUILT_VTK AND USE_INSTALLED_VTK )
MESSAGE ( "Warning. Please make sure that only ONE of the USE_INSTALLED_VTK or USE_BUILT_VTK setting is set to ON." )
ELSE ( USE_BUILT_VTK AND USE_INSTALLED_VTK )
IF ( NOT USE_VTK_FILE )
MESSAGE ( "Warning. VTK might be found on your system as different flavours: installed VTK or built VTK. Please make sure that the VTK_INSTALL_PATH or VTK_BINARY_PATH setting reflects which VTK you are planning to use, then set ONE of the USE_INSTALLED_VTK or USE_BUILT_VTK setting to ON." )
ENDIF ( NOT USE_VTK_FILE )
ENDIF ( USE_BUILT_VTK AND USE_INSTALLED_VTK )
2001-12-21 22:40:33 +03:00
# Note:
#
# If you use that module then you are probably relying on VTK to be found
2002-01-08 01:29:06 +03:00
# on your system. Here is the CMake code you might probably want to use to
# work hand-in-hand with that module (in that example CAN_BUILD is a var
# that is set to 0 if your project can not be build):
2001-12-21 22:40:33 +03:00
#
# INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
#
# IF (USE_VTK_FILE)
# INCLUDE (${USE_VTK_FILE})
# ELSE (USE_VTK_FILE)
# SET (CAN_BUILD 0)
# ENDIF (USE_VTK_FILE)