- cmake
- make(Linux/Unix and MacOS) or Visual Studio(Windows)
Use git clone --recursive https://github.com/dokriseum/CGTutorial.git
to clone. Otherwise, the submodules (glew, glfw, glm) won't be cloned.
First, you have to install some standard tools: libgl1-mesa-dev
, libxrandr-dev,
libxinerama-dev
, libxcursor-dev
, libxi-dev
Your current directory has to be CGTutorial/
.
- Create the Makefile:
cmake -S . -B build
- Use make to build the project:
cd build && make
sudo apt install libgl1-mesa-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules xorg-dev build-essential cmake -y
You should end up with an executable CGTutorial/build/CGTutorial
.
MacOS could have some problems since some Apple Systems don't support OpenGL 3.*.
- Open the folder
CGTutorial
in Visual Studio. It should detect theCMakeLists.txt
and build the solution automatically in Debug mode. - Choose the target called
CGTutorial.exe
.
Inspired by https://github.com/ArthurSonzogni/OpenGL_CMake_Skeleton