cmake: detect libusb on FreeBSD

Source:
http://patch-tracker.debian.org/patch/series/view/libosmosdr/0.1.7.cd37e9-2/libusb-freebsd

Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
Steve Markgraf 2013-11-17 19:17:02 +01:00
parent cd37e9fab1
commit effcaa75bf
1 changed files with 10 additions and 1 deletions

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