# preset: include from other files

**URL:** https://discourse.cmake.org/t/preset-include-from-other-files/4392
**Category:** Usage
**Created:** [November 1, 2021, 3:30pm UTC](https://discourse.cmake.org/t/preset-include-from-other-files/4392 "2021-11-01T15:30:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gerhardol](https://discourse.cmake.org/user_avatar/discourse.cmake.org/gerhardol/32/1926_2.png) [@gerhardol](https://discourse.cmake.org/u/gerhardol)
#### Post date: [November 1, 2021, 3:30pm UTC](https://discourse.cmake.org/t/preset-include-from-other-files/4392/1 "2021-11-01T15:30:29Z")

</div>

A few suggestions for the nice preset feature

1. preset include other files  
There is currently only possible to have presets read from two files in the root directory: `CMakePresets.json` and `CMakeUserPresets.json`  
It is not possible to include this information from other directories.  
This would be useful for having similar setup for separate applications.

Automatically including the parent directory would be a way, I would prefer to explicitly specify the include file (that may be recursive).

I believe this could somehow be a solution for [Help converting most of a CI matrix to presets?](https://discourse.cmake.org/t/help-converting-most-of-a-ci-matrix-to-presets/3391/) too. Yuo will have to configure all variants but that could be generated which is easier than parsing.

1. support to preload cache  
Similar to what `cmake -C f<file>` provides

2. support for --install --preset=  
Similar to --build --prefix=  
configure allows “installDir” but `cmake --install` requires the binaryDir still.  
A workaround in [Install components with presets](https://discourse.cmake.org/t/install-components-with-presets/3590)  
or by parsing the .json files

---

<div class="post-metadata">

### Author: ![benthevining](https://discourse.cmake.org/user_avatar/discourse.cmake.org/benthevining/32/1924_2.png) [@benthevining](https://discourse.cmake.org/u/benthevining)
#### Post date: [November 1, 2021, 7:25pm UTC](https://discourse.cmake.org/t/preset-include-from-other-files/4392/2 "2021-11-01T19:25:26Z")

</div>

+1 for allowing preset inheritance from other files, this would be really helpful!

---

<div class="post-metadata">

### Author: ![gerhardol](https://discourse.cmake.org/user_avatar/discourse.cmake.org/gerhardol/32/1926_2.png) [@gerhardol](https://discourse.cmake.org/u/gerhardol)
#### Post date: [February 28, 2022, 3:48pm UTC](https://discourse.cmake.org/t/preset-include-from-other-files/4392/3 "2022-02-28T15:48:09Z")

</div>

1. is mostly implemented in upcoming 3.23, some limitations  
[https://gitlab.kitware.com/cmake/cmake/-/issues/23214](https://gitlab.kitware.com/cmake/cmake/-/issues/23214)
