Article 56A63 Building CMake Qt projects with VSCode

Building CMake Qt projects with VSCode

by
dugan
from LinuxQuestions.org on (#56A63)
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.latest?d=yIl2AUoC8zA latest?i=YmgaFAzcL4Q:jYUb4OsuRZE:F7zBnMy latest?i=YmgaFAzcL4Q:jYUb4OsuRZE:V_sGLiP latest?d=qj6IDK7rITs latest?i=YmgaFAzcL4Q:jYUb4OsuRZE:gIN9vFwYmgaFAzcL4Q
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments