1 find_package(PkgConfig)
4 # libffi is provided by base system so brew does not take the risk to override it
5 # hence then need for an explicit look-up
6 set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/libffi/lib/pkgconfig")
8 if (GLIB_FIND_REQUIRED)
9 set(_pkgconfig_REQUIRED REQUIRED)
11 pkg_check_modules(GLIB ${_pkgconfig_REQUIRED} glib-2.0)
13 find_path(GLIB_INCLUDE_DIRS glib.h)
14 find_library(GLIB_LIBRARIES glib-2.0)
15 if (GLIB_INCLUDE_DIRS AND GLIB_LIBRARIES)
17 if (NOT GLIB_FIND_QUIETLY)
18 message(STATUS "Found GLIB: ${GLIB_LIBRARIES}")
20 elseif (GLIB_FIND_REQUIRED)
21 message(SEND_ERROR "Could not find GLIB")
22 elseif (NOT GLIB_FIND_QUIETLY)
23 message(STATUS "Could not find GLIB")
26 mark_as_advanced(GLIB_INCLUDE_DIRS GLIB_LIBRARIES)