1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-19 15:31:59 +02:00

Add proper QtSparkle find module and make it an optional dep

This commit is contained in:
Dominik Schmidt 2012-11-03 01:04:13 +01:00
parent a5ef97788e
commit 8282d0a4ba
4 changed files with 34 additions and 6 deletions

View File

@ -139,6 +139,11 @@ macro_log_feature(QTWEETLIB_FOUND "QTweetLib" "Qt Twitter Library" "https://gith
macro_optional_find_package(LibLastFm 1.0.0)
macro_log_feature(LIBLASTFM_FOUND "liblastfm" "Qt library for the Last.fm webservices" "https://github.com/eartle/liblastfm" TRUE "" "liblastfm is needed for scrobbling tracks to Last.fm and fetching cover artwork")
IF( WIN32 )
macro_optional_find_package(QtSparkle)
macro_log_feature(QTSPARKLE_FOUND "qtsparkle" "Library for creating auto updaters written in Qt" "https://github.com/davidsansome/qtsparkle" FALSE "" "")
ENDIF( WIN32 )
#### submodules start
# automatically init submodules here, don't delete this code we may add submodules again
@ -181,10 +186,6 @@ ELSE()
SET( CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
ENDIF()
IF( WIN32 )
find_library(QTSPARKLE_LIBRARIES qtsparkle)
ENDIF( WIN32 )
#show dep log
macro_display_feature_log()

View File

@ -0,0 +1,24 @@
# - Find qtsparkle
# Find the qtsparkle includes and the qtsparkle libraries
# This module defines
# QTSPARKLE_INCLUDE_DIR, root qtsparkle include dir. Include qtsparkle includes with qtsparkle/foo.h
# QTSPARKLE_LIBRARY, the path to qtsparkle
# QTSPARKLE_FOUND, whether qtsparkle was found
FIND_PATH(QTSPARKLE_INCLUDE_DIR NAMES qtsparkle/Updater
HINTS
${CMAKE_INSTALL_INCLUDEDIR}
${KDE4_INCLUDE_DIR}
)
FIND_LIBRARY(QTSPARKLE_LIBRARIES NAMES qtsparkle
HINTS
${CMAKE_INSTALL_LIBDIR}
${KDE4_LIB_DIR}
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(QtSparkle
REQUIRED_VARS QTSPARKLE_LIBRARIES QTSPARKLE_INCLUDE_DIR)
MARK_AS_ADVANCED(QTSPARKLE_INCLUDE_DIR QTSPARKLE_LIBRARIES)

View File

@ -21,6 +21,7 @@
#cmakedefine WITH_BREAKPAD
#cmakedefine WITH_CRASHREPORTER
#cmakedefine WITH_BINARY_ATTICA
#cmakedefine WITH_QtSparkle
#cmakedefine LIBLASTFM_FOUND

View File

@ -22,6 +22,8 @@
#include "TomahawkWindow.h"
#include "ui_TomahawkWindow.h"
#include "config.h"
#include <QAction>
#include <QCloseEvent>
#include <QDesktopServices>
@ -76,7 +78,7 @@
#include "LoadXSPFDialog.h"
#include "widgets/ContainedMenuButton.h"
#ifdef Q_OS_WIN
#if defined( Q_WS_WIN ) && defined( WITH_QtSparkle )
#include <qtsparkle/Updater>
#ifndef THBN_CLICKED
#define THBN_CLICKED 0x1800
@ -411,7 +413,7 @@ TomahawkWindow::setupUpdateCheck()
#if defined( Q_OS_MAC ) && defined( HAVE_SPARKLE )
connect( ActionCollection::instance()->getAction( "checkForUpdates" ), SIGNAL( triggered( bool ) ),
SLOT( checkForUpdates() ) );
#elif defined( Q_WS_WIN )
#elif defined( Q_WS_WIN ) && defined( WITH_QtSparkle )
QUrl updaterUrl;
if ( qApp->arguments().contains( "--debug" ) )