mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/cmake-demo.git
synced 2025-12-18 02:58:04 +00:00
Initial Commit
This commit is contained in:
87
CMakeLists.txt
Normal file
87
CMakeLists.txt
Normal file
@@ -0,0 +1,87 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/libs/stm32-cmake/cmake/stm32_gcc.cmake)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs/stm32-cmake/cmake)
|
||||
|
||||
project(demo C CXX ASM)
|
||||
|
||||
################## TOOLCHAIN SETUP ####################################
|
||||
find_package(HAL COMPONENTS STM32F4 REQUIRED)
|
||||
find_package(FreeRTOS COMPONENTS ARM_CM4F STM32F4 REQUIRED)
|
||||
find_package(CMSIS COMPONENTS STM32F407ZG RTOS_V2 REQUIRED)
|
||||
#######################################################################
|
||||
|
||||
set (PROJECT_SOURCES
|
||||
core/src/main.c
|
||||
core/src/freertos.c
|
||||
core/src/adc.c
|
||||
core/src/gpio.c
|
||||
core/src/can.c
|
||||
core/src/dma.c
|
||||
core/src/spi.c
|
||||
core/src/tim.c
|
||||
core/src/usart.c
|
||||
core/src/syscalls.c
|
||||
core/src/sysmem.c
|
||||
core/src/stm32f4xx_it.c
|
||||
core/src/stm32f4xx_hal_msp.c
|
||||
core/src/stm32f4xx_hal_timebase_tim.c
|
||||
|
||||
# Application specific
|
||||
App/Src/shared.cpp
|
||||
App/Src/startup.cpp
|
||||
App/Src/tasks/arming.cpp
|
||||
App/Src/tasks/fire.cpp
|
||||
App/Src/tasks/sense.cpp
|
||||
)
|
||||
|
||||
set (PROJECT_INCLUDES
|
||||
core/inc/
|
||||
|
||||
# Application specific
|
||||
App/Inc/
|
||||
libs/STAHR-defs/
|
||||
)
|
||||
|
||||
############ Libraries ###############################################
|
||||
# STA-CORE
|
||||
add_subdirectory(libs/sta-core)
|
||||
list(APPEND PROJECT_SOURCES ${STA_CORE_SOURCES})
|
||||
list(APPEND PROJECT_INCLUDES ${STA_CORE_INCLUDES})
|
||||
# rtos2-utils
|
||||
add_subdirectory(libs/rtos2-utils)
|
||||
list(APPEND PROJECT_SOURCES ${RTOS2_UTILS_SOURCES})
|
||||
list(APPEND PROJECT_INCLUDES ${RTOS2_UTILS_INCLUDES})
|
||||
# TACOS
|
||||
add_subdirectory(libs/TACOS)
|
||||
list(APPEND PROJECT_SOURCES ${TACOS_SOURCES})
|
||||
list(APPEND PROJECT_INCLUDES ${TACOS_INCLUDES})
|
||||
#######################################################################
|
||||
|
||||
# ################## PROJECT SETUP ######################################
|
||||
add_executable(demo ${PROJECT_SOURCES})
|
||||
target_link_libraries(demo PRIVATE
|
||||
FreeRTOS::STM32::F4::ARM_CM4F
|
||||
FreeRTOS::STM32::F4::Timers
|
||||
FreeRTOS::STM32::F4::Heap::4
|
||||
FreeRTOS::STM32::F4::EventGroups
|
||||
CMSIS::STM32::F4::RTOS_V2
|
||||
CMSIS::STM32::F407ZG
|
||||
HAL::STM32::F4
|
||||
HAL::STM32::F4::ADC
|
||||
HAL::STM32::F4::CAN
|
||||
HAL::STM32::F4::GPIO
|
||||
HAL::STM32::F4::UART
|
||||
HAL::STM32::F4::SPI
|
||||
HAL::STM32::F4::DMA
|
||||
HAL::STM32::F4::RCC
|
||||
HAL::STM32::F4::TIM
|
||||
HAL::STM32::F4::TIMEx
|
||||
HAL::STM32::F4::CORTEX
|
||||
STM32::NoSys
|
||||
)
|
||||
target_include_directories (demo PRIVATE ${PROJECT_INCLUDES})
|
||||
|
||||
target_compile_definitions(demo PRIVATE
|
||||
USE_CMSIS_RTOS_V2
|
||||
CMSIS_RTOS_V2_DEVICE_HEADER="stm32f4xx_hal.h"
|
||||
)
|
||||
Reference in New Issue
Block a user