Installation
Windows installation
-
1. Download and install: CMake https://cmake.org/
-
-
- Download \(->\) Windows x64 Installer (cmake-x.x.x-windows-x86_64.msi)
-
- Enable the option "Add CMake to the system PATH" in the setup during installation.
-
-
CMake est un outil de génération de projet qui permettra de configurer vos code C++ de manière portable.
-
Patientez jusqu'à la fin de l'installation avant de passer à la suite.
-
-
VSCode est un outil d'édition de texte et code.
-
-
Le logiciel est propriétaire à Microsoft et peut nécessiter la création d'un compte sur leur site, mais est gratuit.
-
Ne confondez pas Visual Studio Code/VSCode (IDE multiplateforme sans compilateur), et Microsoft Visual Studio Community Edition (IDE dédié pour Windows avec compilateur C++).
-
Notez que le téléchargement et l'installation peuvent être long. Vous devrez redémarrer votre ordinateur après l'installation.
-
3. In the directory where you placed the session codes, run the script located in
00_test_installation/scripts/visual-studio-generate.bat.
-
-
- Upon completion of the execution, a file
00_test_installation/build/project.sln or project.slnx should be created. Open it with Visual Studio to access the compilable code.
-
- You can access the code from the "Solution Explorer" window. Compilation and execution are done via the "Local Windows Debugger" button (the "Play" icon at the top).
-
-
- Le script de génération utilise CMake pour créer un projet Visual Studio (fichier .sln) adapté au code.
-
- Si vous ajoutez de nouveaux fichiers C++ au code, il sera nécessaire de relancer ce script afin que Visual Studio prenne en compte les nouveaux fichiers.
-
- Si vous rencontrez des erreurs lors de l'execution du script de compilation, vérifiez que votre code est bien positionné dans un répertoire sans accents ni espaces.
Mac installation
-
1. Install, if you don't already have them, the following tools:
-
-
-
VSCode est un outil d'édition de code.
-
-
brew est un gestionnaire de paquets pour MacOS.
-
2. In a terminal, type the following commands
# CMake tool to compile
brew install cmake
# Install pkg-config - tool helping to find library for compilation
brew install pkg-config
# Install ninja - a compilation chain tool
brew install ninja
# Install glfw - the window handler used as external library
brew install glfw
-
3. Open a terminal and switch to the directory where you placed the session codes
csc43043ep-lab-code/. You can test the compilation by typing the following commands:
cd 00_test_installation
mkdir build
cd build
cmake ..
make
If the compilation went smoothly, an executable
project should be created in the
build/ directory. You can launch it by typing:
-
4. The code editing can be done by opening the file
vscode.code-workspace with VS Code located in the root directory of the session codes. Choose the "RelWithDebInfo" configuration to compile with the debugging options.
Debug
If GLFW is not found, it is possible to use the precompiled version provided with the code.
-
- Open the 'CMakeLists.txt' and modify the following line:
option(MACOS_GLFW_PRECOMPILED "Use precompiled library for GLFW on MacOS" OFF)
to
option(MACOS_GLFW_PRECOMPILED "Use precompiled library for GLFW on MacOS" ON)
-
- Open Finder in the following directory:
00_test_installation/cgp/third_party/glfw/macos/lib/
-
- Open the file
libglfw.3.dylib (right-click, or CTRL+Click), choose Open
-
- Perform a new compilation of the code.
Installation on Linux/Ubuntu
-
1. Install, if you don't have them yet:
-
-
-
VSCode est un outil d'édition de code.
-
2. Install the necessary tools by typing the following command 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
-
3. Open a terminal and switch to the directory where you placed the session codes
csc43043ep-lab-code/. You can test the compilation by typing the following commands:
cd 00_test_installation
mkdir build
cd build
cmake ..
make
-
4. The code editing can be done by opening the file
vscode.code-workspace with VS Code located in the root directory of the session codes. Choose the "RelWithDebInfo" configuration to compile with the debugging options.
Detailed Additional Help
If you encounter a problem, a detailed version of the possible installations is available here
https://imagecomputing.net/cgp/compilation (some code paths may differ).