Note: This is only a one-time setup guide. For actually building KeePassXC, please refer to our build guide.
Install the build toolchain
First, install Xcode from the AppStore and run
in a terminal to install the Xcode CLI tools. Next, install Homebrew
(or use the pkg installer if you dislike curl | bash).
Use Homebrew to install the required build tools:
Install build dependencies
To install the actual build dependencies, there are two options:
- Via Homebrew (faster, but suitable only for local builds).
- Via vcpkg (much slower, but suitable for distribution).
Option 1: Install build dependencies via Homebrew
Open a terminal and run:
Option 2: Install build dependencies via vcpkg
Set up vcpkg in a location of your choosing:
Install pkg-config and (optionally) the vcpkg stub package from Homebrew:
If you installed the vcpkg stub package, set the VCPKG_ROOT environment variable to your install location. You can then run the vcpkg command from anywhere, given that Homebrew is in your PATH. Otherwise, call the vcpkg binary with its full path.
The first time, you compile KeePassXC, vcpkg will download, compile, and install all required dependencies from the vcpkg manifest.
Important: If you have custom INCLUDE or CPATH variables set, make sure, . is not part of your include path and the path variables contain no empty segmemts (which can happen easily if you construct them like export INCLUDE="/some/include/path:${INCLUDE}") or else you will see strange compilation errors.