2 pkg_check_modules (LIBUSB_PKG libusb-1.0)
3 find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h
5 ${LIBUSB_PKG_INCLUDE_DIRS}
6 /usr/include/libusb-1.0
11 find_library(LIBUSB_LIBRARIES NAMES usb-1.0
13 ${LIBUSB_PKG_LIBRARY_DIRS}
18 if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
19 set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found")
20 message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}")
21 else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
22 set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
23 message(STATUS "libusb-1.0 not found.")
24 endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
26 mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
28 endif(NOT LIBUSB_FOUND)