blob: 1fdaee959739edba38f286590244d3a568cb7b11 [file] [log] [blame]
Emeric Vigier2f625822012-08-06 11:09:52 -04001# - Try to find the GLIB library
2# Once done this will define
3#
4# GLIB_FOUND - system has GLIB
5# GLIB_INCLUDES - the GLIB include directories
6# GLIB_LIBRARIES - The libraries needed to use GLIB
7
8if (WIN32)
9
10INCLUDE(MacroGetenvWinPath)
11
12MACRO_GETENV_WIN_PATH(_program_FILES_DIR PROGRAMFILES)
13
14FIND_PATH(GLIB_INCLUDE_DIR glib.h
15 ${_program_FILES_DIR}/glib/include/glib-2.0
16)
17
18
19# search for GLIB in the default install directory for applications (default of (n)make install)
20FIND_LIBRARY(GLIB_LIBRARY NAMES glib-2.0
21 PATHS
22 ${_program_FILES_DIR}/glib/lib
23)
24
25if (GLIB_LIBRARY AND GLIB_INCLUDE_DIR)
26 set(GLIB_FOUND TRUE)
27 set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GLIB_INCLUDES})
28 set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${GLIB_LIBRARIES})
29
30endif (GLIB_LIBRARY AND GLIB_INCLUDE_DIR)
31
32if (GLIB_FOUND)
33 if (NOT GLIB_FIND_QUIETLY)
34 message(STATUS "Found GLIB: ${GLIB_LIBRARY}")
35 endif (NOT GLIB_FIND_QUIETLY)
36else (GLIB_FOUND)
37 if (GLIB_FIND_REQUIRED)
38 message(FATAL_ERROR "Could NOT find GLIB library")
39 endif (GLIB_FIND_REQUIRED)
40endif (GLIB_FOUND)
41
42endif (WIN32)