# FILE\_SET include directory manipulation

**URL:** <https://discourse.cmake.org/t/file-set-include-directory-manipulation/10648>\
**Category:** Usage\
**Created:** [April 12, 2024, 8:20pm UTC](https://discourse.cmake.org/t/file-set-include-directory-manipulation/10648 "2024-04-12T20:20:02Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![pjfasano](https://discourse.cmake.org/user_avatar/discourse.cmake.org/pjfasano/32/4488_2.png) [@pjfasano](https://discourse.cmake.org/u/pjfasano)\
**Post date:** [April 12, 2024, 10:10pm UTC](https://discourse.cmake.org/t/file-set-include-directory-manipulation/10648/6 "2024-04-12T22:10:14Z")

</div>

> [@craig.scott](#):
>
> You shouldn’t use the name of the top level directory for your `BASE_DIRS`.

I don’t disagree, but this is a slow migration to CMake from a custom build system which made _heavy_ use of Git submodules. It also made a point of not separating headers from sources, but instead grouped headers and sources into “libraries”. That is, a typical structure would be:

```plaintext
project/
|- Makefile
|- project.mk
|- libraries/
| |- foo/
| | |- module.mk
| | |- foo1.h
| | |- foo1.cpp
| | |- foo2.h
| | |- foo2.cpp
| |- bar/
| | |- module.mk
| | |- bar1.h
| | |- bar1.cpp
| | |- bar2.h
| | |- bar2.cpp
|- programs/
| |- tools/
| | |- module.mk
| | |- tool1.cpp
| | |- tool2.cpp
| |- utils/
| | |- module.mk
| | |- util1.cpp
| | |- util2.cpp

```

When one of the “libraries” (like `foo` or `bar`) got too big or needed to be used somewhere else, it would just get pulled out into its own repository and added to `project/libraries/` as a (Git) submodule. Of course, that meant that now all of the headers and sources needed to be at top level of the new Git repository, since it had just been a subdirectory of a larger project.

EDIT: And, of course, it didn’t have a separate build tree, so object files would get scattered across all of those directories!

EDIT2: Even further, the old build system didn’t even have installing headers as an option – of course you would always build everything from scratch every time!

---

_[View the full topic](https://discourse.cmake.org/t/file-set-include-directory-manipulation/10648)._
