# add\_subdirectory with path outside project produces strange tmp directorys

**URL:** https://discourse.cmake.org/t/add-subdirectory-with-path-outside-project-produces-strange-tmp-directorys/4309
**Category:** Code
**Tags:** os:linux, os:windows
**Created:** [October 19, 2021, 4:21pm UTC](https://discourse.cmake.org/t/add-subdirectory-with-path-outside-project-produces-strange-tmp-directorys/4309 "2021-10-19T16:21:01Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![JojoS62](https://discourse.cmake.org/user_avatar/discourse.cmake.org/jojos62/32/1890_2.png) [@JojoS62](https://discourse.cmake.org/u/JojoS62)
#### Post date: [October 20, 2021, 8:22am UTC](https://discourse.cmake.org/t/add-subdirectory-with-path-outside-project-produces-strange-tmp-directorys/4309/10 "2021-10-20T08:22:46Z")

</div>

after lots of checking, I’ve done something simple: I have copied the project closer to the root to get shorter pathnames. And voila, it looks better:

 ![grafik](https://discourse.cmake.org/uploads/default/original/2X/8/8fe39914c0702ad19daa819929c9361d1d0a2c7e.png)

but what I still not understand, when I provide a relative path to add\_subdirectory for the binary path, it is still prepended by the full project path. This creates long pathnames that seem to be shortened, it happens in the cmake build configuration step.I couldn’t find some sort of concatenation in the Mbed cmake files.

edit:  
there is a algorithm to shorten filenames: [https://cmake.org/cmake/help/latest/variable/CMAKE\_OBJECT\_PATH\_MAX.html](https://cmake.org/cmake/help/latest/variable/CMAKE_OBJECT_PATH_MAX.html)  
that explains the hash values in the filename

---

_[View the full topic](https://discourse.cmake.org/t/add-subdirectory-with-path-outside-project-produces-strange-tmp-directorys/4309)._
