diff options
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 97 |
1 files changed, 68 insertions, 29 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1982a3c4c..2f8c3b156 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,6 +19,13 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) find_library(ZXCVBN_LIBRARIES zxcvbn) if(NOT ZXCVBN_LIBRARIES) add_library(zxcvbn STATIC zxcvbn/zxcvbn.c) + # Disable error-level shadow issues + if(CC_HAS_Wshadow_compatible_local) + set_property(SOURCE zxcvbn/zxcvbn.c APPEND PROPERTY COMPILE_OPTIONS "-Wno-shadow-compatible-local") + endif() + if(CC_HAS_Wshadow_local) + set_property(SOURCE zxcvbn/zxcvbn.c APPEND PROPERTY COMPILE_OPTIONS "-Wno-shadow-local") + endif() include_directories(${CMAKE_CURRENT_SOURCE_DIR}/zxcvbn) set(ZXCVBN_LIBRARIES zxcvbn) endif(NOT ZXCVBN_LIBRARIES) @@ -40,7 +47,6 @@ set(keepassx_SOURCES core/EntryAttachments.cpp core/EntryAttributes.cpp core/EntrySearcher.cpp - core/FilePath.cpp core/FileWatcher.cpp core/Group.cpp core/HibpOffline.cpp @@ -48,7 +54,9 @@ set(keepassx_SOURCES core/Merger.cpp core/Metadata.cpp core/PasswordGenerator.cpp + core/PasswordHealth.cpp core/PassphraseGenerator.cpp + core/Resources.cpp core/SignalMultiplexer.cpp core/ScreenLockListener.cpp core/ScreenLockListenerPrivate.cpp @@ -86,6 +94,12 @@ set(keepassx_SOURCES format/OpVaultReaderAttachments.cpp format/OpVaultReaderBandEntry.cpp format/OpVaultReaderSections.cpp + gui/styles/styles.qrc + gui/styles/StateColorPalette.cpp + gui/styles/base/phantomcolor.cpp + gui/styles/base/BaseStyle.cpp + gui/styles/dark/DarkStyle.cpp + gui/styles/light/LightStyle.cpp gui/AboutDialog.cpp gui/Application.cpp gui/CategoryListWidget.cpp @@ -139,18 +153,25 @@ set(keepassx_SOURCES gui/group/EditGroupWidget.cpp gui/group/GroupModel.cpp gui/group/GroupView.cpp - gui/masterkey/KeyComponentWidget.cpp - gui/masterkey/PasswordEditWidget.cpp - gui/masterkey/YubiKeyEditWidget.cpp - gui/masterkey/KeyFileEditWidget.cpp + gui/databasekey/KeyComponentWidget.cpp + gui/databasekey/PasswordEditWidget.cpp + gui/databasekey/YubiKeyEditWidget.cpp + gui/databasekey/KeyFileEditWidget.cpp gui/dbsettings/DatabaseSettingsWidget.cpp gui/dbsettings/DatabaseSettingsDialog.cpp gui/dbsettings/DatabaseSettingsWidgetGeneral.cpp gui/dbsettings/DatabaseSettingsWidgetMetaDataSimple.cpp gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp - gui/dbsettings/DatabaseSettingsWidgetMasterKey.cpp - gui/dbsettings/DatabaseSettingsWidgetStatistics.cpp - gui/dbsettings/DatabaseSettingsPageStatistics.cpp + gui/dbsettings/DatabaseSettingsWidgetDatabaseKey.cpp + gui/reports/ReportsWidget.cpp + gui/reports/ReportsDialog.cpp + gui/reports/ReportsWidgetHealthcheck.cpp + gui/reports/ReportsPageHealthcheck.cpp + gui/reports/ReportsWidgetHibp.cpp + gui/reports/ReportsPageHibp.cpp + gui/reports/ReportsWidgetStatistics.cpp + gui/reports/ReportsPageStatistics.cpp + gui/osutils/OSUtilsBase.cpp gui/settings/SettingsWidget.cpp gui/widgets/ElidedLabel.cpp gui/widgets/PopupHelpWidget.cpp @@ -158,7 +179,7 @@ set(keepassx_SOURCES gui/wizard/NewDatabaseWizardPage.cpp gui/wizard/NewDatabaseWizardPageMetaData.cpp gui/wizard/NewDatabaseWizardPageEncryption.cpp - gui/wizard/NewDatabaseWizardPageMasterKey.cpp + gui/wizard/NewDatabaseWizardPageDatabaseKey.cpp keys/CompositeKey.cpp keys/FileKey.cpp keys/PasswordKey.cpp @@ -176,20 +197,22 @@ if(APPLE) ${keepassx_SOURCES} core/ScreenLockListenerMac.cpp core/MacPasteboard.cpp - gui/macutils/MacUtils.cpp - gui/macutils/AppKitImpl.mm - gui/macutils/AppKit.h) + gui/osutils/macutils/MacUtils.cpp + gui/osutils/macutils/AppKitImpl.mm + gui/osutils/macutils/AppKit.h) endif() if(UNIX AND NOT APPLE) set(keepassx_SOURCES ${keepassx_SOURCES} core/ScreenLockListenerDBus.cpp - gui/MainWindowAdaptor.cpp) + gui/MainWindowAdaptor.cpp + gui/osutils/nixutils/NixUtils.cpp) endif() if(MINGW) set(keepassx_SOURCES ${keepassx_SOURCES} - core/ScreenLockListenerWin.cpp) + core/ScreenLockListenerWin.cpp + gui/osutils/winutils/WinUtils.cpp) endif() if(MINGW OR (UNIX AND NOT APPLE)) set(keepassx_SOURCES @@ -197,6 +220,10 @@ if(MINGW OR (UNIX AND NOT APPLE)) core/OSEventFilter.cpp) endif() +set(keepassx_SOURCES ${keepassx_SOURCES} + ../share/icons/icons.qrc + ../share/wizard/wizard.qrc) + set(keepassx_SOURCES_MAINEXE main.cpp) add_feature_info(Auto-Type WITH_XC_AUTOTYPE "Automatic password typing") @@ -213,7 +240,6 @@ if(APPLE) add_feature_info(TouchID WITH_XC_TOUCHID "TouchID integration") endif() -set(BROWSER_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/browser) add_subdirectory(browser) add_subdirectory(proxy) if(WITH_XC_BROWSER) @@ -270,6 +296,7 @@ endif() if(WITH_XC_NETWORKING) list(APPEND keepassx_SOURCES + core/HibpDownloader.cpp core/IconDownloader.cpp core/NetworkManager.cpp gui/UpdateCheckDialog.cpp @@ -305,9 +332,8 @@ target_link_libraries(keepassx_core ${YUBIKEY_LIBRARIES} ${ZXCVBN_LIBRARIES} ${ARGON2_LIBRARIES} - ${GCRYPT_LIBRARIES} - ${GPGERROR_LIBRARIES} - ${ZLIB_LIBRARIES}) + ${ZLIB_LIBRARIES} + ) if(WITH_XC_SSHAGENT) target_link_libraries(keepassx_core sshagent) @@ -330,7 +356,8 @@ if(HAIKU) target_link_libraries(keepassx_core network) endif() if(UNIX AND NOT APPLE) - target_link_libraries(keepassx_core Qt5::DBus) + target_link_libraries(keepassx_core Qt5::DBus X11) + include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS}) endif() if(MINGW) target_link_libraries(keepassx_core Wtsapi32.lib Ws2_32.lib) @@ -349,6 +376,7 @@ if(MINGW) endif() add_executable(${PROGNAME} WIN32 ${keepassx_SOURCES_MAINEXE} ${WIN32_ProductVersionFiles}) +target_link_libraries(keepassx_core ${GCRYPT_LIBRARIES} ${GPGERROR_LIBRARIES}) target_link_libraries(${PROGNAME} keepassx_core) set_target_properties(${PROGNAME} PROPERTIES ENABLE_EXPORTS ON) @@ -391,10 +419,6 @@ install(TARGETS ${PROGNAME} BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT Runtime) -if(APPLE OR UNIX) - install(FILES ../share/docs/man/keepassxc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/) -endif() - if(MINGW) if(${CMAKE_SIZEOF_VOID_P} EQUAL "8") set(OUTPUT_FILE_POSTFIX "Win64") @@ -439,9 +463,14 @@ if(MINGW) set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/share/windows/keepassxc.ico") set(CPACK_WIX_UI_BANNER "${CMAKE_SOURCE_DIR}/share/windows/wix-banner.bmp") set(CPACK_WIX_UI_DIALOG "${CMAKE_SOURCE_DIR}/share/windows/wix-dialog.bmp") + set(CPACK_WIX_UI_REF "KPXC_InstallDir") set(CPACK_WIX_TEMPLATE "${CMAKE_SOURCE_DIR}/share/windows/wix-template.xml") set(CPACK_WIX_PATCH_FILE "${CMAKE_SOURCE_DIR}/share/windows/wix-patch.xml") - set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://keepassxc.org") + set(CPACK_WIX_EXTRA_SOURCES + "${CMAKE_SOURCE_DIR}/share/windows/KPXC_InstallDir.wxs" + "${CMAKE_SOURCE_DIR}/share/windows/KPXC_InstallDirDlg.wxs" + "${CMAKE_SOURCE_DIR}/share/windows/KPXC_ExitDlg.wxs") + set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://keepassxc.org") set(CPACK_WIX_EXTENSIONS "WixUtilExtension.dll") include(CPack) @@ -453,9 +482,11 @@ if(MINGW) COMPONENT Runtime) # Use windeployqt.exe to setup Qt dependencies - set(WINDEPLOYQT_MODE "--release") - if(CMAKE_BUILD_TYPE_LOWER STREQUAL "debug") - set(WINDEPLOYQT_MODE "--debug") + if(Qt5Core_VERSION VERSION_LESS "5.14.1") + set(WINDEPLOYQT_MODE "--release") + if(CMAKE_BUILD_TYPE_LOWER STREQUAL "debug") + set(WINDEPLOYQT_MODE "--debug") + endif() endif() install(CODE "execute_process(COMMAND ${WINDEPLOYQT_EXE} ${PROGNAME}.exe ${WINDEPLOYQT_MODE} WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX} OUTPUT_QUIET)" @@ -465,8 +496,16 @@ if(MINGW) install(FILES ${Qt5_PREFIX}/ssl/certs/ca-bundle.crt DESTINATION "ssl/certs") # install OpenSSL library if(WITH_XC_NETWORKING) - find_library(OPENSSL_DLL NAMES libssl-1_1.dll libssl-1_1-x64.dll PATH_SUFFIXES bin) - find_library(CRYPTO_DLL NAMES libcrypto-1_1.dll libcrypto-1_1-x64.dll PATH_SUFFIXES bin) + find_file(OPENSSL_DLL NAMES libssl-1_1.dll libssl-1_1-x64.dll) + if (NOT OPENSSL_DLL) + message(FATAL_ERROR "Cannot find libssl dll, ensure openssl is properly installed.") + endif() + + find_file(CRYPTO_DLL NAMES libcrypto-1_1.dll libcrypto-1_1-x64.dll) + if (NOT CRYPTO_DLL) + message(FATAL_ERROR "Cannot find libcrypto dll, ensure libgcrypt is properly installed.") + endif() + install(FILES ${OPENSSL_DLL} ${CRYPTO_DLL} DESTINATION ".") endif() endif() |