https://github.com/plusk01/freertos-posix-cmake
Use CMake to build apps for POSIX/Linux FreeRTOS port
https://github.com/plusk01/freertos-posix-cmake
Last synced: about 1 month ago
JSON representation
Use CMake to build apps for POSIX/Linux FreeRTOS port
- Host: GitHub
- URL: https://github.com/plusk01/freertos-posix-cmake
- Owner: plusk01
- Created: 2022-04-18T16:20:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-18T16:21:02.000Z (over 4 years ago)
- Last Synced: 2025-03-14T21:37:12.025Z (over 1 year ago)
- Language: C
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
FreeRTOS-POSIX-CMake Example
============================
This repo contains FreeRTOS example applications that run on the [POSIX/Linux port of FreeRTOS](https://www.freertos.org/FreeRTOS-simulator-for-Linux.html).
Each application is created as its own CMake project (in the `apps` directory). The POSIX port is configured in the `cmake/freertos.posix.cmake` file. Each CMake project includes this port file, which (1) downloads the appropriate verion of the FreeRTOS kernel, and (2) adds the kernel and port sources to the CMake project's main target via the `freertos_target_add_kernel` CMake function. For example, the `blinky` demo app has the following in its `CMakeLists.txt`:
```cmake
include(${CMAKE_SOURCE_DIR}/../../cmake/freertos.posix.cmake)
add_executable(blinky src/main.c src/main_blinky.c src/console.c)
target_include_directories(blinky PRIVATE $)
target_include_directories(blinky PUBLIC $)
target_compile_definitions(blinky PRIVATE projCOVERAGE_TEST=1)
freertos_target_add_kernel(blinky)
```
---
The goal of this repo is similar to [FreeRTOS-CMake](https://github.com/jonathanmichel/FreeRTOS-CMake) in that CMake is used to build a FreeRTOS application. However, the difference is that this version (1) uses more modern CMake and target-specific functions, (2) better separates the core kernel and the application sources/includes, and (3) is more scalable by abstracting kernel-specific sources into a port-specific cmake file (e.g., `freertos.posix.cmake`).