Add hidapi lib

This commit is contained in:
german
2020-09-18 19:15:16 -05:00
parent 693a1fe1e8
commit e2523c3828
6 changed files with 35 additions and 18 deletions

20
externals/hidapi/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,20 @@
project(hidapi)
add_library(hidapi STATIC hidapi/hidapi/hidapi.h)
target_include_directories(hidapi PUBLIC hidapi/hidapi)
if(APPLE)
target_sources(hidapi PRIVATE hidapi/mac/hid.c)
elseif(MSVC)
target_sources(hidapi PRIVATE hidapi/windows/hid.c)
else()
find_package(Libudev)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND LIBUDEV_FOUND)
target_sources(hidapi PRIVATE hidapi/linux/hid.c)
target_link_libraries(hidapi PRIVATE hidapi/udev)
else()
target_sources(hidapi PRIVATE hidapi/libusb/hid.c)
endif()
endif()
add_library(Hidapi::Hidapi ALIAS hidapi)

1
externals/hidapi/hidapi vendored Submodule

Submodule externals/hidapi/hidapi added at ad27b46170