From 677fa91e376b98d871bb238ecb84685dd4f33ebd Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sun, 26 Apr 2009 20:33:29 +0200 Subject: Hello, world! --- Modules/FindUSB.cmake | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Modules/FindUSB.cmake (limited to 'Modules/FindUSB.cmake') diff --git a/Modules/FindUSB.cmake b/Modules/FindUSB.cmake new file mode 100644 index 0000000..d562b98 --- /dev/null +++ b/Modules/FindUSB.cmake @@ -0,0 +1,31 @@ +# - Try to find libusb-1.0 +# Once done, this will define +# +# USB_FOUND - system has libusb-1.0 +# USB_INCLUDE_DIRS - the libusb-1.0 include directories +# USB_LIBRARIES - link these to use libusb-1.0 + +include(LibFindMacros) + +# Dependencies + +# Use pkg-config to get hints about paths +libfind_pkg_check_modules(USB_PKGCONF libusb-1.0) + +# Include dir +find_path(USB_INCLUDE_DIR + NAMES libusb.h + PATHS ${USB_PKGCONF_INCLUDE_DIRS} +) + +# Finally the library itself +find_library(USB_LIBRARY + NAMES usb-1.0 + PATHS ${USB_PKGCONF_LIBRARY_DIRS} +) + +# Set the include dir variables and the libraries and let libfind_process do the rest. +# NOTE: Singular variables for this library, plural for libraries this this lib depends on. +set(USB_PROCESS_INCLUDES USB_INCLUDE_DIR) +set(USB_PROCESS_LIBS USB_LIBRARY) +libfind_process(USB) -- cgit v1.1-32-gdbae