microsoft / microsoft/vscode-cmake-tools
CMake build from task not working after Open Folder
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 546
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 32
Description
### Brief Issue Summary
As of fixing bug #1234, running CMake build from task is basically working, but not right after Open Folder command.
1. Have a project with CMakeLists.txt in it's root directory.
2. Have this in tasks.json:
```
{
"version": "2.0.0",
"tasks": [
{
"label": "CMake Build",
"type": "cmake",
"command": "build",
"group": "build"
}
]
}
```
3. In launch.json:
```
{
"version": "0.2.0",
"configurations": [
{
...
"preLaunchTask": "CMake Build"
...
}
]
}
```
4. After opening the project using Open Folder command(also, in case it opens automatically at VSCode start), I press F5 key to build project and run it.
### Expected:
Project to be built and run.
### Apparent Behavior:
Got an error in output tab:
```
Error: The cmake task detection didn't contribute a task for the following configuration:
{
"label": "CMake Build",
"type": "cmake",
"command": "build",
"group": "build"
}
The task will be ignored.
```
But after I modify somehow tasks.json(e.g. enter space, delete it and save file), launch works as expected, task found successfully.
If then I open some other folder, and then reopen the project folder again, CMake Build task recognition fail again.
### Platform and Versions
- **Operating System**: Linux Mint 19
- **CMake Version**: 3.5.1
- **VSCode Version**: 1.51.1
- **CMake Tools Extension Version**: v1.5.3
- **Compiler/Toolchain**: arm-none-eabi-gcc 4.8
### Other Notes/Information
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
Reproduce the failure using the listed tasks.json and launch.json after Open Folder, then compare it with behavior after saving tasks.json. Start by tracing CMake task detection during folder opening; done means the CMake Build task is recognized immediately and F5 builds and runs the project without editing tasks.json.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, typescript, vscode
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100