Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
keepassxc: support macOS
Closes #32879, taking the new description from the PR
- Loading branch information
Showing
3 changed files
with
89 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Fix "No known features for CXX compiler", see | ||
https://cmake.org/pipermail/cmake/2016-December/064733.html and the note at | ||
https://cmake.org/cmake/help/v3.10/command/cmake_minimum_required.html | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -20,10 +20,10 @@ if(NOT CMAKE_BUILD_TYPE) | ||
FORCE) | ||
endif() | ||
|
||
-project(KeePassXC) | ||
- | ||
cmake_minimum_required(VERSION 3.1.0) | ||
|
||
+project(KeePassXC) | ||
+ | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | ||
|
||
# Support Visual Studio Code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Remove the use of macdeployqt to avoid copying dependencies and | ||
reduce installation size from 90 MB to 9 MB. | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -188,8 +188,8 @@ else() | ||
set(PROGNAME keepassxc) | ||
endif() | ||
|
||
-if(APPLE AND WITH_APP_BUNDLE AND "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local") | ||
- set(CMAKE_INSTALL_PREFIX "/Applications") | ||
+if(APPLE AND WITH_APP_BUNDLE) | ||
+ set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/Applications") | ||
endif() | ||
|
||
if(MINGW) | ||
@@ -198,7 +198,7 @@ if(MINGW) | ||
set(PLUGIN_INSTALL_DIR ".") | ||
set(DATA_INSTALL_DIR "share") | ||
elseif(APPLE AND WITH_APP_BUNDLE) | ||
- set(CLI_INSTALL_DIR "/usr/local/bin") | ||
+ set(CLI_INSTALL_DIR "../bin") | ||
set(BIN_INSTALL_DIR ".") | ||
set(PLUGIN_INSTALL_DIR "${PROGNAME}.app/Contents/PlugIns") | ||
set(DATA_INSTALL_DIR "${PROGNAME}.app/Contents/Resources") | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 5255186..0175983 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -282,11 +282,6 @@ if(APPLE AND WITH_APP_BUNDLE) | ||
if(NOT DEFINED QT_BINARY_DIR) | ||
set(QT_BINARY_DIR "/usr/local/opt/qt5/bin" CACHE PATH "QT binary folder") | ||
endif() | ||
- add_custom_command(TARGET ${PROGNAME} | ||
- POST_BUILD | ||
- COMMAND ${QT_BINARY_DIR}/macdeployqt ${PROGNAME}.app | ||
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src | ||
- COMMENT "Deploying app bundle") | ||
endif() | ||
|
||
if(MINGW) | ||
diff --git a/src/autotype/mac/CMakeLists.txt b/src/autotype/mac/CMakeLists.txt | ||
index ac93de0..03d502e 100644 | ||
--- a/src/autotype/mac/CMakeLists.txt | ||
+++ b/src/autotype/mac/CMakeLists.txt | ||
@@ -16,7 +16,6 @@ if(WITH_APP_BUNDLE) | ||
add_custom_command(TARGET keepassx-autotype-cocoa | ||
POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libkeepassx-autotype-cocoa.so ${PLUGIN_INSTALL_DIR} | ||
- COMMAND ${QT_BINARY_DIR}/macdeployqt ${PROGNAME}.app -executable=${PLUGIN_INSTALL_DIR}/libkeepassx-autotype-cocoa.so -no-plugins | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src | ||
COMMENT "Deploying autotype plugin") | ||
else() |