From 2fe86b56618468343a0fc99489f028f9995c53e3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 30 Oct 2021 16:11:27 -0700 Subject: [PATCH] build-system: correctly build against hidapi On some Linux system (like openSUSE) there are two versions of the library and we need to explicitly pick one. Signed-off-by: Dirk Hohndel --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bac09ae8d..e1e7a628a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -232,6 +232,12 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") # in some builds we appear to be missing libz for some strange reason... set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lz -lpthread) + # on some Linux systems (like openSUSE) we don't manage to successfully + # link against libhidapi-libusb - even if that is used by libdivecomputer + find_library(HID_LIB hidapi-libusb) + message(STATUS "find hidapi-libusb: ${HID_LIB}") + set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${HID_LIB}) + # Test for ARM processor (Raspberry Pi) and add libGLESv2 if found if (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "armv6l") message (STATUS "Found ARM processor. Adding libGLESv2")