Skip to content
Nils Schimmelmann edited this page Jul 20, 2025 · 53 revisions

Building MMapper

Get the code

Enter a directory that you want to build in and check out the code

git clone https://github.com/MUME/MMapper.git
cd MMapper

Linux

You need to have a C++ compiler, CMake, and Qt development packages installed for your distribution:

Distro Command
Debian/Ubuntu sudo apt-get install -y build-essential qt5-qmake libqt5opengl5-dev libqt5websockets5-dev zlib1g-dev libssl-dev qt5keychain-dev libglm-dev cmake ninja-build
Fedora sudo dnf install -y @development-tools qt5-qtbase-devel qt5-qtwebsockets-devel zlib-devel openssl-devel qt5-qtkeychain-devel glm-devel cmake ninja-build

Make sure you are in the directory of the source tree and run:

mkdir build
cd build
cmake -G Ninja -S ..
cmake --build . --parallel
ctest
cpack

Mac OS X

Utilize brew and aqtinstall to install the dependencies:

brew install cmake ninja aqtinstall
aqt install-qt mac desktop 6.5.3 clang_64 -m qtwebsockets

Make sure you have installed the X-code install the Command Line Tools package:

xcode-select --install

Add aqtinstall's Qt installation dir to your path:

  echo 'export PATH="~/6.5.3/macos/bin:$PATH"' >> ~/.zshrc

Change the directory to the source tree, and run:

mkdir build
cd build
cmake -G Ninja -S ..
cmake --build . --parallel
ctest
cpack

Windows

MingW64

Download and install the following:

  1. Qt Open Source for Windows with MinGW, Git, and the OpenSSL toolkit
  2. CMake
  3. NSIS
  4. 7-zip

Reference the following script to figure out how to build everything: https://github.com/MUME/MMapper/blob/master/.appveyor.yml#L178

MSVC

  1. Install Visual Studio Community 2019 with the Desktop development with C++ workload option
  2. Install Qt Visual Studio Tools
  3. Install Qt Open Source for Windows for MSVC 2019 along with the OpenSSL toolkit
  4. Clone the repository and edit your CMakeSettings.json accordingly:
{
  "configurations": [
    {
      "name": "x64-Debug",
      "generator": "Ninja",
      "configurationType": "Debug",
      "inheritEnvironments": [ "msvc_x64_x64" ],
      "buildRoot": "${projectDir}\\out\\build\\${name}",
      "installRoot": "${projectDir}\\out\\install\\${name}",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "",
      "ctestCommandArgs": "",
      "variables": [
        {
          "name": "Qt5_DIR",
          "value": "C:/Qt/5.15.2/msvc2019_64/"
        },
        {
          "name": "QTDIR",
          "value": "C:/Qt/5.15.2/msvc2019_64/"
        },
        {
          "name": "OPENSSL_ROOT_DIR",
          "value": "C:/Qt/Tools/OpenSSL/Win_x64"
        }
      ],
      "cmakeToolchain": ""
    }
  ]
}

Code Style

You can run a code style check with the following Docker command:

docker run \
        --platform linux/amd64 \
		--volume "$(pwd)":"$(pwd)" \
		--workdir "$(pwd)" \
		ghcr.io/jidicula/clang-format:"14" \
		--dry-run \
		--Werror \
		--style=file \
		$(find src/ -iname *.h -o -iname *.c -o -iname *.cpp -o -iname *.hpp)

Clone this wiki locally