-
Notifications
You must be signed in to change notification settings - Fork 425
/
Copy pathCMakeLists.txt
35 lines (28 loc) · 1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cmake_minimum_required(VERSION 3.6.3...3.25 FATAL_ERROR)
add_library(hidapi_netbsd
${HIDAPI_PUBLIC_HEADERS}
hid.c
)
target_link_libraries(hidapi_netbsd PUBLIC hidapi_include)
find_package(Threads REQUIRED)
target_link_libraries(hidapi_netbsd PRIVATE Threads::Threads)
set_target_properties(hidapi_netbsd
PROPERTIES
EXPORT_NAME "netbsd"
OUTPUT_NAME "hidapi-netbsd"
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
PUBLIC_HEADER "${HIDAPI_PUBLIC_HEADERS}"
)
# compatibility with find_package()
add_library(hidapi::netbsd ALIAS hidapi_netbsd)
# compatibility with raw library link
add_library(hidapi-netbsd ALIAS hidapi_netbsd)
if(HIDAPI_INSTALL_TARGETS)
install(TARGETS hidapi_netbsd EXPORT hidapi
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hidapi"
)
endif()
hidapi_configure_pc("${PROJECT_ROOT}/pc/hidapi-netbsd.pc.in")