# How to Configure FreeRTOS Includes with a "Custom Prefix"?

**URL:** <https://forums.freertos.org/t/how-to-configure-freertos-includes-with-a-custom-prefix/22307>\
**Category:** Kernel\
**Created:** [January 21, 2025, 10:21am UTC](https://forums.freertos.org/t/how-to-configure-freertos-includes-with-a-custom-prefix/22307 "2025-01-21T10:21:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![conara](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/conara/32/2862_2.png) [@conara](https://forums.freertos.org/u/conara)\
**Post date:** [January 21, 2025, 10:21am UTC](https://forums.freertos.org/t/how-to-configure-freertos-includes-with-a-custom-prefix/22307/1 "2025-01-21T10:21:45Z")

</div>

Hello everyone,

I’m using the FreeRTOS-Kernel in my project and managing it with `FetchContent` in CMake. Everything is working fine, but I’d like to configure the way I include FreeRTOS headers for clarity and to avoid potential naming conflicts with other libraries.

Currently, I include headers like this:

```auto
#include <timers.h>
#include <task.h>

```

However, I’d like to make it more explicit that these headers are part of FreeRTOS by including them with a prefix, like this:

e.g.

```auto
#include <freertos-kernel-src/include/timers.h>
#include <freertos-kernel-src/include/task.h>

```

**Reasons for Doing This**

1. **Prevent Naming Conflicts:** To avoid clashes with similarly named headers from other libraries.
2. **Improve Readability:** To make it clear in the code that these are FreeRTOS headers.

**My Setup**

- I use the FreeRTOS `CMakeLists.txt` files directly (via `FetchContent`) without modifying them.
- My project structure is standard, with FreeRTOS headers located under `freertos-kernel-src/include`.

**My Question**

How can I configure my project to achieve this header inclusion format without modifying the FreeRTOS repository or its CMake files? Ideally, I want this to be done in my own project’s `CMakeLists.txt`.

Has anyone faced a similar issue or found a clean solution for this?

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [January 21, 2025, 3:25pm UTC](https://forums.freertos.org/t/how-to-configure-freertos-includes-with-a-custom-prefix/22307/2 "2025-01-21T15:25:24Z")

</div>

Assuming that you are talking about including FreeRTOS header files in your application, you should be able to do the following in your application `CMakeLists.txt`:

```auto
target_include_directories( app
                            PRIVATE
                            $ROOT_DIR
                          )

```

where:

- `app` is you application target.
- `ROOT_DIR` is the location of `freertos-kernel-src`.

Does that work?

---

<div class="post-metadata">

**Author:** ![archigup](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/archigup/32/1418_2.png) [@archigup](https://forums.freertos.org/u/archigup)\
**Post date:** [January 22, 2025, 9:49pm UTC](https://forums.freertos.org/t/how-to-configure-freertos-includes-with-a-custom-prefix/22307/3 "2025-01-22T21:49:28Z")

</div>

You may need your include paths to include both the path you want to include from (i.e. the directory freertos-kernel-src is in) as well as the FreeRTOS include directory directly.
