Skip to content

Commit 8219750

Browse files
nbourdauzarvox
authored andcommitted
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 <[email protected]>
1 parent 3d735a8 commit 8219750

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cmake_modules/Findlibusb-1.0.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
4949
else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
5050
find_path(LIBUSB_1_INCLUDE_DIR
5151
NAMES
52-
libusb-1.0/libusb.h
52+
libusb.h
5353
PATHS
5454
/usr/include
5555
/usr/local/include
@@ -61,7 +61,7 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
6161

6262
find_library(LIBUSB_1_LIBRARY
6363
NAMES
64-
usb-1.0
64+
usb-1.0 usb
6565
PATHS
6666
/usr/lib
6767
/usr/local/lib
@@ -95,4 +95,4 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
9595
# show the LIBUSB_1_INCLUDE_DIRS and LIBUSB_1_LIBRARIES variables only in the advanced view
9696
mark_as_advanced(LIBUSB_1_INCLUDE_DIRS LIBUSB_1_LIBRARIES)
9797

98-
endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
98+
endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)

src/usb_libusb10.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <stdlib.h>
3030
#include <string.h>
3131
#include <unistd.h>
32-
#include <libusb-1.0/libusb.h>
32+
#include <libusb.h>
3333
#include "freenect_internal.h"
3434
#include "loader.h"
3535

src/usb_libusb10.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define USB_LIBUSB10
2929

3030
#include "libfreenect.h"
31-
#include <libusb-1.0/libusb.h>
31+
#include <libusb.h>
3232

3333
#if defined(__APPLE__)
3434
/*

0 commit comments

Comments
 (0)