Skip to content

Config file for CMake environment variables

CMake uses a number of environment variables for configuration that a user might want to set for all of their projects.

Examples include CMAKE_GENERATOR and CMAKE_EXPORT_COMPILE_COMMANDS.

Because these are effectively CMake configuration options, it would be nice to have a CMake-specific location to define these variables rather than setting them in the shell. Because !9615 (merged) establishes a user config directory, we could allow a ~/.config/cmake/Environment.json file to provide values for these options and set the environment variables for the process.

A warning could be displayed if the definitions in this file shadow existing environment variables.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information