diff options
| author | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
| commit | 5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch) | |
| tree | 8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/src/hidapi/linux/CMakeLists.txt | |
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/src/hidapi/linux/CMakeLists.txt')
| -rw-r--r-- | contrib/SDL-3.2.8/src/hidapi/linux/CMakeLists.txt | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/hidapi/linux/CMakeLists.txt b/contrib/SDL-3.2.8/src/hidapi/linux/CMakeLists.txt new file mode 100644 index 0000000..9c62708 --- /dev/null +++ b/contrib/SDL-3.2.8/src/hidapi/linux/CMakeLists.txt | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | cmake_minimum_required(VERSION 3.6.3...3.25 FATAL_ERROR) | ||
| 2 | |||
| 3 | add_library(hidapi_hidraw | ||
| 4 | ${HIDAPI_PUBLIC_HEADERS} | ||
| 5 | hid.c | ||
| 6 | ) | ||
| 7 | target_link_libraries(hidapi_hidraw PUBLIC hidapi_include) | ||
| 8 | |||
| 9 | find_package(Threads REQUIRED) | ||
| 10 | |||
| 11 | include(FindPkgConfig) | ||
| 12 | pkg_check_modules(libudev REQUIRED IMPORTED_TARGET libudev) | ||
| 13 | |||
| 14 | target_link_libraries(hidapi_hidraw PRIVATE PkgConfig::libudev Threads::Threads) | ||
| 15 | |||
| 16 | set_target_properties(hidapi_hidraw | ||
| 17 | PROPERTIES | ||
| 18 | EXPORT_NAME "hidraw" | ||
| 19 | OUTPUT_NAME "hidapi-hidraw" | ||
| 20 | VERSION ${PROJECT_VERSION} | ||
| 21 | SOVERSION ${PROJECT_VERSION_MAJOR} | ||
| 22 | PUBLIC_HEADER "${HIDAPI_PUBLIC_HEADERS}" | ||
| 23 | ) | ||
| 24 | |||
| 25 | # compatibility with find_package() | ||
| 26 | add_library(hidapi::hidraw ALIAS hidapi_hidraw) | ||
| 27 | # compatibility with raw library link | ||
| 28 | add_library(hidapi-hidraw ALIAS hidapi_hidraw) | ||
| 29 | |||
| 30 | if(HIDAPI_INSTALL_TARGETS) | ||
| 31 | install(TARGETS hidapi_hidraw EXPORT hidapi | ||
| 32 | LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
| 33 | ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
| 34 | PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hidapi" | ||
| 35 | ) | ||
| 36 | endif() | ||
| 37 | |||
| 38 | hidapi_configure_pc("${PROJECT_ROOT}/pc/hidapi-hidraw.pc.in") | ||
