Warning, /frameworks/kdelibs4support/cmake/modules/FindTaglib.cmake is written in an unsupported language. File is not indexed.

0001 # - Try to find the Taglib library
0002 # Once done this will define
0003 #
0004 #  TAGLIB_FOUND - system has the taglib library
0005 #  TAGLIB_CFLAGS - the taglib cflags
0006 #  TAGLIB_LIBRARIES - The libraries needed to use taglib
0007 
0008 # Copyright (c) 2006, Laurent Montel, <montel@kde.org>
0009 #
0010 # Redistribution and use is allowed according to the terms of the BSD license.
0011 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0012 
0013 if(NOT TAGLIB_MIN_VERSION)
0014   set(TAGLIB_MIN_VERSION "1.4")
0015 endif(NOT TAGLIB_MIN_VERSION)
0016 
0017 if(NOT WIN32)
0018     find_program(TAGLIBCONFIG_EXECUTABLE NAMES taglib-config PATHS
0019        ${BIN_INSTALL_DIR}
0020     )
0021 endif(NOT WIN32)
0022 
0023 #reset vars
0024 set(TAGLIB_LIBRARIES)
0025 set(TAGLIB_CFLAGS)
0026 
0027 # if taglib-config has been found
0028 if(TAGLIBCONFIG_EXECUTABLE)
0029 
0030   exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_VERSION)
0031 
0032   if(TAGLIB_VERSION VERSION_LESS "${TAGLIB_MIN_VERSION}")
0033      message(STATUS "TagLib version not found: version searched :${TAGLIB_MIN_VERSION}, found ${TAGLIB_VERSION}")
0034      set(TAGLIB_FOUND FALSE)
0035   else(TAGLIB_VERSION VERSION_LESS "${TAGLIB_MIN_VERSION}")
0036 
0037      exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_LIBRARIES)
0038 
0039      exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_CFLAGS)
0040 
0041      if(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS)
0042         set(TAGLIB_FOUND TRUE)
0043         message(STATUS "Found taglib: ${TAGLIB_LIBRARIES}")
0044      endif(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS)
0045      string(REGEX REPLACE " *-I" ";" TAGLIB_INCLUDES "${TAGLIB_CFLAGS}")
0046   endif(TAGLIB_VERSION VERSION_LESS "${TAGLIB_MIN_VERSION}")
0047   mark_as_advanced(TAGLIB_CFLAGS TAGLIB_LIBRARIES TAGLIB_INCLUDES)
0048 
0049 else(TAGLIBCONFIG_EXECUTABLE)
0050 
0051   include(FindLibraryWithDebug)
0052   include(FindPackageHandleStandardArgs)
0053 
0054   find_path(TAGLIB_INCLUDES
0055     NAMES
0056     tag.h
0057     PATH_SUFFIXES taglib
0058     PATHS
0059     ${KDE4_INCLUDE_DIR}
0060     ${INCLUDE_INSTALL_DIR}
0061   )
0062 
0063   find_library_with_debug(TAGLIB_LIBRARIES
0064     WIN32_DEBUG_POSTFIX d
0065     NAMES tag
0066     PATHS
0067     ${KDE4_LIB_DIR}
0068     ${LIB_INSTALL_DIR}
0069   )
0070   
0071   find_package_handle_standard_args(Taglib DEFAULT_MSG 
0072                                     TAGLIB_INCLUDES TAGLIB_LIBRARIES)
0073 endif(TAGLIBCONFIG_EXECUTABLE)
0074 
0075 
0076 if(TAGLIB_FOUND)
0077   if(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE)
0078     message(STATUS "Taglib found: ${TAGLIB_LIBRARIES}")
0079   endif(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE)
0080 else(TAGLIB_FOUND)
0081   if(Taglib_FIND_REQUIRED)
0082     message(FATAL_ERROR "Could not find Taglib")
0083   endif(Taglib_FIND_REQUIRED)
0084 endif(TAGLIB_FOUND)
0085