forked from OpenRTX/OpenRTX
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
153 lines (137 loc) · 4.72 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# SPDX-License-Identifier: GPL-3.0-or-later
cmake_minimum_required(VERSION 3.20.0)
#
# Zephyr build system imposes to have a fixed folder structure for the target-specific
# files, that is [...]/boards/ARCH/BOARDNAME because it infers the target
# architecture by looking at the name of the parent folder of the board folder.
#
# This does not make sense, because:
# 1) The folder with the target-specific files should be put anywhere, given that
# the project using Zephyr may have its own conventions.
# 2) Inferring the target architecture only from the folder tree is an idiocy.
#
# So: to make Zephyr play happily in his sandpit without complaints, we create a
# board_root subfolder inside the build one and we copy the board-specific config
# files there from our platform/targets tree creating the necessary folder tree.
#
# NOTE: the board-specific CMakeLists.txt files have to use the ${OPENRTX_ROOT}
# variable as the base path. E.g. ${OPENRTX_ROOT}/platform/drivers/somedriver.c
#
if (${BOARD} STREQUAL "ttwrplus")
set(ARCH xtensa)
set(CONF_FILE ${CMAKE_CURRENT_LIST_DIR}/platform/mcu/ESP32S3/zephyr.conf)
endif()
#
# Create the board_root folder and the proper folder tree for the targets
#
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_LIST_DIR}/platform/targets/${BOARD}
${CMAKE_CURRENT_LIST_DIR}/build/board_root/boards/${ARCH}/${BOARD})
#
# Set the BOARD_ROOT and OPENRTX_ROOT variables
#
set(BOARD_ROOT ${CMAKE_CURRENT_LIST_DIR}/build/board_root)
set(OPENRTX_ROOT ${CMAKE_CURRENT_LIST_DIR})
#
# Finally, set up the project
#
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(openrtx)
execute_process(COMMAND git describe --tags --dirty --always
OUTPUT_VARIABLE GIT_VER_ID
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
target_compile_definitions(app
PRIVATE
_GNU_SOURCE
FONT_UBUNTU_REGULAR
CODEC2_MODE_EN_DEFAULT=0
FREEDV_MODE_EN_DEFAULT=0
CODEC2_MODE_3200_EN=1
M_PI=3.14159265358979323846f
GIT_VERSION="${GIT_VER_ID}"
)
target_include_directories(app
PRIVATE
openrtx/include
openrtx/include/rtx
openrtx/include/core
openrtx/include/calibration
openrtx/include/protocols
openrtx/include/fonts/adafruit
openrtx/include/fonts/symbols
platform/drivers/ADC
platform/drivers/NVM
platform/drivers/GPS
platform/drivers/USB
platform/drivers/tones
platform/drivers/baseband
platform/drivers/backlight
platform/drivers/chSelector
subprojects/codec2
subprojects/codec2/src
lib/minmea/include
lib/qdec/include
)
target_sources(app
PRIVATE
openrtx/src/main.c
openrtx/src/core/state.c
openrtx/src/core/threads.c
openrtx/src/core/battery.c
openrtx/src/core/graphics.c
openrtx/src/core/input.c
openrtx/src/core/utils.c
openrtx/src/core/queue.c
openrtx/src/core/chan.c
openrtx/src/core/gps.c
openrtx/src/core/dsp.cpp
openrtx/src/core/cps.c
openrtx/src/core/crc.c
openrtx/src/core/datetime.c
openrtx/src/core/openrtx.c
openrtx/src/core/audio_codec.c
openrtx/src/core/audio_stream.c
openrtx/src/core/audio_path.cpp
openrtx/src/core/data_conversion.c
openrtx/src/core/memory_profiling.cpp
openrtx/src/core/voicePrompts.c
openrtx/src/core/voicePromptUtils.c
openrtx/src/core/voicePromptData.S
openrtx/src/core/nvmem_access.c
openrtx/src/rtx/rtx.cpp
openrtx/src/rtx/OpMode_FM.cpp
openrtx/src/rtx/OpMode_M17.cpp
openrtx/src/protocols/M17/M17DSP.cpp
openrtx/src/protocols/M17/M17Golay.cpp
openrtx/src/protocols/M17/M17Callsign.cpp
openrtx/src/protocols/M17/M17Modulator.cpp
openrtx/src/protocols/M17/M17Demodulator.cpp
openrtx/src/protocols/M17/M17FrameEncoder.cpp
openrtx/src/protocols/M17/M17FrameDecoder.cpp
openrtx/src/protocols/M17/M17LinkSetupFrame.cpp
openrtx/src/ui/default/ui.c
openrtx/src/ui/default/ui_main.c
openrtx/src/ui/default/ui_menu.c
openrtx/src/ui/default/ui_strings.c
subprojects/codec2/src/dump.c
subprojects/codec2/src/lpc.c
subprojects/codec2/src/nlp.c
subprojects/codec2/src/phase.c
subprojects/codec2/src/quantise.c
subprojects/codec2/src/postfilter.c
subprojects/codec2/src/codec2.c
subprojects/codec2/src/codec2_fft.c
subprojects/codec2/src/lsp.c
subprojects/codec2/src/sine.c
subprojects/codec2/src/interp.c
subprojects/codec2/src/kiss_fft.c
subprojects/codec2/src/kiss_fftr.c
subprojects/codec2/src/newamp1.c
subprojects/codec2/src/codebook.c
subprojects/codec2/src/codebookd.c
subprojects/codec2/src/pack.c
subprojects/codec2/src/codebooknewamp1.c
subprojects/codec2/src/codebooknewamp1_energy.c
lib/minmea/minmea.c
)