-
Notifications
You must be signed in to change notification settings - Fork 465
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
Multi-target debug cwd configuration #1101
Comments
We can mark this as a feature request. In the meantime, you can use the
This is not ideal for a project with multiple targets since you'll have to change the cwd each time you change debug targets, but it can get you by until the feature is implemented. |
@bobbrow any guidance on how/where to do this? I found vscode-cmake-tools/src/cmake-tools.ts Line 1260 in 6be0293
async launchTarget(name?: string)
I suppose we could add a line something like That would require adding another cmake setting |
I've been thinking about this and wasn't sure if this was the right approach. It would require a lot of manual target/path setting. The mechanism that CMake provides to accumulate binaries/resources into a working location is INSTALL and the information should be mostly derivable from CMakeLists.txt, but I've been looking over the INSTALL documentation and it seems it allows for more scenarios than I anticipated. I want to sync with the Visual Studio team that owns the CMake experience and see what their thoughts are about this. I *think* that we could provide a debug selector that will also let you pick one of the paths specified in your INSTALL directive though I'm not sure how reliable the guessing will be since you can INSTALL to multiple locations. |
Related #771 |
You can use the following in your settings.json without having to modify the cwd each time:
However, this does not work for non-debug launches. Any ideas? |
This issue is now marked as 'stale-old' due to there being no activity on it for the past 720 days. Unless the 'stale-old' label is removed or the issue is commented on, this will be remain open for at least 14 days and then it may be closed. If you would like to make this issue exempt from getting stale, please add the 'stale-exempt' label. |
I stopped using CMake in VSCode because of several small pain points like this, but I'd love to come back. |
My workspace is structured like so:
When debugging, I want CMake Tools to set the cwd to each project's
out
directory because I distribute the files fromresources/
toout/
and access them using relative paths.The cwd is currently set to
${workspaceFolder}
which means none of the resources are found.I have tried putting this in each project's
CMakeLists.txt
but it did not workAny suggestions?
Edit:
${CMAKE_BINARY_DIR}
is set to${PROJECT_SOURCE_DIR}/out
in each project's CMake Lists.txtThe text was updated successfully, but these errors were encountered: