Follow the instructions below to clone, configure, and build the project.
git clone --recurse-submodules -j8 https://github.com/upf-gti/CGFrameworkStudent.git
Once cloned, you can optionally work on your own repository.
The framework provided is compatible with all operating systems. Here are the steps for each platform:
- Install MS Visual Studio Community
→ Select "Desktop Development with C++" - Install CMake
→ Select "Windows x64 Installer" for the last version.
→ Enable "Add CMake to PATH" during installation (otherwise CMake won't work in the terminal)
Open a Windows Terminal, go to the project folder, and run:
cd CGFrameworkStudent
mkdir build
cd build
cmake .. -DCMAKE_POLICY_VERSION_MINIMUM=3.12Double click on the .sln VS project inside the build/ folder.
You are all set!
Remember you can optionally create your own repository.
- Install XCode (you may need to update MacOS version)
- Install Homebrew (to install the missing libraries). Open a terminal and run this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Install CMake:
brew install cmakeOpen a MacOS Terminal, go to the project folder, and run:
cd CGFrameworkStudent
mkdir build && cd build
cmake -G "Xcode" ..This will generate a XCode project inside the folder build/.
You are all set!
Remember you can optionally create your own repository.
If CMake fails, run this command an try again:
sudo xcode-select --resetIf the error says that it cannot find C/C++ compilers, find them using:
xcrun -find c++
xcrun -find ccThen, try to build again (inside the build directory) specifying the paths:
cmake -D CMAKE_C_COMPILER="Path_of_C_compiler" -D CMAKE_CXX_COMPILER="Path_of_C++_compiler" -G Xcode ..- Install CMake, libraries and compilers using these commands:
sudo apt install cmake
sudo apt install build-essential
sudo apt install -y libglu1-mesa-dev freeglut3-dev mesa-common-dev libgl1-mesa-devOpen a Linux Terminal, go to the project folder, and run:
cd CGFrameworkStudent
mkdir build && cd build
cmake ..This will generate a Makefile inside the folder build/.
Use make to compile. You can speed-up compilation using more threads with -j(num threads), for example: make -j8.
Remember you can optionally create your own repository.
After installing all the libs for your platform, if you need a more light weight IDE which can be used in any platform (included Linux), this is your better option.
Visual Studio Code can be downloaded for each platform here.
NOTE: you must have a C/C++ compiler installed and added to the path before progressing with the installation.
After 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
Then, on VSCode, open the project folder where the CMakeLists.txt is located and the configuration of the project should start automatically. At this point you should be able to build and run the project using the VSCode interface.
If not, then open the CMake tab on the left of VSCode, and select the configure and build the project options.
Check this link to learn how to debug the framework in Visual Studio Code.
If you want to push your local copy to your own GitHub repo:
- Create an empty private repository on GitHub
- Open the terminal
- Go to the CGFrameworkStudent cloned repository folder:
cd CGFrameworkStudent
- Point your local repo to your newly created GitHub repo:
git remote set-url origin <your-repository-url.git>
- IMPORTANT: verify both "fetch" and "push" are pointing to your repository:
git remote -v
You should see:
origin <your-repository-url.git> (fetch)
origin <your-repository-url.git> (push)
- Update changes to the remote
git push