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