summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindUSB.cmake28
-rwxr-xr-xcmake/Packaging/preinst.in2
2 files changed, 29 insertions, 1 deletions
diff --git a/cmake/Modules/FindUSB.cmake b/cmake/Modules/FindUSB.cmake
new file mode 100644
index 000000000..97f3db675
--- /dev/null
+++ b/cmake/Modules/FindUSB.cmake
@@ -0,0 +1,28 @@
+if(NOT LIBUSB_FOUND)
+ pkg_check_modules (LIBUSB_PKG libusb-1.0)
+ find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h
+ PATHS
+ ${LIBUSB_PKG_INCLUDE_DIRS}
+ /usr/include/libusb-1.0
+ /usr/include
+ /usr/local/include
+ )
+
+ find_library(LIBUSB_LIBRARIES NAMES usb-1.0
+ PATHS
+ ${LIBUSB_PKG_LIBRARY_DIRS}
+ /usr/lib
+ /usr/local/lib
+ )
+
+if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+ set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found")
+ message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}")
+else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+ set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
+ message(STATUS "libusb-1.0 not found.")
+endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+
+mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
+
+endif(NOT LIBUSB_FOUND)
diff --git a/cmake/Packaging/preinst.in b/cmake/Packaging/preinst.in
index c60d46568..cb7ee1bc4 100755
--- a/cmake/Packaging/preinst.in
+++ b/cmake/Packaging/preinst.in
@@ -1,5 +1,5 @@
#!/bin/sh
if [ "$1" = "install" ]; then
- ls
+ echo
fi