- Download Cmake from the link in the site
- Run Cmake GUI, choose the project folder and destination folder for the cpp project files, press configure choose compiler (VS2022 for example). After configuration finished successfully press configure again and then press generate.
- If everything passes successfully click the "launch project" button or go to the build folder and launch the project from there.
- Build and start debugging.
Note: some of the notes below about debugging are probably also relevant for Linux / macOS (with some adjustments) but I haven't tested it.
If when scanning for kits (compilers) the CMake Tools extension doesn't find anything (even though you have it installed), check if changing the system locale to "English (United States)" - locale "Israel (Hebrew)" doesn't work (other locales probably work but I only tested "English (United States)". Afterwards restart the computer and scan for kits again.
This is how you do it:
- Make sure you choose the Debug build variant:
- Build and click (Windows) Launch to start debugging
If the launch configuration is not set up correctly try the following:
- In VS Code, open .vscode/launch.json
- Click the button Add Configuration...
- Choose C/C++: (Windows) Launch
- Change program and cwd to the correct paths (I also changed console but it's not mandatory).
Here's a configuration that works for me :
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Debug/Demo_bin.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build/",
"environment": [],
"console": "integratedTerminal"
}- Click (Windows) Launch to start debugging
When you first open the project you will see the following (or a similar) screen
-
Do not use the default (Ninja) generator!
On Windows choose: "Let CMake decide"
On Linux/Mac choose "Unix Makefiles"
-
To share the build directory with VS choose build directory to be "build"
Afterwards, open the Demo_bin run configuration and put





