# Populate include directories from sub\_directory to all of parts of the project. How?

**URL:** https://discourse.cmake.org/t/populate-include-directories-from-sub-directory-to-all-of-parts-of-the-project-how/14449
**Category:** Code
**Created:** [July 26, 2025, 12:48pm UTC](https://discourse.cmake.org/t/populate-include-directories-from-sub-directory-to-all-of-parts-of-the-project-how/14449 "2025-07-26T12:48:17Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![vito.gamberini](https://discourse.cmake.org/user_avatar/discourse.cmake.org/vito.gamberini/32/4376_2.png) [@vito.gamberini](https://discourse.cmake.org/u/vito.gamberini)
#### Post date: [July 27, 2025, 5:37am UTC](https://discourse.cmake.org/t/populate-include-directories-from-sub-directory-to-all-of-parts-of-the-project-how/14449/4 "2025-07-27T05:37:42Z")

</div>

It’s not `/Dir1`, it’s `Dir1`. By putting the `/` before the directory you’ve made it into an absolute path, literally saying “`Dir1` in the root of the entire filesystem”.

You almost certainly want a relative path, no leading slash. Relative paths in most CMake contexts, including `target_sources()`, are relative to the current source directory

---

_[View the full topic](https://discourse.cmake.org/t/populate-include-directories-from-sub-directory-to-all-of-parts-of-the-project-how/14449)._
