summaryrefslogtreecommitdiffstats
path: root/externals/find-modules/Findlibusb.cmake
diff options
context:
space:
mode:
authorAlexandre Bouvier <contact@amb.tf>2022-12-05 22:03:34 +0100
committerAlexandre Bouvier <contact@amb.tf>2022-12-06 05:30:40 +0100
commitf385175aa21f47b5f4830fcc65128b19ee46e2fe (patch)
tree093eec7642239bb4cfbea05121870191d2f181f7 /externals/find-modules/Findlibusb.cmake
parentMerge pull request #9385 from Morph1984/dynarmic-ver (diff)
downloadyuzu-f385175aa21f47b5f4830fcc65128b19ee46e2fe.tar
yuzu-f385175aa21f47b5f4830fcc65128b19ee46e2fe.tar.gz
yuzu-f385175aa21f47b5f4830fcc65128b19ee46e2fe.tar.bz2
yuzu-f385175aa21f47b5f4830fcc65128b19ee46e2fe.tar.lz
yuzu-f385175aa21f47b5f4830fcc65128b19ee46e2fe.tar.xz
yuzu-f385175aa21f47b5f4830fcc65128b19ee46e2fe.tar.zst
yuzu-f385175aa21f47b5f4830fcc65128b19ee46e2fe.zip
Diffstat (limited to 'externals/find-modules/Findlibusb.cmake')
-rw-r--r--externals/find-modules/Findlibusb.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/externals/find-modules/Findlibusb.cmake b/externals/find-modules/Findlibusb.cmake
new file mode 100644
index 000000000..66f61001c
--- /dev/null
+++ b/externals/find-modules/Findlibusb.cmake
@@ -0,0 +1,18 @@
+# SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf>
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+find_package(PkgConfig QUIET)
+if (PKG_CONFIG_FOUND)
+ pkg_search_module(LIBUSB QUIET IMPORTED_TARGET libusb-1.0)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(libusb
+ REQUIRED_VARS LIBUSB_LINK_LIBRARIES
+ VERSION_VAR LIBUSB_VERSION
+)
+
+if (libusb_FOUND AND NOT TARGET libusb::usb)
+ add_library(libusb::usb ALIAS PkgConfig::LIBUSB)
+endif()