# What is the procedure for accessing code in other subdirectories?

**URL:** https://discourse.cmake.org/t/what-is-the-procedure-for-accessing-code-in-other-subdirectories/8328
**Category:** Code
**Tags:** os:linux
**Created:** [June 13, 2023, 7:56pm UTC](https://discourse.cmake.org/t/what-is-the-procedure-for-accessing-code-in-other-subdirectories/8328 "2023-06-13T19:56:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![texjunky](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@texjunky](https://discourse.cmake.org/u/texjunky)
#### Post date: [June 13, 2023, 7:56pm UTC](https://discourse.cmake.org/t/what-is-the-procedure-for-accessing-code-in-other-subdirectories/8328/1 "2023-06-13T19:56:31Z")

</div>

## System

`g++` on Linux Mint.

## Sample project

My project has lots of files, but attention may be confined to the three below and their related CMakeLists.txt files:

1. `containers/Square.cpp`
2. `equations/DEsolve.cpp`
3. `branch/cli.cpp`

The first two contain no dependencies outside their own subdirectory. The third has include statements for the first two.

## Symptom of problem

Complication of `branch/cli.cpp` produces

```auto
fatal error: Square.h: No such file or directory

```

I assume I need proper instructions in the CMakeLists.txt files, but I am new to cmake and don’t know them. Explanation or pointer to appropriate place in docs would be much appreciated.

I could easily provide zip of project, if that is allowed.

---

<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: [June 17, 2023, 10:46pm UTC](https://discourse.cmake.org/t/what-is-the-procedure-for-accessing-code-in-other-subdirectories/8328/2 "2023-06-17T22:46:21Z")

</div>

I think [the tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html) would be the place to start here. Feel free to ask follow up questions on Discourse.

---

<div class="post-metadata">

### Author: ![texjunky](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@texjunky](https://discourse.cmake.org/u/texjunky)
#### Post date: [June 18, 2023, 12:41am UTC](https://discourse.cmake.org/t/what-is-the-procedure-for-accessing-code-in-other-subdirectories/8328/3 "2023-06-18T00:41:23Z")

</div>

Thanks, I find the docs intimating because of the jargon.

---

<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: [June 18, 2023, 4:14pm UTC](https://discourse.cmake.org/t/what-is-the-procedure-for-accessing-code-in-other-subdirectories/8328/4 "2023-06-18T16:14:52Z")

</div>

@betsy.mcphail Do we have a glossary of terms we can link their first usage to?
