diff --git a/CMakeLists.txt b/CMakeLists.txt index 72f1628fe..ea3bccb20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ PROJECT( tomahawk ) CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) -SET( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" ) +SET( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/CMakeModules" ) SET( THIRDPARTY_DIR ${CMAKE_SOURCE_DIR}/thirdparty ) # Check if we need qtgui: @@ -18,12 +18,22 @@ FIND_PACKAGE( Taglib 1.6.0 REQUIRED ) include( CheckTagLibFileName ) check_taglib_filename( COMPLEX_TAGLIB_FILENAME ) +# required deps FIND_PACKAGE( LibLastFm 0.3.3 REQUIRED ) FIND_PACKAGE( LibEchonest 1.1.1 REQUIRED ) FIND_PACKAGE( CLucene 0.9.23 REQUIRED ) -FIND_PACKAGE( Gloox 1.0 REQUIRED ) + FIND_PACKAGE( QJSON REQUIRED ) +# optional deps +INCLUDE( MacroOptionalFindPackage ) +INCLUDE( MacroLogFeature ) +macro_optional_find_package(Gloox 1.0) +macro_log_feature(Gloox_FOUND "Gloox" "A portable high-level Jabber/XMPP library for C++" "http://camaya.net/gloox" FALSE "" "Gloox is needed for the Jabber SIP plugin and the XMPP-Bot") + +macro_display_feature_log() + + ADD_SUBDIRECTORY( thirdparty ) ADD_SUBDIRECTORY( src/libtomahawk ) ADD_SUBDIRECTORY( src ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5e10e097d..a91b24865 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,7 +33,6 @@ SET( tomahawkSources ${tomahawkSources} infosystem/infoplugins/echonestplugin.cpp infosystem/infoplugins/musixmatchplugin.cpp - xmppbot/xmppbot.cpp web/api_v1.cpp musicscanner.cpp @@ -74,7 +73,7 @@ SET( tomahawkHeaders ${tomahawkHeaders} infosystem/infoplugins/echonestplugin.h infosystem/infoplugins/musixmatchplugin.h - xmppbot/xmppbot.h + web/api_v1.h musicscanner.h @@ -84,6 +83,7 @@ SET( tomahawkHeaders ${tomahawkHeaders} shortcuthandler.h ) + SET( tomahawkHeadersGui ${tomahawkHeadersGui} sourcetree/sourcesmodel.h sourcetree/sourcetreeitem.h @@ -142,6 +142,10 @@ IF( UNIX ) INCLUDE( "CMakeLists.unix.txt" ) ENDIF( UNIX ) + +IF(Gloox_FOUND) + ADD_SUBDIRECTORY( xmppbot ) +ENDIF(Gloox_FOUND) ADD_SUBDIRECTORY( sip ) kde4_add_app_icon( tomahawkSources "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" ) @@ -181,7 +185,6 @@ TARGET_LINK_LIBRARIES( tomahawk ${OS_SPECIFIC_LINK_LIBRARIES} ${LIBECHONEST_LIBRARY} ${LIBLASTFM_LIBRARY} - ${GLOOX_LIBRARIES} ${QXTWEB_LIBRARIES} ${QTWEETLIB_LIBRARIES} ${QJSON_LIBRARIES} diff --git a/src/sip/CMakeLists.txt b/src/sip/CMakeLists.txt index e2b01058d..235405165 100644 --- a/src/sip/CMakeLists.txt +++ b/src/sip/CMakeLists.txt @@ -1,3 +1,7 @@ -ADD_SUBDIRECTORY( jabber ) + +IF(Gloox_FOUND) + ADD_SUBDIRECTORY( jabber ) +ENDIF(Gloox_FOUND) + ADD_SUBDIRECTORY( twitter ) ADD_SUBDIRECTORY( zeroconf ) diff --git a/src/tomahawkapp.cpp b/src/tomahawkapp.cpp index 0a141bc09..c5eed0acc 100644 --- a/src/tomahawkapp.cpp +++ b/src/tomahawkapp.cpp @@ -20,7 +20,6 @@ #include "playlist/dynamic/GeneratorFactory.h" #include "playlist/dynamic/echonest/EchonestGenerator.h" #include "utils/tomahawkutils.h" -#include "xmppbot/xmppbot.h" #include "web/api_v1.h" #include "scriptresolver.h" #include "sourcelist.h" @@ -37,6 +36,11 @@ #include #endif +// should go to a plugin actually +#ifdef Gloox_FOUND + #include "xmppbot/xmppbot.h" +#endif + #ifdef Q_WS_MAC #include "mac/macshortcuthandler.h" #endif @@ -475,6 +479,7 @@ TomahawkApp::setupSIP() { qDebug() << Q_FUNC_INFO; +#ifdef Gloox_FOUND //FIXME: jabber autoconnect is really more, now that there is sip -- should be renamed and/or split out of jabber-specific settings if( !arguments().contains( "--nosip" ) && TomahawkSettings::instance()->jabberAutoConnect() ) { @@ -483,6 +488,7 @@ TomahawkApp::setupSIP() m_sipHandler->connectPlugins( true ); // m_sipHandler->setProxy( *TomahawkUtils::proxy() ); } +#endif }