FindVRPN.cmake 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Filename: FindVRPN.cmake
  2. # Author: kestred (29 Nov, 2013)
  3. #
  4. # Usage:
  5. # find_package(VRPN [REQUIRED] [QUIET])
  6. #
  7. # It sets the following variables:
  8. # VRPN_FOUND - system has libvrpn
  9. # VRPN_INCLUDE_DIR - the vrpn include directory
  10. # VRPN_LIBRARY_DIR - the vrpn library directory
  11. # VRPN_LIBRARY - the path to the library binary
  12. #
  13. if(VRPN_INCLUDE_DIR AND VRPN_LIBRARY_DIR)
  14. set(FOUND_VRPN TRUE)
  15. else()
  16. # Find the vrpn include files
  17. find_path(VRPN_INCLUDE_DIR
  18. NAMES "vrpn_Keyboard.h"
  19. PATHS "/usr/include"
  20. "/usr/local/include"
  21. "/opt/vrpn/include"
  22. PATH_SUFFIXES "" "vrpn"
  23. DOC "The path to vrpn's include directory."
  24. )
  25. # Find the libvrpn library (.a, .so)
  26. find_library(VRPN_LIBRARY
  27. NAMES "vrpn"
  28. "libvrpn"
  29. PATHS "/usr"
  30. "/usr/local"
  31. "/opt/vrpn"
  32. PATH_SUFFIXES "lib" "lib32" "lib64"
  33. )
  34. get_filename_component(VRPN_LIBRARY_DIR "${VRPN_LIBRARY}" PATH)
  35. set(VRPN_LIBRARY_DIR "${VRPN_LIBRARY_DIR}" CACHE PATH "The path to vrpn's library directory.") # Library path
  36. mark_as_advanced(VRPN_INCLUDE_DIR)
  37. mark_as_advanced(VRPN_LIBRARY_DIR)
  38. mark_as_advanced(VRPN_LIBRARY)
  39. endif()
  40. include(FindPackageHandleStandardArgs)
  41. find_package_handle_standard_args(VRPN DEFAULT_MSG VRPN_LIBRARY VRPN_INCLUDE_DIR VRPN_LIBRARY_DIR)