1 From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001
2 From: Samuel Martin <s.martin49@gmail.com>
3 Date: Sun, 25 Jan 2015 10:01:17 +0100
4 Subject: [PATCH 2/2] cmake: fix FindUSB1.cmake
6 Make sure all ldflags are correctly set, especially for static build.
8 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
10 cmake/FindUSB1.cmake | 8 ++++++--
11 1 file changed, 6 insertions(+), 2 deletions(-)
13 diff --git a/cmake/FindUSB1.cmake b/cmake/FindUSB1.cmake
14 index b90e297..e7f1b3c 100644
15 --- a/cmake/FindUSB1.cmake
16 +++ b/cmake/FindUSB1.cmake
17 @@ -26,8 +26,12 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
18 PATH_SUFFIXES libusb-1.0
19 PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
21 - FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0
22 - PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
23 + set(LIBUSB_LIBRARIES ${PC_LIBUSB_STATIC_LDFLAGS} ${PC_LIBUSB_STATIC_LDFLAGS_OTHER})
24 + foreach(libname ${PC_LIBUSB_STATIC_LIBRARIES})
25 + FIND_LIBRARY(lib NAMES ${libname}
26 + PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
27 + list(APPEND LIBUSB_LIBRARIES ${lib})
30 include(FindPackageHandleStandardArgs)
31 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)