diff options
| author | Matthias Kretz <kretz@kde.org> | 2008-11-18 22:35:17 +0000 | 
|---|---|---|
| committer | Matthias Kretz <kretz@kde.org> | 2008-11-18 22:35:17 +0000 | 
| commit | 9fa39a6c1756f33fefc331ae4204087d68092b53 (patch) | |
| tree | 5a74c996a0b682551b60bc79a1aee00078a66563 | |
| parent | 877046103ca395ba7b2d842fd00404869e54bef0 (diff) | |
| download | extra-cmake-modules-9fa39a6c1756f33fefc331ae4204087d68092b53.tar.gz extra-cmake-modules-9fa39a6c1756f33fefc331ae4204087d68092b53.tar.bz2 | |
figure out the Phonon version and put it in PHONON_VERSION
svn path=/trunk/KDE/kdelibs/; revision=886287
| -rw-r--r-- | modules/FindPhonon.cmake | 12 | 
1 files changed, 11 insertions, 1 deletions
| diff --git a/modules/FindPhonon.cmake b/modules/FindPhonon.cmake index 14d15422..4d015129 100644 --- a/modules/FindPhonon.cmake +++ b/modules/FindPhonon.cmake @@ -4,14 +4,23 @@  #  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) +   file(READ "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h" _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}") +   message(STATUS "Phonon Version: ${PHONON_VERSION}") +endmacro(_phonon_find_version) +  if(PHONON_FOUND) -   # Already found, nothing more to do +   # Already found, nothing more to do except figuring out the version +   _phonon_find_version()  else(PHONON_FOUND)     if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)        set(PHONON_FIND_QUIETLY TRUE) @@ -29,6 +38,7 @@ else(PHONON_FOUND)        set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})        set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR})        set(PHONON_FOUND TRUE) +      _phonon_find_version()     else(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)        set(PHONON_FOUND FALSE)     endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) | 
