Warning, /multimedia/amarok/cmake/modules/FindLibLastFm.cmake is written in an unsupported language. File is not indexed.

0001 # - Find LibLastFM
0002 # Find the liblastfm includes and the liblastfm libraries
0003 # This module defines
0004 # LIBLASTFM_FOUND, whether liblastfm was found. If it was, it further sets:
0005 # LIBLASTFM_INCLUDE_DIR, root lastfm include dir
0006 # LIBLASTFM_LIBRARY, the path to liblastfm
0007 # LIBLASTFM_VERSION, version of found liblastfm as a string, e.g "0.3"
0008 
0009 
0010 find_path(LIBLASTFM_INCLUDE_DIR NAMES global.h
0011    HINTS
0012    ~/usr/include
0013    /opt/local/include
0014    /usr/include
0015    /usr/local/include
0016    PATH_SUFFIXES lastfm5
0017 )
0018 
0019 find_library( LIBLASTFM_LIBRARY NAMES lastfm5
0020     PATHS
0021     ~/usr/lib
0022    /opt/local/lib
0023    /usr/lib
0024    /usr/lib64
0025    /usr/local/lib
0026    /usr/local/lib64
0027 )
0028 
0029 
0030 if(LIBLASTFM_INCLUDE_DIR AND LIBLASTFM_LIBRARY)
0031    set(LIBLASTFM_FOUND TRUE)
0032 else()
0033    set(LIBLASTFM_FOUND FALSE)
0034 endif()
0035 
0036 if(LIBLASTFM_FOUND)
0037    set(regex "#define LASTFM_VERSION_STRING \"(.*)\"")
0038    file(STRINGS "${LIBLASTFM_INCLUDE_DIR}/global.h" LIBLASTFM_VERSION REGEX ${regex})
0039    if(${LIBLASTFM_VERSION} MATCHES ${regex})
0040       set(LIBLASTFM_VERSION ${CMAKE_MATCH_1})
0041       message(STATUS "Found liblastfm: ${LIBLASTFM_INCLUDE_DIR}, ${LIBLASTFM_LIBRARY}, version ${LIBLASTFM_VERSION}")
0042    else()
0043       message(WARNING "Found liblastfm: ${LIBLASTFM_INCLUDE_DIR} - but failed to parse version")
0044       set(LIBLASTFM_FOUND FALSE)
0045       unset(LIBLASTFM_INCLUDE_DIR)
0046       unset(LIBLASTFM_LIBRARY)
0047    endif()
0048    unset(regex)
0049 endif()
0050 
0051 mark_as_advanced(LIBLASTFM_INCLUDE_DIR LIBLASTFM_LIBRARY)