Browse files

Fix cmake libusb search and fix libusb include

Adjust cmake test for libusb library so that the compatible libusb for
freebsd can be found.  Since freebsd's libusb header are located in a
different place from libusb-1.0, the includes in the source code must be
adjusted using #include <libusb.h>.  Actually those new include statements
are those that libusb-1.0 really expects to be used (see libusb-1.0.pc
cflags to verify this). With this commit, libfreenect is buildable on
freebsd.

Signed-off-by: Nicolas Bourdaud <nicolas.bourdaud@gmail.com>
  • Loading branch information...
1 parent 3d735a8 commit 8219750df3a13501626a7f7f54d24afb8e64ec3f @nbourdau nbourdau committed with zarvox Jan 19, 2012
Showing with 5 additions and 5 deletions.
  1. +3 −3 cmake_modules/Findlibusb-1.0.cmake
  2. +1 −1 src/usb_libusb10.c
  3. +1 −1 src/usb_libusb10.h
View
6 cmake_modules/Findlibusb-1.0.cmake
@@ -49,7 +49,7 @@ if (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
find_path(LIBUSB_1_INCLUDE_DIR
NAMES
- libusb-1.0/libusb.h
+ libusb.h
PATHS
/usr/include
/usr/local/include
@@ -61,7 +61,7 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
find_library(LIBUSB_1_LIBRARY
NAMES
- usb-1.0
+ usb-1.0 usb
PATHS
/usr/lib
/usr/local/lib
@@ -95,4 +95,4 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
# show the LIBUSB_1_INCLUDE_DIRS and LIBUSB_1_LIBRARIES variables only in the advanced view
mark_as_advanced(LIBUSB_1_INCLUDE_DIRS LIBUSB_1_LIBRARIES)
-endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
+endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
View
2 src/usb_libusb10.c
@@ -29,7 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <libusb-1.0/libusb.h>
+#include <libusb.h>
#include "freenect_internal.h"
#include "loader.h"
View
2 src/usb_libusb10.h
@@ -28,7 +28,7 @@
#define USB_LIBUSB10
#include "libfreenect.h"
-#include <libusb-1.0/libusb.h>
+#include <libusb.h>
#if defined(__APPLE__)
/*

0 comments on commit 8219750

Please sign in to comment.