-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
90 lines (76 loc) · 2.34 KB
/
CMakeLists.txt
File metadata and controls
90 lines (76 loc) · 2.34 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(drivebrain_software_2026)
include(FetchContent)
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/cmake")
#################################
# Custom libs
#################################
add_subdirectory(drivebrain_core)
add_subdirectory(drivebrain_comms)
#################################
# Find packages
#################################
find_package(foxglove-websocket REQUIRED)
find_package(Protobuf REQUIRED CONFIG)
find_package(Boost REQUIRED)
find_package(spdlog REQUIRED)
find_package(mcap REQUIRED)
find_package(dbcppp REQUIRED)
#################################
# Upstreams (non-conan)
#################################
FetchContent_Declare(
HT_Proto
GIT_REPOSITORY https://github.com/hytech-racing/HT_proto.git
GIT_TAG 26f8113
)
FetchContent_MakeAvailable(HT_Proto)
FetchContent_Declare(
vn_driver_lib
GIT_REPOSITORY https://github.com/hytech-racing/vn_driver_lib.git
GIT_TAG 0d40803
)
FetchContent_MakeAvailable(vn_driver_lib)
FetchContent_Declare(
HT_CAN
URL "https://github.com/hytech-racing/HT_CAN/releases/download/231/drivebrain_can_lib.tar.gz"
)
FetchContent_MakeAvailable(HT_CAN)
FetchContent_Declare(
simulink_automation_msgs_cpp
URL "https://github.com/hytech-racing/drivebrain_simulink_models/releases/download/rel38/proto_outputs.tar.gz"
)
FetchContent_MakeAvailable(simulink_automation_msgs_cpp)
FetchContent_Declare(
drivebrain_simulink_models
URL "https://github.com/hytech-racing/drivebrain_simulink_models/releases/download/rel38/codegen_outputs.tar.gz"
)
FetchContent_MakeAvailable(drivebrain_simulink_models)
#################################
# Linking to main app
#################################
add_executable(drivebrain
drivebrain_app/src/main.cpp
drivebrain_app/src/drivebrain_app.cpp
)
target_include_directories(drivebrain PUBLIC drivebrain_app/include)
target_link_libraries(drivebrain PUBLIC
foxglove-websocket::foxglove-websocket
mcap::mcap
protobuf::libprotobuf
boost::boost
hytech_msgs_cpp_lib
hytech_can_msgs_cpp_lib
drivebrain_core
drivebrain_comms
matlab_model
)
#################################
# Unit Testing
#################################
if(NOT CMAKE_CROSSCOMPILING)
enable_testing()
add_subdirectory(tests)
endif()