2021-05-26 19:03:53 +00:00
|
|
|
# hidapi
|
2022-01-02 21:13:55 +00:00
|
|
|
set(BUILD_SHARED_LIBS FALSE CACHE BOOL "Don't build shared libs")
|
|
|
|
set(HIDAPI_INSTALL_TARGETS FALSE CACHE BOOL "Don't install anything")
|
|
|
|
|
|
|
|
if(CMAKE_SYSTEM MATCHES "Linux")
|
|
|
|
set(HIDAPI_WITH_LIBUSB FALSE CACHE BOOL "Don't build with libusb for linux")
|
|
|
|
endif()
|
|
|
|
|
2021-05-26 19:03:53 +00:00
|
|
|
add_library(3rdparty_hidapi INTERFACE)
|
2022-01-02 21:13:55 +00:00
|
|
|
add_subdirectory(hidapi EXCLUDE_FROM_ALL)
|
2021-05-26 19:03:53 +00:00
|
|
|
|
|
|
|
if(APPLE)
|
2022-01-03 15:33:33 +00:00
|
|
|
target_link_libraries(3rdparty_hidapi INTERFACE hidapi_darwin "-framework CoreFoundation" "-framework IOKit")
|
2021-05-26 19:03:53 +00:00
|
|
|
elseif(CMAKE_SYSTEM MATCHES "Linux")
|
|
|
|
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-hidraw udev)
|
|
|
|
elseif(WIN32)
|
2023-07-11 18:40:30 +00:00
|
|
|
target_link_libraries(3rdparty_hidapi INTERFACE hidapi::hidapi hidapi::include Shlwapi.lib)
|
2021-05-26 19:03:53 +00:00
|
|
|
else()
|
|
|
|
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-libusb usb)
|
|
|
|
endif()
|