mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Updated Building KeePassXC (markdown)
@@ -90,35 +90,30 @@ Download and unpack the source code as described in the [Linux](#linux) section,
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DWITH_XC_ALL=ON ..
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_XC_ALL=ON ..
|
||||
make -j8 package
|
||||
```
|
||||
|
||||
#### Notes:
|
||||
If you installed Qt5 via Homebrew, you should be able to compile KeePassXC without any changes. If CMake fails to find your Qt installation, you can specify it manually by adding the following parameter:
|
||||
If you have `vcpkg` installed, add `-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake` to the `cmake` command to automatically download and install all required build and runtime dependencies locally to your build directory before compiling KeePassXC.
|
||||
|
||||
`-DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake`
|
||||
If you installed Qt5 via Homebrew and CMake fails to find your Qt installation, you can specify it manually by adding the following parameter:
|
||||
|
||||
(or whatever your Qt installation path is)
|
||||
`-DCMAKE_PREFIX_PATH=$(brew --prefix qt5)/lib/cmake`
|
||||
|
||||
When building with ASAN support on macOS, you need to use `export ASAN_OPTIONS=detect_leaks=0` before running the tests (LSAN is no supported on macOS).
|
||||
|
||||
### Windows
|
||||
In a _MSYS2 MinGW_ terminal (*not* _MSYS2 MSYS_ which is the default), download and unpack the source code as described in the [Linux](#linux) section, change into the source code directory and run:
|
||||
The preferred way to build on Windows is using MSVC. To install all required dependencies automatically, you may have to add `-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake` to your `cmake` command.
|
||||
|
||||
If you are using MSYS2, open a _MSYS2 MinGW_ terminal (*not* _MSYS2 MSYS_ which is the default), download and unpack the source code as described in the [Linux](#linux) section, change into the source code directory and run:
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DWITH_XC_ALL=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake -G "MSYS Makefiles -DWITH_XC_ALL=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j8 package
|
||||
```
|
||||
|
||||
#### Notes:
|
||||
If you are using MSVC, you may have to specify your Vcpkg toolchain by adding the following CMake parameter: `-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake`
|
||||
|
||||
If you are using MSYS2, you may have to add ```-G "MSYS Makefiles"``` to the beginning of the cmake command.
|
||||
|
||||
## 3. Running tests
|
||||
If you compiled KeePassXC with the CMake flags `-DWITH_TESTS=ON` and `-DWITH_GUI_TESTS=ON`, you can run our unit test suite with:
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user