From 247b85fe69aea28a7d0f87ebc8aff9fc26361c8c Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 7 May 2019 12:56:55 -0400 Subject: [PATCH] Update INSTALL.md and cleanup CMakeLists.txt (#3074) INSTALL.md * Better organization of CMake options CMakeLists.txt * If WITH_XC_NETWORKING is disabled, also disable WITH_XC_UPDATECHECK * Move KeeShare logic into KeeShare CMakeLists.txt * Remove WITH_XC_KEESHARE_SECURE build option * Attempt to find quazip, if found enable WITH_XC_KEESHARE_SECURE and build with secure container support --- CMakeLists.txt | 30 +++++++----------------------- INSTALL.md | 14 +++++++++++--- src/CMakeLists.txt | 9 ++++----- src/keeshare/CMakeLists.txt | 20 ++++++++++++++++---- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a84ef18c..689515a39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,19 +44,18 @@ option(WITH_APP_BUNDLE "Enable Application Bundle for macOS" ON) set(WITH_XC_ALL OFF CACHE BOOL "Build in all available plugins") option(WITH_XC_AUTOTYPE "Include Auto-Type." ON) -option(WITH_XC_NETWORKING "Include networking code (e.g. for downlading website icons)." OFF) +option(WITH_XC_NETWORKING "Include networking code (e.g. for downloading website icons)." OFF) option(WITH_XC_BROWSER "Include browser integration with keepassxc-browser." OFF) option(WITH_XC_YUBIKEY "Include YubiKey support." OFF) option(WITH_XC_SSHAGENT "Include SSH agent support." OFF) -option(WITH_XC_KEESHARE "Sharing integration with KeeShare" OFF) -option(WITH_XC_KEESHARE_SECURE "Sharing integration with secured KeeShare containers" OFF) +option(WITH_XC_KEESHARE "Sharing integration with KeeShare (requires quazip5 for secure containers)" OFF) option(WITH_XC_UPDATECHECK "Include automatic update checks; disable for controlled distributions" ON) if(APPLE) option(WITH_XC_TOUCHID "Include TouchID support for macOS." OFF) endif() if(WITH_XC_ALL) - # Enable all options + # Enable all options (except update check) set(WITH_XC_AUTOTYPE ON) set(WITH_XC_NETWORKING ON) set(WITH_XC_BROWSER ON) @@ -68,18 +67,16 @@ if(WITH_XC_ALL) endif() endif() -if(WITH_XC_KEESHARE_SECURE) - set(WITH_XC_KEESHARE ON) -endif() - if(WITH_XC_SSHAGENT OR WITH_XC_KEESHARE) set(WITH_XC_CRYPTO_SSH ON) else() set(WITH_XC_CRYPTO_SSH OFF) endif() -if(WITH_XC_UPDATECHECK) - set(WITH_XC_NETWORKING ON) +# Prefer WITH_XC_NETWORKING setting over WITH_XC_UPDATECHECK +if(NOT WITH_XC_NETWORKING AND WITH_XC_UPDATECHECK) + message(STATUS "Disabling WITH_XC_UPDATECHECK because WITH_XC_NETWORKING is disabled") + set(WITH_XC_UPDATECHECK OFF) endif() set(KEEPASSXC_VERSION_MAJOR "2") @@ -406,19 +403,6 @@ endif() include_directories(SYSTEM ${ARGON2_INCLUDE_DIR} ${sodium_INCLUDE_DIR}) -# Optional -if(WITH_XC_KEESHARE) - set(WITH_XC_KEESHARE_INSECURE ON) - if(WITH_XC_KEESHARE_SECURE) - # ZLIB is needed and already required - find_package(QuaZip REQUIRED) - include_directories(SYSTEM ${QUAZIP_INCLUDE_DIR}) - endif() -else() - set(WITH_XC_KEESHARE_INSECURE OFF) - set(WITH_XC_KEESHARE_SECURE OFF) -endif() - # Optional if(WITH_XC_YUBIKEY) find_package(YubiKey REQUIRED) diff --git a/INSTALL.md b/INSTALL.md index 3bc9185d9..957e6d37d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -97,18 +97,26 @@ These steps place the compiled KeePassXC binary inside the `./build/src/` direct -DWITH_XC_AUTOTYPE=[ON|OFF] Enable/Disable Auto-Type (default: ON) -DWITH_XC_YUBIKEY=[ON|OFF] Enable/Disable YubiKey HMAC-SHA1 authentication support (default: OFF) -DWITH_XC_BROWSER=[ON|OFF] Enable/Disable KeePassXC-Browser extension support (default: OFF) - -DWITH_XC_NETWORKING=[ON|OFF] Enable/Disable Networking support (favicon download) (default: OFF) + -DWITH_XC_NETWORKING=[ON|OFF] Enable/Disable Networking support (e.g., favicon downloading) (default: OFF) -DWITH_XC_SSHAGENT=[ON|OFF] Enable/Disable SSHAgent support (default: OFF) - -DWITH_XC_KEESHARE=[ON|OFF] Enable/Disable KeeShare group syncronization extension (default: OFF) -DWITH_XC_TOUCHID=[ON|OFF] (macOS Only) Enable/Disable Touch ID unlock (default:OFF) + -DWITH_XC_KEESHARE=[ON|OFF] Enable/Disable KeeShare group synchronization extension (default: OFF) + -DWITH_XC_KEESHARE_SECURE=[ON|OFF] Enable/Disable KeeShare signed containers, requires libquazip5 (default: OFF) -DWITH_XC_ALL=[ON|OFF] Enable/Disable compiling all plugins above (default: OFF) - -DWITH_XC_KEESHARE_SECURE=[ON|OFF] Enable/Disable KeeShare secure containers, requires libquazip5 (default: OFF) + + -DWITH_XC_UPDATECHECK=[ON|OFF] Enable/Disable automatic updating checking (requires WITH_XC_NETWORKING) (default: ON) + -DWITH_TESTS=[ON|OFF] Enable/Disable building of unit tests (default: ON) -DWITH_GUI_TESTS=[ON|OFF] Enable/Disable building of GUI tests (default: OFF) -DWITH_DEV_BUILD=[ON|OFF] Enable/Disable deprecated method warnings (default: OFF) -DWITH_ASAN=[ON|OFF] Enable/Disable address sanitizer checks (Linux / macOS only) (default: OFF) -DWITH_COVERAGE=[ON|OFF] Enable/Disable coverage tests (GCC only) (default: OFF) -DWITH_APP_BUNDLE=[ON|OFF] Enable Application Bundle for macOS (default: ON) + + -DKEEPASSXC_BUILD_TYPE=[Snapshot|PreRelease|Release] Set the build type to show/hide stability warnings (default: "Snapshot") + -DKEEPASSXC_DIST_TYPE=[Snap|AppImage|Other] Specify the distribution method (default: "Other") + -DOVERRIDE_VERSION=[X.X.X] Specify a version number when building. Used with snapshot builds (default: "") + -DGIT_HEAD_OVERRIDE=[XXXXXXX] Specify the 7 digit git commit ref for this build. Used with distribution builds (default: "") ``` * If you are on MacOS you must add this parameter to **Cmake**, with the Qt version you have installed
`-DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.6.2/lib/cmake/` diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5e7a474d2..f142f3680 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,9 +16,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -configure_file(config-keepassx.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-keepassx.h) -configure_file(git-info.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/git-info.h) - find_library(ZXCVBN_LIBRARIES zxcvbn) if(NOT ZXCVBN_LIBRARIES) add_library(zxcvbn STATIC zxcvbn/zxcvbn.c) @@ -194,8 +191,7 @@ add_feature_info(Auto-Type WITH_XC_AUTOTYPE "Automatic password typing") add_feature_info(Networking WITH_XC_NETWORKING "Compile KeePassXC with network access code (e.g. for downloading website icons)") add_feature_info(KeePassXC-Browser WITH_XC_BROWSER "Browser integration with KeePassXC-Browser") add_feature_info(SSHAgent WITH_XC_SSHAGENT "SSH agent integration compatible with KeeAgent") -add_feature_info(KeeShare WITH_XC_KEESHARE "Sharing integration with KeeShare") -add_feature_info(KeeShare-Secure WITH_XC_KEESHARE_SECURE "Sharing integration with KeeShare with secure sources") +add_feature_info(KeeShare WITH_XC_KEESHARE "Sharing integration with KeeShare (requires quazip5 for secure containers)") add_feature_info(YubiKey WITH_XC_YUBIKEY "YubiKey HMAC-SHA1 challenge-response") add_feature_info(UpdateCheck WITH_XC_UPDATECHECK "Automatic update checking") if(APPLE) @@ -260,6 +256,9 @@ if(WITH_XC_TOUCHID) set_source_files_properties(touchid/TouchID.mm PROPERTY COMPILE_FLAGS "-Wno-old-style-cast -Wno-error") endif() +configure_file(config-keepassx.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-keepassx.h) +configure_file(git-info.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/git-info.h) + add_library(autotype STATIC ${autotype_SOURCES}) target_link_libraries(autotype Qt5::Core Qt5::Widgets) diff --git a/src/keeshare/CMakeLists.txt b/src/keeshare/CMakeLists.txt index 14aa17b99..d791d3be6 100644 --- a/src/keeshare/CMakeLists.txt +++ b/src/keeshare/CMakeLists.txt @@ -1,4 +1,6 @@ if(WITH_XC_KEESHARE) + set(WITH_XC_KEESHARE_INSECURE ON PARENT_SCOPE) + include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) set(keeshare_SOURCES @@ -15,9 +17,19 @@ if(WITH_XC_KEESHARE) ) add_library(keeshare STATIC ${keeshare_SOURCES}) - if(WITH_XC_KEESHARE_SECURE) - target_link_libraries(keeshare Qt5::Core Qt5::Widgets ${GCRYPT_LIBRARIES} ${QUAZIP_LIBRARIES} ${crypto_ssh_LIB}) + target_link_libraries(keeshare PUBLIC Qt5::Core Qt5::Widgets ${GCRYPT_LIBRARIES} ${crypto_ssh_LIB}) + + # Try to find libquazip5, if found, enable secure sharing + find_package(QuaZip) + if(QUAZIP_FOUND) + set(WITH_XC_KEESHARE_SECURE ON PARENT_SCOPE) + target_include_directories(keeshare SYSTEM PRIVATE ${QUAZIP_INCLUDE_DIR}) + target_link_libraries(keeshare PRIVATE ${QUAZIP_LIBRARIES}) else() - target_link_libraries(keeshare Qt5::Core Qt5::Widgets ${GCRYPT_LIBRARIES} ${crypto_ssh_LIB}) + set(WITH_XC_KEESHARE_SECURE OFF PARENT_SCOPE) + message(STATUS "KeeShare: Secure container support is DISABLED; quazip library not found") endif() -endif() +else(WITH_XC_KEESHARE) + set(WITH_XC_KEESHARE_INSECURE OFF PARENT_SCOPE) + set(WITH_XC_KEESHARE_SECURE OFF PARENT_SCOPE) +endif(WITH_XC_KEESHARE)