I have an issue where the environment setting in a config preset is not used when running ninja.
$ cmake --preset default && touch CMakeLists.txt && (cd build/default; ninja) Preset environment variables: MY_ENVIRONMENT_VARIABLE="Test" -- MY_ENVIRONMENT_VARIABLE: Test -- Configuring done (0.0s) -- Generating done (0.0s) -- Build files have been written to: /home/kuka/cmake_env/build/default [0/1] Re-running CMake... -- MY_ENVIRONMENT_VARIABLE: -- Configuring done (0.0s) -- Generating done (0.0s) -- Build files have been written to: /home/kuka/cmake_env/build/default ninja: no work to do.
I expected that the environment variable is set during the configuration triggered by ninja.
Is this a bug or expected behavior?
See my simple project:
cmake_env.zip (691 Bytes)
- Setting the variable again in the build preset does not help
cmake --build --presetdefault instead of ninja works, but I still think the generated build.ninja should know this.