You need those tools:
-
CMake >= 3.14
-
Git
-
Python
brew install git cmake python
Use your package manager to install dependencies
sudo apt install git cmake python
You need to install the Visual Studio, and:
winget install Git.Git Python CMake.
- Create a build folder:
cmake -B build
if you want to use other build tools, like Ninja:
cmake -B build -G Ninja
- Build Project:
cmake -B build
This command should invokes the building tool that you set before.
- Run the Executable File
./build/learnopengl
For Windows User:
The output learnopengl.exe
should be in ./build/Debug
folder.
Your Text Ediotr may need the compile_commands.json
to do autocompleting, you can build projects first then copy compile_commands.json
from the build
folder.
For VSCode user, you need ms-vscode.cmake-tools
, ms-vscode.cpptools
and twxs.cmake
those three extensions. When you opened this project, VSCode should will tell you to install them.
After opening project, you should use >CMake: Select Configure Preset
to select build preset and >CMake: Select Build Preset
to select target preset.
Due to the limitation of ms-vscode.cmake-tools
, you can not change current working dictionary of target program, highly recommend using terminal to launch target program.
Please Read CMakeLists.txt
for more information.