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.:
{
"name": "toolchain-gcc",
"hidden": true,
"toolchainFile": "${sourceDir}/cmake/toolchains/gcc.cmake"
},
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.
Any ideas on some possible workarounds?