From 65992ba6aee89c63beb91ff59fc1ec1e5212a6a3 Mon Sep 17 00:00:00 2001 From: thez3ro Date: Sun, 4 Dec 2016 19:57:24 +0100 Subject: [PATCH 1/4] Option to select extension compile-time. Fix #50 #123 --- CMakeLists.txt | 9 +++++++ src/CMakeLists.txt | 42 ++++++++++++++++++++--------- src/autotype/CMakeLists.txt | 38 ++++++++++++++------------ src/config-keepassx.h.cmake | 4 +++ src/gui/MainWindow.cpp | 11 +++++++- tests/CMakeLists.txt | 8 +++--- tests/config-keepassx-tests.h.cmake | 4 +++ 7 files changed, 82 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cbef4bc45..883f462ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,10 @@ option(WITH_GUI_TESTS "Enable building of GUI tests" OFF) option(WITH_DEV_BUILD "Use only for development. Disables/warns about deprecated methods." OFF) option(WITH_COVERAGE "Use to build with coverage tests. (GCC ONLY)." OFF) +option(WITH_XC_AUTOTYPE "Include Autotype." OFF) +option(WITH_XC_HTTP "Include KeePassHTTP." OFF) +option(WITH_XC_YUBIKEY "Include Yubikey support." OFF) + set(KEEPASSXC_VERSION "2.1.0") set(KEEPASSXC_VERSION_NUM "2.1.0") @@ -221,5 +225,10 @@ if(WITH_TESTS) endif(WITH_TESTS) if(PRINT_SUMMARY) + # This will print ENABLED, REQUIRED and DISABLED feature_summary(WHAT ALL) +else() + # This will only print ENABLED and DISABLED feature + print_enabled_features() + print_disabled_features() endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5778e06be..b85032ef3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -118,14 +118,6 @@ set(keepassx_SOURCES gui/group/EditGroupWidget.cpp gui/group/GroupModel.cpp gui/group/GroupView.cpp - http/AccessControlDialog.cpp - http/EntryConfig.cpp - http/HttpPasswordGeneratorWidget.cpp - http/HttpSettings.cpp - http/OptionDialog.cpp - http/Protocol.cpp - http/Server.cpp - http/Service.cpp keys/CompositeKey.cpp keys/CompositeKey_p.h keys/FileKey.cpp @@ -161,11 +153,30 @@ set(keepassx_FORMS gui/entry/EditEntryWidgetHistory.ui gui/entry/EditEntryWidgetMain.ui gui/group/EditGroupWidgetMain.ui - http/AccessControlDialog.ui - http/HttpPasswordGeneratorWidget.ui - http/OptionDialog.ui ) +add_feature_info(KeePassHTTP WITH_XC_HTTP "KeePassHTTP support for ChromeIPass and PassIFox") + +if(WITH_XC_HTTP) + set(keepasshttp_SOURCES + http/AccessControlDialog.cpp + http/EntryConfig.cpp + http/HttpPasswordGeneratorWidget.cpp + http/HttpSettings.cpp + http/OptionDialog.cpp + http/Protocol.cpp + http/Server.cpp + http/Service.cpp + ) + set(keepasshttp_FORMS + http/AccessControlDialog.ui + http/HttpPasswordGeneratorWidget.ui + http/OptionDialog.ui + ) + set(keepasshttp_LIB keepasshttp) + qt5_wrap_ui(keepasshttp_SOURCES ${keepasshttp_FORMS}) +endif() + if(MINGW) set(keepassx_SOURCES_MAINEXE ${keepassx_SOURCES_MAINEXE} @@ -177,15 +188,20 @@ qt5_wrap_ui(keepassx_SOURCES ${keepassx_FORMS}) add_library(zxcvbn STATIC zxcvbn/zxcvbn.cpp) target_link_libraries(zxcvbn) +if(WITH_XC_HTTP) + add_library(keepasshttp STATIC ${keepasshttp_SOURCES}) + target_link_libraries(keepasshttp ${MHD_LIBRARIES} Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network) +endif() + add_library(keepassx_core STATIC ${keepassx_SOURCES}) set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUILDING_CORE) -target_link_libraries(keepassx_core zxcvbn Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network) +target_link_libraries(keepassx_core zxcvbn ${keepasshttp_LIB} Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network) add_executable(${PROGNAME} WIN32 MACOSX_BUNDLE ${keepassx_SOURCES_MAINEXE}) target_link_libraries(${PROGNAME} keepassx_core zxcvbn - ${MHD_LIBRARIES} + ${keepasshttp_LIB} Qt5::Core Qt5::Concurrent Qt5::Widgets diff --git a/src/autotype/CMakeLists.txt b/src/autotype/CMakeLists.txt index 40dd449db..613b122ff 100644 --- a/src/autotype/CMakeLists.txt +++ b/src/autotype/CMakeLists.txt @@ -1,21 +1,25 @@ -if(UNIX AND NOT APPLE) - find_package(X11) - find_package(Qt5X11Extras 5.2) - if(PRINT_SUMMARY) - add_feature_info(libXi X11_Xi_FOUND "The X11 Xi Protocol library is required for auto-type") - add_feature_info(libXtst X11_XTest_FOUND "The X11 XTEST Protocol library is required for auto-type") - add_feature_info(Qt5X11Extras Qt5X11Extras_FOUND "The Qt5X11Extras library is required for auto-type") +add_feature_info(Autotype WITH_XC_AUTOTYPE "Auto-type passwords in Input fields") + +if(WITH_XC_AUTOTYPE) + if(UNIX AND NOT APPLE) + find_package(X11) + find_package(Qt5X11Extras 5.2) + if(PRINT_SUMMARY) + add_feature_info(libXi X11_Xi_FOUND "The X11 Xi Protocol library is required for auto-type") + add_feature_info(libXtst X11_XTest_FOUND "The X11 XTEST Protocol library is required for auto-type") + add_feature_info(Qt5X11Extras Qt5X11Extras_FOUND "The Qt5X11Extras library is required for auto-type") + endif() + + if(X11_FOUND AND X11_Xi_FOUND AND X11_XTest_FOUND AND Qt5X11Extras_FOUND) + add_subdirectory(xcb) + endif() + elseif(APPLE) + add_subdirectory(mac) + elseif(WIN32) + add_subdirectory(windows) endif() - if(X11_FOUND AND X11_Xi_FOUND AND X11_XTest_FOUND AND Qt5X11Extras_FOUND) - add_subdirectory(xcb) + if(WITH_TESTS) + add_subdirectory(test) endif() -elseif(APPLE) - add_subdirectory(mac) -elseif(WIN32) - add_subdirectory(windows) -endif() - -if(WITH_TESTS) - add_subdirectory(test) endif() diff --git a/src/config-keepassx.h.cmake b/src/config-keepassx.h.cmake index 2ef2836c5..9ae5f4836 100644 --- a/src/config-keepassx.h.cmake +++ b/src/config-keepassx.h.cmake @@ -12,6 +12,10 @@ #define KEEPASSX_PLUGIN_DIR "${PLUGIN_INSTALL_DIR}" #define KEEPASSX_DATA_DIR "${DATA_INSTALL_DIR}" +#cmakedefine WITH_XC_HTTP +#cmakedefine WITH_XC_AUTOTYPE +#cmakedefine WITH_XC_YUBIKEY + #cmakedefine HAVE_PR_SET_DUMPABLE 1 #cmakedefine HAVE_RLIMIT_CORE 1 #cmakedefine HAVE_PT_DENY_ATTACH 1 diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index ed58f69ea..cc94ca9a9 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -22,6 +22,8 @@ #include #include +#include "config-keepassx.h" + #include "autotype/AutoType.h" #include "core/Config.h" #include "core/FilePath.h" @@ -35,12 +37,16 @@ #include "gui/MessageBox.h" #include "gui/SearchWidget.h" +#ifdef WITH_XC_HTTP #include "http/Service.h" #include "http/HttpSettings.h" #include "http/OptionDialog.h" +#endif + #include "gui/SettingsWidget.h" #include "gui/PasswordGeneratorWidget.h" +#ifdef WITH_XC_HTTP class HttpPlugin: public ISettingsPage { public: @@ -72,6 +78,7 @@ class HttpPlugin: public ISettingsPage private: Service *m_service; }; +#endif const QString MainWindow::BaseWindowTitle = "KeePassXC"; @@ -92,7 +99,9 @@ MainWindow::MainWindow() m_countDefaultAttributes = m_ui->menuEntryCopyAttribute->actions().size(); restoreGeometry(config()->get("GUI/MainWindowGeometry").toByteArray()); + #ifdef WITH_XC_HTTP m_ui->settingsWidget->addSettingsPage(new HttpPlugin(m_ui->tabWidget)); + #endif setWindowIcon(filePath()->applicationIcon()); QAction* toggleViewAction = m_ui->toolBar->toggleViewAction(); @@ -449,7 +458,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) m_ui->actionRepairDatabase->setEnabled(inDatabaseTabWidgetOrWelcomeWidget); m_ui->actionLockDatabases->setEnabled(m_ui->tabWidget->hasLockableDatabases()); - + if ((3 == currentIndex) != m_ui->actionPasswordGenerator->isChecked()) { bool blocked = m_ui->actionPasswordGenerator->blockSignals(true); m_ui->actionPasswordGenerator->toggle(); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0dcb4a77e..af38acea6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -85,13 +85,13 @@ endmacro(add_unit_test) set(TEST_LIBRARIES keepassx_core + ${keepasshttp_LIB} Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Test ${GCRYPT_LIBRARIES} ${ZLIB_LIBRARIES} - ${MHD_LIBRARIES} ) set(testsupport_SOURCES modeltest.cpp FailDevice.cpp) @@ -143,9 +143,11 @@ add_unit_test(NAME testkeepass1reader SOURCES TestKeePass1Reader.cpp add_unit_test(NAME testwildcardmatcher SOURCES TestWildcardMatcher.cpp LIBS ${TEST_LIBRARIES}) -add_unit_test(NAME testautotype SOURCES TestAutoType.cpp +if(WITH_XC_AUTOTYPE) + add_unit_test(NAME testautotype SOURCES TestAutoType.cpp LIBS ${TEST_LIBRARIES}) -set_target_properties(testautotype PROPERTIES ENABLE_EXPORTS ON) + set_target_properties(testautotype PROPERTIES ENABLE_EXPORTS ON) +endif() add_unit_test(NAME testentry SOURCES TestEntry.cpp LIBS ${TEST_LIBRARIES}) diff --git a/tests/config-keepassx-tests.h.cmake b/tests/config-keepassx-tests.h.cmake index b515f5c5f..26204f7dd 100644 --- a/tests/config-keepassx-tests.h.cmake +++ b/tests/config-keepassx-tests.h.cmake @@ -5,4 +5,8 @@ #define KEEPASSX_TEST_DATA_DIR "${KEEPASSX_TEST_DATA_DIR}" +#cmakedefine WITH_XC_HTTP +#cmakedefine WITH_XC_AUTOTYPE +#cmakedefine WITH_XC_YUBIKEY + #endif // KEEPASSX_CONFIG_TESTS_H From fa891edb7c886385eefc7ba170142a0ec5c2e38f Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Wed, 7 Dec 2016 22:40:09 -0500 Subject: [PATCH 2/4] Added extensions section in about dialog; fixed url as well --- src/gui/AboutDialog.cpp | 16 ++++++++++++++++ src/gui/AboutDialog.ui | 14 +++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/gui/AboutDialog.cpp b/src/gui/AboutDialog.cpp index 6ca02d1aa..a4f180b05 100644 --- a/src/gui/AboutDialog.cpp +++ b/src/gui/AboutDialog.cpp @@ -56,6 +56,22 @@ AboutDialog::AboutDialog(QWidget* parent) .arg(Crypto::backendVersion()); m_ui->label_libs->setText(libs); + QString extensions; +#ifdef WITH_XC_HTTP + extensions += "- KeePassHTTP\n"; +#endif +#ifdef WITH_XC_AUTOTYPE + extensions += "- Autotype\n"; +#endif +#ifdef WITH_XC_YUBIKEY + extensions += "- Yubikey\n"; +#endif + + if (extensions.isEmpty()) + extensions = "None"; + + m_ui->label_features->setText(m_ui->label_features->text() + extensions); + setAttribute(Qt::WA_DeleteOnClose); connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(close())); } diff --git a/src/gui/AboutDialog.ui b/src/gui/AboutDialog.ui index 35f0e9e32..49b75f1e8 100644 --- a/src/gui/AboutDialog.ui +++ b/src/gui/AboutDialog.ui @@ -6,8 +6,8 @@ 0 0 - 375 - 210 + 455 + 238 @@ -53,7 +53,7 @@ - <a href="http://www.keepassx.org/">http://www.keepassx.org/</a> + <a href="https://www.keepassxc.org/">https://www.keepassxc.org/</a> true @@ -93,6 +93,14 @@ + + + + Extensions: + + + + From 07a41f58d72b6ffd688792d259dcd82cf0eac933 Mon Sep 17 00:00:00 2001 From: thez3ro Date: Tue, 13 Dec 2016 21:14:39 +0100 Subject: [PATCH 3/4] Add autotype library linking Added Autotype switch + updated Travis to always test all extension --- .travis.yml | 4 ++-- src/CMakeLists.txt | 30 ++++++++++++++++++++---------- src/autotype/AutoType.cpp | 4 ++++ src/autotype/CMakeLists.txt | 2 -- src/autotype/test/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 1 + 6 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index d4caf68d5..a7807b612 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ os: # Define clang compiler without any frills compiler: - clang - + # Define gcc compile with deploy option (only for master/develop merges) matrix: include: @@ -33,7 +33,7 @@ before_script: - mkdir build && pushd build script: - - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUI_TESTS=ON $CMAKE_ARGS .. + - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUI_TESTS=ON -DWITH_XC_HTTP=ON -DWITH_XC_AUTOTYPE=ON -DWITH_XC_YUBIKEY=ON $CMAKE_ARGS .. - make -j2 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then make test ARGS+="-E testgui --output-on-failure"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then xvfb-run -a --server-args="-screen 0 800x600x24" make test ARGS+="-R testgui --output-on-failure"; fi diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b85032ef3..62ac6ef22 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,15 +29,6 @@ endif() configure_file(version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY) set(keepassx_SOURCES - autotype/AutoType.cpp - autotype/AutoTypeAction.cpp - autotype/AutoTypePlatformPlugin.h - autotype/AutoTypeSelectDialog.cpp - autotype/AutoTypeSelectView.cpp - autotype/ShortcutWidget.cpp - autotype/WildcardMatcher.cpp - autotype/WindowSelectComboBox.cpp - autotype/test/AutoTypeTestInterface.h core/AutoTypeAssociations.cpp core/Config.cpp core/Database.cpp @@ -156,6 +147,7 @@ set(keepassx_FORMS ) add_feature_info(KeePassHTTP WITH_XC_HTTP "KeePassHTTP support for ChromeIPass and PassIFox") +add_feature_info(Autotype WITH_XC_AUTOTYPE "Auto-type passwords in Input fields") if(WITH_XC_HTTP) set(keepasshttp_SOURCES @@ -177,6 +169,20 @@ if(WITH_XC_HTTP) qt5_wrap_ui(keepasshttp_SOURCES ${keepasshttp_FORMS}) endif() +set(autotype_SOURCES + core/Tools.cpp + autotype/AutoType.cpp + autotype/AutoTypeAction.cpp + autotype/AutoTypePlatformPlugin.h + autotype/AutoTypeSelectDialog.cpp + autotype/AutoTypeSelectView.cpp + autotype/ShortcutWidget.cpp + autotype/WildcardMatcher.cpp + autotype/WindowSelectComboBox.cpp + autotype/test/AutoTypeTestInterface.h +) +set(autotype_LIB autotype) + if(MINGW) set(keepassx_SOURCES_MAINEXE ${keepassx_SOURCES_MAINEXE} @@ -193,15 +199,19 @@ if(WITH_XC_HTTP) target_link_libraries(keepasshttp ${MHD_LIBRARIES} Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network) endif() +add_library(autotype STATIC ${autotype_SOURCES}) +target_link_libraries(autotype Qt5::Core Qt5::Widgets) + add_library(keepassx_core STATIC ${keepassx_SOURCES}) set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUILDING_CORE) -target_link_libraries(keepassx_core zxcvbn ${keepasshttp_LIB} Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network) +target_link_libraries(keepassx_core zxcvbn ${keepasshttp_LIB} ${autotype_LIB} Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network) add_executable(${PROGNAME} WIN32 MACOSX_BUNDLE ${keepassx_SOURCES_MAINEXE}) target_link_libraries(${PROGNAME} keepassx_core zxcvbn ${keepasshttp_LIB} + ${autotype_LIB} Qt5::Core Qt5::Concurrent Qt5::Widgets diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index 979fe3ad2..0c942e728 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -20,6 +20,8 @@ #include #include +#include "config-keepassx.h" + #include "autotype/AutoTypePlatformPlugin.h" #include "autotype/AutoTypeSelectDialog.h" #include "autotype/WildcardMatcher.h" @@ -59,7 +61,9 @@ AutoType::AutoType(QObject* parent, bool test) QString pluginPath = filePath()->pluginPath(pluginName); if (!pluginPath.isEmpty()) { + #ifdef WITH_XC_AUTOTYPE loadPlugin(pluginPath); + #endif } connect(qApp, SIGNAL(aboutToQuit()), SLOT(unloadPlugin())); diff --git a/src/autotype/CMakeLists.txt b/src/autotype/CMakeLists.txt index 613b122ff..4b3610538 100644 --- a/src/autotype/CMakeLists.txt +++ b/src/autotype/CMakeLists.txt @@ -1,5 +1,3 @@ -add_feature_info(Autotype WITH_XC_AUTOTYPE "Auto-type passwords in Input fields") - if(WITH_XC_AUTOTYPE) if(UNIX AND NOT APPLE) find_package(X11) diff --git a/src/autotype/test/CMakeLists.txt b/src/autotype/test/CMakeLists.txt index 9b3dbd490..f92a3fd90 100644 --- a/src/autotype/test/CMakeLists.txt +++ b/src/autotype/test/CMakeLists.txt @@ -3,4 +3,4 @@ set(autotype_test_SOURCES ) add_library(keepassx-autotype-test MODULE ${autotype_test_SOURCES}) -target_link_libraries(keepassx-autotype-test testautotype Qt5::Core Qt5::Widgets) +target_link_libraries(keepassx-autotype-test testautotype keepassx_core ${autotype_LIB} Qt5::Core Qt5::Widgets) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index af38acea6..0ea73b2fe 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -86,6 +86,7 @@ endmacro(add_unit_test) set(TEST_LIBRARIES keepassx_core ${keepasshttp_LIB} + ${autotype_LIB} Qt5::Core Qt5::Concurrent Qt5::Widgets From 0e65b9b9f8b5bf94dc3c706f6be4459ce5d95d2f Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 27 Dec 2016 22:24:22 -0500 Subject: [PATCH 4/4] Corrected autotype lib building for Windows --- src/CMakeLists.txt | 9 ++++----- src/autotype/test/CMakeLists.txt | 2 +- src/autotype/windows/CMakeLists.txt | 4 ++-- src/core/Global.h | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 62ac6ef22..30332c71e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -169,6 +169,8 @@ if(WITH_XC_HTTP) qt5_wrap_ui(keepasshttp_SOURCES ${keepasshttp_FORMS}) endif() +add_subdirectory(autotype) + set(autotype_SOURCES core/Tools.cpp autotype/AutoType.cpp @@ -181,7 +183,6 @@ set(autotype_SOURCES autotype/WindowSelectComboBox.cpp autotype/test/AutoTypeTestInterface.h ) -set(autotype_LIB autotype) if(MINGW) set(keepassx_SOURCES_MAINEXE @@ -202,6 +203,8 @@ endif() add_library(autotype STATIC ${autotype_SOURCES}) target_link_libraries(autotype Qt5::Core Qt5::Widgets) +set(autotype_LIB autotype) + add_library(keepassx_core STATIC ${keepassx_SOURCES}) set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUILDING_CORE) target_link_libraries(keepassx_core zxcvbn ${keepasshttp_LIB} ${autotype_LIB} Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network) @@ -210,8 +213,6 @@ add_executable(${PROGNAME} WIN32 MACOSX_BUNDLE ${keepassx_SOURCES_MAINEXE}) target_link_libraries(${PROGNAME} keepassx_core zxcvbn - ${keepasshttp_LIB} - ${autotype_LIB} Qt5::Core Qt5::Concurrent Qt5::Widgets @@ -231,8 +232,6 @@ install(TARGETS ${PROGNAME} BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT Runtime) -add_subdirectory(autotype) - if(APPLE) if(QT_MAC_USE_COCOA AND EXISTS "${QT_LIBRARY_DIR}/Resources/qt_menu.nib") install(DIRECTORY "${QT_LIBRARY_DIR}/Resources/qt_menu.nib" diff --git a/src/autotype/test/CMakeLists.txt b/src/autotype/test/CMakeLists.txt index f92a3fd90..f41fa1b50 100644 --- a/src/autotype/test/CMakeLists.txt +++ b/src/autotype/test/CMakeLists.txt @@ -3,4 +3,4 @@ set(autotype_test_SOURCES ) add_library(keepassx-autotype-test MODULE ${autotype_test_SOURCES}) -target_link_libraries(keepassx-autotype-test testautotype keepassx_core ${autotype_LIB} Qt5::Core Qt5::Widgets) +target_link_libraries(keepassx-autotype-test keepassx_core ${autotype_LIB} Qt5::Core Qt5::Widgets) diff --git a/src/autotype/windows/CMakeLists.txt b/src/autotype/windows/CMakeLists.txt index dac8a7867..cc3ad4b44 100644 --- a/src/autotype/windows/CMakeLists.txt +++ b/src/autotype/windows/CMakeLists.txt @@ -3,7 +3,7 @@ set(autotype_win_SOURCES ) add_library(keepassx-autotype-windows MODULE ${autotype_win_SOURCES}) -target_link_libraries(keepassx-autotype-windows ${PROGNAME} Qt5::Core Qt5::Widgets) +target_link_libraries(keepassx-autotype-windows keepassx_core ${autotype_LIB} Qt5::Core Qt5::Widgets) install(TARGETS keepassx-autotype-windows BUNDLE DESTINATION . COMPONENT Runtime -LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} COMPONENT Runtime) \ No newline at end of file +LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} COMPONENT Runtime) diff --git a/src/core/Global.h b/src/core/Global.h index bd6a73356..1cae4b51e 100644 --- a/src/core/Global.h +++ b/src/core/Global.h @@ -24,9 +24,9 @@ #if defined(Q_OS_WIN) # if defined(KEEPASSX_BUILDING_CORE) -# define KEEPASSX_EXPORT Q_DECL_EXPORT -# else # define KEEPASSX_EXPORT Q_DECL_IMPORT +# else +# define KEEPASSX_EXPORT Q_DECL_EXPORT # endif #else # define KEEPASSX_EXPORT Q_DECL_EXPORT