I propose adding a new option to
cmake -E that takes a file of environment variables to set, much like
cmake -E env.
THIS=THAT MY_PATH=/path/to/thing DEBUG_MODE=yes
cmake -E env_file .env my_command
I often find myself adding large lists of environment variables to
cmake -E env, and thought there could be a better solution.
I threw together a working example here: