From: Antonio Ospite Date: Tue, 21 Feb 2012 13:48:06 +0000 (+0100) Subject: cmake: fix libusb search X-Git-Tag: v0.1.0~1^2~37 X-Git-Url: https://git.ao2.it/libam7xxx.git/commitdiff_plain/ff1b548c9ae29b22e42c232710eebf20440dbed8?ds=sidebyside cmake: fix libusb search 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 . 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). Taken from libfreenect commit 8219750df3a13501626a7f7f54d24afb8e64ec3f https://github.com/OpenKinect/libfreenect/commit/8219750df3a13501626a7f7f54d24afb8e64ec3f --- diff --git a/cmake_modules/Findlibusb-1.0.cmake b/cmake_modules/Findlibusb-1.0.cmake index 405ed51..ec40055 100644 --- a/cmake_modules/Findlibusb-1.0.cmake +++ b/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) \ No newline at end of file +endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS) diff --git a/src/am7xxx.c b/src/am7xxx.c index c5ec753..b63067e 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "am7xxx.h" #include "serialize.h"