doc/c++/COMPILING-CMAKE-VCPKG.md
Contents
<!-- END doctoc generated TOC please keep comment here to allow auto update -->WARNING: CMake build is NOT officially supported and should be used for dev purposes ONLY.
For the official way to build CataclysmDDA, see:
cmake >= 3.20.0
vcpkg from vcpkg.io
msgfmt (optional) as part of Git Bash or msys2 in the default install paths.
On Linux (for libxcrypt):
autoconf
automake
libtool
pkg-config
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:
-DVCPKG_ROOT=C:\dev\vcpkg (or whatever the path is) to any cmake configure commandsVCPKG_ROOT to the path to the vcpkg checkout.VCPKG_ROOT cache variable in CMakePresets.json to the appropriate pathThe 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".
CMakePresets.json file which is tracked by source control. Do not commit this change.Run the command
cmake --list-presetsIt 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=OFFFrom 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 RelWithDebInfoFrom 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 or cataclysm-tiles.exe