-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
79 lines (60 loc) · 1.77 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
cmake_minimum_required(VERSION 3.22)
set(CMAKE_PROJECT_NAME nixie-vfd-clock_firmware)
# Setup compiler settings
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_CXX_STANDARD 20)
set(BUILD_TESTING OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
# Add custom compiler flags, will also add flags to C++ compiler
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
# Include toolchain file
include(cubemx/cmake/gcc-arm-none-eabi.cmake)
# Disable warnings for rwx segments, as they are normal for embedded systems
add_link_options(-Wl,--no-warn-rwx-segments)
set(core_BUILDCONFIGURATION "embedded")
add_subdirectory(core)
# Enable CMake support for languages
enable_language(C CXX ASM)
# Core project settings
project(${CMAKE_PROJECT_NAME})
message("Build type: " ${CMAKE_BUILD_TYPE})
# Create an executable object type
add_executable(${CMAKE_PROJECT_NAME})
# Add STM32CubeMX generated sources
add_subdirectory(cubemx/cmake/stm32cubemx)
# Link directories setup
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
# Add user defined library search paths
)
add_subdirectory(src/clock/Time)
add_subdirectory(src/util)
# Add sources to executable
target_sources(
${CMAKE_PROJECT_NAME} PRIVATE
src/Application.cxx
src/clock/Clock.cxx
src/LED/AddressableLedDriver.cxx
src/LED/LightController.cxx
src/tube-control/TubeControl.cxx
src/tube-control/nixie/Nixie.cxx
src/tube-control/vfd/font/Font.cxx
src/tube-control/vfd/VFD.cxx
src/esp_gateway/PacketProcessor.cxx
)
# Add include paths
target_include_directories(
${CMAKE_PROJECT_NAME} PRIVATE
src
)
# Add linked libraries
target_link_libraries(
${CMAKE_PROJECT_NAME}
stm32cubemx
core
util
Time
)