worldspawn/cmake/FindGLIB.cmake
2020-11-17 12:16:16 +01:00

21 lines
699 B
CMake

find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
if (GLIB_FIND_REQUIRED)
set(_pkgconfig_REQUIRED REQUIRED)
endif ()
pkg_check_modules(GLIB ${_pkgconfig_REQUIRED} glib-2.0)
else ()
find_path(GLIB_INCLUDE_DIRS glib.h)
find_library(GLIB_LIBRARIES glib-2.0)
if (GLIB_INCLUDE_DIRS AND GLIB_LIBRARIES)
set(GLIB_FOUND 1)
if (NOT GLIB_FIND_QUIETLY)
message(STATUS "Found GLIB: ${GLIB_LIBRARIES}")
endif ()
elseif (GLIB_FIND_REQUIRED)
message(SEND_ERROR "Could not find GLIB")
elseif (NOT GLIB_FIND_QUIETLY)
message(STATUS "Could not find GLIB")
endif ()
endif ()
mark_as_advanced(GLIB_INCLUDE_DIRS GLIB_LIBRARIES)