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
#
2001-12-21 22:40:33 +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
#
# VTK_BINARY_PATH - where is (one of) the binary tree(s).
# USE_INSTALLED_VTK - should an installed version of VTK be used
#
# USE_VTK_FILE - the full path and location of the UseVTK.cmake file
# ONLY SET if ONE of the USE_BUILT_VTK or
# USE_INSTALLED_VTK 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
)
#
# 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 a built tree, USE_BUILT_VTK allows the user to
# use it or not.
#
# Important: it *has* to be set to OFF first in order to allow
# the user to change the VTK_BINARY_PATH value *before* the USE_VTK_FILE
# is set (and the cache created).
#
# For example, CMake could have picked-up the wrong VTK binary path, and if
# the related VTK cache was immediately loaded there would not be any way
# to overwrite these cache values (even by changing the binary path or
# USE_VTK_FILE).
2001-09-21 01:31:38 +04:00
#
IF ( VTK_BINARY_PATH )
2001-12-21 22:40:33 +03:00
SET ( USE_BUILT_VTK 0 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 V T K _ B I N A R Y _ P A T H i s c o r r e c t b e f o r e s e t t i n g i t t o O N . " )
2001-09-21 01:31:38 +04:00
ENDIF ( VTK_BINARY_PATH )
2001-09-19 22:52:59 +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.
#
# Important: it *has* to be set to OFF first in order to allow
# the user to change the VTK_INSTALL_PATH value before the USE_VTK_FILE
# is set (and the cache created).
#
# For example, you might have simultaneously installed different major
# versions like VTK 3.2, 4.0, 5.1, etc.
#
# Moreover, USE_INSTALLED_VTK has to be OFF since USE_BUILT_VTK has to be OFF
# too (see above). If USE_INSTALLED_VTK was ON by default, then USE_VTK_FILE
# would be set immediately (since one of them is ON) in favor of the
# installed tree.
#
IF ( VTK_INSTALL_PATH )
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 V T K _ I N S T A L L _ P A T H i s c o r r e c t b e f o r e s e t t i n g i t t o O N . " )
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
# is ON, i.e. if the user has decided if he wants to use either the built
# or the installed VTK. Even if only one of the VTK flavor was found,
# this also enable the user to change the path to his VTK (in case the
# wrong installed or built VTK was automatically found).
#
# Once this decision has been made, there is no way to go back except by
# erasing the cache. Mark these useless vars as ADVANCED to reflect this.
#
IF ( USE_BUILT_VTK )
IF ( NOT USE_INSTALLED_VTK )
2001-10-26 22:35:53 +04:00
FIND_FILE ( USE_VTK_FILE UseVTK.cmake ${ VTK_BINARY_PATH } )
2001-12-21 22:40:33 +03:00
MARK_AS_ADVANCED (
U S E _ B U I L T _ V T K
U S E _ I N S T A L L E D _ V T K
U S E _ V T K _ F I L E
V T K _ I N S T A L L _ P A T H
)
ENDIF ( NOT USE_INSTALLED_VTK )
ELSE ( USE_BUILT_VTK )
IF ( USE_INSTALLED_VTK )
SET ( USE_VTK_FILE ${ VTK_INSTALL_PATH } /include/vtk/UseVTK.cmake )
MARK_AS_ADVANCED (
U S E _ B U I L T _ V T K
U S E _ I N S T A L L E D _ V T K
U S E _ V T K _ F I L E
V T K _ B I N A R Y _ P A T H
)
ENDIF ( USE_INSTALLED_VTK )
ENDIF ( USE_BUILT_VTK )
2001-05-23 19:34:19 +04:00
2001-12-21 22:40:33 +03:00
# Note:
#
# If you use that module then you are probably relying on VTK to be found
# on your system. As said before, it might be found as different flavours:
# installed VTK, or (multiple) built VTK. Moreover, even if it is found
# automatically, CMake might have picked the wrong path/version.
#
# Here is the CMake code you might probably want to use to work hand-in-hand
# with that module:
#
# INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
#
# IF (USE_VTK_FILE)
# INCLUDE (${USE_VTK_FILE})
# ELSE (USE_VTK_FILE)
# MESSAGE("Warning. This project is supposed to work with VTK, which might be found on your system as different flavours: installed VTK, or (multiple) built VTK. Please, make sure that the VTK_INSTALL_PATH or VTK_BINARY_PATH setting reflect which VTK you are planning to use, then set one of the USE_INSTALLED_VTK or USE_BUILT_VTK to ON.")
# SET (CAN_BUILD 0)
# ENDIF (USE_VTK_FILE)