Build
Prerequisites
Ensure you have the following tools installed before proceeding with the build process:
- CMake (version
3.27or later) - vcpkg (for dependency management)
- Visual Studio (required for Windows users)
- g++ (required for Linux users)
These prerequisites are essential across all platforms to successfully build the project.
You can check out our vcpkg setup guide for a very easy integration.
Building the Project
1. Clone the Project Repository
Begin by cloning the project repository:
git clone git@github.com:G-Epitech/DFMY-RType.git
cd DFMY-RType
2. Set Up vcpkg
Install vcpkg by following the official guide, then integrate it with CMake. Run the following command:
./vcpkg integrate install
If you're on Windows, replace ./vcpkg with .\vcpkg for the appropriate path format.
3. Configure and Install Dependencies with CMake
Since we are using a vcpkg manifest, the dependencies defined in vcpkg.json will be automatically installed when you configure the project with CMake.
Use the following command to configure the project and ensure vcpkg is linked correctly:
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=<vcpkg_root>/scripts/buildsystems/vcpkg.cmake
- The
-S .argument specifies the source directory as the current folder. - The
-Bbuild argument sets the build directory tobuild/. <vcpkg_root>should be replaced with the actual path to your vcpkg installation.
This command will configure the project and install all required dependencies from vcpkg.json.
4. Build the Project
After configuring CMake, you can build the project by running:
cmake --build build
This will compile the client, server, and libraries defined in the subdirectories.
5. Run the Project
After building, you can run the client or server binaries from the build directory:
./build/r-type_client # To run the client
./build/r-type_server # To run the server
Additional Notes
- For Windows users, ensure that
Visual Studiois installed and the appropriateMSVCcompiler is selected. - For Linux users, make sure
g++is installed and available in yourPATH.
For ease of use we also added a Makefile at the root of the repository, you can also check it out