mirror of
https://github.com/libretro/dolphin
synced 2024-11-08 06:23:55 -05:00
24 lines
604 B
CMake
24 lines
604 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(WIN32)
|
|
target_sources(hidapi PRIVATE windows/hid.c)
|
|
if(MINGW)
|
|
target_link_libraries(hidapi PRIVATE winmm setupapi)
|
|
endif()
|
|
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)
|
|
endif()
|
|
endif()
|
|
|
|
add_library(Hidapi::Hidapi ALIAS hidapi)
|