1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 03:09:57 +01:00

Add support for building without Sparkle on mac.

This commit is contained in:
John Maguire 2010-12-14 18:20:14 +00:00
parent b9e642c864
commit f95d893945
5 changed files with 32 additions and 12 deletions

View File

@ -58,7 +58,11 @@ find_path(LASTFM_INCLUDE_DIRS lastfm/ws.h)
if (APPLE)
find_library(GROWL Growl)
option(ENABLE_SPARKLE "Sparkle updating" ON)
find_library(SPARKLE Sparkle)
if (ENABLE_SPARKLE AND SPARKLE)
set(HAVE_SPARKLE ON)
endif (ENABLE_SPARKLE AND SPARKLE)
# Uses Darwin kernel version.
# 9.8.0 -> 10.5/Leopard
# 10.4.0 -> 10.6/Snow Leopard
@ -258,4 +262,5 @@ summary_add("devices: GIO backend" HAVE_GIO)
summary_add("Gnome sound menu integration" HAVE_LIBINDICATE)
summary_add("Wiimote support" ENABLE_WIIMOTEDEV)
summary_add("Visualisations" ENABLE_VISUALISATIONS)
summary_add("Sparkle integration" HAVE_SPARKLE)
summary_show()

View File

@ -4,7 +4,6 @@ set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Woverloaded-virtual -Wall -Wno-sign-compare ${CMAKE_CXX_FLAGS}")
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${SPARKLE})
include_directories(../3rdparty/gmock/gtest/include)
if(WIN32)
include_directories(../3rdparty/qtwin)
@ -809,14 +808,16 @@ endif(HAVE_LIBINDICATE)
if (APPLE)
target_link_libraries(clementine_lib
${GROWL}
${SPARKLE}
/System/Library/Frameworks/AppKit.framework
/System/Library/Frameworks/Carbon.framework
/System/Library/Frameworks/DiskArbitration.framework
/System/Library/Frameworks/Foundation.framework
/System/Library/Frameworks/IOKit.framework
)
include_directories(${SPARKLE}/Headers)
if (HAVE_SPARKLE)
include_directories(${SPARKLE}/Headers)
target_link_libraries(${SPARKLE})
endif (HAVE_SPARKLE)
else (APPLE)
target_link_libraries(clementine_lib ${QXT_LIBRARIES})
endif (APPLE)
@ -888,8 +889,12 @@ if (APPLE)
install(DIRECTORY "${QT_QTGUI_LIBRARY_RELEASE}/Versions/Current/Resources/"
DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Resources")
install(DIRECTORY "${SPARKLE}/Versions/Current/Resources"
DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/Sparkle.framework")
if (HAVE_SPARKLE)
install(DIRECTORY "${SPARKLE}/Versions/Current/Resources"
DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/Sparkle.framework")
endif (HAVE_SPARKLE)
install(DIRECTORY "${GROWL}/Versions/Current/Resources"
DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Frameworks/Growl.framework")

View File

@ -32,6 +32,7 @@
#cmakedefine SNOW_LEOPARD
#cmakedefine LEOPARD
#cmakedefine HAVE_SPARKLE
#cmakedefine HAVE_GSTREAMER
#cmakedefine HAVE_LIBVLC

View File

@ -29,7 +29,6 @@
#import <Foundation/NSTimer.h>
#import <Foundation/NSURL.h>
#import <AppKit/NSNibDeclarations.h>
#import <Sparkle/SUUpdater.h>
#import <Kernel/AvailabilityMacros.h>
@ -39,6 +38,10 @@
#include "macglobalshortcutbackend.h"
#include "utilities.h"
#ifdef HAVE_SPARKLE
#import <Sparkle/SUUpdater.h>
#endif
#include <QCoreApplication>
#include <QDir>
#include <QEvent>
@ -177,8 +180,10 @@ void MacMain() {
[[NSAutoreleasePool alloc] init];
// Creates and sets the magic global variable so QApplication will find it.
[MacApplication sharedApplication];
// Creates and sets the magic global variable for Sparkle.
[[SUUpdater sharedUpdater] setDelegate: NSApp];
#ifdef HAVE_SPARKLE
// Creates and sets the magic global variable for Sparkle.
[[SUUpdater sharedUpdater] setDelegate: NSApp];
#endif
}
void SetShortcutHandler(MacGlobalShortcutBackend* handler) {
@ -190,7 +195,9 @@ void SetApplicationHandler(PlatformInterface* handler) {
}
void CheckForUpdates() {
#ifdef HAVE_SPARKLE
[[SUUpdater sharedUpdater] checkForUpdates: NSApp];
#endif
}
QString GetBundlePath() {

View File

@ -481,10 +481,12 @@ MainWindow::MainWindow(Engine::Type engine, QWidget *parent)
connect(tray_icon_, SIGNAL(ChangeVolume(int)), SLOT(VolumeWheelEvent(int)));
#ifdef Q_OS_DARWIN
// Add check for updates item to application menu.
QAction* check_updates = ui_->menuTools->addAction(tr("Check for updates..."));
check_updates->setMenuRole(QAction::ApplicationSpecificRole);
connect(check_updates, SIGNAL(triggered(bool)), SLOT(CheckForUpdates()));
#ifdef HAVE_SPARKLE
// Add check for updates item to application menu.
QAction* check_updates = ui_->menuTools->addAction(tr("Check for updates..."));
check_updates->setMenuRole(QAction::ApplicationSpecificRole);
connect(check_updates, SIGNAL(triggered(bool)), SLOT(CheckForUpdates()));
#endif
// Force this menu to be the app "Preferences".
ui_->action_configure->setMenuRole(QAction::PreferencesRole);