diff options
| author | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-04-24 20:06:39 -0700 |
|---|---|---|
| committer | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-04-27 02:41:00 -0700 |
| commit | 655ab9b4e2af61bbc7010e5c97ad8da09fa7b232 (patch) | |
| tree | 327ae6cc9f7055a06a1dd5cc5560097164261707 /Externals/hidapi | |
| parent | dd31a403dbcc68388568fece827c3f0887bb4b25 (diff) | |
CMake: clean up HIDAPI build
Diffstat (limited to 'Externals/hidapi')
| -rw-r--r-- | Externals/hidapi/CMakeLists.txt | 20 | ||||
| -rw-r--r-- | Externals/hidapi/libusb/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | Externals/hidapi/linux/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | Externals/hidapi/mac/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | Externals/hidapi/windows/CMakeLists.txt | 1 |
5 files changed, 20 insertions, 4 deletions
diff --git a/Externals/hidapi/CMakeLists.txt b/Externals/hidapi/CMakeLists.txt new file mode 100644 index 0000000000..4b33a46fd5 --- /dev/null +++ b/Externals/hidapi/CMakeLists.txt @@ -0,0 +1,20 @@ +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(MSVC) + target_sources(hidapi PRIVATE windows/hid.c) +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) diff --git a/Externals/hidapi/libusb/CMakeLists.txt b/Externals/hidapi/libusb/CMakeLists.txt deleted file mode 100644 index 5bb2c08688..0000000000 --- a/Externals/hidapi/libusb/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_library(hidapi-libusb hid.c) diff --git a/Externals/hidapi/linux/CMakeLists.txt b/Externals/hidapi/linux/CMakeLists.txt deleted file mode 100644 index f7984bd755..0000000000 --- a/Externals/hidapi/linux/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_library(hidapi-hidraw hid.c) diff --git a/Externals/hidapi/mac/CMakeLists.txt b/Externals/hidapi/mac/CMakeLists.txt deleted file mode 100644 index ccd2898ed4..0000000000 --- a/Externals/hidapi/mac/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_library(hidapi hid.c) diff --git a/Externals/hidapi/windows/CMakeLists.txt b/Externals/hidapi/windows/CMakeLists.txt deleted file mode 100644 index 3b0b4ce5fa..0000000000 --- a/Externals/hidapi/windows/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_library(hidapi-hid hid.c) |
