WARNING: CMake build is NOT officially supported and should be used for dev purposes ONLY.
For the official way to build CataclysmDDA, see:
- Prerequisites
- Configure
- Build
- Install
- Run
cmake
>= 3.20.0
vcpkg
from vcpkg.io
msgfmt
(optional) as part of Git Bash or msys2 in the default install paths.
The file CMakePresets.json
contains all the presets.
They will all build the code into the directory out/build/<preset>/
.
If vcpkg is checked out in a location different from C:\vcpkg
, eg. C:\dev\vcpkg
, you must do one of the following:
- append
-DVCPKG_ROOT=C:\dev\vcpkg
(or whatever the path is) to any cmake configure commands - set the environment variable
VCPKG_ROOT
to the path to the vcpkg checkout. - edit the
VCPKG_ROOT
cache variable inCMakePresets.json
to the appropriate path
The Standard toolbar shows the presets in the Configuration drop-down box.
From the main menu, select Project -> Configure Cache
If you do not have msgfmt
available, or do not want to include translations with the build, you need to additionally set DLOCALIZE=OFF
. To do this, go to Project -> CMake Settings, scroll to the bottom where "windows-tiles-sounds-x64-msvc"
is defined, and under "cacheVariables"
change the value from "LOCALIZE": "True"
to "LOCALIZE": "OFF"
.
- Note: doing this will change the
CMakePresets.json
file which is tracked by source control. Do not commit this change.
Run the command
cmake --list-presets
It will show the presets available to you. The list changes based on the environment you are in. If empty, the environment is not supported.
Run the command
cmake --preset <preset>
If you do not have msgfmt
available, or do not want to include translations with the build, you need to additionally pass -DLOCALIZE=OFF
.
cmake --preset <preset> -DLOCALIZE=OFF
From the Standard toolbar's Build Preset drop-down menu select the build preset.
From the main menu, select Build -> Build All
Run the command
cmake --build --preset <preset>
From the main menu, select Build -> Install CataclysmDDA
Run the command
cmake --install out/build/<preset>/ --config RelWithDebInfo
From the Standard toolbar's Select Startup Item... drop-down menu select cataclysm-tiles.exe (Install)
The Project Configuration drop-down menu will show RelWithDebInfo
.
You can now Start Without Debugging (default Ctrl+F5) or Debug -> Start Debugging (default F5).
Run the commands
cd out/install/<preset>/
cataclysm
orcataclysm-tiles.exe