diff --git a/CMakeLists.txt b/CMakeLists.txt index cd3fae90ea112cafe83dcdbf8ee4af57437821c9..fb10f4e93c8a6e8eed385a9746da642544b6a375 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,10 @@ IF(POLICY CMP0043) CMAKE_POLICY(SET CMP0043 NEW) ENDIF(POLICY CMP0043) +IF(POLICY CMP0020) + CMAKE_POLICY(SET CMP0020 NEW) +ENDIF(POLICY CMP0020) + # First, check is the compiler is new enough, most version of Clang are fine # until problems arise, checking for GCC is enough IF (CMAKE_COMPILER_IS_GNUCC) @@ -504,7 +508,7 @@ IF(NOT ${ENABLE_STATIC} MATCHES false) ) ENDIF() -QT5_USE_MODULES(ringclient Core) +QT5_USE_MODULES(ringclient Core Concurrent) IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") QT5_USE_MODULES(ringclient DBus) @@ -579,6 +583,7 @@ STRING(REPLACE "${CMAKE_LIBRARY_ARCHITECTURE}" "" SANE_LIBRARY_PATH "${CMAKE_INS INSTALL( TARGETS ringclient ARCHIVE DESTINATION ${SANE_LIBRARY_PATH} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin LIBRARY DESTINATION ${SANE_LIBRARY_PATH} DESTINATION ${SANE_LIBRARY_PATH} ) diff --git a/cmake/FindRing.cmake b/cmake/FindRing.cmake index 86760349eecdd9543f4da27faf3ab3fe629e6b84..713df9a251b41658ed3e7dc0d7bb6dd12e28edf0 100644 --- a/cmake/FindRing.cmake +++ b/cmake/FindRing.cmake @@ -20,6 +20,7 @@ FIND_LIBRARY(ring_BIN NAMES ring PATHS ${RING_BUILD_DIR}/.libs PATHS ${CMAKE_INSTALL_PREFIX}/lib PATHS ${CMAKE_INSTALL_PREFIX}/libexec + PATHS ${CMAKE_INSTALL_PREFIX}/bin ) # Try a static version too @@ -32,7 +33,9 @@ IF(${ring_BIN} MATCHES "") PATHS ${CMAKE_INSTALL_PREFIX}/libexec ) +IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") ADD_DEFINITIONS(-fPIC) +ENDIF() ENDIF() diff --git a/cmake/winBuild.cmake b/cmake/winBuild.cmake new file mode 100644 index 0000000000000000000000000000000000000000..3b2bf73a92d8f691866d2f9fea0e8e216ed2eb85 --- /dev/null +++ b/cmake/winBuild.cmake @@ -0,0 +1,10 @@ +# this one is important +SET(CMAKE_SYSTEM_NAME Windows) + +# specify the cross compiler +SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres) +SET(CMAKE_ASM_YASM_COMPILER yasm) +SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32/) +set(LIB_FLAGS "-Wl,--output-def,libringclient.def") \ No newline at end of file diff --git a/src/accountstatusmodel.cpp b/src/accountstatusmodel.cpp index be13ab4b35aebb9ce91d952cad128835e8f9d04b..c7d8c748eb886a3cc0a2d0c4ea5974d1c5416a62 100644 --- a/src/accountstatusmodel.cpp +++ b/src/accountstatusmodel.cpp @@ -20,6 +20,24 @@ //System #include <errno.h> +#ifdef _WIN32 +#include <winerror.h> +#define ESHUTDOWN WSAESHUTDOWN +#define ENODATA WSANO_DATA +#define ETIME WSAETIMEDOUT +#define EPFNOSUPPORT WSAEPROTONOSUPPORT +#define EHOSTDOWN WSAEHOSTDOWN +#define ESTALE WSAESTALE +#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#define ETOOMANYREFS WSAETOOMANYREFS +#define EUSERS WSAEUSERS +#define EBADMSG 9905 +#define ENOLINK 9918 +#define ENOSR 9922 +#define ENOSTR 9924 +#define EMULTIHOP 2004 +#endif + //Qt #include <QtCore/QCoreApplication> #include <QtCore/QDateTime> diff --git a/src/collectionmanagerinterface.h b/src/collectionmanagerinterface.h index 78bc5fc3af1795a41f871944f894855f65aa5f4e..8920c56f5de1a53f1e70f151b6b83732661436a6 100644 --- a/src/collectionmanagerinterface.h +++ b/src/collectionmanagerinterface.h @@ -46,7 +46,7 @@ class CollectionConfigurationInterface; /** * Common elements for each CollectionManagerInterface */ -class CollectionManagerInterfaceBase { +class LIB_EXPORT CollectionManagerInterfaceBase { public: virtual bool hasEnabledCollections (CollectionInterface::SupportedFeatures features = CollectionInterface::SupportedFeatures::NONE) const = 0; virtual bool hasCollections (CollectionInterface::SupportedFeatures features = CollectionInterface::SupportedFeatures::NONE) const = 0; diff --git a/src/qtwrapper/instancemanager.cpp b/src/qtwrapper/instancemanager.cpp index 486a472522c4f9a2c996bb1d70e87fa061f576d1..1f03a389a869dab5f13871c76a5e8b862b85678a 100644 --- a/src/qtwrapper/instancemanager.cpp +++ b/src/qtwrapper/instancemanager.cpp @@ -45,7 +45,7 @@ InstanceInterface::InstanceInterface() : m_pTimer(nullptr) m_pTimer = new QTimer(this); m_pTimer->setInterval(50); - connect(m_pTimer,&QTimer::timeout,this,&pollEvents); + connect(m_pTimer,SIGNAL(timeout()),this,SLOT(pollEvents())); m_pTimer->start(); ringFlags |= DRing::DRING_FLAG_DEBUG; ringFlags |= DRing::DRING_FLAG_CONSOLE_LOG; @@ -70,7 +70,7 @@ InstanceInterface::~InstanceInterface() } -void pollEvents() +void InstanceInterface::pollEvents() { DRing::pollEvents(); } diff --git a/src/qtwrapper/instancemanager_wrap.h b/src/qtwrapper/instancemanager_wrap.h index 792833cb035171d93f7a74154f952e35f6c89439..df7820f4cdf98dd4898d19c0d5363dc9029ac6db 100644 --- a/src/qtwrapper/instancemanager_wrap.h +++ b/src/qtwrapper/instancemanager_wrap.h @@ -40,7 +40,6 @@ class InstanceInterface: public QObject Q_OBJECT public: InstanceInterface(); - ~InstanceInterface(); // TODO: These are not present in dring.h @@ -59,6 +58,8 @@ public Q_SLOTS: // METHODS bool isConnected(); + void pollEvents(); + private: QTimer* m_pTimer;