I have a code base with a lot of different c source files in different folders. For projects we want to configure a project folder and reference different source folders from that project. I configured this using CMake and it al compiles fine. Also vscode shows me de code file I need for that project. But intellisense is not working.
CMake generates a c_cpp_properties.json file for me, from which I understand I can use to configure intellisense. But how? I have c_cpp_properties.json file with the folling content:
{
"configurations": [
{
"name": "test",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
I have the following folder structure:
- projects/my_app
- .vscode
- vscode.code-workspace
- c_cpp_properties.json
- build
- compile_commands.json
- source
- app.c
- app.h
- CMakeLists.txt
- .vscode
- components
- component1
- source
- component1.c
- component1.h
- source
- component2
- source
- component2.c
- component2.h
- source
- component1
- my_lib
- source
- …
- CMakeLists.txt
- source
I also have some extra sources which are not visible in the vscode workspace. But are included in de CMakeLists.txt.
I cannot get intellisense to work.
I expected to use intellisense in vscode for my workspace.