2024-03-11 07:15:21 +00:00
|
|
|
# SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf>
|
2024-03-06 05:22:02 +00:00
|
|
|
#
|
2024-03-11 07:15:21 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2024-03-06 05:22:02 +00:00
|
|
|
|
2024-03-11 07:15:21 +00:00
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
pkg_search_module(LIBUSB QUIET IMPORTED_TARGET libusb-1.0)
|
2024-03-06 05:22:02 +00:00
|
|
|
|
2024-03-11 07:15:21 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(libusb
|
|
|
|
REQUIRED_VARS LIBUSB_LINK_LIBRARIES
|
|
|
|
VERSION_VAR LIBUSB_VERSION
|
|
|
|
)
|
2024-03-06 05:22:02 +00:00
|
|
|
|
2024-03-11 07:15:21 +00:00
|
|
|
if (libusb_FOUND AND NOT TARGET libusb::usb)
|
|
|
|
add_library(libusb::usb ALIAS PkgConfig::LIBUSB)
|
|
|
|
endif()
|