]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - cmake/FindGLIB.cmake
netradiant: strip 16-bit png to 8-bit, fix #153
[xonotic/netradiant.git] / cmake / FindGLIB.cmake
1 find_package(PkgConfig)
2 if (PKG_CONFIG_FOUND)
3     if (APPLE)
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")
7     endif ()
8     if (GLIB_FIND_REQUIRED)
9         set(_pkgconfig_REQUIRED REQUIRED)
10     endif ()
11     pkg_check_modules(GLIB ${_pkgconfig_REQUIRED} glib-2.0)
12 else ()
13     find_path(GLIB_INCLUDE_DIRS glib.h)
14     find_library(GLIB_LIBRARIES glib-2.0)
15     if (GLIB_INCLUDE_DIRS AND GLIB_LIBRARIES)
16         set(GLIB_FOUND 1)
17         if (NOT GLIB_FIND_QUIETLY)
18             message(STATUS "Found GLIB: ${GLIB_LIBRARIES}")
19         endif ()
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")
24     endif ()
25 endif ()
26 mark_as_advanced(GLIB_INCLUDE_DIRS GLIB_LIBRARIES)