dolphin/Externals/hidapi/CMakeLists.txt
MerryMage 14c03388b3 Externals: Link against required libraries
* curl requires zlib
* hidapi when not using libudev requires libusb
2021-01-03 14:26:38 +00:00

22 lines
570 B
CMake

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