diff --git a/CMakeLists.txt b/CMakeLists.txt index 71e0dfb4d..941ce321c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,6 +112,13 @@ if (APPLE) set(HAVE_SPARKLE ON) endif (ENABLE_SPARKLE AND SPARKLE) + find_library(SPOTIFY libspotify) + if (SPOTIFY) + set (SPOTIFY_FOUND ON) + set (SPOTIFY_INCLUDE_DIRS ${SPOTIFY}) + set (SPOTIFY_LIBRARIES ${SPOTIFY}) + endif (SPOTIFY) + # Uses Darwin kernel version. # 9.8.0 -> 10.5/Leopard # 10.4.0 -> 10.6/Snow Leopard diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0b6679746..e790cae20 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1129,6 +1129,14 @@ if (APPLE) WORLD_READ WORLD_EXECUTE) endif (HAVE_BREAKPAD) + if (HAVE_SPOTIFY) + install(FILES ${CMAKE_BINARY_DIR}/clementine-spotifyblob + DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Resources" + PERMISSIONS OWNER_EXECUTE OWNER_READ + GROUP_EXECUTE GROUP_READ + WORLD_EXECUTE WORLD_READ) + endif (HAVE_SPOTIFY) + add_custom_command(TARGET clementine POST_BUILD COMMAND diff --git a/src/radio/spotifyservice.cpp b/src/radio/spotifyservice.cpp index 3ec4c2623..c8623e894 100644 --- a/src/radio/spotifyservice.cpp +++ b/src/radio/spotifyservice.cpp @@ -21,7 +21,12 @@ SpotifyService::SpotifyService(RadioModel* parent) starred_(NULL), inbox_(NULL), login_task_id_(0) { +#ifdef Q_OS_DARWIN + blob_path_ = QCoreApplication::applicationDirPath() + "/../Resources/clementine-spotifyblob"; +#else blob_path_ = QCoreApplication::applicationFilePath() + "-spotifyblob"; +#endif + qLog(Debug) << "Loading spotify blob from:" << blob_path_; } SpotifyService::~SpotifyService() {