Patch for CMAKE libusb-1.0.so finding on bananapi-r2
@@ -64,6 +64,9 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
set(LIBUSB_1_LIBRARY_NAME usb)
endif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+message(STATUS "DEBUG --->>>> SEARCHING FOR LIBUSB")
+if(NOT bananapi-r2)
+ message(STATUS "DEBUG --->>>> NOT BANANAPI")
find_library(LIBUSB_1_LIBRARY
NAMES ${LIBUSB_1_LIBRARY_NAME}
PATHS
@@ -72,6 +75,23 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
/opt/local/lib
/sw/lib
)
+endif(NOT bananapi-r2)
+
+
+#bananapi-r2 ubuntu 16.04 has wrong libusb-1.0.so path
+#when compiling on bananapi-r2 run cmake with -DBananapi-r2=YES argument like so:
+# $(builddir)/cmake -DBananapi-r2=YES ../
+if(bananapi-r2)
+ message(STATUS "DEBUG --->>>> BANANAPI")
+ find_library(LIBUSB_1_LIBRARY
+ NAMES ${LIBUSB_1_LIBRARY_NAME}
+ PATHS
+ /lib/arm-linux-gnueabihf/
+ /usr/lib/arm-linux-gnueabihf/
+ NO_DEFAULT_PATH
+ )
+endif(bananapi-r2)
+message(STATUS "DEBUG --->>>> LIBUSB ${LIBUSB_1_LIBRARY}")
set(LIBUSB_1_INCLUDE_DIRS
${LIBUSB_1_INCLUDE_DIR}
