From b85f95988286f7e4b2eddd1782e3dd8ec294a194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= Date: Sun, 8 Dec 2019 20:54:58 +0100 Subject: [PATCH] Fix build under MSYS2 MinGW-w64 (Windows) - Under MSYS2 MinGW-w64 the filename of the hidapi import library is "libhidapi.dll.a". Add hidapi.dll to NAMES of findlibrary(). --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64d5a6e..27602fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,8 @@ find_path(HIDAPI_HEADER_DIR hidapi.h ) if (BUILD_HIDAPI_SHARED) - find_library(HIDAPI_LIB NAMES hidapi-hidraw hidapi-libusb + # Under MSYS2 MinGW-w64 the filename of the import library is libhidapi.dll.a + find_library(HIDAPI_LIB NAMES hidapi-hidraw hidapi-libusb hidapi.dll PATHS ../hidapi ../hidapi.git PATH_SUFFIXES linux/.libs libusb/.libs linux libusb mac DOC "The location of the HIDAPI shared library file"