-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
63 lines (50 loc) · 1.61 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
cmake_minimum_required(VERSION 3.0)
project(minipro)
set(CMAKE_CXX_STANDARD 17)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(Log4cxx REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_search_module(GLIB REQUIRED glib-2.0)
include_directories(include ${GLIB_INCLUDE_DIRS})
add_library(bluez STATIC
lib/bluez/att.c
lib/bluez/bluetooth.c
lib/bluez/crypto.c
lib/bluez/gatt-client.c
lib/bluez/gatt-db.c
lib/bluez/gatt-helpers.c
lib/bluez/hci.c
lib/bluez/io-mainloop.c
lib/bluez/mainloop.c
lib/bluez/queue.c
lib/bluez/timeout-glib.c
lib/bluez/util.c
lib/bluez/uuid.c
)
add_library(minipro STATIC
src/minipro/minipro.cpp
src/minipro/packet.cpp
src/minipro/drive.cpp
src/minipro/enter_remote_control_mode.cpp
src/minipro/exit_remote_control_mode.cpp
)
target_include_directories(minipro PUBLIC lib/bluez)
add_library(bluetooth STATIC
src/bluetooth/le_client.cpp
src/bluetooth/l2_cap_socket.cpp
src/bluetooth/utils.cpp
)
target_include_directories(bluetooth PUBLIC lib/bluez)
add_library(util STATIC
src/util/xbox360_controller.cpp
src/util/joystick.cpp
src/util/loop_rate.cpp
)
add_executable(gattclient ${BLUEZ_SRC} lib/bluez/btgattclient.c)
target_link_libraries(gattclient bluez ${GLIB_LDFLAGS})
target_include_directories(gattclient PUBLIC lib/bluez)
add_executable(t_minipro ${BLUEZ_SRC} test/minipro/t_minipro.cpp )
target_link_libraries(t_minipro minipro bluetooth util bluez ${GLIB_LDFLAGS} pthread)
target_include_directories(t_minipro PUBLIC lib/bluez)
add_executable(t_joystick test/joystick/t_joystick.cpp)
target_link_libraries(t_joystick util pthread)