aboutsummaryrefslogtreecommitdiffstats
path: root/host/cmake
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2013-03-11 11:30:37 -0700
committerJosh Blum <josh@joshknows.com>2013-03-11 11:30:37 -0700
commitd39020b2364ef9fd17d51208fd94f025ed769e04 (patch)
treebc0615238875f3baa90f621949ae523ea9f5a5d7 /host/cmake
parent83063ea8b149281717677b1e20ab5e014996778d (diff)
downloaduhd-d39020b2364ef9fd17d51208fd94f025ed769e04.tar.gz
uhd-d39020b2364ef9fd17d51208fd94f025ed769e04.tar.bz2
uhd-d39020b2364ef9fd17d51208fd94f025ed769e04.zip
usb: check for and use libusb_handle_events_timeout_completed
Diffstat (limited to 'host/cmake')
-rw-r--r--host/cmake/Modules/FindUSB1.cmake14
1 files changed, 13 insertions, 1 deletions
diff --git a/host/cmake/Modules/FindUSB1.cmake b/host/cmake/Modules/FindUSB1.cmake
index 8bfc2f975..33ac891bc 100644
--- a/host/cmake/Modules/FindUSB1.cmake
+++ b/host/cmake/Modules/FindUSB1.cmake
@@ -32,7 +32,19 @@ FIND_LIBRARY(LIBUSB_LIBRARIES
PATHS /usr/local/lib /usr/lib /opt/local/lib
)
+include(CheckFunctionExists)
+if(LIBUSB_INCLUDE_DIRS)
+ set(CMAKE_REQUIRED_INCLUDES ${LIBUSB_INCLUDE_DIRS})
+endif()
+if(LIBUSB_LIBRARIES)
+ set(CMAKE_REQUIRED_LIBRARIES ${LIBUSB_LIBRARIES})
+endif()
+CHECK_FUNCTION_EXISTS("libusb_handle_events_timeout_completed" HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED)
+
+if(HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED)
+ list(APPEND LIBUSB_DEFINITIONS "HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED=1")
+endif(HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED)
+
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIRS)
MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIRS LIBUSB_LIBRARIES)
-