vscode-cmake-tools
vscode-cmake-tools copied to clipboard
`cmake.cacheInit` does not respect absolute paths in environment variables
Brief Issue Summary
Reproducing steps
- Set environment variable
CMAKE_INIT_CACHEto an absolute path, e.g./tmp/my-init-cache.cmake - Add the following setting in
settings.json"cmake.cacheInit": "${env:CMAKE_INIT_CACHE}" - Click "Configure All Projects" button
I expect the file /tmp/my-init-cache.cmake will be used to initialize CMake cache. Unfortunately the following command is invoked:
cmake ... -C /home/my-user/my-workspace//tmp/my-init-cache.cmake ...
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
it looks like we are not expanding the path before we test if it is an absolute path.
Can you try using this setting and see if it works:
"cmake.cacheInit": "/tmp/my-init-cache.cmake"
The following setting works:
"cmake.cacheInit": "/tmp/my-init-cache.cmake"
Workaround:
"cmake.cacheInit": "/${env:CMAKE_INIT_CACHE}"
then the following command will be executed:
cmake ... -C //tmp/my-init-cache.cmake ...