dolphin/Externals/hidapi/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
680 B
CMake
Raw Normal View History

2017-04-25 05:06:39 +02:00
project(hidapi)
add_library(hidapi STATIC hidapi-src/hidapi/hidapi.h)
dolphin_disable_warnings(hidapi)
target_include_directories(hidapi PUBLIC hidapi-src/hidapi)
2017-04-25 05:06:39 +02:00
if(APPLE)
target_sources(hidapi PRIVATE hidapi-src/mac/hid.c)
2017-04-25 05:06:39 +02:00
elseif(MSVC)
target_sources(hidapi PRIVATE hidapi-src/windows/hid.c)
2017-04-25 05:06:39 +02:00
else()
find_package(LIBUDEV)
2017-04-25 05:06:39 +02:00
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND LIBUDEV_FOUND)
target_sources(hidapi PRIVATE hidapi-src/linux/hid.c)
2017-04-25 05:06:39 +02:00
target_link_libraries(hidapi PRIVATE udev)
else()
target_sources(hidapi PRIVATE hidapi-src/libusb/hid.c)
target_link_libraries(hidapi PRIVATE LibUSB::LibUSB)
2017-04-25 05:06:39 +02:00
endif()
endif()
add_library(Hidapi::Hidapi ALIAS hidapi)