From 93eef448c23473a7f8132514cf2a8ac9585e261f Mon Sep 17 00:00:00 2001 From: Wilbert van Ham Date: Sun, 24 Nov 2013 10:31:48 +0100 Subject: [PATCH 1/3] Update CMakeLists.txt added quotation marks to prevent error: Regular expression "(-libusb|/libusb/" cannot compile --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3cd007..64d5a6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ else() ) set(HIDAPI_STATIC_OBJECT ${HIDAPI_OBJECT}) find_package(PkgConfig REQUIRED) - if (HIDAPI_OBJECT MATCHES \(-libusb|/libusb/(.libs/)?hid\)\\.o\$) + if (HIDAPI_OBJECT MATCHES "\(-libusb|/libusb/(.libs/)?hid\)\\.o\$") pkg_check_modules(LIBUSB REQUIRED libusb-1.0) set(HIDAPI_LINK_LIBS ${LIBUSB_LIBRARIES} rt pthread) else() From e4c5a3abf362f5a6289e31d9fcbd6efec8f36cd4 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 21 Sep 2016 09:54:28 -0400 Subject: [PATCH 2/3] Fix missing links to dependencies of libtempered --- libtempered/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libtempered/CMakeLists.txt b/libtempered/CMakeLists.txt index b989315..34b4120 100644 --- a/libtempered/CMakeLists.txt +++ b/libtempered/CMakeLists.txt @@ -8,6 +8,7 @@ endif() if (BUILD_SHARED_LIB) add_library(tempered-shared SHARED ${libtempered_FILES}) + target_link_libraries(tempered-shared ${HIDAPI_LINK_LIBS}) set_target_properties(tempered-shared PROPERTIES OUTPUT_NAME tempered SOVERSION 0 @@ -22,6 +23,7 @@ endif() if (BUILD_STATIC_LIB) add_library(tempered-static STATIC ${libtempered_FILES}) + target_link_libraries(tempered-static ${HIDAPI_LINK_LIBS}) set_target_properties(tempered-static PROPERTIES OUTPUT_NAME tempered ) 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 3/3] 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"