Update hamlib and libusb package finders for Linux

This commit is contained in:
Bill Somerville 2021-04-13 02:02:49 +01:00
parent 63e485e819
commit 00f1d7577a
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
2 changed files with 7 additions and 3 deletions

View File

@ -28,14 +28,16 @@ if (NOT hamlib_PKGCONF_FOUND)
else () else ()
set (hamlib_LIBRARIES ${hamlib_LIBRARIES};m;dl) set (hamlib_LIBRARIES ${hamlib_LIBRARIES};m;dl)
endif () endif ()
elseif (UNIX AND NOT APPLE)
set (hamlib_LIBRARIES ${hamlib_PKGCONF_STATIC_LDFLAGS})
endif () endif ()
if (hamlib_FOUND AND NOT TARGET hamlib::hamlib) if (hamlib_FOUND AND NOT TARGET hamlib::hamlib)
add_library (hamlib::hamlib UNKNOWN IMPORTED) add_library (hamlib::hamlib UNKNOWN IMPORTED)
set_target_properties (hamlib::hamlib PROPERTIES set_target_properties (hamlib::hamlib PROPERTIES
IMPORTED_LOCATION "${hamlib_LIBRARY}" IMPORTED_LOCATION "${hamlib_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${hamlib_PKGCONF_CFLAGS_OTHER}" INTERFACE_COMPILE_OPTIONS "${hamlib_PKGCONF_STATIC_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${hamlib_INCLUDE_DIRS}" INTERFACE_INCLUDE_DIRECTORIES "${hamlib_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${hamlib_LIBRARIES}" INTERFACE_LINK_LIBRARIES "${hamlib_LIBRARIES}"
) )
endif () endif ()

View File

@ -13,6 +13,8 @@
# libusb::libusb - The libusb library # libusb::libusb - The libusb library
# #
include (LibFindMacros)
if (WIN32) if (WIN32)
# Use path suffixes on MS Windows as we probably shouldn't # Use path suffixes on MS Windows as we probably shouldn't
# trust the PATH envvar. PATH will still be searched to find the # trust the PATH envvar. PATH will still be searched to find the
@ -25,7 +27,7 @@ if (WIN32)
endif () endif ()
libfind_pkg_detect (libusb libusb-1.0 libfind_pkg_detect (libusb libusb-1.0
FIND_PATH libusb.h PATH_SUFFIXES 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) libfind_process (libusb)