#  LIBUSB_FOUND - system has LIBUSB
#  LIBUSB_INCLUDE_DIR - the LIBUSB include directories
#  LIBUSB_LIBRARIES - link these to use LIBUSB

FIND_PATH( LIBUSB_INCLUDE_DIR libusb.h
  ${LIBUSB_ROOT_DIR}/include
  /usr/include/libusb-1.0
  /usr/local/include/libusb-1.0
  /opt/local/include/libusb-1.0
)

FIND_LIBRARY( LIBUSB_LIBRARY 
  NAMES	
    usb-1.0 usb libusb libusb-1.0 libusb-1.0-0-dev
  PATHS  
    ${LIBUSB_ROOT_DIR}/lib
    /usr/lib64
    /usr/lib
    /usr/local/lib
    /opt/local/lib
)

IF(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARY)
  SET( LIBUSB_FOUND TRUE )
  SET( LIBUSB_LIBRARIES ${LIBUSB_LIBRARIES} ${LIBUSB_LIBRARY} )
ENDIF(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARY)

IF(LIBUSB_FOUND)
   IF(NOT LIBUSB_FIND_QUIETLY)
      MESSAGE(STATUS "Found LIBUSB: ${LIBUSB_LIBRARY}")
   ENDIF(NOT LIBUSB_FIND_QUIETLY)
ELSE(LIBUSB_FOUND)
   IF(LIBUSB_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find LIBUSB!")
   ENDIF(LIBUSB_FIND_REQUIRED)
ENDIF(LIBUSB_FOUND)
