-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
34 lines (26 loc) · 950 Bytes
/
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
cmake_minimum_required(VERSION 3.20)
# Use AVR GCC toolchain
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/Toolchain/avr8-gcc-toolchain.cmake)
project(LabBenchPowerSupply_Firmware C)
set(AVR_MCU atmega328p)
set(AVR_MCU_SPEED 16000000)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)
add_compile_definitions(
F_CPU=${AVR_MCU_SPEED}
__AVR_ATmega328P__
I2C_IMPLEM_MASTER_FULL
)
add_compile_options(-mmcu=${AVR_MCU})
set(CMAKE_EXE_LINKER_FLAGS "-mmcu=${AVR_MCU}")
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DDEBUG_WITH_SIMAVR)
endif()
# This variable is needed by some drivers in order to locate the config.h file
# Provided by the application
set (CONFIG_FILE_DIR ${CMAKE_SOURCE_DIR}/App/inc)
add_subdirectory(${CMAKE_SOURCE_DIR}/Utils)
add_subdirectory(${CMAKE_SOURCE_DIR}/Drivers)
add_subdirectory(${CMAKE_SOURCE_DIR}/Modules)
add_subdirectory(${CMAKE_SOURCE_DIR}/Sensors)
add_subdirectory(${CMAKE_SOURCE_DIR}/App)