sudo xcode-select --install
brew install --cask cmake
or get from https://cmake.org/download/brew install ninja
or get it from https://github.com/ninja-build/ninja/releasesbrew install ccache
Clone https://github.com/vcmi/vcmi with submodules. Example for command line:
git clone --recurse-submodules https://github.com/vcmi/vcmi.git
There're 2 ways to get dependencies automatically.
We use this to produce builds on CI.
Please find detailed instructions here. Note that the link points to the state of the current branch, for the latest release check the same document in the master branch.
On the step where you need to replace PROFILE, choose:
macos-intel
macos-arm
brew install boost minizip sdl2 sdl2_image sdl2_mixer sdl2_ttf tbb
brew install ffmpeg
(you can also use an earlier FFmpeg version)brew install qt@5
for Qt 5 or brew install qt
for Qt 6This applies only to Xcode-based toolchain. If xcrun -f clang
prints errors, then use either of the following ways:
xcode-select
utility to set Xcode or Xcode Command Line Tools path, example: sudo xcode-select -s /Library/Developer/CommandLineTools
DEVELOPER_DIR
environment variable pointing to Xcode or Xcode Command Line Tools path, example: export DEVELOPER_DIR=/Applications/Xcode.app
Note that if you wish to use Qt Creator or CLion IDE, you should skip this step and configure respective variables inside the IDE. Or you could create a CMake preset to avoid manual configuration.
The following walkthrough lists only the bare minimum of required CMake options.
cd
to the source code directorycmake -S . -B BUILD_DIR
where BUILD_DIR can be any path, don't press Return-G Xcode
-G Ninja
-G 'Unix Makefiles'
Debug
/ RelWithDebInfo
/ Release
/ MinSizeRel
- and pass it in CMAKE_BUILD_TYPE
option, example: -D CMAKE_BUILD_TYPE=Debug
. If you use don't pass this option, RelWithDebInfo
will be used.--toolchain conan-generated/conan_toolchain.cmake
(or via CMAKE_TOOLCHAIN_FILE
variable) where conan-generated must be replaced with your directory choice-D "CMAKE_PREFIX_PATH="
variable. See below what you can insert after =
(but before the closing quote), multiple values must be separated with ;
(semicolon):
$(brew --prefix qt@5)
/Users/kambala/dev/Qt-libs/5.15.2/Clang64
You must also install game files to be able to run the built version, see Installation on macOS.
Open VCMI.xcodeproj
from the build directory, select vcmiclient
scheme and hit Run (Cmd+R). To build Launcher, select vcmilauncher
scheme instead.
cmake --build <path to build directory>
-- -j$(sysctl -n hw.ncpu)
to the above--config <configuration name>
to the above, example: --config Debug
You can run binaries from your IDE or directly from the bin directory: