go2sh / cmake-integration-vscode

CMake Server Interface for VSCode.
https://go2sh.github.io/cmake-integration-vscode/
Other
19 stars 11 forks source link

Environment variables in configuration seetings seem not to work #15

Closed hriekehof closed 5 years ago

hriekehof commented 5 years ago

Before i say anything thanks so much for your work. The multi root workspace is really a nice and the extension seems to work fine for me for know. However it seems to that when i define a cache variable with "cmake.cacheEntries" in the json file and use an evironment varibale in the definitions for path like "${env:Variable}\path\to\something" ${env:Variable} is not resolved in the CMakeCache.txt

It would be great if this would work

go2sh commented 5 years ago

Can you check with v0.4.0 I think i fixed it.

hriekehof commented 5 years ago

I have to say it again this extension is awesome :) I didn't check the old case but when i have an environment variable in the cmake_configuration.json like this:

{
  "name": "RelWithDebInfo-M4",
  "buildType": "RelWithDebInfo",
  "toolchain": "c:/xxx/toolchain.cmake",
  "buildDirectory": "${env:BUILD_PATH}/project/${buildType}"
}

I get the following error message when i configure the project:

image

The reason is clearly that the variable is not substituted

go2sh commented 5 years ago

Ah I see. Will investigate.

go2sh commented 5 years ago

I'll found it. Will push a tonight.

hriekehof commented 5 years ago

I tested this today again and i recognize that the variable substitution only works for the buildDirectory variable in the array. For the toolchain variable it seems not to work for me. It would be great if it would work for all variables in this file.