--- stlink-1.8.0/cmake/modules/Findlibusb.cmake.orig	2024-02-01 00:01:58.000000000 +0100
+++ stlink-1.8.0/cmake/modules/Findlibusb.cmake	2025-01-10 09:34:25.813966700 +0100
@@ -54,6 +54,12 @@
     endif()
 
     if (WIN32 AND NOT EXISTS "/etc/debian_version") # Skip this for Debian...
+        find_package(PkgConfig)
+        if(PKG_CONFIG_FOUND)
+            pkg_check_modules(LIBUSB libusb-1.0)
+        endif()
+
+        if (NOT LIBUSB_FOUND)
         # Preparations for installing libusb library
         set(LIBUSB_WIN_VERSION 1.0.25)                  # set libusb version
         set(LIBUSB_WIN_ARCHIVE libusb-${LIBUSB_WIN_VERSION}.7z)
@@ -83,11 +89,12 @@
             COMMAND ${CMAKE_COMMAND} -E tar xv ${LIBUSB_WIN_ARCHIVE_PATH}
             WORKING_DIRECTORY ${LIBUSB_WIN_OUTPUT_FOLDER}
             )
+        endif()
 
         # Find path to libusb library
         FIND_PATH(
             LIBUSB_INCLUDE_DIR NAMES libusb.h
-            HINTS ${LIBUSB_WIN_OUTPUT_FOLDER}/include
+            HINTS ${LIBUSB_INCLUDE_DIRS}
             PATH_SUFFIXES libusb-1.0
             NO_DEFAULT_PATH
             NO_CMAKE_FIND_ROOT_PATH
@@ -97,7 +104,7 @@
             set(LIBUSB_NAME usb-1.0)
             find_library(
                 LIBUSB_LIBRARY NAMES ${LIBUSB_NAME}
-                HINTS ${LIBUSB_WIN_OUTPUT_FOLDER}/MinGW${ARCH}/static
+                HINTS ${LIBUSB_LIBRARY_DIRS}
                 NO_DEFAULT_PATH
                 NO_CMAKE_FIND_ROOT_PATH
                 )
@@ -130,7 +137,10 @@
     FIND_PACKAGE_HANDLE_STANDARD_ARGS(libusb DEFAULT_MSG LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR)
     mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY)
 
-    if (NOT LIBUSB_FOUND)
+    if (LIBUSB_FOUND)
+        message(STATUS "=== LIBUSB_INCLUDE_DIR: " ${LIBUSB_INCLUDE_DIR})
+        message(STATUS "=== LIBUSB_LIBRARY: " ${LIBUSB_LIBRARY})
+    else ()
         message(FATAL_ERROR "libusb library not found on your system! Install libusb 1.0.x from your package repository.")
     endif()
 endif()
