aboutsummaryrefslogtreecommitdiffstats
path: root/host/cmake
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2015-08-06 16:01:13 -0700
committerMartin Braun <martin.braun@ettus.com>2015-08-06 18:07:24 -0700
commit0f2346554d47678cb924f94ce7d6cd7bc94238ef (patch)
tree59d0adcdbc7cd971a5d962a24b5f0a4af6ca4dfb /host/cmake
parentf4e7debd1fea196e37f921bf1b3025fcfc6816b5 (diff)
downloaduhd-0f2346554d47678cb924f94ce7d6cd7bc94238ef.tar.gz
uhd-0f2346554d47678cb924f94ce7d6cd7bc94238ef.tar.bz2
uhd-0f2346554d47678cb924f94ce7d6cd7bc94238ef.zip
UHD: libusb_strerror compatibility with older versions of libusb
Diffstat (limited to 'host/cmake')
-rw-r--r--host/cmake/Modules/FindUSB1.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/host/cmake/Modules/FindUSB1.cmake b/host/cmake/Modules/FindUSB1.cmake
index 1e8e3ba03..7c4a8fb6b 100644
--- a/host/cmake/Modules/FindUSB1.cmake
+++ b/host/cmake/Modules/FindUSB1.cmake
@@ -8,7 +8,7 @@ PKG_CHECK_MODULES(PC_LIBUSB QUIET libusb-1.0)
FIND_PATH(LIBUSB_INCLUDE_DIRS
NAMES libusb.h
- HINTS $ENV{LIBUSB_DIR}/include $ENV{LIBUSB_DIR}/include/libusb-1.0
+ HINTS $ENV{LIBUSB_DIR}/include $ENV{LIBUSB_DIR}/include/libusb-1.0
${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDEDIR}/libusb-1.0
PATHS /usr/local/include/libusb-1.0 /usr/local/include
/usr/include/libusb-1.0 /usr/include
@@ -52,6 +52,11 @@ if(HAVE_LIBUSB_ERROR_NAME)
list(APPEND LIBUSB_DEFINITIONS "HAVE_LIBUSB_ERROR_NAME=1")
endif(HAVE_LIBUSB_ERROR_NAME)
+CHECK_FUNCTION_EXISTS("libusb_strerror" HAVE_LIBUSB_STRERROR)
+if(HAVE_LIBUSB_STRERROR)
+ list(APPEND LIBUSB_DEFINITIONS "HAVE_LIBUSB_STRERROR=1")
+endif(HAVE_LIBUSB_STRERROR)
+
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIRS)
MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIRS LIBUSB_LIBRARIES)