preset: include from other files

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? 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
    or by parsing the .json files

2 Likes

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

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