summaryrefslogtreecommitdiffstats
path: root/Modules/FindUSB.cmake
diff options
context:
space:
mode:
authorGravatar Jacob Myers2010-06-11 21:58:38 -0400
committerGravatar Hector Martin2010-06-12 04:28:57 +0200
commit6eef4b8c6263af1938ea52bc6e3c6976678225ff (patch)
tree21d79d5e749715d845754bb81444c33d50e48bcb /Modules/FindUSB.cmake
parent433f675157bfcbbb43cf93ac8cadb0120084098b (diff)
downloadusbmuxd-6eef4b8c6263af1938ea52bc6e3c6976678225ff.tar.gz
usbmuxd-6eef4b8c6263af1938ea52bc6e3c6976678225ff.tar.bz2
These patches get usbmuxd compiling/working on FreeBSD. With minor changes, it could work on other BSD's also.
Diffstat (limited to 'Modules/FindUSB.cmake')
-rw-r--r--Modules/FindUSB.cmake15
1 files changed, 12 insertions, 3 deletions
diff --git a/Modules/FindUSB.cmake b/Modules/FindUSB.cmake
index d1d705a..486864f 100644
--- a/Modules/FindUSB.cmake
+++ b/Modules/FindUSB.cmake
@@ -9,8 +9,17 @@ include(LibFindMacros)
# Dependencies
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(USB_PKGCONF libusb-1.0>=1.0.3)
+# pkg-config + libusb fails on FreeBSD, though libusb is in base
+if(NOT(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD"))
+ # Use pkg-config to get hints about paths
+ libfind_pkg_check_modules(USB_PKGCONF libusb-1.0>=1.0.3)
+ # We want to look for libusb-1.0
+ set(USB_LIBRARY_NAME usb-1.0)
+else()
+ set(USB_PKGCONF_INCLUDE_DIRS /usr/include)
+ set(USB_PKGCONF_LIBRARY_DIRS /usr/lib)
+ set(USB_LIBRARY_NAME usb)
+endif()
# Include dir
find_path(USB_INCLUDE_DIR
@@ -20,7 +29,7 @@ find_path(USB_INCLUDE_DIR
# Finally the library itself
find_library(USB_LIBRARY
- NAMES usb-1.0
+ NAMES ${USB_LIBRARY_NAME}
PATHS ${USB_PKGCONF_LIBRARY_DIRS}
)