Feature request: default values for environment variables in presets

It would be helpful to have the ability to supply a default value for environment variables in presets (when the environment variable is not defined).

My use case is this… I’d like to make the build directory a subdirectory of XDG_CACHE_HOME. The semantics of this variable are such that applications should use ~/.cache if the variable is not defined. It would be nice if it were possible to express this in CMakePresets.json.

2 Likes

+1 for feature, it also would compose great with new default CMake config dir (see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9615 for details)