FindHIDAPI.cmake 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # - try to find HIDAPI library
  2. # from http://www.signal11.us/oss/hidapi/
  3. #
  4. # Cache Variables: (probably not for direct use in your scripts)
  5. # HIDAPI_INCLUDE_DIR
  6. # HIDAPI_LIBRARY
  7. #
  8. # Non-cache variables you might use in your CMakeLists.txt:
  9. # HIDAPI_FOUND
  10. # HIDAPI_INCLUDE_DIRS
  11. # HIDAPI_LIBRARIES
  12. #
  13. # Requires these CMake modules:
  14. # FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
  15. #
  16. # Original Author:
  17. # 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
  18. # http://academic.cleardefinition.com
  19. # Iowa State University HCI Graduate Program/VRAC
  20. #
  21. # Copyright Iowa State University 2009-2010.
  22. # Distributed under the Boost Software License, Version 1.0.
  23. # (See accompanying file LICENSE_1_0.txt or copy at
  24. # http://www.boost.org/LICENSE_1_0.txt)
  25. find_library(HIDAPI_LIBRARY
  26. NAMES hidapi hidapi-libusb)
  27. find_path(HIDAPI_INCLUDE_DIR
  28. NAMES hidapi.h
  29. PATH_SUFFIXES
  30. hidapi)
  31. include(FindPackageHandleStandardArgs)
  32. find_package_handle_standard_args(HIDAPI
  33. DEFAULT_MSG
  34. HIDAPI_LIBRARY
  35. HIDAPI_INCLUDE_DIR)
  36. if(HIDAPI_FOUND)
  37. set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}")
  38. set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}")
  39. endif()
  40. mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY)