Make Google Drive support optional and add a cmake option for it

This commit is contained in:
David Sansome 2012-07-26 21:23:08 +01:00
parent 1031482024
commit 73062bce3d
3 changed files with 24 additions and 5 deletions

View File

@ -84,6 +84,8 @@ find_library(LASTFM_LIBRARIES lastfm)
find_path(LASTFM_INCLUDE_DIRS lastfm/ws.h)
find_path(LASTFM1_INCLUDE_DIRS lastfm/Track.h)
find_path(SPARSEHASH_INCLUDE_DIRS google/sparsetable)
if(LASTFM_INCLUDE_DIRS AND LASTFM1_INCLUDE_DIRS)
set(HAVE_LIBLASTFM1 ON)
endif()
@ -200,6 +202,7 @@ option(ENABLE_BREAKPAD "Enable crash reporting" OFF)
option(ENABLE_SPOTIFY_BLOB "Build the spotify non-GPL binary" ON)
option(ENABLE_SPOTIFY "Enable spotify support" ON)
option(ENABLE_MOODBAR "Enable moodbar" ON)
option(ENABLE_GOOGLE_DRIVE "Enable Google Drive support" ON)
if(WIN32)
option(ENABLE_WIN32_CONSOLE "Show the windows console even outside Debug mode" OFF)
@ -266,6 +269,10 @@ if(ENABLE_MOODBAR AND FFTW3_FOUND)
set(HAVE_MOODBAR ON)
endif()
if(ENABLE_GOOGLE_DRIVE AND SPARSEHASH_INCLUDE_DIRS AND TAGLIB_VERSION VERSION_GREATER 1.7.999)
set(HAVE_GOOGLE_DRIVE ON)
endif()
if(ENABLE_VISUALISATIONS)
# When/if upstream accepts our patches then these options can be used to link
@ -439,6 +446,7 @@ summary_add("Devices: iPod Touch, iPhone, iPad support" HAVE_IMOBILEDEVICE)
summary_add("Devices: MTP support" HAVE_LIBMTP)
summary_add("Devices: GIO backend" HAVE_GIO)
summary_add("Gnome sound menu integration" HAVE_LIBINDICATE)
summary_add("Google Drive support" HAVE_GOOGLE_DRIVE)
summary_add("Last.fm support" HAVE_LIBLASTFM)
summary_add("Moodbar support" HAVE_MOODBAR)
summary_add("Spotify support: core code" HAVE_SPOTIFY)

View File

@ -160,8 +160,6 @@ set(SOURCES
internet/digitallyimportedsettingspage.cpp
internet/digitallyimportedurlhandler.cpp
internet/geolocator.cpp
internet/googledriveservice.cpp
internet/googledriveurlhandler.cpp
internet/groovesharkradio.cpp
internet/groovesharkservice.cpp
internet/groovesharksettingspage.cpp
@ -433,8 +431,6 @@ set(HEADERS
internet/digitallyimportedservicebase.h
internet/digitallyimportedsettingspage.h
internet/geolocator.h
internet/googledriveservice.h
internet/googledriveurlhandler.h
internet/groovesharkservice.h
internet/groovesharksettingspage.h
internet/groovesharkurlhandler.h
@ -970,6 +966,7 @@ optional_source(HAVE_LIBMTP
# Windows media lister
optional_source(HAVE_SAC
INCLUDE_DIRECTORIES ${SPARSEHASH_INCLUDE_DIRS}
SOURCES
devices/wmdmdevice.cpp
devices/wmdmlister.cpp
@ -999,6 +996,16 @@ optional_source(HAVE_MOODBAR
moodbar/moodbarproxystyle.h
)
# Google Drive support
optional_source(HAVE_GOOGLE_DRIVE
SOURCES
internet/googledriveservice.cpp
internet/googledriveurlhandler.cpp
HEADERS
internet/googledriveservice.h
internet/googledriveurlhandler.h
)
# Hack to add Clementine to the Unity system tray whitelist
optional_source(LINUX
SOURCES core/ubuntuunityhack.cpp

View File

@ -17,7 +17,6 @@
#include "digitallyimportedservicebase.h"
#include "icecastservice.h"
#include "googledriveservice.h"
#include "jamendoservice.h"
#include "magnatuneservice.h"
#include "internetmimedata.h"
@ -37,6 +36,9 @@
#ifdef HAVE_SPOTIFY
#include "spotifyservice.h"
#endif
#ifdef HAVE_GOOGLE_DRIVE
#include "googledriveservice.h"
#endif
#include <QMimeData>
#include <QtDebug>
@ -65,7 +67,9 @@ InternetModel::InternetModel(Application* app, QObject* parent)
#ifdef HAVE_LIBLASTFM
AddService(new LastFMService(app, this));
#endif
#ifdef HAVE_GOOGLE_DRIVE
AddService(new GoogleDriveService(app, this));
#endif
AddService(new GroovesharkService(app, this));
AddService(new MagnatuneService(app, this));
AddService(new PodcastService(app, this));