-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Set up Build Environment on macOS
Note: This is only a one-time setup guide. For actually building KeePassXC, please refer to our build guide.
First, install Xcode from the AppStore and run
xcode-select --install
in a terminal to install the Xcode CLI tools. Next, install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(or use the pkg installer if you dislike curl | bash).
Use Homebrew to install the required build tools:
brew install cmake asciidoctor
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).
Open a terminal and run:
brew install qt@5 argon2 botan qrencode readline minizip
Set up vcpkg in a location of your choosing:
git clone https://github.com/Microsoft/vcpkg.git && ./vcpkg/bootstrap-vcpkg.sh
Install pkg-config and (optionally) the vcpkg stub package from Homebrew:
brew install pkg-config vcpkg
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.
Finally, compile and install the actual build dependencies. Since Qt is extremely picky, you have to set your vcpkg triplet to either x64-osx-release
or arm64-osx-release
(depending on your architecture). The default x64-osx
or am64-osx
triplets do not work and will result only in nonsensical build failures. You can ask vcpkg to use a different triplet either by setting the VCPKG_DEFAULT_TRIPLET
environment variable or by passing it via the --triplet
parameter to the vcpkg install
call.
The following packages need to be installed:
vcpkg install argon2 botan minizip qt5 qt5-svg qt5-tools qt5-imageformats \
qt5-translations readline zlib libqrencode
Homebrew:
brew update && brew upgrade
vcpkg:
cd vcpkg && git pull && ./vcpkg update
Copyright (C) 2016-2023 KeePassXC Team