A sample CMake for OpenGL based projects.
For more information about how all of these was done please refer to this link.
Install the following dependencies
- CMake (to download click here)
- IDE (e.g. Visual Studio)
- Make sure that CMake is installed and added to the system PATH variable.
- Open terminal in the CMakeLists.txt directory and run:
mkdir build
cd build
cmake -A Win32 ..
Note: The project must be configured as Win32, due to precompiled x86 binaries of thirdparty libraries.
- The following recipe was successfully tested on Ubuntu 20.04 platform.
- So far, we haven't tested macOS, nor any other Unix flavors.
- However, we anticipate most Linux distros should build similarly, aside from a few package-management tweaks.
- So... if you're developing on those platforms, please feel free to contribute :-)
sudo apt update
sudo apt install -y build-essential cmake mesa-common-dev mesa-utils freeglut3-dev
mkdir build
cd build
cmake ..
make -j4
./OpenGLExample
Any improvements to CMake script are greatly welcome.
- GoannaDoIt (Andrew J Macdonald)