Let’s say I have a build infrastructure repository, containing a cmake/common_presets.json, and various toolchain files that are referenced in this file’s presets, e.g.:
I wish to include common_presets.json in another project’s root-level CMakePresets.json via a submodule. Unfortunately, it doesn’t look like a currentSourceDir macro exists, so if I include common_presets.json in my CMakePresets.json, the sourceDir macro expands to the new project root, and all of the paths break. I believe that this also happens if you simply specify a relative path, since it seems that the relative path is with respect to the top-level CMakePresets.json, as opposed to the included file.
Unfortunately, it seems like fileDir also evaluates to the path of the `CMakePresets.json` that is including common_presets.json, as opposed to the path to common_presets.json itself. While this might be the expected behavior if macros aren’t expanded until after inclusion in the calling file, this is still undesirable for me.