diff options
-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) |