microsoft / microsoft/vscode-cmake-tools
Multi-target debug cwd configuration
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 546
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 32
Description
My workspace is structured like so:
${workspaceFolder}
|----- CMakeLists.txt
|
|----- build/
|
|----- projects/
|----- projectA/
| |----- src/
| |----- out/
| |----- resources/
| |----- CMakeLists.txt
|
... (3 more identically structured projects)
When debugging, I want CMake Tools to set the cwd to each project's out directory because I distribute the files from resources/ to out/ 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 work
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
Any suggestions?
Edit: ${CMAKE_BINARY_DIR} is set to ${PROJECT_SOURCE_DIR}/out in each project's CMake Lists.txt
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported workspace layout and the CMakeLists.txt files; reproduce how CMake Tools chooses the debug cwd for multiple targets. Trace the existing debug configuration path, with completion defined as each target using its project's out directory and the behavior covered by a regression test or documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake
- Domain
- build-system, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100