From af4f56abfd66458c74df4439eba3775eb2df372d Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Fri, 5 May 2017 20:20:27 -0400 Subject: [PATCH 1/2] Support vscode --- .gitignore | 2 ++ CMakeLists.txt | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 3a63e9705..0521a42e3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ release*/ .idea/ *.iml *.kdev4 + +\.vscode/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 2da138277..d7ef18a6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,9 @@ cmake_minimum_required(VERSION 2.8.12) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +# Support Visual Studio Code +include(CMakeToolsHelpers OPTIONAL) + include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) include(CheckCXXSourceCompiles) From 5c8809e55d9763fc87ca5394aa6f5f388576ef4f Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sat, 6 May 2017 11:50:05 -0400 Subject: [PATCH 2/2] Update cmake files, fixes #331 --- CMakeLists.txt | 10 ++++++--- cmake/FindLibMicroHTTPD.cmake | 9 -------- src/CMakeLists.txt | 39 +++-------------------------------- src/http/CMakeLists.txt | 7 ------- 4 files changed, 10 insertions(+), 55 deletions(-) delete mode 100644 cmake/FindLibMicroHTTPD.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index d7ef18a6e..cde795ad2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,8 +42,13 @@ option(WITH_XC_AUTOTYPE "Include Auto-Type." ON) option(WITH_XC_HTTP "Include KeePassHTTP and Custom Icon Downloads." OFF) option(WITH_XC_YUBIKEY "Include YubiKey support." OFF) -set(KEEPASSXC_VERSION "2.1.4") -set(KEEPASSXC_VERSION_NUM "2.1.4") +# Process ui files automatically from source files +set(CMAKE_AUTOUIC ON) + +set(KEEPASSXC_VERSION_MAJOR "2") +set(KEEPASSXC_VERSION_MINOR "1") +set(KEEPASSXC_VERSION_PATCH "4") +set(KEEPASSXC_VERSION "${KEEPASSXC_VERSION_MAJOR}.${KEEPASSXC_VERSION_MINOR}.${KEEPASSXC_VERSION_PATCH}") if("${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_COMPILER_IS_CLANG 1) @@ -157,7 +162,6 @@ if(MINGW) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase") endif() - link_libraries(ws2_32 wsock32) endif() if(APPLE OR MINGW) diff --git a/cmake/FindLibMicroHTTPD.cmake b/cmake/FindLibMicroHTTPD.cmake deleted file mode 100644 index f31928043..000000000 --- a/cmake/FindLibMicroHTTPD.cmake +++ /dev/null @@ -1,9 +0,0 @@ - -find_path(MHD_INCLUDE_DIR microhttpd.h) - -find_library(MHD_LIBRARIES microhttpd) - -mark_as_advanced(MHD_LIBRARIES MHD_INCLUDE_DIR) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LibMicroHTTPD DEFAULT_MSG MHD_LIBRARIES MHD_INCLUDE_DIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 750b6481c..786a03a80 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -141,32 +141,6 @@ set(keepassx_SOURCES_MAINEXE main.cpp ) -set(keepassx_FORMS - gui/AboutDialog.ui - gui/ChangeMasterKeyWidget.ui - gui/CloneDialog.ui - gui/csvImport/CsvImportWidget.ui - gui/DatabaseOpenWidget.ui - gui/DatabaseSettingsWidget.ui - gui/CategoryListWidget.ui - gui/EditWidget.ui - gui/EditWidgetIcons.ui - gui/EditWidgetProperties.ui - gui/MainWindow.ui - gui/PasswordGeneratorWidget.ui - gui/SearchWidget.ui - gui/SettingsWidgetGeneral.ui - gui/SettingsWidgetSecurity.ui - gui/SetupTotpDialog.ui - gui/TotpDialog.ui - gui/WelcomeWidget.ui - gui/entry/EditEntryWidgetAdvanced.ui - gui/entry/EditEntryWidgetAutoType.ui - gui/entry/EditEntryWidgetHistory.ui - gui/entry/EditEntryWidgetMain.ui - gui/group/EditGroupWidgetMain.ui -) - add_feature_info(AutoType WITH_XC_AUTOTYPE "Automatic password typing") add_feature_info(KeePassHTTP WITH_XC_HTTP "Browser integration compatible with ChromeIPass and PassIFox") add_feature_info(YubiKey WITH_XC_YUBIKEY "YubiKey HMAC-SHA1 challenge-response") @@ -199,13 +173,11 @@ if(MINGW) endif() if(WITH_XC_YUBIKEY) - set(keepassx_SOURCES ${keepassx_SOURCES} keys/drivers/YubiKey.cpp) + list(APPEND keepassx_SOURCES keys/drivers/YubiKey.cpp) else() - set(keepassx_SOURCES ${keepassx_SOURCES} keys/drivers/YubiKeyStub.cpp) + list(APPEND keepassx_SOURCES keys/drivers/YubiKeyStub.cpp) endif() -qt5_wrap_ui(keepassx_SOURCES ${keepassx_FORMS}) - add_library(zxcvbn STATIC zxcvbn/zxcvbn.cpp) target_link_libraries(zxcvbn) @@ -233,11 +205,6 @@ if (UNIX AND NOT APPLE) endif() if(MINGW) - string(REPLACE "." ";" VERSION_LIST ${KEEPASSXC_VERSION}) - list(GET VERSION_LIST 0 KEEPASSXC_VERSION_MAJOR) - list(GET VERSION_LIST 1 KEEPASSXC_VERSION_MINOR) - list(GET VERSION_LIST 2 KEEPASSXC_VERSION_PATCH) - include(GenerateProductVersion) generate_product_version( WIN32_ProductVersionFiles @@ -275,7 +242,7 @@ if(APPLE) set(CPACK_DMG_VOLUME_NAME "${PROGNAME}") set(CPACK_SYSTEM_NAME "OSX") set(CPACK_STRIP_FILES ON) - set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION_NUM}") + set(CPACK_PACKAGE_FILE_NAME "${PROGNAME}-${KEEPASSXC_VERSION}") include(CPack) if(NOT DEFINED QT_BINARY_DIR) diff --git a/src/http/CMakeLists.txt b/src/http/CMakeLists.txt index 53fe7e176..8a3b197ab 100644 --- a/src/http/CMakeLists.txt +++ b/src/http/CMakeLists.txt @@ -13,13 +13,6 @@ if(WITH_XC_HTTP) Server.cpp Service.cpp ) - set(keepasshttp_FORMS - AccessControlDialog.ui - HttpPasswordGeneratorWidget.ui - OptionDialog.ui - ) - - qt5_wrap_ui(keepasshttp_SOURCES ${keepasshttp_FORMS}) add_library(keepasshttp STATIC ${keepasshttp_SOURCES}) target_link_libraries(keepasshttp qhttp Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network)