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" diff --git a/libtempered-util/CMakeLists.txt b/libtempered-util/CMakeLists.txt index 169ada9..6cb6bbc 100644 --- a/libtempered-util/CMakeLists.txt +++ b/libtempered-util/CMakeLists.txt @@ -12,6 +12,10 @@ if (BUILD_SHARED_LIB) OUTPUT_NAME tempered-util SOVERSION 0 ) + if(MINGW) + set_target_properties(tempered-util-shared PROPERTIES + SUFFIX ".dll") + endif() target_link_libraries(tempered-util-shared m) if (DEFINED CMAKE_INSTALL_LIBDIR) install( diff --git a/libtempered/CMakeLists.txt b/libtempered/CMakeLists.txt index 34b4120..eee26a2 100644 --- a/libtempered/CMakeLists.txt +++ b/libtempered/CMakeLists.txt @@ -13,6 +13,10 @@ if (BUILD_SHARED_LIB) OUTPUT_NAME tempered SOVERSION 0 ) + if(MINGW) + set_target_properties(tempered-shared PROPERTIES + SUFFIX ".dll") + endif() if (DEFINED CMAKE_INSTALL_LIBDIR) install( TARGETS tempered-shared