1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 13:47:26 +02:00

Move sip into accounts, and redo the exports so that it links on boxes

with --as-needed by default (and presumably Windows too)
This commit is contained in:
Jeff Mitchell
2011-11-14 17:39:13 -05:00
parent 01aa3ee9a5
commit aae400bea9
29 changed files with 80 additions and 112 deletions

View File

@@ -0,0 +1,32 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ACCOUNTDLLMACRO_H
#define ACCOUNTDLLMACRO_H
#ifdef Q_WS_WIN
#ifdef ACCOUNTDLLEXPORT_PRO
#define ACCOUNTDLLEXPORT __declspec(dllexport)
#else
#define ACCOUNTDLLEXPORT __declspec(dllimport)
#endif
#else
#define ACCOUNTDLLEXPORT
#endif
#endif

View File

@@ -4,37 +4,31 @@ include( ${QT_USE_FILE} )
add_definitions( ${QT_DEFINITIONS} ) add_definitions( ${QT_DEFINITIONS} )
add_definitions( -DQT_PLUGIN ) add_definitions( -DQT_PLUGIN )
add_definitions( -DQT_SHARED ) add_definitions( -DQT_SHARED )
add_definitions( -DDLLEXPORT_PRO ) add_definitions( -DACCOUNTDLLEXPORT_PRO )
set( twitterAccountSources set( twitterAccountSources
twitteraccount.cpp twitteraccount.cpp
twitterconfigwidget.cpp twitterconfigwidget.cpp
tomahawkoauthtwitter.cpp
sip/twittersip.cpp
) )
set( twitterAccountHeaders set( twitterAccountHeaders
twitteraccount.h twitteraccount.h
twitterconfigwidget.h twitterconfigwidget.h
tomahawkoauthtwitter.h
sip/twittersip.h
) )
set( twitterAccountUI set( twitterAccountUI
twitterconfigwidget.ui twitterconfigwidget.ui
) )
set( tomahawkOAuthTwitterSources
tomahawkoauthtwitter.cpp
)
set( tomahawkOAuthTwitterHeaders
tomahawkoauthtwitter.h
)
include_directories( . ${CMAKE_CURRENT_BINARY_DIR} .. include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
${QT_INCLUDE_DIR} ${QT_INCLUDE_DIR}
${QTWEETLIB_INCLUDE_DIR} ${QTWEETLIB_INCLUDE_DIR}
) )
qt4_wrap_cpp( tomahawkOAuthTwitterMoc ${tomahawkOAuthTwitterHeaders} )
add_library( tomahawk_oauth_twitter SHARED ${tomahawkOAuthTwitterSources} ${tomahawkOAuthTwitterMoc} )
qt4_wrap_cpp( twitterAccountMoc ${twitterAccountHeaders} ) qt4_wrap_cpp( twitterAccountMoc ${twitterAccountHeaders} )
qt4_wrap_ui( twitterAccountUI_H ${twitterAccountUI} ) qt4_wrap_ui( twitterAccountUI_H ${twitterAccountUI} )
qt4_add_resources( RC_SRCS "resources.qrc" ) qt4_add_resources( RC_SRCS "resources.qrc" )
@@ -48,16 +42,7 @@ SET( OS_SPECIFIC_LINK_LIBRARIES
) )
ENDIF( WIN32 ) ENDIF( WIN32 )
target_link_libraries( tomahawk_oauth_twitter
${TOMAHAWK_LIBRARIES}
${QTWEETLIB_LIBRARIES}
${QT_LIBRARIES}
${OS_SPECIFIC_LINK_LIBRARIES}
)
target_link_libraries( tomahawk_account_twitter target_link_libraries( tomahawk_account_twitter
tomahawk_oauth_twitter
tomahawk_sip_twitter
${TOMAHAWK_LIBRARIES} ${TOMAHAWK_LIBRARIES}
${QTWEETLIB_LIBRARIES} ${QTWEETLIB_LIBRARIES}
${QT_LIBRARIES} ${QT_LIBRARIES}
@@ -68,5 +53,4 @@ IF( APPLE )
# SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" ) # SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" )
ENDIF( APPLE ) ENDIF( APPLE )
install( TARGETS tomahawk_oauth_twitter DESTINATION lib${LIB_SUFFIX} )
install( TARGETS tomahawk_account_twitter DESTINATION lib${LIB_SUFFIX} ) install( TARGETS tomahawk_account_twitter DESTINATION lib${LIB_SUFFIX} )

View File

@@ -155,6 +155,8 @@ TwitterSipPlugin::disconnectPlugin()
void void
TwitterSipPlugin::accountAuthenticated( const QWeakPointer< TomahawkOAuthTwitter > &twitterAuth, const QTweetUser &user ) TwitterSipPlugin::accountAuthenticated( const QWeakPointer< TomahawkOAuthTwitter > &twitterAuth, const QTweetUser &user )
{ {
Q_UNUSED( user );
if ( !isValid() ) if ( !isValid() )
return; return;

View File

@@ -32,12 +32,12 @@
#include <QTweetLib/qtweetmentions.h> #include <QTweetLib/qtweetmentions.h>
#include <QTweetLib/qtweetdmstatus.h> #include <QTweetLib/qtweetdmstatus.h>
#include "../sipdllmacro.h" #include "accounts/accountdllmacro.h"
#include "sip/SipPlugin.h" #include "sip/SipPlugin.h"
#include "accounts/account.h" #include "accounts/account.h"
#include "accounts/twitter/tomahawkoauthtwitter.h" #include "accounts/twitter/tomahawkoauthtwitter.h"
class SIPDLLEXPORT TwitterSipPlugin : public SipPlugin class ACCOUNTDLLEXPORT TwitterSipPlugin : public SipPlugin
{ {
Q_OBJECT Q_OBJECT

View File

@@ -1,6 +1,6 @@
#include "tomahawkoauthtwitter.h" #include "tomahawkoauthtwitter.h"
#include <QInputDialog> #include <QtGui/QInputDialog>
#include "utils/logger.h" #include "utils/logger.h"

View File

@@ -1,13 +1,13 @@
#ifndef TOMAHAWKOAUTHTWITTERACCOUNT #ifndef TOMAHAWKOAUTHTWITTERACCOUNT
#define TOMAHAWKOAUTHTWITTERACCOUNT #define TOMAHAWKOAUTHTWITTERACCOUNT
#include "dllmacro.h" #include "accounts/accountdllmacro.h"
#include <utils/tomahawkutils.h> #include <utils/tomahawkutils.h>
#include <QTweetLib/qtweetlib_global.h> #include <QTweetLib/qtweetlib_global.h>
#include <QTweetLib/oauthtwitter.h> #include <QTweetLib/oauthtwitter.h>
class DLLEXPORT TomahawkOAuthTwitter : public OAuthTwitter class ACCOUNTDLLEXPORT TomahawkOAuthTwitter : public OAuthTwitter
{ {
Q_OBJECT Q_OBJECT

View File

@@ -19,12 +19,11 @@
#ifndef TWITTERACCOUNT_H #ifndef TWITTERACCOUNT_H
#define TWITTERACCOUNT_H #define TWITTERACCOUNT_H
#include "dllmacro.h"
#include "twitterconfigwidget.h" #include "twitterconfigwidget.h"
#include "tomahawkoauthtwitter.h" #include "tomahawkoauthtwitter.h"
#include "sip/twitter/twittersip.h" #include "sip/twittersip.h"
#include "accounts/accountdllmacro.h"
#include "accounts/account.h" #include "accounts/account.h"
#define MYNAME "ACCOUNTTWITTER" #define MYNAME "ACCOUNTTWITTER"
@@ -35,7 +34,7 @@ namespace Tomahawk
namespace Accounts namespace Accounts
{ {
class DLLEXPORT TwitterAccountFactory : public AccountFactory class ACCOUNTDLLEXPORT TwitterAccountFactory : public AccountFactory
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES( Tomahawk::Accounts::AccountFactory ) Q_INTERFACES( Tomahawk::Accounts::AccountFactory )

View File

@@ -4,20 +4,29 @@ include( ${QT_USE_FILE} )
add_definitions( ${QT_DEFINITIONS} ) add_definitions( ${QT_DEFINITIONS} )
add_definitions( -DQT_PLUGIN ) add_definitions( -DQT_PLUGIN )
add_definitions( -DQT_SHARED ) add_definitions( -DQT_SHARED )
add_definitions( -DDLLEXPORT_PRO ) add_definitions( -DACCOUNTDLLEXPORT_PRO )
set( xmppAccountSources set( xmppAccountSources
xmppaccount.cpp xmppaccount.cpp
xmppconfigwidget.cpp xmppconfigwidget.cpp
sip/xmppsip.cpp
sip/tomahawkxmppmessage.cpp
sip/tomahawkxmppmessagefactory.cpp
sip/avatarmanager.cpp
sip/xmlconsole.cpp
) )
set( xmppAccountHeaders set( xmppAccountHeaders
xmppaccount.h xmppaccount.h
xmppconfigwidget.h xmppconfigwidget.h
sip/xmppsip.h
sip/avatarmanager.h
sip/xmlconsole.h
) )
set( xmppAccountUI set( xmppAccountUI
xmppconfigwidget.ui xmppconfigwidget.ui
sip/xmlconsole.ui
) )
include_directories( . ${CMAKE_CURRENT_BINARY_DIR} .. include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
@@ -39,9 +48,8 @@ SET( OS_SPECIFIC_LINK_LIBRARIES
ENDIF( WIN32 ) ENDIF( WIN32 )
target_link_libraries( tomahawk_account_xmpp target_link_libraries( tomahawk_account_xmpp
tomahawk_sip_xmpp
${TOMAHAWK_LIBRARIES} ${TOMAHAWK_LIBRARIES}
${JREEN_LIBRARY} ${LIBJREEN_LIBRARY}
${QT_LIBRARIES} ${QT_LIBRARIES}
${OS_SPECIFIC_LINK_LIBRARIES} ${OS_SPECIFIC_LINK_LIBRARIES}
) )
@@ -51,3 +59,6 @@ IF( APPLE )
ENDIF( APPLE ) ENDIF( APPLE )
install( TARGETS tomahawk_account_xmpp DESTINATION lib${LIB_SUFFIX} ) install( TARGETS tomahawk_account_xmpp DESTINATION lib${LIB_SUFFIX} )
#add_subdirectory(googlewrapper)

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -21,12 +21,12 @@
#include <jreen/client.h> #include <jreen/client.h>
#include <QObject> #include <QtCore/QObject>
#include <QDir> #include <QtCore/QDir>
#include "../sipdllmacro.h" #include "accounts/accountdllmacro.h"
class SIPDLLEXPORT AvatarManager : public QObject class ACCOUNTDLLEXPORT AvatarManager : public QObject
{ {
Q_OBJECT Q_OBJECT

View File

@@ -23,10 +23,10 @@
#define TOMAHAWK_SIP_MESSAGE_NS QLatin1String("http://www.tomhawk-player.org/sip/transports") #define TOMAHAWK_SIP_MESSAGE_NS QLatin1String("http://www.tomhawk-player.org/sip/transports")
#include "../sipdllmacro.h" #include "accounts/accountdllmacro.h"
class TomahawkXmppMessagePrivate; class TomahawkXmppMessagePrivate;
class SIPDLLEXPORT TomahawkXmppMessage : public Jreen::Payload class ACCOUNTDLLEXPORT TomahawkXmppMessage : public Jreen::Payload
{ {
J_PAYLOAD(TomahawkXmppMessage) J_PAYLOAD(TomahawkXmppMessage)
Q_DECLARE_PRIVATE(TomahawkXmppMessage) Q_DECLARE_PRIVATE(TomahawkXmppMessage)

View File

@@ -23,9 +23,9 @@
#include <jreen/stanzaextension.h> #include <jreen/stanzaextension.h>
#include "../sipdllmacro.h" #include "accounts/accountdllmacro.h"
class SIPDLLEXPORT TomahawkXmppMessageFactory : public Jreen::PayloadFactory<TomahawkXmppMessage> class ACCOUNTDLLEXPORT TomahawkXmppMessageFactory : public Jreen::PayloadFactory<TomahawkXmppMessage>
{ {
public: public:
TomahawkXmppMessageFactory(); TomahawkXmppMessageFactory();

View File

@@ -23,18 +23,18 @@
#include <jreen/client.h> #include <jreen/client.h>
#include <jreen/jid.h> #include <jreen/jid.h>
#include <QWidget> #include <QtGui/QWidget>
#include <QXmlStreamReader> #include <QtXml/QXmlStreamReader>
#include <QDateTime> #include <QtCore/QDateTime>
#include <QTextBlock> #include <QtGui/QTextBlock>
namespace Ui { namespace Ui {
class XmlConsole; class XmlConsole;
} }
#include "../sipdllmacro.h" #include "accounts/accountdllmacro.h"
class SIPDLLEXPORT XmlConsole : public QWidget, public Jreen::XmlStreamHandler class ACCOUNTDLLEXPORT XmlConsole : public QWidget, public Jreen::XmlStreamHandler
{ {
Q_OBJECT Q_OBJECT

View File

@@ -43,9 +43,9 @@
#define TOMAHAWK_FEATURE QLatin1String( "tomahawk:sip:v1" ) #define TOMAHAWK_FEATURE QLatin1String( "tomahawk:sip:v1" )
#define TOMAHAWK_CAP_NODE_NAME QLatin1String( "http://tomahawk-player.org/" ) #define TOMAHAWK_CAP_NODE_NAME QLatin1String( "http://tomahawk-player.org/" )
#include "../sipdllmacro.h" #include "accounts/accountdllmacro.h"
class SIPDLLEXPORT XmppSipPlugin : public SipPlugin class ACCOUNTDLLEXPORT XmppSipPlugin : public SipPlugin
{ {
Q_OBJECT Q_OBJECT

View File

@@ -20,9 +20,8 @@
#ifndef XMPPACCOUNT_H #ifndef XMPPACCOUNT_H
#define XMPPACCOUNT_H #define XMPPACCOUNT_H
#include "dllmacro.h" #include "sip/xmppsip.h"
#include "accounts/accountdllmacro.h"
#include "sip/xmpp/xmppsip.h"
#include "accounts/account.h" #include "accounts/account.h"
#define MYNAME "ACCOUNTJABBER" #define MYNAME "ACCOUNTJABBER"
@@ -35,7 +34,7 @@ namespace Tomahawk
namespace Accounts namespace Accounts
{ {
class DLLEXPORT XmppAccountFactory : public AccountFactory class ACCOUNTDLLEXPORT XmppAccountFactory : public AccountFactory
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES( Tomahawk::Accounts::AccountFactory ) Q_INTERFACES( Tomahawk::Accounts::AccountFactory )

View File

@@ -1,9 +1 @@
IF( LIBJREEN_FOUND )
ADD_SUBDIRECTORY( xmpp )
ENDIF( LIBJREEN_FOUND )
IF( QTWEETLIB_FOUND )
ADD_SUBDIRECTORY( twitter )
ENDIF( QTWEETLIB_FOUND )
#ADD_SUBDIRECTORY( zeroconf ) #ADD_SUBDIRECTORY( zeroconf )

View File

@@ -1,46 +0,0 @@
project( tomahawk )
include( ${QT_USE_FILE} )
add_definitions( ${QT_DEFINITIONS} )
add_definitions( -DQT_PLUGIN )
add_definitions( -DQT_SHARED )
add_definitions( -DSIPDLLEXPORT_PRO )
set( twitterSources
twittersip.cpp
)
set( twitterHeaders
twittersip.h
)
include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
${QT_INCLUDE_DIR}
${QTWEETLIB_INCLUDE_DIR}
)
qt4_add_resources( RC_SRCS "resources.qrc" )
qt4_wrap_cpp( twitterMoc ${twitterHeaders} )
add_library( tomahawk_sip_twitter SHARED ${twitterSources} ${twitterMoc} ${RC_SRCS} )
IF( WIN32 )
SET( OS_SPECIFIC_LINK_LIBRARIES
${OS_SPECIFIC_LINK_LIBRARIES}
"winmm.dll"
"iphlpapi.a"
)
ENDIF( WIN32 )
target_link_libraries( tomahawk_sip_twitter
tomahawk_oauth_twitter
${TOMAHAWK_LIBRARIES}
${QTWEETLIB_LIBRARIES}
${QT_LIBRARIES}
${OS_SPECIFIC_LINK_LIBRARIES}
)
IF( APPLE )
# SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" )
ENDIF( APPLE )
install( TARGETS tomahawk_sip_twitter DESTINATION lib${LIB_SUFFIX} )

View File

@@ -1,5 +0,0 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>twitter-icon.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB