summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Markgraf <steve@steve-m.de>2013-11-17 19:17:02 +0100
committerSteve Markgraf <steve@steve-m.de>2013-11-17 19:17:02 +0100
commiteffcaa75bfd43262f621184c28be2935149965b9 (patch)
tree79195fd475c84b1dbad89bae3c3f604ac6a26183
parentcd37e9fab1ed6fc3ba9f0de55f96945099efcd1a (diff)
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>
-rw-r--r--software/libosmosdr/cmake/Modules/FindLibUSB.cmake11
1 files changed, 10 insertions, 1 deletions
diff --git a/software/libosmosdr/cmake/Modules/FindLibUSB.cmake b/software/libosmosdr/cmake/Modules/FindLibUSB.cmake
index 97f3db6..54d57a5 100644
--- a/software/libosmosdr/cmake/Modules/FindLibUSB.cmake
+++ b/software/libosmosdr/cmake/Modules/FindLibUSB.cmake
@@ -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