Linux Setup

System setup

These steps need to be done only once on a given computer.

You system will need the following elements:
All of them can be installed using the standard package manager of your distribution.
Example: For Ubuntu system, type the following commands in a terminal
# Make sure that your apt deposit is updated [optional]
sudo apt-get update

# Basic development tools (g++, make, etc)
sudo apt-get install build-essential pkg-config

# Install CMake tool
sudo apt-get install cmake 

# Install GLFW library
sudo apt-get install libglfw3-dev

First compilation

The following instructions need to be done in full once per projet, or/and when a given project is moved from one machine to another.

Open a command line in the "root" directory corresponding to a scene.
The "root" directory of a scene always contain a premade Makefile and a CMakeLists.txt. You can compile and execute the project using either of them on command line.

Method 1: If you use the provided Makefile
make
#  You can also type make -j$(nproc) for faster compilation in parallel
#  Or make -j 4 (replace 4 with any number of threads you want)

./example_compilation 
# adapt the name of the executable depending on the scene

Note:
Method 2: If you use the CMakeLists.txt
# Create a separated directory (avoids "polluting" the root directory)
mkdir build

# Go to the build/ directory
cd build

# Run CMake
cmake ..
# A file Makefile should be generated

# Compile
make
# Make sure the compilation succeed, an executable should be created (ex. example_compilation)
#  You can also type make -j$(nproc) for faster compilation in parallel
#  Or make -j 4 (replace 4 with any number of threads you want)

# Run the executable (adapt the name to your current scene)
./example_compilation
Rem.

Re-compiling after code modification

When the C++ code is modified, a new executable must be compiled again. This compilation simply consists in calling make again (or make -j[N]).

make   # recompile only what is necessary
./example_compilation  # run the new executable

Notes:

IDE for code edition

Beyond the simple compilation and execution of the project, you are highly encouraged to use a complete IDE (Integrated Development Environment) to edit C++ code. Compared to a simple text editor, an IDE will help you to use efficiently a library (such as CGP) in providing auto-completion (for functions/class names, arguments, etc) to naviguate quickly through the files, as well as proposing debug tools.

You may use VS Code with C++ plugins. Make sure to load a project in opening a folder ("File" \(\rightarrow\) "Open Folder) the root directory, and not simply opening a single file. VS Code is a versatile tool usefull for multiple language, but may require some setup to recognize C++ project.
Another good IDE for C++ is QtCreator. QtCreator has the advantage to be able to be specialized for C++ and doesn't require any tuning or plugins to work.

QtCreator can be installed on Ubuntu using these instructions
sudo apt-get install qtcreator
Follow these instructions to use QtCreator.