Just spent some time trying to figure out how to set up VSCode to edit my current project, which is Qt and CMake.
I have the latest version of Qt from the Qt homepage. To get CMake see it, I set the following environment variable.
Code:
export Qt5_DIR "$HOME/Qt/5.15.0/clang_64/lib/cmake/Qt5"
I start VSCode with "code ." in the root of the project.
I install two extension: "C/C++" and "CMake Tools".
I pull up the Command palette and choose "CMake: Configure". That creates the usual "build" folder and runs CMake. It also puts a compile_commands.json file in the build directory.
I get a popup that says "CMake Tools would like to configure IntelliSense for this folder." I choose "Don't Allow".
I get another popup that says ""Would you like to use ${workspaceFolder/build/compile_commands.json to auto-configure IntelliSense for this folder?" I choose"Yes".
That's the setup that I've found works for me.