This repository has been archived by the owner on Feb 26, 2022. It is now read-only.
forked from signal11/hidapi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
75 lines (69 loc) · 2.21 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
cmake_minimum_required(VERSION 2.8)
project(hidapi)
find_package(Doxygen REQUIRED)
add_custom_target(hidapi_docs ALL
${DOXYGEN_EXECUTABLE}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doxygen
)
if(NOT HAS_MZ_GLOBAL)
include(global.cmake)
endif()
if(WIN32)
set(SRC windows/hid.c)
elseif(APPLE)
find_library(IOKit NAMES IOKit)
find_library(CoreFoundation NAMES CoreFoundation)
set(LIBS ${IOKit} ${CoreFoundation})
set(SRC mac/hid.c)
else() # linux
set(LIBS udev)
set(SRC linux/hid.c)
endif()
set(HEADER hidapi/hidapi.h)
add_library(hidapi SHARED ${SRC} ${HEADER})
set_property(TARGET hidapi PROPERTY VERSION 0.7git)
set_property(TARGET hidapi PROPERTY SOVERSION 0.7git)
add_library(hidapi-static STATIC ${SRC} ${HEADER})
set_property(TARGET hidapi-static PROPERTY VERSION 0.7git)
set_property(TARGET hidapi-static PROPERTY SOVERSION 0.7git)
target_link_libraries(hidapi ${LIBS})
target_link_libraries(hidapi-static ${LIBS})
mz_target_props(hidapi)
mz_target_props(hidapi-static)
if(WIN32)
install(TARGETS hidapi
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib)
install(TARGETS hidapi-static
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib)
install(DIRECTORY hidapi
DESTINATION include
PATTERN "*.svn" EXCLUDE)
install(DIRECTORY doxygen/html
DESTINATION doc
PATTERN "*.svn" EXCLUDE)
else()
install(TARGETS hidapi
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib)
install(TARGETS hidapi-static
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib)
install(DIRECTORY hidapi
DESTINATION include
PATTERN "*.svn" EXCLUDE)
if(APPLE)
install(DIRECTORY doxygen/html
DESTINATION Library/Documentation/hidapi
PATTERN "*.svn" EXCLUDE)
else()
install(DIRECTORY doxygen/html
DESTINATION share/doc/hidapi-doc
PATTERN "*.svn" EXCLUDE)
endif()
endif()