Allow for homebrew prefix location to handle both x64 and arm macs (#8593)

Allow for Homebrew prefix location to handle both x64 and arm macs
This commit is contained in:
Vijay Aravamudhan 2022-10-18 01:51:50 +05:30 committed by GitHub
parent 56307e6cad
commit f7735afcd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -78,7 +78,7 @@ Note: These steps place the compiled KeePassXC binary inside the `./build/src/`
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:
`-DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake`
`-DCMAKE_PREFIX_PATH=$(brew --prefix qt5)/lib/cmake`
(or whatever your Qt installation path is)
@ -98,7 +98,7 @@ CMake Configuration Options
## Common Parameters
```
-DCMAKE_INSTALL_PREFIX=/usr/local
-DCMAKE_INSTALL_PREFIX=$(brew --prefix)
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_BUILD_TYPE=<RelWithDebInfo/Debug/Release>
-DWITH_GUI_TESTS=ON

View File

@ -930,6 +930,13 @@ build() {
# linuxdeploy requires /usr as install prefix
INSTALL_PREFIX="/usr"
fi
if [ -n "$OS_MACOS" ]; then
type brew &> /dev/null 2>&1
if [ $? -eq 0 ]; then
INSTALL_PREFIX=$(brew --prefix)
fi
fi
# Do not build tests cases
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DWITH_TESTS=OFF"

View File

@ -5,7 +5,7 @@
: ${KDBX_SEARCH:=~/.KeePass/*.kdbx}
PROG=$(basename "$0")
KeePassXC=$(ls -f {/usr/local,/Applications}/KeePassXC.app/Contents/MacOS/KeePassXC 2>/dev/null | head -1)
KeePassXC=$(ls -f {/usr/local,/opt/homebrew,/Applications}/KeePassXC.app/Contents/MacOS/KeePassXC 2>/dev/null | head -1)
daemon_main() {
declare -A DBs