-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
75 lines (60 loc) · 1.92 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 3.17)
project(hopper VERSION 0.0 LANGUAGES C ASM)
# configure BSP options
option(BUILD_MIMXRT1010EVK_BSP "Build MIMRX1010-EVK BSP" ON)
option(BUILD_FLIGHTCONTROLLER_BSP "Build flight controller BSP" OFF)
add_compile_definitions(CPU_MIMXRT1011DAE5A)
include(cmake/flags.cmake)
# build all static libraries and modules
add_subdirectory(circbuf)
add_subdirectory(spp)
add_subdirectory(stcp)
add_subdirectory(freertos)
add_subdirectory(drivers)
add_subdirectory(bsp)
add_subdirectory(fslhal)
add_subdirectory(sensor-hub)
add_executable(${PROJECT_NAME}.elf
# device/startup_mimxrt1011.c
device/startup_MIMXRT1011.S
device/system_MIMXRT1011.c
src/main.c
src/app_hal_xconnect.c
src/modules/command_control_comms.c
src/modules/spp_property_list.c
src/modules/control_inputs.c
src/modules/lqr_control.c
src/hw/hw.c
src/hw/imu.c
src/hw/thrust_vanes.c
src/hw/lidar.c
src/hw/esc.c
src/hw/batt_monitor.c
)
target_include_directories(${PROJECT_NAME}.elf
PRIVATE
src
fslhal/include/fslhal
device
CMSIS
stcp/include
spp/include
sensor-hub/include
freertos/freertos_kernel/include
freertos/freertos_kernel/include/freertos
freertos/freertos_kernel/portable/GCC/ARM_CM4F
)
if(BUILD_MIMXRT1010EVK_BSP)
target_include_directories(${PROJECT_NAME}.elf
PRIVATE
../bsp/mimxrt1010-evk/include/bsp
)
endif()
# link
target_link_libraries(${PROJECT_NAME}.elf PUBLIC circbuf spp_client stcp bsp fslhal drivers freertos)
target_link_libraries(${PROJECT_NAME}.elf PRIVATE -Wl,--start-group)
target_link_libraries(${PROJECT_NAME}.elf PRIVATE m)
target_link_libraries(${PROJECT_NAME}.elf PRIVATE c)
target_link_libraries(${PROJECT_NAME}.elf PRIVATE gcc)
target_link_libraries(${PROJECT_NAME}.elf PRIVATE nosys)
target_link_libraries(${PROJECT_NAME}.elf PRIVATE -Wl,--end-group)