Skip to content

Commit

Permalink
Merge branch 'master' into resulthintcheck
Browse files Browse the repository at this point in the history
Conflicts:
	src/libtomahawk/utils/TomahawkUtils.cpp
  • Loading branch information
hugolm84 committed Jan 21, 2013
2 parents c63fff9 + 13bee7f commit 7645862
Show file tree
Hide file tree
Showing 420 changed files with 27,486 additions and 15,518 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
src/accounts/tomahawk
*-build/*
build/*
.directory
Expand Down
14 changes: 9 additions & 5 deletions AUTHORS
Expand Up @@ -4,13 +4,17 @@ Tomahawk is primarily authored by:

Contributors include:

* Leo Franchi <lfranchi@kde.org>
* Dominik Schmidt <dev@dominik-schmidt.de>
* Jeff Mitchell <mitchell@kde.org>
* J Herskowitz <jherskow@gmail.com>
* Leo Franchi <lfranchi@tomahawk-player.org>
* Dominik Schmidt <domme@tomahawk-player.org>
* Jeff Mitchell <jeff@tomahawk-player.org>
* J Herskowitz <j@tomahawk-player.org>
* Alejandro Wainzinger <aikawarazuni@gmail.com>
* Hugo Lindström <hugo@tomahawk-player.org>
* Teo Mrnjavac <teo@kde.org>
* Michael Zanetti <dreadhead@follefuder.org>
* Christopher Reichert <christopher@tomahawk-player.org>

Thanks to:

* Harald Sitter <sitter@kde.org>
* Steve Robertson
* Syd Lawrence <syd@tomahawk-player.org>
196 changes: 167 additions & 29 deletions CMakeLists.txt
Expand Up @@ -11,12 +11,23 @@ SET( TOMAHAWK_ORGANIZATION_DOMAIN "tomahawk-player.org" )
SET( TOMAHAWK_APPLICATION_NAME "Tomahawk" )
SET( TOMAHAWK_DESCRIPTION_SUMMARY "The social media player" )

IF( WIN32 )
SET( TOMAHAWK_SYSTEM "Windows" )
ELSEIF( APPLE )
SET( TOMAHAWK_SYSTEM "OS X" )
ELSEIF( UNIX )
SET( TOMAHAWK_SYSTEM "Linux")
ELSE()
SET( TOMAHAWK_SYSTEM "Uknown Platform, please let the Tomahawk team know, this actually happened" )
ENDIF()

SET( TOMAHAWK_VERSION_MAJOR 0 )
SET( TOMAHAWK_VERSION_MINOR 5 )
SET( TOMAHAWK_VERSION_MINOR 6 )
SET( TOMAHAWK_VERSION_PATCH 99 )

#SET( TOMAHAWK_VERSION_RC 0 )

SET( TOMAHAWK_TRANSLATION_LANGUAGES ar bg bn_IN ca cs de en el es fi fr hi_IN hu gl it ja lt pl pt_BR ru sv tr zh_CN zh_TW )

# enforce proper symbol exporting on all platforms
add_definitions( "-fvisibility=hidden" )
# enforce using constBegin, constEnd for const-iterators
Expand All @@ -25,6 +36,8 @@ add_definitions( "-DQT_STRICT_ITERATORS" )
# build options
option(BUILD_GUI "Build Tomahawk with GUI" ON)
option(BUILD_RELEASE "Generate TOMAHAWK_VERSION without GIT info" OFF)
option(BUILD_TESTS "Build Tomahawk with unit tests" ON)

option(WITH_BREAKPAD "Build with breakpad integration" ON)
option(WITH_CRASHREPORTER "Build with CrashReporter" ON)
option(WITH_BINARY_ATTICA "Enable support for downloading binary resolvers automatically" ON)
Expand All @@ -49,10 +62,12 @@ ENDIF()

# base string used in release and unstable builds
SET( TOMAHAWK_VERSION ${TOMAHAWK_VERSION_MAJOR}.${TOMAHAWK_VERSION_MINOR}.${TOMAHAWK_VERSION_PATCH} )
SET(TOMAHAWK_VERSION_SHORT "${TOMAHAWK_VERSION}")
IF( TOMAHAWK_VERSION_RC )
SET( TOMAHAWK_VERSION ${TOMAHAWK_VERSION}rc${TOMAHAWK_VERSION_RC} )
ENDIF()


# additional info for non-release builds
IF( NOT BUILD_RELEASE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/" )
INCLUDE( CMakeDateStamp )
Expand Down Expand Up @@ -80,35 +95,101 @@ INCLUDE( GNUInstallDirs )
# installer creation
INCLUDE( TomahawkCPack.cmake )

#deps
# deps
INCLUDE( MacroOptionalFindPackage )
INCLUDE( MacroLogFeature )

# Check if we need qtgui:
SET(NEEDED_QT4_COMPONENTS QtCore QtXml QtNetwork )
IF( NOT BUILD_GUI )
ADD_DEFINITIONS( -DENABLE_HEADLESS )
MESSAGE( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} in HEADLESS mode ***" )
ELSE()
MESSAGE( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} full GUI version ***" )
LIST(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" "QtUiTools" )
ENDIF()
# headless mode
if( NOT BUILD_GUI )
add_definitions( -DENABLE_HEADLESS )
message( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} in HEADLESS mode ***" )
else()
message( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} full GUI version ***" )
endif()

IF( BUILD_GUI AND UNIX AND NOT APPLE )
FIND_PACKAGE( X11 )
ENDIF()

macro_optional_find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS} )
macro_log_feature(QT4_FOUND "Qt" "A cross-platform application and UI framework" "http://qt.nokia.com" TRUE "" "If you see this, although libqt4-devel is installed, check whether the \n qtwebkit-devel package and whatever contains QtUiTools is installed too")
find_package(Qt5Core QUIET)
if(Qt5Core_DIR)
find_package(Qt5Widgets QUIET)
message(STATUS "Found Qt5! Please keep in mind, this is highly experimental and not our main development..")

macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()

macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()

find_package(Qt5LinguistTools REQUIRED)
macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro()

macro(setup_qt)
endmacro()

set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
#FIXME: CrashReporter depends on deprecated QHttp
set(WITH_CRASHREPORTER OFF)
set(WITH_BREAKPAD OFF)
else()
message(STATUS "Could not find Qt5, now searching for Qt4... you're better off this way!")

set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork")
if( BUILD_GUI )
list(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" "QtUiTools" "QtSvg")
endif()
if( BUILD_TESTS )
list(APPEND NEEDED_QT4_COMPONENTS "QtTest")
endif()

macro_optional_find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS} )
macro_log_feature(QT4_FOUND "Qt" "A cross-platform application and UI framework" "http://qt.nokia.com" TRUE "" "If you see this, although libqt4-devel is installed, check whether the \n qtwebkit-devel package and whatever contains QtUiTools is installed too")

macro(qt5_use_modules)
endmacro()

macro(qt_wrap_ui)
qt4_wrap_ui(${ARGN})
endmacro()

macro(qt_add_resources)
qt4_add_resources(${ARGN})
endmacro()

macro(qt_add_translation)
qt4_add_translation(${ARGN})
endmacro()

macro(setup_qt)
if(NOT BUILD_GUI)
set(QT_DONT_USE_QTGUI TRUE)
endif()
if(UNIX AND NOT APPLE)
set(QT_USE_QTDBUS TRUE)
endif()
set(QT_USE_QTSQL TRUE)
set(QT_USE_QTNETWORK TRUE)
set(QT_USE_QTXML TRUE)
set(QT_USE_QTWEBKIT TRUE)

include( ${QT_USE_FILE} )
endmacro()
endif()

if(BUILD_GUI AND UNIX AND NOT APPLE)
find_package( X11 )
endif()

macro_optional_find_package(Phonon 4.5.0)
macro_log_feature(PHONON_FOUND "Phonon" "The Phonon multimedia library" "http://phonon.kde.org" TRUE "" "")
if(PHONON_FOUND)
message(STATUS "Phonon found; ensure that phonon-vlc is at least 0.4")
endif()

macro_optional_find_package(Echonest 2.0.0)
macro_log_feature(ECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest 2.0.0 is needed for dynamic playlists and the infosystem")
macro_optional_find_package(Echonest 2.0.2)
macro_log_feature(ECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest 2.0.2 is needed for dynamic playlists and the infosystem")

macro_optional_find_package(CLucene 0.9.23)
macro_log_feature(CLucene_FOUND "CLucene" "The open-source, C++ search engine" "http://clucene.sf.net" TRUE "" "CLucene is used for indexing the collection")
Expand All @@ -121,8 +202,8 @@ macro_log_feature(TAGLIB_FOUND "TagLib" "Audio Meta-Data Library" "http://develo
include( CheckTagLibFileName )
check_taglib_filename( COMPLEX_TAGLIB_FILENAME )

macro_optional_find_package(Boost)
macro_log_feature(Boost_FOUND "Boost" "Provides free peer-reviewed portable C++ source libraries" "http://www.boost.org" TRUE "" "") #FIXME: give useful explaination
find_package(Boost REQUIRED)
macro_log_feature(Boost_FOUND "Boost" "Provides free peer-reviewed portable C++ source libraries" "http://www.boost.org" TRUE "" "") #FIXME: give useful explanation

macro_optional_find_package(QCA2)
macro_log_feature(QCA2_FOUND "QCA2" "Provides encryption and signing functions required for Grooveshark resolver" "http://delta.affinix.com/qca/" TRUE "" "")
Expand All @@ -135,18 +216,36 @@ macro_log_feature(QuaZip_FOUND "QuaZip" "Provides support for extracting downloa

macro_optional_find_package(Jreen 1.0.5)
macro_log_feature(JREEN_FOUND "Jreen" "Qt XMPP Library" "http://qutim.org/jreen / https://github.com/euroelessar/jreen" FALSE "" "Jreen is needed for the Jabber SIP plugin.\n")
if(PC_JREEN_VERSION STREQUAL "1.1.0")
message(FATAL_ERROR "Jreen 1.1.0 has a very annoying bug that breaks accepting auth requests in Tomahawk. Please upgrade to 1.1.1 or downgrade to 1.0.5.")
endif()

macro_optional_find_package(QTweetLib)
macro_log_feature(QTWEETLIB_FOUND "QTweetLib" "Qt Twitter Library" "https://github.com/minimoog/QTweetLib" FALSE "" "QTweetLib is needed for the Twitter SIP plugin.\n")

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")

# we need pthreads too
macro_optional_find_package(Threads)
macro_log_feature(THREADS_FOUND "Threads" "Threading Library" "" TRUE "" "Platform specific library for threading")

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 )

#TODO: support external qxt
set(QXTWEB_FOUND TRUE)
set(QXTWEB_LIBRARIES qxtweb-standalone)
set(QXTWEB_INCLUDE_DIRS ${THIRDPARTY_DIR}/qxt/qxtweb-standalone/qxtweb ${CMAKE_CURRENT_BINARY_DIR})

### libportfwd
set(LIBPORTFWD_INCLUDE_DIR ${THIRDPARTY_DIR}/libportfwd/include)
set(LIBPORTFWD_LIBRARY tomahawk_portfwd)
set(LIBPORTFWD_LIBRARIES ${LIBPORTFWD_LIBRARY})
add_subdirectory(${THIRDPARTY_DIR}/libportfwd)

#### submodules start
# automatically init submodules here, don't delete this code we may add submodules again

Expand All @@ -161,15 +260,7 @@ ENDIF( WIN32 )

#### submodules end

### libportfwd
SET( LIBPORTFWD_INCLUDE_DIR ${THIRDPARTY_DIR}/libportfwd/include )
SET( LIBPORTFWD_LIBRARY tomahawk_portfwd )
SET( LIBPORTFWD_LIBRARIES ${LIBPORTFWD_LIBRARY} )
ADD_SUBDIRECTORY( ${THIRDPARTY_DIR}/libportfwd )

# we need pthreads too
macro_optional_find_package(Threads)
macro_log_feature(THREADS_FOUND "Threads" "Threading Library" "" TRUE "" "Platform specific library for threading")

macro_optional_find_package(KDE4)
macro_optional_find_package(KDE4Installed)
Expand Down Expand Up @@ -216,3 +307,50 @@ ADD_SUBDIRECTORY( thirdparty )
ADD_SUBDIRECTORY( src )
ADD_SUBDIRECTORY( src/libtomahawk )
ADD_SUBDIRECTORY( admin )

if( BUILD_TESTS )
enable_testing()
add_subdirectory( tests )
endif()


# Add all targets to the build-tree export set
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Tomahawk" CACHE PATH "Installation directory for CMake files")
set(CMAKE_INSTALL_FULL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}")
export(TARGETS tomahawklib tomahawk_portfwd
FILE "${PROJECT_BINARY_DIR}/TomahawkLibraryDepends.cmake")

# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE Tomahawk)

# Create a TomahawkBuildTreeSettings.cmake file for the use from the build tree
configure_file(TomahawkBuildTreeSettings.cmake.in "${PROJECT_BINARY_DIR}/TomahawkBuildTreeSettings.cmake" @ONLY)

# Create the TomahawkConfig.cmake and TomahawkConfigVersion files
file(RELATIVE_PATH CONF_REL_INCLUDE_DIR "${CMAKE_INSTALL_FULL_CMAKEDIR}" "${CMAKE_INSTALL_FULL_INCLUDEDIR}")

configure_file(TomahawkConfig.cmake.in "${PROJECT_BINARY_DIR}/TomahawkConfig.cmake" @ONLY)
configure_file(TomahawkConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/TomahawkConfigVersion.cmake" @ONLY)
file(COPY TomahawkUse.cmake DESTINATION "${PROJECT_BINARY_DIR}")
file(COPY TomahawkAddPlugin.cmake DESTINATION "${PROJECT_BINARY_DIR}")


# Install the cmake files
install(
FILES
"${PROJECT_BINARY_DIR}/TomahawkConfig.cmake"
"${PROJECT_BINARY_DIR}/TomahawkConfigVersion.cmake"
"${PROJECT_BINARY_DIR}/TomahawkUse.cmake"
"${PROJECT_BINARY_DIR}/TomahawkAddPlugin.cmake"
DESTINATION
"${CMAKE_INSTALL_CMAKEDIR}"
)

# Install the export set for use with the install-tree
install(
EXPORT
TomahawkLibraryDepends
DESTINATION
"${CMAKE_INSTALL_CMAKEDIR}"
)
5 changes: 0 additions & 5 deletions CMakeModules/FindLibLastFm.cmake
Expand Up @@ -7,11 +7,6 @@
# (c) Dominik Schmidt <dev@dominik-schmidt.de>
#

# Dependencies
if(NOT QT4_FOUND)
find_package(Qt4 REQUIRED)
endif()

# Include dir
find_path(LIBLASTFM_INCLUDE_DIR
# Track.h doesn't exist in liblastfm-0.3.1, was called Track back then
Expand Down
35 changes: 7 additions & 28 deletions CMakeModules/FindQJSON.cmake
Expand Up @@ -6,45 +6,24 @@
# QJSON_INCLUDE_DIR - the include path of the qjson library
#

if (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)

# Already in cache
set (QJSON_FOUND TRUE)

else (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)

if (NOT WIN32)
# use pkg-config to get the values of QJSON_INCLUDE_DIRS
# and QJSON_LIBRARY_DIRS to add as hints to the find commands.
include (FindPkgConfig)
pkg_check_modules (QJSON REQUIRED QJson>=0.5)
endif (NOT WIN32)

find_library (QJSON_LIBRARIES
find_library (QJSON_LIBRARIES
NAMES
qjson
PATHS
${QJSON_LIBRARY_DIRS}
${LIB_INSTALL_DIR}
${KDE4_LIB_DIR}
)
)

find_path (QJSON_INCLUDE_DIR
find_path (QJSON_INCLUDE_DIR
NAMES
parser.h
PATH_SUFFIXES
qjson
qjson/parser.h
PATHS
${QJSON_INCLUDE_DIRS}
${INCLUDE_INSTALL_DIR}
${KDE4_INCLUDE_DIR}
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QJSON DEFAULT_MSG QJSON_LIBRARIES QJSON_INCLUDE_DIR)
)

if ( UNIX AND NOT APPLE )
set ( QJSON_LIBRARIES "${QJSON_LIBRARIES} ${QJSON_LDFLAGS}" CACHE INTERNAL "")
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QJSON DEFAULT_MSG QJSON_LIBRARIES QJSON_INCLUDE_DIR)

endif (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)
3 changes: 0 additions & 3 deletions CMakeModules/FindQTweetLib.cmake
Expand Up @@ -7,9 +7,6 @@
# (c) Dominik Schmidt <dev@dominik-schmidt.de>
#

# Dependencies
find_package(Qt4 REQUIRED)

# Include dir
find_path(QTWEETLIB_INCLUDE_DIR
NAMES QTweetLib/qtweetlib_global.h
Expand Down
7 changes: 3 additions & 4 deletions CMakeModules/FindQuaZip.cmake
@@ -1,11 +1,10 @@
find_package(Qt4)
find_path(QuaZip_INCLUDE_DIR quazip.h ${CMAKE_INSTALL_PREFIX}/include/quazip ${CMAKE_INSTALL_PREFIX}/include /usr/include/quazip /usr/local/include/quazip ${QT_INCLUDE_DIR}/quazip ${QT_INCLUDE_DIR} ${QUAZIP_DIR}/include/quazip ${QUAZIP_DIR}/quazip ${QUAZIP_DIR}/include)
find_path(QuaZip_INCLUDE_DIR quazip/quazip.h ${CMAKE_INSTALL_PREFIX}/include/quazip ${CMAKE_INSTALL_PREFIX}/include /usr/include/quazip /usr/local/include/quazip ${QT_INCLUDE_DIR}/quazip ${QT_INCLUDE_DIR} ${QUAZIP_DIR}/include/quazip ${QUAZIP_DIR}/quazip ${QUAZIP_DIR}/include)
find_library(QuaZip_LIBRARY NAMES quazip PATHS ${CMAKE_INSTALL_PREFIX}/lib64 ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/Library/Frameworks ${QUAZIP_DIR}/lib64 ${QUAZIP_DIR}/lib ${QUAZIP_DIR}/quazip ${QUAZIP_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(quazip DEFAULT_MSG QuaZip_LIBRARY QuaZip_INCLUDE_DIR)
set(QuaZip_LIBRARIES ${QuaZip_LIBRARY})
mark_as_advanced(QuaZip_LIBRARY QuaZip_INCLUDE_DIR)

if(QuaZip_LIBRARY AND QuaZip_INCLUDE_DIR)
set(QuaZip_FOUND TRUE)
if(QuaZip_LIBRARY AND QuaZip_INCLUDE_DIR)
set(QuaZip_FOUND TRUE)
endif()

0 comments on commit 7645862

Please sign in to comment.