diff --git a/CMakeLists.txt b/CMakeLists.txt index bfbcc5c2f..ce1962154 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -353,7 +353,7 @@ endif() macro_log_feature(LIBATTICA_FOUND "libattica" "Provides support for installation of resolvers from the Tomahawk website" "http://download.kde.org/stable/attica/" TRUE "" "") macro_optional_find_package(QuaZip) -macro_log_feature(QuaZip_FOUND "QuaZip" "Provides support for extracting downloaded resolvers automatically." "http://quazip.sourceforge.net/" TRUE "" "") +macro_log_feature(QUAZIP_FOUND "QuaZip" "Provides support for extracting downloaded resolvers automatically." "http://quazip.sourceforge.net/" TRUE "" "") 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") diff --git a/CMakeModules/FindEchonest.cmake b/CMakeModules/FindEchonest.cmake index 2a3625ef5..145937239 100644 --- a/CMakeModules/FindEchonest.cmake +++ b/CMakeModules/FindEchonest.cmake @@ -13,7 +13,7 @@ endif() PKG_CHECK_MODULES(PC_ECHONEST QUIET libechonest${LIBECHONEST_SUFFIX}) -FIND_PATH(ECHONEST_INCLUDE_DIR NAMES echonest/Track.h +FIND_PATH(ECHONEST_INCLUDE_DIR NAMES echonest${LIBECHONEST_SUFFIX}/Track.h HINTS ${PC_ECHONEST_INCLUDEDIR} ${PC_ECHONEST_INCLUDE_DIRS} diff --git a/CMakeModules/FindLibLastFm.cmake b/CMakeModules/FindLibLastFm.cmake index 545e39f9b..a3488350e 100644 --- a/CMakeModules/FindLibLastFm.cmake +++ b/CMakeModules/FindLibLastFm.cmake @@ -14,7 +14,7 @@ endif() # Include dir find_path(LIBLASTFM_INCLUDE_DIR # Track.h doesn't exist in liblastfm-0.3.1, was called Track back then - NAMES lastfm/Track.h + NAMES lastfm${LASTFM_LIB_SUFFIX}/Track.h PATHS ${KDE4_INCLUDE_DIR} ) diff --git a/CMakeModules/FindQuaZip.cmake b/CMakeModules/FindQuaZip.cmake index 5c9de0077..7e628fcd4 100644 --- a/CMakeModules/FindQuaZip.cmake +++ b/CMakeModules/FindQuaZip.cmake @@ -1,10 +1,43 @@ -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) -endif() +# QUAZIP_FOUND - QuaZip library was found +# QUAZIP_INCLUDE_DIR - Path to QuaZip include dir +# QUAZIP_INCLUDE_DIRS - Path to QuaZip and zlib include dir (combined from QUAZIP_INCLUDE_DIR + ZLIB_INCLUDE_DIR) +# QUAZIP_LIBRARIES - List of QuaZip libraries +# QUAZIP_ZLIB_INCLUDE_DIR - The include dir of zlib headers + + +IF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) + # in cache already + SET(QUAZIP_FOUND TRUE) +ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) + IF (Qt5Core_FOUND) + set(QUAZIP_LIB_VERSION_SUFFIX 5) + ENDIF() + IF (WIN32) + FIND_PATH(QUAZIP_LIBRARY_DIR + WIN32_DEBUG_POSTFIX d + NAMES libquazip${QUAZIP_LIB_VERSION_SUFFIX}.dll + HINTS "C:/Programme/" "C:/Program Files" + PATH_SUFFIXES QuaZip/lib + ) + FIND_LIBRARY(QUAZIP_LIBRARIES NAMES libquazip${QUAZIP_LIB_VERSION_SUFFIX}.dll HINTS ${QUAZIP_LIBRARY_DIR}) + FIND_PATH(QUAZIP_INCLUDE_DIR NAMES quazip.h HINTS ${QUAZIP_LIBRARY_DIR}/../ PATH_SUFFIXES include/quazip${QUAZIP_LIB_VERSION_SUFFIX}) + FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR NAMES zlib.h) + ELSE(WIN32) + FIND_PACKAGE(PkgConfig) +# pkg_check_modules(PC_QCA2 QUIET qca2) + pkg_check_modules(PC_QUAZIP quazip) + FIND_LIBRARY(QUAZIP_LIBRARIES + WIN32_DEBUG_POSTFIX d + NAMES quazip${QUAZIP_LIB_VERSION_SUFFIX} + HINTS /usr/lib /usr/lib64 + ) + FIND_PATH(QUAZIP_INCLUDE_DIR quazip.h + HINTS /usr/include /usr/local/include + PATH_SUFFIXES quazip${QUAZIP_LIB_VERSION_SUFFIX} + ) + FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR zlib.h HINTS /usr/include /usr/local/include) + ENDIF (WIN32) + INCLUDE(FindPackageHandleStandardArgs) + SET(QUAZIP_INCLUDE_DIRS ${QUAZIP_INCLUDE_DIR} ${QUAZIP_ZLIB_INCLUDE_DIR}) + find_package_handle_standard_args(QUAZIP DEFAULT_MSG QUAZIP_LIBRARIES QUAZIP_INCLUDE_DIR QUAZIP_ZLIB_INCLUDE_DIR QUAZIP_INCLUDE_DIRS) +ENDIF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) diff --git a/CMakeModules/NSIS.template.in b/CMakeModules/NSIS.template.in index eedb6e210..a22cb868c 100644 --- a/CMakeModules/NSIS.template.in +++ b/CMakeModules/NSIS.template.in @@ -375,7 +375,7 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER File "${MING_BIN}\libechonest5.dll" File "${MING_BIN}\liblastfm5.dll" - File "${MING_BIN}\libquazip.dll" + File "${MING_BIN}\libquazip5.dll" File "${MING_BIN}\libqt5keychain.dll" ; GnuTLS diff --git a/src/infoplugins/generic/echonest/EchonestPlugin.cpp b/src/infoplugins/generic/echonest/EchonestPlugin.cpp index 92e8c110b..a17c4a42b 100644 --- a/src/infoplugins/generic/echonest/EchonestPlugin.cpp +++ b/src/infoplugins/generic/echonest/EchonestPlugin.cpp @@ -23,7 +23,11 @@ #include "utils/Logger.h" #include "utils/NetworkAccessManager.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else #include +#endif #include diff --git a/src/infoplugins/generic/echonest/EchonestPlugin.h b/src/infoplugins/generic/echonest/EchonestPlugin.h index 7388b3884..40edd0c24 100644 --- a/src/infoplugins/generic/echonest/EchonestPlugin.h +++ b/src/infoplugins/generic/echonest/EchonestPlugin.h @@ -25,7 +25,11 @@ #include "infosystem/InfoSystem.h" #include "infosystem/InfoSystemWorker.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else #include +#endif #include diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index 5d5ddfaa0..17d849f14 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -421,7 +421,7 @@ include_directories( IF(LIBATTICA_FOUND) SET( libGuiSources ${libGuiSources} AtticaManager.cpp ) INCLUDE_DIRECTORIES( ${LIBATTICA_INCLUDE_DIR} ) - LIST(APPEND PRIVATE_LINK_LIBRARIES ${LIBATTICA_LIBRARIES} ${LibAttica_LIBRARIES} ${QuaZip_LIBRARIES} ) + LIST(APPEND PRIVATE_LINK_LIBRARIES ${LIBATTICA_LIBRARIES} ${LibAttica_LIBRARIES} ${QUAZIP_LIBRARIES} ) IF( TOMAHAWK_QT5 ) LIST(APPEND LINK_LIBRARIES KF5::Attica ) ENDIF( TOMAHAWK_QT5 ) diff --git a/src/libtomahawk/EchonestCatalogSynchronizer.cpp b/src/libtomahawk/EchonestCatalogSynchronizer.cpp index cb70ed8cc..5d030c75c 100644 --- a/src/libtomahawk/EchonestCatalogSynchronizer.cpp +++ b/src/libtomahawk/EchonestCatalogSynchronizer.cpp @@ -33,8 +33,13 @@ #include "TomahawkSettings.h" #include "Track.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#include +#else #include #include +#endif using namespace Tomahawk; diff --git a/src/libtomahawk/EchonestCatalogSynchronizer.h b/src/libtomahawk/EchonestCatalogSynchronizer.h index 50d7cc287..0e7a5ac11 100644 --- a/src/libtomahawk/EchonestCatalogSynchronizer.h +++ b/src/libtomahawk/EchonestCatalogSynchronizer.h @@ -22,7 +22,11 @@ #include "DllMacro.h" #include "Query.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else #include +#endif #include #include diff --git a/src/libtomahawk/GlobalActionManager.cpp b/src/libtomahawk/GlobalActionManager.cpp index 318b85887..a9fe87fac 100644 --- a/src/libtomahawk/GlobalActionManager.cpp +++ b/src/libtomahawk/GlobalActionManager.cpp @@ -47,11 +47,16 @@ #include "TomahawkSettings.h" #include "ViewManager.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else #include +#endif #include #include + GlobalActionManager* GlobalActionManager::s_instance = 0; using namespace Tomahawk; diff --git a/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp b/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp index 098e460c6..85b747be8 100644 --- a/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp +++ b/src/libtomahawk/accounts/lastfm/LastFmConfig.cpp @@ -29,10 +29,17 @@ #include "utils/Closure.h" #include "utils/NetworkAccessManager.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#include +#include +#include +#else #include #include #include #include +#endif using namespace Tomahawk::Accounts; diff --git a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp index 4a7cdb09d..3ca1d6af4 100644 --- a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp +++ b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.cpp @@ -34,8 +34,13 @@ #include "TomahawkSettings.h" #include "utils/NetworkAccessManager.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#include +#else #include #include +#endif using namespace Tomahawk::Accounts; using namespace Tomahawk::InfoSystem; diff --git a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h index 6e202b216..0eb3b0749 100644 --- a/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h +++ b/src/libtomahawk/accounts/lastfm/LastFmInfoPlugin.h @@ -24,9 +24,15 @@ #include "infosystem/InfoSystemWorker.h" #include "DllMacro.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#include +#include +#else #include #include #include +#endif #include diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h b/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h index b12108e54..5704f35f6 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestControl.h @@ -24,7 +24,11 @@ #include #include +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else #include +#endif namespace Tomahawk { diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h b/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h index 5ed250c51..adb6e6c3b 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestGenerator.h @@ -28,7 +28,12 @@ #include "DllMacro.h" + +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else #include +#endif namespace Tomahawk { diff --git a/src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp b/src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp index d7e2040de..960aadb36 100644 --- a/src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp +++ b/src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp @@ -24,7 +24,11 @@ #include "utils/TomahawkUtils.h" #include "utils/Logger.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else #include +#endif #include #include diff --git a/src/libtomahawk/utils/TomaHkLinkGeneratorPlugin.cpp b/src/libtomahawk/utils/TomaHkLinkGeneratorPlugin.cpp index 9724c2b84..caa7f1108 100644 --- a/src/libtomahawk/utils/TomaHkLinkGeneratorPlugin.cpp +++ b/src/libtomahawk/utils/TomaHkLinkGeneratorPlugin.cpp @@ -30,6 +30,12 @@ #include "../resolvers/SyncScriptJob.h" #include "../utils/Logger.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else +#include +#endif + QString Tomahawk::Utils::TomaHkLinkGeneratorPlugin::hostname() const { diff --git a/src/libtomahawk/utils/TomaHkLinkGeneratorPlugin.h b/src/libtomahawk/utils/TomaHkLinkGeneratorPlugin.h index 76219012a..316761cee 100644 --- a/src/libtomahawk/utils/TomaHkLinkGeneratorPlugin.h +++ b/src/libtomahawk/utils/TomaHkLinkGeneratorPlugin.h @@ -25,8 +25,6 @@ #include "../DllMacro.h" #include "../Typedefs.h" -#include - namespace Tomahawk { class ScriptJob; diff --git a/src/libtomahawk/utils/TomahawkUtils.cpp b/src/libtomahawk/utils/TomahawkUtils.cpp index 048286108..a1d5e3876 100644 --- a/src/libtomahawk/utils/TomahawkUtils.cpp +++ b/src/libtomahawk/utils/TomahawkUtils.cpp @@ -32,12 +32,20 @@ #include "Track.h" #ifdef LIBLASTFM_FOUND + #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + #include + #else #include + #endif #endif +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#include +#else #include #include - +#endif // We need this for the version info (if available) #include diff --git a/src/tomahawk/Scrobbler.h b/src/tomahawk/Scrobbler.h index fab0ca691..01c26959c 100644 --- a/src/tomahawk/Scrobbler.h +++ b/src/tomahawk/Scrobbler.h @@ -20,10 +20,15 @@ #ifndef TOMAHAWK_SCROBBLER_H #define TOMAHAWK_SCROBBLER_H -#include "lastfm/ScrobblePoint.h" #include "Result.h" #include "infosystem/InfoSystem.h" + +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else +#include +#endif #include /** diff --git a/src/tomahawk/TomahawkApp.h b/src/tomahawk/TomahawkApp.h index c161d07e5..953140bd4 100644 --- a/src/tomahawk/TomahawkApp.h +++ b/src/tomahawk/TomahawkApp.h @@ -64,7 +64,11 @@ namespace Tomahawk } #ifdef LIBLASTFM_FOUND + #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + #include + #else #include + #endif #include "Scrobbler.h" #endif diff --git a/src/tomahawk/sourcetree/items/CategoryItems.cpp b/src/tomahawk/sourcetree/items/CategoryItems.cpp index 425591f03..c830ff9c6 100644 --- a/src/tomahawk/sourcetree/items/CategoryItems.cpp +++ b/src/tomahawk/sourcetree/items/CategoryItems.cpp @@ -33,7 +33,11 @@ #include "utils/ImageRegistry.h" #include "utils/Logger.h" +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else #include +#endif using namespace Tomahawk;