Skip to content

Compiling on Windows (CMake)

João Paulo edited this page Nov 26, 2024 · 1 revision

Microsoft Visual Studio 2022 with CMake

1. Download and Install the Required Software

To compile on Windows, you will need to download and install the following software:

2. Set Up vcpkg

Make sure to follow the full installation of vcpkg by referring to the Official Quickstart. Execute the following in Powershell:

To open Powershell, navigate to your desired directory (e.g., C:\) and choose Open PowerShell window here (Shift + Right-click).

Then, proceed with configuring vcpkg:

git clone https://github.com/microsoft/vcpkg
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install

Execute the following command in Powershell with Administrator permissions to set the vcpkg environment variable:

[System.Environment]::SetEnvironmentVariable('VCPKG_ROOT','C:\vcpkg', [System.EnvironmentVariableTarget]::Machine)

3. Download the Source Code

Run the following command to clone the source code:

cd C:\
git clone --recursive https://github.com/jprzimba/crystalserver.git

4. Build the Project

  1. Open Visual Studio. In the Get started section, select Open a local folder and open the server's main folder.

  2. Wait for Visual Studio to load the project. It will automatically install the required libraries and generate the CMake cache. (Be patient, as the first cache generation may take a few minutes).

  3. Once the CMake cache is successfully generated, you can compile the server by going to the Build menu and selecting Build All.