How to specify default values for environment variables in CMakePresets

1.3k Views Asked by At

When using CMakePresets.json the documentation states that I can use either $env{<variable-name>} or $penv{<variable-name>} to query environment variables.

Is it possible to specify a default value in case the environment variable is not set?

Note:

  • Since the variable that I am trying to set is also inside the presets, I can't handle the issue inside a CMake script.
  • If default values are not supported is there any workaround with which I could achieve the same inside the presets file?
0

There are 0 best solutions below