diff options
Diffstat (limited to 'Modules/FindUSB.cmake')
-rw-r--r-- | Modules/FindUSB.cmake | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/Modules/FindUSB.cmake b/Modules/FindUSB.cmake deleted file mode 100644 index 486864f..0000000 --- a/Modules/FindUSB.cmake +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | # - Try to find libusb-1.0 | ||
2 | # Once done, this will define | ||
3 | # | ||
4 | # USB_FOUND - system has libusb-1.0 | ||
5 | # USB_INCLUDE_DIRS - the libusb-1.0 include directories | ||
6 | # USB_LIBRARIES - link these to use libusb-1.0 | ||
7 | |||
8 | include(LibFindMacros) | ||
9 | |||
10 | # Dependencies | ||
11 | |||
12 | # pkg-config + libusb fails on FreeBSD, though libusb is in base | ||
13 | if(NOT(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")) | ||
14 | # Use pkg-config to get hints about paths | ||
15 | libfind_pkg_check_modules(USB_PKGCONF libusb-1.0>=1.0.3) | ||
16 | # We want to look for libusb-1.0 | ||
17 | set(USB_LIBRARY_NAME usb-1.0) | ||
18 | else() | ||
19 | set(USB_PKGCONF_INCLUDE_DIRS /usr/include) | ||
20 | set(USB_PKGCONF_LIBRARY_DIRS /usr/lib) | ||
21 | set(USB_LIBRARY_NAME usb) | ||
22 | endif() | ||
23 | |||
24 | # Include dir | ||
25 | find_path(USB_INCLUDE_DIR | ||
26 | NAMES libusb.h | ||
27 | PATHS ${USB_PKGCONF_INCLUDE_DIRS} | ||
28 | ) | ||
29 | |||
30 | # Finally the library itself | ||
31 | find_library(USB_LIBRARY | ||
32 | NAMES ${USB_LIBRARY_NAME} | ||
33 | PATHS ${USB_PKGCONF_LIBRARY_DIRS} | ||
34 | ) | ||
35 | |||
36 | # Set the include dir variables and the libraries and let libfind_process do the rest. | ||
37 | # NOTE: Singular variables for this library, plural for libraries this this lib depends on. | ||
38 | set(USB_PROCESS_INCLUDES USB_INCLUDE_DIR) | ||
39 | set(USB_PROCESS_LIBS USB_LIBRARY) | ||
40 | libfind_process(USB) | ||