FindCTK.cmake 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 CTK is found.
  24. # CTK_USE_FILE - CMake file to use CTK.
  25. # CTK_MAJOR_VERSION - The CTK major version number.
  26. # CTK_MINOR_VERSION - The CTK minor version number
  27. # (odd non-release).
  28. # CTK_BUILD_VERSION - The CTK 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. # CTK_LIBRARIES - List of libraries
  33. #
  34. # The following cache entries must be set by the user to locate VTK:
  35. # CTK_DIR - The directory containing CTKConfig.cmake.
  36. # This is either the root of the build tree,
  37. # or the lib/ctk directory. This is the
  38. # only cache entry.
  39. #
  40. # Assume not found.
  41. SET(CTK_FOUND 0)
  42. # Construct consitent error messages for use below.
  43. 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.")
  44. # Use the Config mode of the find_package() command to find CTKConfig.
  45. # If this succeeds (possibly because CTK_DIR is already set), the
  46. # command will have already loaded CTKConfig.cmake and set CTK_FOUND.
  47. IF(NOT CTK_FOUND)
  48. FIND_PACKAGE(CTK QUIET NO_MODULE)
  49. ENDIF()
  50. #-----------------------------------------------------------------------------
  51. IF(NOT CTK_FOUND)
  52. # CTK not found, explain to the user how to specify its location.
  53. IF(CTK_FIND_REQUIRED)
  54. MESSAGE(FATAL_ERROR ${CTK_DIR_MESSAGE})
  55. ELSE(CTK_FIND_REQUIRED)
  56. IF(NOT CTK_FIND_QUIETLY)
  57. MESSAGE(STATUS ${CTK_DIR_MESSAGE})
  58. ENDIF(NOT CTK_FIND_QUIETLY)
  59. ENDIF(CTK_FIND_REQUIRED)
  60. ENDIF()