forked from signal11/hidapi
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
74 lines (55 loc) · 1.69 KB
/
CMakeLists.txt
File metadata and controls
74 lines (55 loc) · 1.69 KB
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
cmake_minimum_required(VERSION 2.8)
project(hidapi)
set(VERSION_MAJOR "0")
set(VERSION_MINOR "7")
set(VERSION_PATCH "1")
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
option(DEBUG_PARSER "verbose parser debuggint output" OFF)
option(LIBUSB "use libusb backend" OFF)
option(HIDRAW "use hidraw backend (linux/freebsd)" ON)
option(EXAMPLE_TEST "build test example" ON)
option(EXAMPLE_OSC "build osc example" ON)
# add our own cmake-modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake_modules/")
if( DEBUG_PARSER )
add_definitions( -DDEBUG_PARSER )
endif()
# some default libraries
if (NOT WIN32)
find_package(Pthreads)
if (NOT PTHREADS_FOUND)
message(SEND_ERROR "cannot find libpthreads")
endif()
endif()
# directories
add_subdirectory(hidapi)
if(LIBUSB)
add_subdirectory(libusb)
# set( hidapi_source ${hidapi_SOURCE_DIR}/libusb )
link_directories( ${LIBUSB_1_LIBRARIES} ${PTHREADS_LIBRARIES} )
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND HIDRAW)
add_subdirectory(linux)
# set( hidapi_source ${hidapi_SOURCE_DIR}/linux )
link_directories( ${UDEV_LIBRARIES} )
endif()
if(WIN32)
add_subdirectory(windows)
# set( hidapi_source ${hidapi_SOURCE_DIR}/windows )
#todo: add library dependencies
endif()
if(APPLE)
add_subdirectory(mac)
# set( hidapi_source ${hidapi_SOURCE_DIR}/mac )
#todo: add library dependencies - TEST
link_directories("-framework IOKit -framework CoreFoundation")
endif()
add_subdirectory(hidapi_parser)
# message( "main: hidapi source dir: ${hidapi_source}" )
if( EXAMPLE_TEST )
add_subdirectory(hidtest)
add_subdirectory(hidparsertest)
endif()
if( EXAMPLE_OSC )
add_subdirectory(hidapi2osc)
endif()