mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
a3ba0b58af
Former-commit-id: 27a02e329378f980bd3ee9e4be983c4e11ae0614
38 lines
862 B
CMake
38 lines
862 B
CMake
project(hidapi)
|
|
|
|
# Add the 'generic' hidapi include directory
|
|
include_directories(../../include/hidapi)
|
|
|
|
#TODO[TvdZ]: Rename hidapi-??? to hidapi
|
|
if(APPLE)
|
|
|
|
find_package(IOKit REQUIRED)
|
|
find_package(CoreFoundation REQUIRED)
|
|
|
|
include_directories($IOKit_INCLUDE_DIRS})
|
|
include_directories($CoreFoundation_INCLUDE_DIRS})
|
|
|
|
# HIDAPI library specific for MacOS
|
|
add_library(hidapi-mac hid-mac.c)
|
|
|
|
target_link_libraries(hidapi-mac
|
|
${IOKit_LIBRARY}
|
|
${CoreFoundation_LIBRARY})
|
|
elseif(UNIX)
|
|
# HIDAPI library based on lib-usb
|
|
|
|
#add libusb and pthreads
|
|
find_package(libusb-1.0 REQUIRED)
|
|
find_package(Threads REQUIRED)
|
|
|
|
include_directories(${LIBUSB_1_INCLUDE_DIRS})
|
|
|
|
add_library(hidapi-libusb hid-libusb.c)
|
|
|
|
target_link_libraries(hidapi-libusb
|
|
${LIBUSB_1_LIBRARIES} #apt-get install libusb-1.0-0-dev
|
|
${CMAKE_THREAD_LIBS_INIT}
|
|
)
|
|
|
|
endif()
|