2010-02-28 18:28:56 +01:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
2012-08-28 20:19:29 +02:00
|
|
|
cmake_policy(SET CMP0011 OLD)
|
2010-02-28 18:28:56 +01:00
|
|
|
|
2010-08-28 19:25:54 +02:00
|
|
|
include(CheckCXXCompilerFlag)
|
2010-02-28 18:28:56 +01:00
|
|
|
include(FindPkgConfig)
|
2014-09-26 12:33:02 +02:00
|
|
|
include(cmake/C++11Compat.cmake)
|
2010-08-31 20:23:23 +02:00
|
|
|
include(cmake/Summary.cmake)
|
2010-06-09 00:39:31 +02:00
|
|
|
include(cmake/Version.cmake)
|
2010-09-05 00:33:31 +02:00
|
|
|
include(cmake/Deb.cmake)
|
2010-09-04 20:55:29 +02:00
|
|
|
include(cmake/Rpm.cmake)
|
2011-04-29 21:44:51 +02:00
|
|
|
include(cmake/SpotifyVersion.cmake)
|
2011-10-29 19:37:30 +02:00
|
|
|
include(cmake/OptionalSource.cmake)
|
2014-02-11 15:18:52 +01:00
|
|
|
include(cmake/Format.cmake)
|
2012-05-27 18:28:07 +02:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
2010-02-28 18:28:56 +01:00
|
|
|
|
2012-11-20 15:13:05 +01:00
|
|
|
if (CMAKE_CXX_COMPILER MATCHES ".*clang")
|
|
|
|
set(CMAKE_COMPILER_IS_CLANGXX 1)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-uninitialized")
|
|
|
|
endif ()
|
|
|
|
|
2014-01-27 16:32:02 +01:00
|
|
|
if (APPLE)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --stdlib=libc++")
|
|
|
|
endif ()
|
2012-11-26 15:36:05 +01:00
|
|
|
|
2014-08-05 22:16:41 +02:00
|
|
|
find_program(CCACHE_EXECUTABLE NAMES ccache)
|
|
|
|
if (CCACHE_EXECUTABLE)
|
2014-08-06 20:05:41 +02:00
|
|
|
message(STATUS "ccache found: will be used for compilation and linkage")
|
2014-08-05 22:16:41 +02:00
|
|
|
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_EXECUTABLE})
|
|
|
|
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_EXECUTABLE})
|
|
|
|
endif ()
|
|
|
|
|
2011-02-04 13:07:00 +01:00
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
set(LINUX 1)
|
|
|
|
endif (UNIX AND NOT APPLE)
|
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
set(QT_MIN_VERSION 5.0.0)
|
|
|
|
|
|
|
|
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core OpenGL Sql Network Xml Widgets Concurrent)
|
|
|
|
find_package(X11)
|
|
|
|
if(X11_FOUND)
|
|
|
|
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
|
|
|
|
endif()
|
|
|
|
|
2010-12-14 18:07:41 +01:00
|
|
|
|
|
|
|
if(NOT APPLE)
|
2015-04-11 22:49:34 +02:00
|
|
|
find_package(Qt5 COMPONENTS WebKitWidgets)
|
2010-12-14 18:07:41 +01:00
|
|
|
endif(NOT APPLE)
|
2010-02-28 18:28:56 +01:00
|
|
|
|
2010-04-21 13:03:30 +02:00
|
|
|
# Find Qt's lconvert binary. Try qt's binary dir first, fall back to looking in PATH
|
2015-04-11 22:49:34 +02:00
|
|
|
find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert lconvert-qt5 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH)
|
|
|
|
find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert lconvert-qt5)
|
2010-04-21 13:03:30 +02:00
|
|
|
|
2010-04-19 11:42:30 +02:00
|
|
|
if(APPLE)
|
|
|
|
if(NOT QT_MAC_USE_COCOA)
|
|
|
|
message(FATAL_ERROR "Cocoa support is required")
|
|
|
|
endif(NOT QT_MAC_USE_COCOA)
|
|
|
|
endif(APPLE)
|
|
|
|
|
2010-02-28 18:28:56 +01:00
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
find_package(Boost REQUIRED)
|
2010-04-06 21:18:14 +02:00
|
|
|
find_package(Gettext REQUIRED)
|
2010-11-21 16:13:26 +01:00
|
|
|
find_package(PkgConfig REQUIRED)
|
2012-01-02 18:21:07 +01:00
|
|
|
find_package(Protobuf REQUIRED)
|
2012-05-27 18:28:07 +02:00
|
|
|
find_package(FFTW3)
|
2010-02-28 18:28:56 +01:00
|
|
|
|
2013-04-15 13:23:56 +02:00
|
|
|
pkg_check_modules(CDIO libcdio)
|
|
|
|
pkg_check_modules(CHROMAPRINT libchromaprint)
|
|
|
|
pkg_check_modules(GIO gio-2.0)
|
|
|
|
pkg_check_modules(GLIB glib-2.0)
|
|
|
|
pkg_check_modules(GOBJECT gobject-2.0)
|
2014-09-21 11:35:21 +02:00
|
|
|
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
|
|
|
|
pkg_check_modules(GSTREAMER_APP REQUIRED gstreamer-app-1.0)
|
|
|
|
pkg_check_modules(GSTREAMER_AUDIO REQUIRED gstreamer-audio-1.0)
|
|
|
|
pkg_check_modules(GSTREAMER_BASE REQUIRED gstreamer-base-1.0)
|
|
|
|
pkg_check_modules(GSTREAMER_TAG REQUIRED gstreamer-tag-1.0)
|
2013-04-15 13:23:56 +02:00
|
|
|
pkg_check_modules(LIBGPOD libgpod-1.0>=0.7.92)
|
|
|
|
pkg_check_modules(LIBMTP libmtp>=1.0)
|
2015-04-11 22:49:34 +02:00
|
|
|
pkg_check_modules(LIBMYGPO_QT5 libmygpo-qt5>=1.0.7)
|
2014-03-29 09:17:34 +01:00
|
|
|
pkg_check_modules(LIBPULSE libpulse)
|
2013-04-15 13:23:56 +02:00
|
|
|
pkg_check_modules(LIBXML libxml-2.0)
|
2015-04-11 22:49:34 +02:00
|
|
|
pkg_check_modules(QCA_QT5 qca2-qt5)
|
2013-04-15 13:23:56 +02:00
|
|
|
pkg_check_modules(SPOTIFY libspotify>=12.1.45)
|
|
|
|
pkg_check_modules(TAGLIB REQUIRED taglib>=1.6)
|
2010-08-14 20:56:05 +02:00
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
find_package(ZLIB REQUIRED)
|
2010-12-30 17:20:33 +01:00
|
|
|
find_library(QTSPARKLE_LIBRARIES qtsparkle)
|
2010-08-14 20:56:05 +02:00
|
|
|
endif (WIN32)
|
2010-02-28 18:28:56 +01:00
|
|
|
|
2010-06-06 23:08:52 +02:00
|
|
|
find_library(LASTFM_LIBRARIES lastfm)
|
2010-02-28 18:28:56 +01:00
|
|
|
find_path(LASTFM_INCLUDE_DIRS lastfm/ws.h)
|
2012-06-28 18:41:51 +02:00
|
|
|
find_path(LASTFM1_INCLUDE_DIRS lastfm/Track.h)
|
|
|
|
|
2012-07-26 22:23:08 +02:00
|
|
|
find_path(SPARSEHASH_INCLUDE_DIRS google/sparsetable)
|
|
|
|
|
2012-10-28 02:25:27 +02:00
|
|
|
# Google Drive support needs Taglib 1.8, but this version isn't in old Ubuntu
|
|
|
|
# distros. If the user seems to want Drive support (ie. they have sparsehash
|
|
|
|
# installed and haven't disabled drive), and has an old taglib, compile our
|
|
|
|
# internal one and use that instead.
|
2014-01-24 14:05:14 +01:00
|
|
|
option(USE_BUILTIN_TAGLIB "If the system's version of Taglib is too old, compile our builtin version instead" ON)
|
|
|
|
if (USE_BUILTIN_TAGLIB AND TAGLIB_VERSION VERSION_LESS 1.8)
|
|
|
|
message(STATUS "Using builtin taglib because your system's version is too old")
|
2013-12-17 19:38:05 +01:00
|
|
|
set(TAGLIB_VERSION 1.9.1)
|
2012-10-28 02:25:27 +02:00
|
|
|
set(TAGLIB_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/3rdparty/taglib/headers/taglib/;${CMAKE_BINARY_DIR}/3rdparty/taglib/headers/")
|
2012-10-28 02:12:18 +02:00
|
|
|
set(TAGLIB_LIBRARY_DIRS "")
|
|
|
|
set(TAGLIB_LIBRARIES tag)
|
2013-08-18 04:39:33 +02:00
|
|
|
set(TAGLIB_HAS_OPUS ON)
|
2012-10-28 02:12:18 +02:00
|
|
|
add_subdirectory(3rdparty/taglib)
|
2013-08-18 04:39:33 +02:00
|
|
|
else()
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${TAGLIB_INCLUDE_DIRS}")
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES "${TAGLIB_LIBRARIES}")
|
|
|
|
check_cxx_source_compiles("#include <opusfile.h>
|
|
|
|
int main() { char *s; TagLib::Ogg::Opus::File opusfile(s); return 0;}" TAGLIB_HAS_OPUS)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES)
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES)
|
2012-10-28 02:12:18 +02:00
|
|
|
endif()
|
|
|
|
|
2012-06-28 18:41:51 +02:00
|
|
|
if(LASTFM_INCLUDE_DIRS AND LASTFM1_INCLUDE_DIRS)
|
|
|
|
set(HAVE_LIBLASTFM1 ON)
|
|
|
|
endif()
|
2010-02-28 18:28:56 +01:00
|
|
|
|
2010-03-01 13:13:11 +01:00
|
|
|
if (APPLE)
|
2010-04-15 17:23:12 +02:00
|
|
|
find_library(SPARKLE Sparkle)
|
2011-04-25 21:16:26 +02:00
|
|
|
|
2011-04-27 00:20:11 +02:00
|
|
|
find_library(SPOTIFY libspotify)
|
|
|
|
if (SPOTIFY)
|
|
|
|
set (SPOTIFY_FOUND ON)
|
|
|
|
set (SPOTIFY_INCLUDE_DIRS ${SPOTIFY})
|
|
|
|
set (SPOTIFY_LIBRARIES ${SPOTIFY})
|
|
|
|
endif (SPOTIFY)
|
|
|
|
|
2011-05-30 12:09:34 +02:00
|
|
|
add_subdirectory(3rdparty/SPMediaKeyTap)
|
|
|
|
set(SPMEDIAKEYTAP_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/SPMediaKeyTap)
|
2012-09-25 18:53:53 +02:00
|
|
|
set(SPMEDIAKEYTAP_LIBRARIES SPMediaKeyTap)
|
2010-03-01 13:13:11 +01:00
|
|
|
endif (APPLE)
|
|
|
|
|
2010-11-03 22:11:43 +01:00
|
|
|
find_package(Threads)
|
|
|
|
|
2010-02-28 18:28:56 +01:00
|
|
|
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
|
|
|
|
add_definitions(-DNDEBUG)
|
|
|
|
add_definitions(-DQT_NO_DEBUG_OUTPUT)
|
|
|
|
endif(${CMAKE_BUILD_TYPE} MATCHES "Release")
|
|
|
|
|
|
|
|
# Set up definitions and paths
|
|
|
|
add_definitions(${QT_DEFINITIONS})
|
|
|
|
link_directories(${TAGLIB_LIBRARY_DIRS})
|
2010-04-06 18:57:02 +02:00
|
|
|
link_directories(${GSTREAMER_LIBRARY_DIRS})
|
2010-02-28 18:28:56 +01:00
|
|
|
|
2010-12-26 14:01:35 +01:00
|
|
|
# Don't try to use webkit if their include directories couldn't be found.
|
2010-09-26 17:10:08 +02:00
|
|
|
if (NOT QT_QTWEBKIT_INCLUDE_DIR)
|
|
|
|
set (QT_USE_QTWEBKIT 0)
|
|
|
|
endif (NOT QT_QTWEBKIT_INCLUDE_DIR)
|
2010-04-30 13:27:27 +02:00
|
|
|
|
2010-02-28 18:28:56 +01:00
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
include_directories(${TAGLIB_INCLUDE_DIRS})
|
2010-04-06 18:57:02 +02:00
|
|
|
include_directories(${GSTREAMER_INCLUDE_DIRS})
|
2013-12-31 19:15:15 +01:00
|
|
|
include_directories(${GSTREAMER_APP_INCLUDE_DIRS})
|
2014-09-21 11:35:21 +02:00
|
|
|
include_directories(${GSTREAMER_AUDIO_INCLUDE_DIRS})
|
2013-12-31 19:15:15 +01:00
|
|
|
include_directories(${GSTREAMER_BASE_INCLUDE_DIRS})
|
|
|
|
include_directories(${GSTREAMER_TAG_INCLUDE_DIRS})
|
2010-04-06 18:57:02 +02:00
|
|
|
include_directories(${GLIB_INCLUDE_DIRS})
|
|
|
|
include_directories(${GLIBCONFIG_INCLUDE_DIRS})
|
|
|
|
include_directories(${LIBXML_INCLUDE_DIRS})
|
2010-02-28 18:28:56 +01:00
|
|
|
|
2010-03-02 23:02:43 +01:00
|
|
|
if (WIN32)
|
|
|
|
# RC compiler
|
|
|
|
string(REPLACE "gcc" "windres" CMAKE_RC_COMPILER_INIT ${CMAKE_C_COMPILER})
|
2010-03-04 17:50:27 +01:00
|
|
|
enable_language(RC)
|
2012-01-15 18:19:02 +01:00
|
|
|
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -o <OBJECT> <SOURCE> -I ${CMAKE_SOURCE_DIR}/dist/windows")
|
2010-03-02 23:02:43 +01:00
|
|
|
endif(WIN32)
|
|
|
|
|
2011-06-20 17:08:06 +02:00
|
|
|
add_definitions(-DQT_NO_CAST_TO_ASCII -DQT_STRICT_ITERATORS)
|
2010-03-25 23:37:00 +01:00
|
|
|
|
2010-04-06 21:18:14 +02:00
|
|
|
# Translations stuff
|
2011-07-27 21:54:05 +02:00
|
|
|
find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext PATHS /target/bin)
|
2010-05-07 15:10:21 +02:00
|
|
|
if(NOT GETTEXT_XGETTEXT_EXECUTABLE)
|
|
|
|
message(FATAL_ERROR "Could not find xgettext executable")
|
|
|
|
endif(NOT GETTEXT_XGETTEXT_EXECUTABLE)
|
2011-07-27 21:54:05 +02:00
|
|
|
find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge PATHS /target/bin)
|
|
|
|
if(NOT GETTEXT_MSGMERGE_EXECUTABLE)
|
|
|
|
message(FATAL_ERROR "Could not find msgmerge executable")
|
|
|
|
endif(NOT GETTEXT_MSGMERGE_EXECUTABLE)
|
|
|
|
find_program(GETTEXT_MSGFMT_EXECUTABLE msgfmt PATHS /target/bin)
|
|
|
|
if(NOT GETTEXT_MSGFMT_EXECUTABLE)
|
|
|
|
message(FATAL_ERROR "Could not find msgfmt executable")
|
|
|
|
endif(NOT GETTEXT_MSGFMT_EXECUTABLE)
|
2010-04-06 21:18:14 +02:00
|
|
|
|
2010-06-11 00:48:23 +02:00
|
|
|
# Optional bits
|
2011-04-24 19:02:26 +02:00
|
|
|
if(WIN32)
|
|
|
|
option(ENABLE_WIN32_CONSOLE "Show the windows console even outside Debug mode" OFF)
|
|
|
|
endif(WIN32)
|
|
|
|
|
2012-08-28 20:19:29 +02:00
|
|
|
optional_component(BREAKPAD OFF "Crash reporting")
|
2010-08-31 20:23:23 +02:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(GOOGLE_DRIVE OFF "Google Drive support"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "Google sparsehash" SPARSEHASH_INCLUDE_DIRS
|
2012-10-28 02:25:27 +02:00
|
|
|
DEPENDS "Taglib 1.8" "TAGLIB_VERSION VERSION_GREATER 1.7.999"
|
2012-08-28 20:19:29 +02:00
|
|
|
)
|
2010-08-31 20:23:23 +02:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(DROPBOX OFF "Dropbox support"
|
2012-11-28 16:51:19 +01:00
|
|
|
DEPENDS "Google sparsehash" SPARSEHASH_INCLUDE_DIRS
|
|
|
|
DEPENDS "Taglib 1.8" "TAGLIB_VERSION VERSION_GREATER 1.7.999"
|
|
|
|
)
|
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(SKYDRIVE OFF "Skydrive support"
|
2012-11-29 17:03:52 +01:00
|
|
|
DEPENDS "Google sparsehash" SPARSEHASH_INCLUDE_DIRS
|
|
|
|
DEPENDS "Taglib 1.8" "TAGLIB_VERSION VERSION_GREATER 1.7.999"
|
|
|
|
)
|
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(BOX OFF "Box support"
|
2012-12-12 18:34:15 +01:00
|
|
|
DEPENDS "Google sparsehash" SPARSEHASH_INCLUDE_DIRS
|
|
|
|
DEPENDS "Taglib 1.8" "TAGLIB_VERSION VERSION_GREATER 1.7.999"
|
|
|
|
)
|
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(VK OFF "Vk.com support")
|
2014-03-07 18:58:50 +01:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(SEAFILE OFF "Seafile support"
|
2013-02-12 13:54:19 +01:00
|
|
|
DEPENDS "Google sparsehash" SPARSEHASH_INCLUDE_DIRS
|
|
|
|
DEPENDS "Taglib 1.8" "TAGLIB_VERSION VERSION_GREATER 1.7.999"
|
|
|
|
)
|
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(AUDIOCD OFF "Devices: Audio CD support"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "libcdio" CDIO_FOUND
|
|
|
|
)
|
2011-08-10 17:23:32 +02:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(LIBGPOD OFF "Devices: iPod classic support"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "libgpod" LIBGPOD_FOUND
|
|
|
|
)
|
2010-08-31 20:23:23 +02:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(GIO OFF "Devices: GIO device backend"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "libgio" GIO_FOUND
|
|
|
|
DEPENDS "Linux or Windows" "NOT APPLE"
|
|
|
|
)
|
2010-08-31 20:23:23 +02:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(LIBMTP OFF "Devices: MTP support"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "libmtp" LIBMTP_FOUND
|
|
|
|
)
|
2010-12-19 16:10:26 +01:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(LIBLASTFM OFF "Last.fm support"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "liblastfm" LASTFM_LIBRARIES LASTFM_INCLUDE_DIRS
|
|
|
|
)
|
2011-03-23 22:53:24 +01:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(DBUS OFF "D-Bus support"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "Linux" LINUX
|
|
|
|
)
|
2011-04-29 21:44:51 +02:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(WIIMOTEDEV OFF "Wiimote support"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "D-Bus support" HAVE_DBUS
|
|
|
|
)
|
2011-11-05 16:31:29 +01:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(DEVICEKIT OFF "Devices: DeviceKit backend"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "D-Bus support" HAVE_DBUS
|
|
|
|
)
|
2011-11-05 16:31:29 +01:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(SPOTIFY_BLOB OFF "Spotify support: non-GPL binary helper"
|
2012-09-03 16:47:38 +02:00
|
|
|
DEPENDS "protobuf" PROTOBUF_FOUND PROTOBUF_PROTOC_EXECUTABLE
|
2012-09-03 17:35:43 +02:00
|
|
|
DEPENDS "libspotify" SPOTIFY_FOUND
|
|
|
|
)
|
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(MOODBAR OFF "Moodbar support"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "fftw3" FFTW3_FOUND
|
|
|
|
)
|
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(SPARKLE OFF "Sparkle integration"
|
2012-08-28 20:19:29 +02:00
|
|
|
DEPENDS "Mac OS X" APPLE
|
|
|
|
DEPENDS "Sparkle" SPARKLE
|
|
|
|
)
|
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(LIBPULSE OFF "Pulse audio integration"
|
2014-03-29 09:17:34 +01:00
|
|
|
DEPENDS "libpulse" LIBPULSE_FOUND
|
|
|
|
)
|
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
optional_component(VISUALISATIONS OFF "Visualisations")
|
2012-08-28 20:19:29 +02:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
if(NOT HAVE_SPOTIFY_BLOB AND NOT QCA_QT5_FOUND)
|
|
|
|
message(FATAL_ERROR "Either QCA-qt5 must be available or the non-GPL Spotify "
|
2013-09-17 17:09:56 +02:00
|
|
|
"code must be compiled in")
|
2015-04-11 22:49:34 +02:00
|
|
|
elseif(QCA_QT5_FOUND)
|
2013-09-17 17:09:56 +02:00
|
|
|
set(HAVE_SPOTIFY_DOWNLOADER ON)
|
|
|
|
endif()
|
2012-08-28 20:19:29 +02:00
|
|
|
|
|
|
|
# Find DBus if it's enabled
|
|
|
|
if (HAVE_DBUS)
|
2015-04-11 22:49:34 +02:00
|
|
|
find_package(Qt5 COMPONENTS DBus)
|
2012-08-28 20:19:29 +02:00
|
|
|
endif ()
|
2012-07-26 22:23:08 +02:00
|
|
|
|
2014-03-07 18:58:50 +01:00
|
|
|
if (HAVE_VK)
|
|
|
|
add_subdirectory(3rdparty/vreen)
|
|
|
|
include_directories(${VREEN_INCLUDE_DIRS})
|
|
|
|
include_directories(${VREENOAUTH_INCLUDE_DIRS})
|
|
|
|
endif(HAVE_VK)
|
|
|
|
|
2012-08-28 20:19:29 +02:00
|
|
|
# We can include the Qt definitions now
|
2015-04-11 22:49:34 +02:00
|
|
|
set(QT_LIBRARIES Qt5::Core Qt5::OpenGL Qt5::Sql Qt5::Network Qt5::Xml Qt5::Widgets Qt5::Concurrent Qt5::X11Extras)
|
2012-08-28 20:19:29 +02:00
|
|
|
|
|
|
|
# Remove GLU and GL from the link line - they're not really required
|
|
|
|
# and don't exist on my mingw toolchain
|
|
|
|
list(REMOVE_ITEM QT_LIBRARIES "-lGLU -lGL")
|
2011-04-25 21:16:26 +02:00
|
|
|
|
2012-12-24 09:29:24 +01:00
|
|
|
option(BUNDLE_PROJECTM_PRESETS "Install Clementine's own copies of libprojectm presets - disable this if you want to use a system package instead" ON)
|
|
|
|
|
2010-06-11 00:48:23 +02:00
|
|
|
if(ENABLE_VISUALISATIONS)
|
2010-07-10 22:21:06 +02:00
|
|
|
# When/if upstream accepts our patches then these options can be used to link
|
2010-07-10 22:33:28 +02:00
|
|
|
# to system installed projectM instead.
|
2010-07-10 22:21:06 +02:00
|
|
|
option(USE_SYSTEM_PROJECTM "Don't set this option unless your system projectM library has been compiled with the Clementine patches in 3rdparty" OFF)
|
|
|
|
if(USE_SYSTEM_PROJECTM)
|
2010-07-17 13:56:33 +02:00
|
|
|
pkg_check_modules(LIBPROJECTM libprojectM)
|
2010-07-10 22:21:06 +02:00
|
|
|
else(USE_SYSTEM_PROJECTM)
|
|
|
|
add_subdirectory(3rdparty/libprojectm)
|
|
|
|
set(LIBPROJECTM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libprojectm)
|
|
|
|
set(LIBPROJECTM_LIBRARIES projectM)
|
|
|
|
endif(USE_SYSTEM_PROJECTM)
|
2010-06-11 00:48:23 +02:00
|
|
|
endif(ENABLE_VISUALISATIONS)
|
|
|
|
|
2010-06-30 21:55:46 +02:00
|
|
|
|
2013-11-22 17:05:55 +01:00
|
|
|
# Build our copy of QSqlLiteDriver.
|
|
|
|
# We do this because we can't guarantee that the driver shipped with Qt exposes the
|
|
|
|
# raw sqlite3_ functions required for FTS support. This way we know that those symbols
|
|
|
|
# exist at compile-time and that our code links to the same sqlite library as the
|
|
|
|
# Qt driver.
|
|
|
|
add_subdirectory(3rdparty/qsqlite)
|
|
|
|
include_directories("3rdparty/qsqlite")
|
2010-06-30 21:55:46 +02:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
add_subdirectory(3rdparty/singleapplication)
|
|
|
|
set(SINGLEAPPLICATION_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/singleapplication)
|
|
|
|
set(SINGLEAPPLICATION_LIBRARIES singleapplication)
|
2010-07-10 22:33:28 +02:00
|
|
|
|
2010-07-11 14:02:30 +02:00
|
|
|
# QtIoCompressor isn't patched, so we can use a system version if it's
|
|
|
|
# available
|
|
|
|
find_path(QTIOCOMPRESSOR_INCLUDE_DIRS qtiocompressor.h PATH_SUFFIXES QtSolutions)
|
|
|
|
find_library(QTIOCOMPRESSOR_LIBRARIES QtSolutions_IOCompressor-2.3)
|
|
|
|
if(NOT QTIOCOMPRESSOR_INCLUDE_DIRS OR NOT QTIOCOMPRESSOR_LIBRARIES)
|
|
|
|
add_subdirectory(3rdparty/qtiocompressor)
|
|
|
|
set(QTIOCOMPRESSOR_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/qtiocompressor)
|
|
|
|
set(QTIOCOMPRESSOR_LIBRARIES qtiocompressor)
|
|
|
|
endif(NOT QTIOCOMPRESSOR_INCLUDE_DIRS OR NOT QTIOCOMPRESSOR_LIBRARIES)
|
2010-07-10 22:33:28 +02:00
|
|
|
|
2010-07-24 14:35:21 +02:00
|
|
|
# When/if upstream accepts our or reimplement our patches then these options can be
|
|
|
|
# used to link to system installed qxt instead.
|
|
|
|
option(USE_SYSTEM_QXT "Don't set this option unless your system Qxt library has been compiled with the Clementine patches in 3rdparty" OFF)
|
|
|
|
if (USE_SYSTEM_QXT)
|
|
|
|
find_path(QXTCORE_INCLUDE_DIRS qxtglobal.h PATH_SUFFIXES QxtCore)
|
|
|
|
find_path(QXTGUI_INCLUDE_DIRS qxtglobalshortcut.h PATH_SUFFIXES QxtGui)
|
|
|
|
set(QXT_INCLUDE_DIRS ${QXTCORE_INCLUDE_DIRS} ${QXTGUI_INCLUDE_DIRS})
|
|
|
|
# We only need its header. We don't need to link to QxtCore.
|
|
|
|
find_library(QXT_LIBRARIES QxtGui)
|
|
|
|
else (USE_SYSTEM_QXT)
|
2010-07-24 14:46:48 +02:00
|
|
|
add_definitions(-DQXT_STATIC -DBUILD_QXT_GUI -DBUILD_QXT_CORE)
|
2010-07-24 17:22:15 +02:00
|
|
|
set(QXT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/qxt)
|
|
|
|
set(QXT_LIBRARIES qxt)
|
2010-07-24 14:35:21 +02:00
|
|
|
if (NOT APPLE)
|
|
|
|
add_subdirectory(3rdparty/qxt)
|
|
|
|
endif (NOT APPLE)
|
|
|
|
endif (USE_SYSTEM_QXT)
|
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
find_path(ECHONEST5_INCLUDE_DIRS echonest5/echonest_export.h)
|
|
|
|
find_library(ECHONEST5_LIBRARIES echonest5)
|
2010-12-18 19:36:56 +01:00
|
|
|
|
2011-03-29 21:05:13 +02:00
|
|
|
# Use system gmock if it's available
|
|
|
|
# We need to look for both gmock and gtest
|
|
|
|
find_path(GMOCK_INCLUDE_DIRS gmock/gmock.h)
|
|
|
|
find_library(GMOCK_LIBRARIES gmock)
|
|
|
|
if(GMOCK_INCLUDE_DIRS)
|
|
|
|
find_path(GTEST_INCLUDE_DIRS gtest/gtest.h)
|
|
|
|
find_library(GTEST_LIBRARIES gtest)
|
|
|
|
if(GTEST_INCLUDE_DIRS)
|
|
|
|
set(USE_SYSTEM_GMOCK 1)
|
|
|
|
set(GMOCK_LIBRARIES ${GMOCK_LIBRARIES} ${GTEST_LIBRARIES})
|
|
|
|
endif(GTEST_INCLUDE_DIRS)
|
|
|
|
endif(GMOCK_INCLUDE_DIRS)
|
2010-10-02 18:23:33 +02:00
|
|
|
|
2014-09-25 15:09:13 +02:00
|
|
|
# Use the system's sha2 if it's available.
|
|
|
|
find_path(SHA2_INCLUDE_DIRS sha2.h)
|
|
|
|
find_library(SHA2_LIBRARIES sha2)
|
|
|
|
if(SHA2_LIBRARIES AND SHA2_INCLUDE_DIRS)
|
|
|
|
message(STATUS "Using system sha2 library")
|
|
|
|
set(USE_SYSTEM_SHA2 ON)
|
|
|
|
else()
|
|
|
|
message(STATUS "Using builtin sha2 library")
|
|
|
|
set(USE_SYSTEM_SHA2 OFF)
|
|
|
|
add_subdirectory(3rdparty/sha2)
|
|
|
|
set(SHA2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/sha2)
|
|
|
|
set(SHA2_LIBRARIES sha2)
|
|
|
|
endif()
|
2012-01-17 23:01:01 +01:00
|
|
|
|
2015-04-11 22:49:34 +02:00
|
|
|
# Use the system libmygpo-qt5 if a recent enough version was found
|
|
|
|
if(LIBMYGPO_QT5_FOUND)
|
|
|
|
set(MYGPOQT5_LIBRARIES ${LIBMYGPO_QT5_LIBRARIES})
|
|
|
|
set(MYGPOQT5_INCLUDE_DIRS ${LIBMYGPO_QT5_INCLUDE_DIRS})
|
2013-04-15 13:32:57 +02:00
|
|
|
else()
|
2015-04-11 22:49:34 +02:00
|
|
|
add_subdirectory(3rdparty/libmygpo-qt5)
|
|
|
|
set(MYGPOQT5_LIBRARIES mygpo-qt5)
|
|
|
|
set(MYGPOQT5_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libmygpo-qt5/src)
|
2013-04-15 13:32:57 +02:00
|
|
|
endif()
|
2012-03-06 01:35:55 +01:00
|
|
|
|
2012-06-27 17:08:51 +02:00
|
|
|
# Qocoa
|
|
|
|
add_subdirectory(3rdparty/qocoa)
|
|
|
|
|
2010-07-11 14:02:30 +02:00
|
|
|
# Subdirectories
|
2010-02-28 18:28:56 +01:00
|
|
|
add_subdirectory(src)
|
2010-09-25 16:55:36 +02:00
|
|
|
if (WIN32)
|
|
|
|
add_subdirectory(3rdparty/qtwin)
|
2013-01-17 14:11:15 +01:00
|
|
|
add_subdirectory(3rdparty/tinysvcmdns)
|
2010-09-25 16:55:36 +02:00
|
|
|
endif (WIN32)
|
2010-03-01 02:47:50 +01:00
|
|
|
add_subdirectory(tests)
|
2010-05-03 15:58:41 +02:00
|
|
|
add_subdirectory(dist)
|
2010-09-26 16:21:23 +02:00
|
|
|
add_subdirectory(tools/ultimate_lyrics_parser)
|
2012-01-06 00:22:51 +01:00
|
|
|
add_subdirectory(ext/libclementine-common)
|
|
|
|
add_subdirectory(ext/libclementine-tagreader)
|
|
|
|
add_subdirectory(ext/clementine-tagreader)
|
2013-01-03 21:40:47 +01:00
|
|
|
add_subdirectory(ext/libclementine-remote)
|
2013-09-17 16:49:29 +02:00
|
|
|
add_subdirectory(ext/libclementine-spotifyblob)
|
2011-02-15 22:08:28 +01:00
|
|
|
|
2010-09-04 22:01:51 +02:00
|
|
|
option(WITH_DEBIAN OFF)
|
|
|
|
if(WITH_DEBIAN)
|
|
|
|
add_subdirectory(debian)
|
|
|
|
endif(WITH_DEBIAN)
|
2010-03-04 17:41:14 +01:00
|
|
|
|
2011-03-23 22:53:24 +01:00
|
|
|
if(HAVE_BREAKPAD)
|
|
|
|
add_subdirectory(3rdparty/google-breakpad)
|
|
|
|
endif(HAVE_BREAKPAD)
|
|
|
|
|
2011-04-29 21:44:51 +02:00
|
|
|
if(HAVE_SPOTIFY_BLOB)
|
2012-01-06 00:22:51 +01:00
|
|
|
add_subdirectory(ext/clementine-spotifyblob)
|
2011-04-29 21:44:51 +02:00
|
|
|
endif(HAVE_SPOTIFY_BLOB)
|
|
|
|
|
2012-05-27 18:28:07 +02:00
|
|
|
if(HAVE_MOODBAR)
|
|
|
|
add_subdirectory(gst/moodbar)
|
|
|
|
endif()
|
|
|
|
|
2010-03-04 17:41:14 +01:00
|
|
|
# Uninstall support
|
2010-03-04 17:50:27 +01:00
|
|
|
configure_file(
|
2010-03-04 17:41:14 +01:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
|
|
IMMEDIATE @ONLY)
|
|
|
|
|
2010-03-04 17:50:27 +01:00
|
|
|
add_custom_target(uninstall
|
2010-03-04 17:41:14 +01:00
|
|
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
2010-08-31 20:23:23 +02:00
|
|
|
|
|
|
|
# Show a summary of what we have enabled
|
|
|
|
summary_show()
|