2013-11-22 14:42:02 +01:00
|
|
|
project(hidapi)
|
|
|
|
|
2013-12-17 22:53:16 +01:00
|
|
|
# Add the 'generic' hidapi include directory
|
|
|
|
include_directories(../../include/hidapi)
|
2013-11-22 14:42:02 +01:00
|
|
|
|
2013-12-18 15:54:43 +01:00
|
|
|
#TODO[TvdZ]: Rename hidapi-??? to hidapi
|
2013-12-17 22:53:16 +01:00
|
|
|
if(APPLE)
|
2013-11-22 14:42:02 +01:00
|
|
|
|
2013-12-17 22:53:16 +01:00
|
|
|
find_package(IOKit REQUIRED)
|
|
|
|
find_package(CoreFoundation REQUIRED)
|
2013-11-22 14:42:02 +01:00
|
|
|
|
2013-12-17 22:53:16 +01:00
|
|
|
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)
|
|
|
|
|
2013-12-18 09:11:18 +01:00
|
|
|
include_directories(${LIBUSB_1_INCLUDE_DIRS})
|
2013-12-17 22:53:16 +01:00
|
|
|
|
|
|
|
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()
|