1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

Phonon cmake config file is still a mess with Qt4

This commit is contained in:
Dominik Schmidt
2013-08-06 23:58:13 +02:00
parent 3c52e73595
commit 07ae17b5e6
3 changed files with 10 additions and 48 deletions

View File

@@ -220,12 +220,6 @@ IF( UNIX AND NOT APPLE AND QT_QTDBUS_FOUND )
SET( WITH_GNOMESHORTCUTHANDLER ON )
ENDIF( UNIX AND NOT APPLE AND QT_QTDBUS_FOUND )
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.1.0)
macro_log_feature(ECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest 2.1.0 is needed for dynamic playlists and the infosystem")
@@ -312,10 +306,17 @@ if (WITH_KDE4)
macro_optional_find_package(KDE4)
macro_optional_find_package(KDE4Installed)
endif(WITH_KDE4)
# this was used before we had FindKDE4Installed, just leaving it here to keep the flags
# for future kde integration
macro_log_feature(KDE4_FOUND "KDE4" "Provides support for configuring Telepathy Accounts from inside Tomahawk" "https://www.kde.org" FALSE "" "")
if(NOT Phonon_FOUND)
macro_optional_find_package(Phonon 4.5.0)
endif()
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()
IF( KDE4_FOUND )
IF( CMAKE_C_FLAGS )
# KDE4 adds and removes some compiler flags that we don't like

View File

@@ -18,9 +18,7 @@ if( TOMAHAWK_QT5 )
set(Phonon_FOUND ${Phonon4Qt5_FOUND})
set(Phonon_DIR ${Phonon4Qt5_DIR})
else()
find_package(Phonon4)
set(Phonon_FOUND ${PHONON_FOUND})
set(Phonon_DIR ${PHONON_DIR})
find_package(Phonon NO_MODULE)
endif()
find_package_handle_standard_args(Phonon DEFAULT_MSG Phonon_DIR )

View File

@@ -1,37 +0,0 @@
# Find libphonon
# Once done this will define
#
# PHONON_FOUND - system has Phonon Library
# PHONON_INCLUDES - the Phonon include directory
# PHONON_LIBS - link these to use Phonon
# PHONON_VERSION - the version of the Phonon Library
# Copyright (c) 2008, Matthias Kretz <kretz@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
macro(_phonon_find_version)
set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h")
if (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
endif (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
file(READ ${_phonon_namespace_header_file} _phonon_header LIMIT 5000 OFFSET 1000)
string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}")
set(PHONON_VERSION "${CMAKE_MATCH_1}")
endmacro(_phonon_find_version)
# the dirs listed with HINTS are searched before the default sets of dirs
find_library(PHONON_LIBRARY NAMES phonon HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR})
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR})
_phonon_find_version()
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Phonon DEFAULT_MSG PHONON_INCLUDE_DIR PHONON_LIBRARY)
mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY)