1 # - 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 8 if (WIN32) 9 10 INCLUDE(MacroGetenvWinPath) 11 12 MACRO_GETENV_WIN_PATH(_program_FILES_DIR PROGRAMFILES) 13 14 FIND_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) 20 FIND_LIBRARY(GLIB_LIBRARY NAMES glib-2.0 21 PATHS 22 ${_program_FILES_DIR}/glib/lib 23 ) 24 25 if (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 30 endif (GLIB_LIBRARY AND GLIB_INCLUDE_DIR) 31 32 if (GLIB_FOUND) 33 if (NOT GLIB_FIND_QUIETLY) 34 message(STATUS "Found GLIB: ${GLIB_LIBRARY}") 35 endif (NOT GLIB_FIND_QUIETLY) 36 else (GLIB_FOUND) 37 if (GLIB_FIND_REQUIRED) 38 message(FATAL_ERROR "Could NOT find GLIB library") 39 endif (GLIB_FIND_REQUIRED) 40 endif (GLIB_FOUND) 41 42 endif (WIN32) 43