FindCTK.cmake 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # - Find a CTK installation or build tree.
  2. # The following variables are set if CTK is found. If CTK is not
  3. # found, CTK_FOUND is set to false.
  4. # CTK_FOUND - Set to true when VTK is found.
  5. # CTK_USE_FILE - CMake file to use VTK.
  6. # CTK_MAJOR_VERSION - The VTK major version number.
  7. # CTK_MINOR_VERSION - The VTK minor version number
  8. # (odd non-release).
  9. # CTK_BUILD_VERSION - The VTK patch level
  10. # (meaningless for odd minor).
  11. # CTK_INCLUDE_DIRS - Include directories for CTK
  12. # CTK_LIBRARY_DIRS - Link directories for CTK libraries
  13. #
  14. # The following cache entries must be set by the user to locate VTK:
  15. # CTK_DIR - The directory containing CTKConfig.cmake.
  16. # This is either the root of the build tree,
  17. # or the lib/vtk directory. This is the
  18. # only cache entry.
  19. #
  20. # Assume not found.
  21. SET(CTK_FOUND 0)
  22. # Construct consitent error messages for use below.
  23. SET(CTK_DIR_MESSAGE "CTK not found. Set the CTK_DIR cmake cache entry to the directory containing CTKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/vtk for an installation.")
  24. # Use the Config mode of the find_package() command to find CTKConfig.
  25. # If this succeeds (possibly because CTK_DIR is already set), the
  26. # command will have already loaded CTKConfig.cmake and set CTK_FOUND.
  27. IF(NOT CTK_FOUND)
  28. FIND_PACKAGE(CTK QUIET NO_MODULE)
  29. ENDIF()
  30. #-----------------------------------------------------------------------------
  31. IF(NOT CTK_FOUND)
  32. # CTK not found, explain to the user how to specify its location.
  33. IF(CTK_FIND_REQUIRED)
  34. MESSAGE(FATAL_ERROR ${CTK_DIR_MESSAGE})
  35. ELSE(CTK_FIND_REQUIRED)
  36. IF(NOT CTK_FIND_QUIETLY)
  37. MESSAGE(STATUS ${CTK_DIR_MESSAGE})
  38. ENDIF(NOT CTK_FIND_QUIETLY)
  39. ENDIF(CTK_FIND_REQUIRED)
  40. ENDIF()