How to set cmake.cmakePath
for an SDK in devcontainer?
#4060
skycaptain
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm setting up a development environment using devcontainers for a project that uses a cross-compiling SDK.
Our setup defines a path to the native sysroot installation using an environment variable called
SDK_NATIVE_SYSROOT
. We aim to use this variable to setcmake.cmakePath
. The documentation states that we can use environment variables in the configuration like this:${env:VARIABLE_NAME}
.Here's what I've tried in my configuration file:
However, this doesn't work. When I run it, I get an error saying it can't find CMake at
/usr/bin/cmake
. It seems like${env:SDK_NATIVE_SYSROOT}
is being replaced with an empty string.Interestingly, if I put the same setting in
.vscode/settings.json
, it works fine.It appears that settings in the devcontainer.json file are evaluated using the
localEnv
before being sent to the devcontainer, while settings in.vscode/settings.json
are evaluated inside the container. However, theSDK_NATIVE_SYSROOT
variable only exists in the container, not on my local computer.This behavior seems counterintuitive, as the settings in
devcontainer.json
are meant for the container, not my local machine. Is there a way to definecmake.cmakePath
exclusively for the container without using.vscode/settings.json
? Using the latter would also override settings for users working locally.According to this issue we should use
${containerEnv:SDK_NATIVE_SYSROOT}
, however this is not supported by this extension.Beta Was this translation helpful? Give feedback.
All reactions