diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f424d765c..68cc685ad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -198,6 +198,7 @@ qt4_wrap_ui(keepassx_SOURCES ${keepassx_FORMS}) qt4_wrap_cpp(keepassx_SOURCES ${keepassx_MOC}) add_library(keepassx_core STATIC ${keepassx_SOURCES}) +set_target_properties(keepassx_core PROPERTIES COMPILE_DEFINITIONS KEEPASSX_BUILDING_CORE) add_executable(${PROGNAME} WIN32 MACOSX_BUNDLE ${keepassx_SOURCES_MAINEXE}) target_link_libraries(${PROGNAME} @@ -211,6 +212,8 @@ if(UNIX AND NOT APPLE) target_link_libraries(${PROGNAME} ${QT_QTDBUS_LIBRARY}) endif() +set_target_properties(${PROGNAME} PROPERTIES ENABLE_EXPORTS ON) + if(APPLE) configure_file(${CMAKE_SOURCE_DIR}/share/macosx/Info.plist.cmake ${CMAKE_CURRENT_BINARY_DIR}/Info.plist) set_target_properties(${PROGNAME} PROPERTIES diff --git a/src/autotype/AutoTypeAction.h b/src/autotype/AutoTypeAction.h index efaabeb57..1bd061c1c 100644 --- a/src/autotype/AutoTypeAction.h +++ b/src/autotype/AutoTypeAction.h @@ -21,9 +21,11 @@ #include #include +#include "core/Global.h" + class AutoTypeExecutor; -class AutoTypeAction +class KEEPASSX_EXPORT AutoTypeAction { public: virtual ~AutoTypeAction() {} @@ -31,7 +33,7 @@ public: virtual void accept(AutoTypeExecutor* executor) = 0; }; -class AutoTypeChar : public AutoTypeAction +class KEEPASSX_EXPORT AutoTypeChar : public AutoTypeAction { public: explicit AutoTypeChar(const QChar& character); @@ -41,7 +43,7 @@ public: const QChar character; }; -class AutoTypeKey : public AutoTypeAction +class KEEPASSX_EXPORT AutoTypeKey : public AutoTypeAction { public: explicit AutoTypeKey(Qt::Key key); @@ -51,7 +53,7 @@ public: const Qt::Key key; }; -class AutoTypeDelay : public AutoTypeAction +class KEEPASSX_EXPORT AutoTypeDelay : public AutoTypeAction { public: explicit AutoTypeDelay(int delayMs); @@ -61,7 +63,7 @@ public: const int delayMs; }; -class AutoTypeClearField : public AutoTypeAction +class KEEPASSX_EXPORT AutoTypeClearField : public AutoTypeAction { public: explicit AutoTypeClearField(); @@ -69,7 +71,7 @@ public: void accept(AutoTypeExecutor* executor); }; -class AutoTypeExecutor +class KEEPASSX_EXPORT AutoTypeExecutor { public: virtual ~AutoTypeExecutor() {} diff --git a/src/autotype/test/CMakeLists.txt b/src/autotype/test/CMakeLists.txt index 31b1df7e7..749f7d5fa 100644 --- a/src/autotype/test/CMakeLists.txt +++ b/src/autotype/test/CMakeLists.txt @@ -9,4 +9,4 @@ set(autotype_test_MOC qt4_wrap_cpp(autotype_test_SOURCES ${autotype_test_MOC}) add_library(keepassx-autotype-test MODULE ${autotype_test_SOURCES}) -target_link_libraries(keepassx-autotype-test ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) +target_link_libraries(keepassx-autotype-test testautotype ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) diff --git a/src/core/Global.h b/src/core/Global.h index a2a4e5d3c..b69760605 100644 --- a/src/core/Global.h +++ b/src/core/Global.h @@ -118,4 +118,14 @@ template <> class QStaticAssertFailure {}; #endif // COMPILER_STATIC_ASSERT #endif // !defined(Q_STATIC_ASSERT) && !defined(Q_STATIC_ASSERT_X) +#if defined(Q_OS_WIN) +# if defined(KEEPASSX_BUILDING_CORE) +# define KEEPASSX_EXPORT Q_DECL_EXPORT +# else +# define KEEPASSX_EXPORT Q_DECL_IMPORT +# endif +#else +# define KEEPASSX_EXPORT +#endif + #endif // KEEPASSX_GLOBAL_H diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 38018c837..02fa1029e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -154,6 +154,7 @@ add_unit_test(NAME testwildcardmatcher SOURCES TestWildcardMatcher.cpp MOCS Test add_unit_test(NAME testautotype SOURCES TestAutoType.cpp MOCS TestAutoType.h LIBS ${TEST_LIBRARIES}) +set_target_properties(testautotype PROPERTIES ENABLE_EXPORTS ON) add_unit_test(NAME testentry SOURCES TestEntry.cpp MOCS TestEntry.h LIBS ${TEST_LIBRARIES})