-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting environment variables via shell/cmd script #288
Comments
Sounds useful. What sort of design/UX would you like to see? |
I'm not really sure how it's usually done, though I was thinking about something like this: "cmake.environmentScript": "source ${workspaceRoot}/path/to/script.sh" and on Windows: "cmake.environmentScript": "${workspaceRoot}\\path\\to\\script.bat" |
Do you need the script only in the build step or in the configure step of Cmake? I would prefer a preConfigure and preBuild Script step. |
I almost feel like this is getting close to the idea of another Kit type. The VS kits are generated in a similar manner (by invoking the vcvars batch files and collecting environment variables). Perhaps it belongs there? |
Actually all of them:
|
I think the |
I would also be interested in something like this. We already have a batch file that sets all necessary variables for our version of VS2017 build tools as well as some others we need internally. It would be great if we could just make cmake-tools use that as a kit. Has there been any progress in that direction? What would be the direction forward? |
I made a workaround script. Use at your own risk. |
This will also be useful for Yocto SDKs: https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#sdk-running-the-sdk-environment-setup-script The work-around script doesn't work as-is for it, since the setup script sources other files in as well. |
This request was addressed by the addition of |
It would be great to have support for setting environment variables via a script in addition to the current name-value lists (i.e.
cmake.environment
). This would help building against third-party libraries relying on shell/batch scripts to prepare the build environment (e.g., Intel Performance Libraries - each library exposes a .sh/.bat script which sets relevant environment variables).The text was updated successfully, but these errors were encountered: