Warning, /libraries/phonon/cmake/FindGLIB2.cmake is written in an unsupported language. File is not indexed.

0001 # - Try to find the GLIB2 libraries
0002 # Once done this will define
0003 #
0004 #  GLIB2_FOUND - system has glib2
0005 #  GLIB2_INCLUDE_DIR - the glib2 include directory
0006 #  GLIB2_LIBRARIES - glib2 library
0007 
0008 # Copyright (c) 2008 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 
0014 if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
0015     # Already in cache, be silent
0016     set(GLIB2_FIND_QUIETLY TRUE)
0017 endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
0018 
0019 find_package(PkgConfig)
0020 pkg_check_modules(PC_LibGLIB2 glib-2.0)
0021 
0022 find_path(GLIB2_MAIN_INCLUDE_DIR
0023           NAMES glib.h
0024           HINTS ${PC_LibGLIB2_INCLUDEDIR}
0025           PATH_SUFFIXES glib-2.0)
0026 
0027 find_library(GLIB2_LIBRARY 
0028              NAMES glib-2.0 
0029              HINTS ${PC_LibGLIB2_LIBDIR}
0030 )
0031 
0032 set(GLIB2_LIBRARIES ${GLIB2_LIBRARY})
0033 
0034 # search the glibconfig.h include dir under the same root where the library is found
0035 get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" PATH)
0036 
0037 find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
0038           PATH_SUFFIXES glib-2.0/include
0039           HINTS ${PC_LibGLIB2_INCLUDEDIR} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH})
0040 
0041 set(GLIB2_INCLUDE_DIR "${GLIB2_MAIN_INCLUDE_DIR}")
0042 
0043 # not sure if this include dir is optional or required
0044 # for now it is optional
0045 if(GLIB2_INTERNAL_INCLUDE_DIR)
0046   set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} "${GLIB2_INTERNAL_INCLUDE_DIR}")
0047 endif(GLIB2_INTERNAL_INCLUDE_DIR)
0048 
0049 include(FindPackageHandleStandardArgs)
0050 find_package_handle_standard_args(GLIB2  DEFAULT_MSG  GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR)
0051 
0052 mark_as_advanced(GLIB2_INCLUDE_DIR GLIB2_LIBRARIES)