Skip to content

upf-gti/CGFrameworkStudent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computer Graphics

Clone and initialize the repository:

git clone --recurse-submodules -j8 https://github.com/upf-gti/CGFrameworkStudent.git

The framework provided is compatible with all operating systems. The steps for each platform are mandatory to be able to build the framework. The mandatory C++ IDEs are the following:

  • MS Visual Studio Community (Windows)
  • XCode (Mac)
  • Visual Studio Code (Linux, optional for other platforms)

Detailed installation information can be seen below.

Windows

MS Visual Studio Community can be downloaded from here. Make sure you select "Desktop Development with C++".

In addition you need to install CMake which can be downloaded from here. Select "Windows x64 Installer" for the last version. Remember to set "Add CMake to PATH" when asked while installing, otherwhise you won't be able to call CMake from the terminal.

Once you have all required open a Windows Terminal, go to the project folder and do this steps:

mkdir build
cd build
cmake ..

This will generate a Visual Studio project inside the folder build/ (.sln) that you can use to compile and debug the framework.

Mac

You need XCode installed in your system (you may need to update MacOS version), Homebrew to install the missing libraries and also CMake.

To install Homebrew open a terminal and run this command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Continue by installing cmake using this command:

brew install cmake

Once you have all required open a MacOS Terminal, go to the project folder and do this steps:

mkdir build && cd build
cmake -G "Xcode" ..

This will generate a XCode project inside the folder build/ that you can use to compile and debug the framework.

If this process leads to cmake errors, run this command an try again:

sudo xcode-select --reset

Linux

Install cmake and needed libraries using this command:

sudo apt install cmake
sudo apt install build-essential
sudo apt install -y libglu1-mesa-dev freeglut3-dev mesa-common-dev libgl1-mesa-dev

Once you have all required open a Linux Terminal, go to the project folder and do this steps:

mkdir build && cd build
cmake ..

This will generate a Makefile inside the folder build/ that you can use to compile framework.

Use make to compile. You can speed-up compilation using more threads with -j(num threads), for example: make -j8.

Visual Studio Code (Linux, optional for other platforms)

After installing all the libs for your platform, if you need a more light weight IDEs which can be used in any platform (included Linux), this is your better option.

Visual Studio Code can be downloaded for each platform here.

Configuring VSCode

After the VSCode and the requirements for each platform are installed (the steps for each platform are mandatory!), the following extensions are needed to work with C++ code:

C/C++
C/C++ Extension Pack
C/C++ Themes
Cmake Tools

Check this link to learn how to debug the framework in Visual Studio Code.

First, open the project folder where the CMakeLists.txt is located, then open the CMake tab on the left, configure and build the project.