/[zanavi_public1]/navit/cmake/FindGlib.cmake
ZANavi

Contents of /navit/cmake/FindGlib.cmake

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (show annotations) (download)
Fri Oct 28 21:19:04 2011 UTC (8 years, 2 months ago) by zoff99
File size: 1100 byte(s)
import files
1 # - Try to find Glib-2.0 (with gobject)
2 # Once done, this will define
3 #
4 # Glib_FOUND - system has Glib
5 # Glib_INCLUDE_DIRS - the Glib include directories
6 # Glib_LIBRARIES - link these to use Glib
7
8 include(LibFindMacros)
9
10 # Use pkg-config to get hints about paths
11 libfind_pkg_check_modules(Glib_PKGCONF glib-2.0)
12
13 # Main include dir
14 find_path(Glib_INCLUDE_DIR
15 NAMES glib.h
16 PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /sw/include
17 PATH_SUFFIXES glib-2.0
18 )
19
20 # Glib-related libraries also use a separate config header, which is in lib dir
21 find_path(GlibConfig_INCLUDE_DIR
22 NAMES glibconfig.h
23 PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /usr /sw
24 PATH_SUFFIXES lib/glib-2.0/include
25 )
26
27 # Finally the library itself
28 find_library(Glib_LIBRARY
29 NAMES glib-2.0
30 PATHS ${Glib_PKGCONF_LIBRARY_DIRS} /sw/lib
31 )
32
33 # Set the include dir variables and the libraries and let libfind_process do the rest.
34 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
35 set(Glib_PROCESS_INCLUDES Glib_INCLUDE_DIR GlibConfig_INCLUDE_DIR)
36 set(Glib_PROCESS_LIBS Glib_LIBRARY)
37 libfind_process(Glib)
38
39

   
Visit the ZANavi Wiki