PageRenderTime 268ms CodeModel.GetById 141ms app.highlight 1ms RepoModel.GetById 120ms app.codeStats 4ms

/CMakeModules/FindPhonon.cmake

http://github.com/tomahawk-player/tomahawk
CMake | 37 lines | 19 code | 6 blank | 12 comment | 2 complexity | 9d38b4c725e12d1b0e10e92e46a143a1 MD5 | raw file
 1# Find libphonon
 2# Once done this will define
 3#
 4#  PHONON_FOUND    - system has Phonon Library
 5#  PHONON_INCLUDES - the Phonon include directory
 6#  PHONON_LIBS     - link these to use Phonon
 7#  PHONON_VERSION  - the version of the Phonon Library
 8
 9# Copyright (c) 2008, Matthias Kretz <kretz@kde.org>
10#
11# Redistribution and use is allowed according to the terms of the BSD license.
12# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
13
14macro(_phonon_find_version)
15   set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h")
16   if (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
17      set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
18   endif (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
19   file(READ ${_phonon_namespace_header_file} _phonon_header LIMIT 5000 OFFSET 1000)
20   string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}")
21   set(PHONON_VERSION "${CMAKE_MATCH_1}")
22endmacro(_phonon_find_version)
23
24# the dirs listed with HINTS are searched before the default sets of dirs
25find_library(PHONON_LIBRARY NAMES phonon HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})
26find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR})
27
28if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
29   set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
30   set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR})
31   _phonon_find_version()
32endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
33
34include(FindPackageHandleStandardArgs)
35find_package_handle_standard_args(Phonon  DEFAULT_MSG  PHONON_INCLUDE_DIR PHONON_LIBRARY)
36
37mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY)