# \[WSL] Compiling Remere's Map Editor Sources

## 1 **- Install WSL:**&#x20;

* <https://learn.microsoft.com/en-us/windows/wsl/install>

## 2 - Install a Linux Distribution:

* [Ubuntu 22.04](https://apps.microsoft.com/store/detail/ubuntu-22042-lts/9PN20MSR04DW?hl=pt-br\&gl=br)
* [Ubuntu 24.04](https://apps.microsoft.com/detail/9nz3klhxdjp5?hl=pt-br\&gl=BR)

## 3 - Install the required software:

<details>

<summary>Ubuntu 22.04</summary>

The following command will install Git, CMake, a compiler and the libraries used by Remere's Map Editor.

Git will be used to download the source code, and CMake will be used to generate the build files.

```
sudo apt update && sudo apt dist-upgrade
sudo apt install git cmake build-essential autoconf libtool ca-certificates curl zip unzip tar pkg-config ninja-build ccache bison linux-headers-generic libxi-dev libgl1-mesa-dev libegl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libibus-1.0-dev libasound2-dev libxmu-dev libdbus-1-dev libxtst-dev linux-libc-dev libarchive-dev libwxgtk3.0-gtk3-dev python3-distutils libxrender-dev
```

#### Update cmake:

```
sudo apt remove --purge cmake
hash -r
sudo apt install snapd
sudo snap install cmake --classic
cmake --version
```

#### Install vcpkg:

```
cd ~
git clone https://github.com/microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh
cd ..
```

**Update vcpkg if you already have installed:**

```
cd vcpkg
git pull
.\vcpkg upgrade
.\bootstrap-vcpkg.sh
.\vcpkg upgrade --no-dry-run
```

</details>

<details>

<summary>Ubuntu 24.04</summary>

The following command will install Git, CMake, a compiler and the libraries used by Remere's Map Editor.

Git will be used to download the source code, and CMake will be used to generate the build files.

```
sudo apt update && sudo apt dist-upgrade
sudo apt install git cmake build-essential autoconf libtool ca-certificates curl zip unzip tar pkg-config ninja-build ccache bison linux-headers-generic libxi-dev libgl1-mesa-dev libegl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libibus-1.0-dev libasound2-dev libxmu-dev libdbus-1-dev libxtst-dev linux-libc-dev libarchive-dev libwxgtk3.2-dev python3-distutils-extra libxrender-dev
```

#### Update cmake:

```
sudo apt remove --purge cmake
hash -r
sudo apt install snapd
sudo snap install cmake --classic
cmake --version
```

#### Install vcpkg:

```
cd ~
git clone https://github.com/microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh
cd ..
```

**Update vcpkg if you already have installed:**

```
cd vcpkg
git pull
.\vcpkg upgrade
.\bootstrap-vcpkg.sh
.\vcpkg upgrade --no-dry-run
```

</details>

## 4 - Download the source code:

```
git clone --depth 1 https://github.com/opentibiabr/remeres-map-editor.git
cd remeres-map-editor
```

## 5 - Checkout nightly branch (optional):

```
git checkout main
```

## 6 - Folder structure:

```
.
├── remeres-map-editor
└── vcpkg
```

## 7 - Configure and build:

```
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake .. --preset linux-release
cmake --build linux-release
```
