microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.46k stars 449 forks source link

VS_DEBUGGER_WORKING_DIRECTORY is not honoured by the generator #771

Open devshgraphicsprogramming opened 5 years ago

devshgraphicsprogramming commented 5 years ago

Brief Issue Summary

The debugger and run-without-debugger (run in terminal) do not honour the working directory set for individual targets.

Expected:

Both debugger and run-without-debugger run my target from the specified (by VS_DEBUGGER_WORKING_DIRECTORY) working directory.

Apparent Behavior:

Debugger and Run-In-Terminal both attempt to run my target binaries from the root directory of the project as the working directory.

Platform and Versions

codewing commented 4 years ago

I'm having the same issue.

Set "cwd": "${workspaceFolder}/build/", in my launch.json but when I press CTRL + F5 the project is started from the root of the workspace

github-actions[bot] commented 11 months ago

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.

billgan1024 commented 9 months ago

Just encountered this bug as well, hoping for a fix.

gcampbell-msft commented 3 days ago

@billgan1024 @devshgraphicsprogramming What generator are you using for this project?

The design of the VS_DEBUGGER_WORKING_DIRECTORY was initially designed only for the VS generators, it's also tracked here for VS: https://developercommunity.visualstudio.com/t/CMake-integration-does-not-use-VS_DEBUGG/10661022, and Kitware themselves here: https://gitlab.kitware.com/cmake/cmake/-/issues/16478.

If it's not working for even the VS generators, we should likely look into this. More generically, there will be enhancements made in Kitware CMake.

devshgraphicsprogramming commented 2 days ago

Its a 5 year old issue, but @AnastaZIuk probably knows if it still affects us