LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   Building CMake Qt projects with VSCode (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/building-cmake-qt-projects-with-vscode-4175679590/)

dugan 07-29-2020 12:09 PM

Building CMake Qt projects with VSCode
 
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.


All times are GMT -5. The time now is 01:16 AM.