FindCTK.cmake 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ###########################################################################
  2. #
  3. # Library: CTK
  4. #
  5. # Copyright (c) 2010 Kitware Inc.
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License");
  8. # you may not use this file except in compliance with the License.
  9. # You may obtain a copy of the License at
  10. #
  11. # http://www.commontk.org/LICENSE
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. #
  19. ###########################################################################
  20. # - Find a CTK installation or build tree.
  21. # The following variables are set if CTK is found. If CTK is not
  22. # found, CTK_FOUND is set to false.
  23. # CTK_FOUND - Set to true when VTK is found.
  24. # CTK_USE_FILE - CMake file to use VTK.
  25. # CTK_MAJOR_VERSION - The VTK major version number.
  26. # CTK_MINOR_VERSION - The VTK minor version number
  27. # (odd non-release).
  28. # CTK_BUILD_VERSION - The VTK patch level
  29. # (meaningless for odd minor).
  30. # CTK_INCLUDE_DIRS - Include directories for CTK
  31. # CTK_LIBRARY_DIRS - Link directories for CTK libraries
  32. #
  33. # The following cache entries must be set by the user to locate VTK:
  34. # CTK_DIR - The directory containing CTKConfig.cmake.
  35. # This is either the root of the build tree,
  36. # or the lib/vtk directory. This is the
  37. # only cache entry.
  38. #
  39. # Assume not found.
  40. SET(CTK_FOUND 0)
  41. # Construct consitent error messages for use below.
  42. 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/ctk for an installation.")
  43. # Use the Config mode of the find_package() command to find CTKConfig.
  44. # If this succeeds (possibly because CTK_DIR is already set), the
  45. # command will have already loaded CTKConfig.cmake and set CTK_FOUND.
  46. IF(NOT CTK_FOUND)
  47. FIND_PACKAGE(CTK QUIET NO_MODULE)
  48. ENDIF()
  49. #-----------------------------------------------------------------------------
  50. IF(NOT CTK_FOUND)
  51. # CTK not found, explain to the user how to specify its location.
  52. IF(CTK_FIND_REQUIRED)
  53. MESSAGE(FATAL_ERROR ${CTK_DIR_MESSAGE})
  54. ELSE(CTK_FIND_REQUIRED)
  55. IF(NOT CTK_FIND_QUIETLY)
  56. MESSAGE(STATUS ${CTK_DIR_MESSAGE})
  57. ENDIF(NOT CTK_FIND_QUIETLY)
  58. ENDIF(CTK_FIND_REQUIRED)
  59. ENDIF()