forked from smittytone/RP2040-FreeRTOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (47 loc) · 1.64 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
cmake_minimum_required(VERSION 3.14)
# Set project data
set(PROJECT_NAME "RP2040_FREERTOS_PROJECT")
set(BUILD_NUMBER "1")
# Set app-side debugging ON or OFF
set(DO_DEBUG "ON")
# Set env variable 'PICO_SDK_PATH' to the local Pico SDK
# Comment out the set() if you have a global copy of the
# SDK set and $PICO_SDK_PATH defined in your $PATH
set(ENV{PICO_SDK_PATH} "${CMAKE_SOURCE_DIR}/pico-sdk")
# Set flags and directory variables
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DTSDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTSDEBUG")
set(FREERTOS_CFG_DIRECTORY "${CMAKE_SOURCE_DIR}/Config")
set(FREERTOS_SRC_DIRECTORY "${CMAKE_SOURCE_DIR}/FreeRTOS-Kernel")
# Include the Pico SDK
include(pico_sdk_import.cmake)
# Name the project
project(${PROJECT_NAME}
LANGUAGES C CXX ASM
DESCRIPTION "RP2040 AutoSAR with FreeRTOS kernel"
)
# Initialise the Pico SDK
pico_sdk_init()
# Add FreeRTOS as a library
add_library(FreeRTOS STATIC
${FREERTOS_SRC_DIRECTORY}/event_groups.c
${FREERTOS_SRC_DIRECTORY}/list.c
${FREERTOS_SRC_DIRECTORY}/queue.c
${FREERTOS_SRC_DIRECTORY}/stream_buffer.c
${FREERTOS_SRC_DIRECTORY}/tasks.c
${FREERTOS_SRC_DIRECTORY}/timers.c
${FREERTOS_SRC_DIRECTORY}/portable/MemMang/heap_3.c
${FREERTOS_SRC_DIRECTORY}/portable/GCC/ARM_CM0/port.c
)
# Build FreeRTOS
target_include_directories(FreeRTOS PUBLIC
${FREERTOS_CFG_DIRECTORY}/
${FREERTOS_SRC_DIRECTORY}/include
${FREERTOS_SRC_DIRECTORY}/portable/GCC/ARM_CM0
)
add_subdirectory(autosar_classic)
add_subdirectory(autosar_target)
# Clean up
unset(FREERTOS_CFG_DIRECTORY)
unset(FREERTOS_SRC_DIRECTORY)
unset(APP_SRC_DIRECTORY)