Warning, /office/kexi/cmake/modules/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 include(FeatureSummary)
0014 set_package_properties(GLIB2
0015 PROPERTIES DESCRIPTION "Common C routines used by GTK+ and other libs"
0016 URL "http://www.gtk.org")
0017
0018 if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
0019 # Already in cache, be silent
0020 set(GLIB2_FIND_QUIETLY TRUE)
0021 endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
0022
0023 find_package(PkgConfig)
0024 pkg_check_modules(PC_LibGLIB2 QUIET glib-2.0)
0025
0026 find_path(GLIB2_MAIN_INCLUDE_DIR
0027 NAMES glib.h
0028 HINTS ${PC_LibGLIB2_INCLUDEDIR}
0029 PATH_SUFFIXES glib-2.0)
0030
0031 find_library(GLIB2_LIBRARY
0032 NAMES glib-2.0
0033 HINTS ${PC_LibGLIB2_LIBDIR}
0034 )
0035
0036 set(GLIB2_LIBRARIES ${GLIB2_LIBRARY})
0037
0038 # search the glibconfig.h include dir under the same root where the library is found
0039 get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" PATH)
0040
0041 find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
0042 PATH_SUFFIXES glib-2.0/include
0043 HINTS ${PC_LibGLIB2_INCLUDEDIR} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH})
0044
0045 set(GLIB2_INCLUDE_DIR "${GLIB2_MAIN_INCLUDE_DIR}")
0046
0047 # not sure if this include dir is optional or required
0048 # for now it is optional
0049 if(GLIB2_INTERNAL_INCLUDE_DIR)
0050 set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} "${GLIB2_INTERNAL_INCLUDE_DIR}")
0051 endif(GLIB2_INTERNAL_INCLUDE_DIR)
0052
0053 include(FindPackageHandleStandardArgs)
0054 find_package_handle_standard_args(GLIB2 DEFAULT_MSG GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR)
0055
0056 mark_as_advanced(GLIB2_INCLUDE_DIR GLIB2_LIBRARIES)