Skip to content

Instantly share code, notes, and snippets.

@dominicgs
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dominicgs/1bcf4f383f17cb39934f to your computer and use it in GitHub Desktop.
Save dominicgs/1bcf4f383f17cb39934f to your computer and use it in GitHub Desktop.
diff --git a/host/cmake/modules/FindUSB1.cmake b/host/cmake/modules/FindUSB1.cmake
index 0cbf802..2f3138d 100644
--- a/host/cmake/modules/FindUSB1.cmake
+++ b/host/cmake/modules/FindUSB1.cmake
@@ -24,10 +24,15 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
pkg_check_modules(PC_LIBUSB libusb-1.0)
ENDIF(NOT WIN32)
+ set(LIBUSB_LIBRARY_NAME usb-1.0)
+ IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+ set(LIBUSB_LIBRARY_NAME usb)
+ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+
FIND_PATH(LIBUSB_INCLUDE_DIR libusb.h
PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0
+ FIND_LIBRARY(LIBUSB_LIBRARIES NAMES ${LIBUSB_LIBRARY_NAME}
PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
include(FindPackageHandleStandardArgs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment