cmake: detect libusb on FreeBSD

Source:
http://patch-tracker.debian.org/patch/series/view/rtl-sdr/0.5.0.4.4914-2/libusb-freebsd

Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
Steve Markgraf 2013-11-17 19:09:59 +01:00
parent fbfa127889
commit 3969938eb6

View File

@ -8,7 +8,16 @@ if(NOT LIBUSB_FOUND)
/usr/local/include
)
find_library(LIBUSB_LIBRARIES NAMES usb-1.0
#standard library name for libusb-1.0
set(libusb1_library_names usb-1.0)
#libusb-1.0 compatible library on freebsd
if((CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") OR (CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD"))
list(APPEND libusb1_library_names usb)
endif()
find_library(LIBUSB_LIBRARIES
NAMES ${libusb1_library_names}
PATHS
${LIBUSB_PKG_LIBRARY_DIRS}
/usr/lib