Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
# hidapi | ||
set(BUILD_SHARED_LIBS FALSE CACHE BOOL "Don't build shared libs") | ||
set(HIDAPI_INSTALL_TARGETS FALSE CACHE BOOL "Don't install anything") | ||
|
||
if(CMAKE_SYSTEM MATCHES "Linux") | ||
set(HIDAPI_WITH_LIBUSB FALSE CACHE BOOL "Don't build with libusb for linux") | ||
endif() | ||
|
||
add_library(3rdparty_hidapi INTERFACE) | ||
target_include_directories(3rdparty_hidapi INTERFACE hidapi/hidapi) | ||
add_subdirectory(hidapi EXCLUDE_FROM_ALL) | ||
|
||
if(APPLE) | ||
add_subdirectory(hidapi/mac EXCLUDE_FROM_ALL) | ||
target_include_directories(hidapi-mac PUBLIC hidapi/hidapi) | ||
|
||
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-mac "-framework CoreFoundation" "-framework IOKit") | ||
elseif(CMAKE_SYSTEM MATCHES "Linux") | ||
add_subdirectory(hidapi/linux EXCLUDE_FROM_ALL) | ||
target_include_directories(hidapi-hidraw PUBLIC hidapi/hidapi) | ||
|
||
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-hidraw udev) | ||
elseif(WIN32) | ||
add_subdirectory(hidapi/windows EXCLUDE_FROM_ALL) | ||
target_include_directories(hidapi-hid PUBLIC hidapi/hidapi) | ||
|
||
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-hid Shlwapi.lib) | ||
else() | ||
add_subdirectory(hidapi/libusb EXCLUDE_FROM_ALL) | ||
target_include_directories(hidapi-libusb PUBLIC hidapi/hidapi) | ||
|
||
target_link_libraries(3rdparty_hidapi INTERFACE hidapi-libusb usb) | ||
endif() |