# Beginner question about sub-directory / library layout?

**URL:** https://discourse.cmake.org/t/beginner-question-about-sub-directory-library-layout/6428
**Category:** Usage
**Created:** [September 6, 2022, 8:33pm UTC](https://discourse.cmake.org/t/beginner-question-about-sub-directory-library-layout/6428 "2022-09-06T20:33:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![RobN](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@RobN](https://discourse.cmake.org/u/RobN)
#### Post date: [September 6, 2022, 8:33pm UTC](https://discourse.cmake.org/t/beginner-question-about-sub-directory-library-layout/6428/1 "2022-09-06T20:33:48Z")

</div>

I followed the [tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html) steps where it shows linking to a subdirectory/library named “MathFunctions”. The `CMakeLists.txt` in that subdirectory has:

```nohighlight
# state that anybody linking to us needs to include the current source dir
# to find MathFunctions.h, while we don't.
target_include_directories(MathFunctions
          INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
          )

```

I don’t have much experience with C++ project layout. Any recommendations on where to go to learn about the next steps? For example, I imagine that users of the “MathFunctions” might want to include things like this:

```nohighlight
#include "MathFunctions/Stuff.h"
#include "MathFunctions/MoreStuff.h"

```

because as you get more files, you’d want to avoid name conflicts. I don’t know how that translates to directory structure or CMake commands. I don’t know if the library’s files would use the same include style, or drop the prefix:

```nohighlight
#include "Stuff.h"

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [October 17, 2022, 8:53pm UTC](https://discourse.cmake.org/t/beginner-question-about-sub-directory-library-layout/6428/2 "2022-10-17T20:53:20Z")

</div>

You’ll want to have a `MathFunctions` directory in the source tree as well. The interface include directories would remain the parent of that directory.
