diff --git a/CMakeLists.txt b/CMakeLists.txt index a2a7407f9..2152ac0be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ INCLUDE( MacroLogFeature ) # required macro_optional_find_package(LibLastFm 0.3.3) -macro_log_feature(LIBLASTFM_FOUND "LastFm" "Qt library for the Last.fm webservices" "https://github.com/mxcl/liblastfm" TRUE "" "liblastfm is needed for scrobbling tracks to Last.fm and fetching cover artwork") +macro_log_feature(LIBLASTFM_FOUND "LastFm" "Qt library for the Last.fm webservices" "https://github.com/mxcl/liblastfm" FALSE "" "liblastfm is needed for scrobbling tracks to Last.fm and fetching cover artwork") macro_optional_find_package(LibEchonest 1.1.1) macro_log_feature(LIBECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest is needed for dynamic playlists and the infosystem") diff --git a/include/tomahawk/tomahawkapp.h b/include/tomahawk/tomahawkapp.h index 083c8950c..a3162855b 100644 --- a/include/tomahawk/tomahawkapp.h +++ b/include/tomahawk/tomahawkapp.h @@ -36,7 +36,7 @@ namespace Tomahawk } } -#ifndef NO_LIBLASTFM +#ifdef LIBLASTFM_FOUND #include #include "scrobbler.h" #endif @@ -70,7 +70,7 @@ public: void addScriptResolver( const QString& scriptPath ); void removeScriptResolver( const QString& scriptPath ); - + // PlatformInterface virtual void activate(); virtual bool loadUrl( const QString& url ); @@ -91,7 +91,7 @@ private: QList m_collections; QList m_plugins; QList m_scriptResolvers; - + Database* m_database; AudioEngine* m_audioEngine; SipHandler* m_sipHandler; @@ -99,7 +99,7 @@ private: XMPPBot* m_xmppBot; Tomahawk::ShortcutHandler* m_shortcutHandler; -#ifndef NO_LIBLASTFM +#ifdef LIBLASTFM_FOUND Scrobbler* m_scrobbler; #endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 21e3d9225..c4ddbb53a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,7 +37,6 @@ SET( tomahawkSources ${tomahawkSources} musicscanner.cpp scriptresolver.cpp - scrobbler.cpp shortcuthandler.cpp scanmanager.cpp @@ -45,6 +44,12 @@ SET( tomahawkSources ${tomahawkSources} main.cpp ) +IF(LIBLASTFM_FOUND) + SET(tomahawkSources ${tomahawkSources} + scrobbler.cpp + ) +ENDIF(LIBLASTFM_FOUND) + SET( tomahawkSourcesGui ${tomahawkSourcesGui} sourcetree/sourcesmodel.cpp sourcetree/sourcetreeitem.cpp @@ -78,11 +83,16 @@ SET( tomahawkHeaders ${tomahawkHeaders} musicscanner.h scriptresolver.h - scrobbler.h scanmanager.h shortcuthandler.h ) +IF(LIBLASTFM_FOUND) + SET(tomahawkHeaders ${tomahawkHeaders} + scrobbler.h + ) +ENDIF(LIBLASTFM_FOUND) + SET( tomahawkHeadersGui ${tomahawkHeadersGui} sourcetree/sourcesmodel.h @@ -178,13 +188,22 @@ ENDIF( WIN32 ) MESSAGE( STATUS "OS_SPECIFIC_LINK_LIBRARIES: ${OS_SPECIFIC_LINK_LIBRARIES}" ) +SET(LINK_LIBRARIES "") +IF(LIBLASTFM_FOUND) + SET(LINK_LIBRARIES + ${LINK_LIBRARIES} + ${LIBLASTFM_LIBRARY} + ) +ENDIF(LIBLASTFM_FOUND) + + TARGET_LINK_LIBRARIES( tomahawk + ${LINK_LIBRARIES} ${TOMAHAWK_LIBRARIES} ${QT_LIBRARIES} ${MAC_EXTRA_LIBS} ${OS_SPECIFIC_LINK_LIBRARIES} ${LIBECHONEST_LIBRARY} - ${LIBLASTFM_LIBRARY} ${QXTWEB_LIBRARIES} ${QTWEETLIB_LIBRARIES} ${QJSON_LIBRARIES} diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 5ca2d68a6..92e335f0e 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -5,7 +5,7 @@ #include #include -#ifndef NO_LIBLASTFM +#ifdef LIBLASTFM_FOUND #include #include #endif @@ -196,7 +196,7 @@ SettingsDialog::toggleUpnp( bool preferStaticEnabled ) void SettingsDialog::testLastFmLogin() { -#ifndef NO_LIBLASTFM +#ifdef LIBLASTFM_FOUND ui->pushButtonTestLastfmLogin->setEnabled( false ); ui->pushButtonTestLastfmLogin->setText( "Testing..." ); @@ -217,7 +217,7 @@ SettingsDialog::testLastFmLogin() void SettingsDialog::onLastFmFinished() { -#ifndef NO_LIBLASTFM +#ifdef LIBLASTFM_FOUND lastfm::XmlQuery lfm = lastfm::XmlQuery( m_testLastFmQuery->readAll() ); switch( m_testLastFmQuery->error() ) diff --git a/src/tomahawkapp.cpp b/src/tomahawkapp.cpp index 896d53de5..4dc5a86ec 100644 --- a/src/tomahawkapp.cpp +++ b/src/tomahawkapp.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "artist.h" #include "album.h" @@ -189,7 +190,7 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] ) connect( m_shortcutHandler, SIGNAL( mute() ), m_audioEngine, SLOT( mute() ) ); } -#ifndef NO_LIBLASTFM +#ifdef LIBLASTFM_FOUND qDebug() << "Init Scrobbler."; m_scrobbler = new Scrobbler( this ); qDebug() << "Setting NAM.";