From 00f1d7577af74fefe9357bfee8f19460ea9914f3 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 13 Apr 2021 02:02:49 +0100 Subject: [PATCH] Update hamlib and libusb package finders for Linux --- CMake/Modules/Findhamlib.cmake | 6 ++++-- CMake/Modules/Findlibusb.cmake | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMake/Modules/Findhamlib.cmake b/CMake/Modules/Findhamlib.cmake index af7442a54..0bac5c126 100644 --- a/CMake/Modules/Findhamlib.cmake +++ b/CMake/Modules/Findhamlib.cmake @@ -28,14 +28,16 @@ if (NOT hamlib_PKGCONF_FOUND) else () set (hamlib_LIBRARIES ${hamlib_LIBRARIES};m;dl) endif () +elseif (UNIX AND NOT APPLE) + set (hamlib_LIBRARIES ${hamlib_PKGCONF_STATIC_LDFLAGS}) endif () if (hamlib_FOUND AND NOT TARGET hamlib::hamlib) add_library (hamlib::hamlib UNKNOWN IMPORTED) set_target_properties (hamlib::hamlib PROPERTIES IMPORTED_LOCATION "${hamlib_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${hamlib_PKGCONF_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${hamlib_INCLUDE_DIRS}" + INTERFACE_COMPILE_OPTIONS "${hamlib_PKGCONF_STATIC_CFLAGS_OTHER}" + INTERFACE_INCLUDE_DIRECTORIES "${hamlib_INCLUDE_DIR}" INTERFACE_LINK_LIBRARIES "${hamlib_LIBRARIES}" ) endif () diff --git a/CMake/Modules/Findlibusb.cmake b/CMake/Modules/Findlibusb.cmake index b5c6d2029..d3a55cdb7 100644 --- a/CMake/Modules/Findlibusb.cmake +++ b/CMake/Modules/Findlibusb.cmake @@ -13,6 +13,8 @@ # libusb::libusb - The libusb library # +include (LibFindMacros) + if (WIN32) # Use path suffixes on MS Windows as we probably shouldn't # trust the PATH envvar. PATH will still be searched to find the @@ -25,7 +27,7 @@ if (WIN32) endif () libfind_pkg_detect (libusb libusb-1.0 FIND_PATH libusb.h PATH_SUFFIXES libusb-1.0 - FIND_LIBRARY libusb-1.0 ${_library_options} + FIND_LIBRARY usb-1.0 ${_library_options} ) libfind_process (libusb)