git clone --recurse-submodules https://github.com/drohmer/inf585_lab_code.git
or
git clone https://github.com/drohmer/inf585_lab_code.git
cd inf585_lab_code/
git submodule init
git submodule update
Note: Do not use the "Code -> Download ZIP" option from the GitHub GUI as you won't get the CGP library as submodule with the code.
Scenes are in a directory scenes_inf585/xx_Name/
Each scene is provided with its own CMakeLists.txt and Makefile
Compilation via CMake
cd inf585_lab_code/scenes_inf585/00_introduction/
cmake -B build/
cd build/
make -j8 # or any -jN, with N=$(nproc)
./00_introduction
Compilation via Makefile
cd scenes_inf585/00_introduction/
make -j8 # or any -jN, with N=$(nproc)
./00_introduction
More details are provided in the dedicated Installation setup and Compilation page if needed (Windows, Linux, Mac).
The code requires the GLFW library in Linux and Mac.
sudo apt-get install libglfw3-dev
- You may use brew to install glfw. And then add the following two lines on your .zshrc to add glfw library to the path
export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib
- Alternatively, a pre-compiled glfw can be used without installation. To activate it, open the CMakeLists.txt file and set the option MACOS_GLFW_PRECOMPILED to ON. You may need to explicitely allow the mac to use the library if security triggers an alert.
The simplest way is the use of Visual Studio with the scripts/windows_cmake_visual.bat generating a visual studio project.
The full edition/compilation/debug toolchain should work with the following IDE:
- Visual Studio Code/vscode on Linux and MacOS: You may open a project with the dedicated configuration file
vscode.code-workspace
. - CLion on any plateform. Note that as student you are elligible for a free licence to this IDE. A project can be loaded directly from the CMakeLists.txt.
- QtCreator on Linux and MacOS. Install it via your package manager (apt/brew). A project can be loaded directly from the CMakeLists.txt (you may have to indicate to build in RelWithDebInfo instead of the default Debug).
- Visual Studio on Windows only. Free for individuals.
You may use the provided scripts (in directory scripts/) and configuration files to ease some of the compilation process
- vscode.code-workspace: workspace configuration file for Visual Code Studio (vscode).
- scripts/linux_compile_run_cmake.py: Run CMake, compile and run the code on Linux and MacOS. linux_clean.py remove temporary files.
- scripts/windows_cmake_visual.bat: On Windows, call CMake and generate a Visual Studio project. CMake must be accessible on the command line path. scripts/windows_clean.bat remove the temporary files and the visual studio project.
- scripts/linux_compile_emscripten.py: Generate a webpage runing the code of the scene. The script can run on Linux and MacOS if emscripten is installed.