forked from Lagavulin9/piracer-cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
47 lines (39 loc) · 1.05 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
cmake_minimum_required(VERSION 3.15)
project(PiRacer-cpp VERSION 1.0 LANGUAGES CXX)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(pigpio REQUIRED)
include_directories(
./Adafruit_INA219
./Adafruit_PCA9685
./Gamepad
./PiRacer
${pigpio_INCLUDE_DIRS}
)
set(PIRACER_SRC
./Adafruit_INA219/Adafruit_INA219.cpp
./Adafruit_PCA9685/Adafruit_PCA9685.cpp
./PiRacer/PiRacer.cpp
)
set(GAMEPAD_SRC
./Gamepad/Joystick.cpp
./Gamepad/ShanwanGamepad.cpp
)
add_executable(forward_backward_left_right
./examples/forward_backward_left_right.cpp
${PIRACER_SRC}
)
target_link_libraries(forward_backward_left_right ${pigpio_LIBRARY})
add_executable(gamepad_control
./examples/gamepad_control.cpp
${PIRACER_SRC}
${GAMEPAD_SRC}
)
target_link_libraries(gamepad_control ${pigpio_LIBRARY})
add_executable(read_battery
./examples/read_battery.cpp
${PIRACER_SRC}
)
target_link_libraries(read_battery ${pigpio_LIBRARY})