FindCTK.cmake 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ###########################################################################
  2. #
  3. # Library: CTK
  4. #
  5. # Copyright (c) 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.apache.org/licenses/LICENSE-2.0.txt
  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_PATCH_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()
  56. if(NOT CTK_FIND_QUIETLY)
  57. message(STATUS ${CTK_DIR_MESSAGE})
  58. endif()
  59. endif()
  60. endif()