Files
openstreetmap-mod_tile-pyth…/cmake/FindGLIB.cmake
Hummeltech 6d00447862 Improve test coverage (#384)
* Report coverage for almost all jobs
  * Some jobs fail and are omitted
* Add more tests to `gen_tile_test.cpp`
  * Also lightly cleaned up formatting
* Clean up cmake/* files
  * So they don't report an empty version
* Remove commented `check_*` lines from `CMakeLists.txt` file
  * These were left over from the initial CMake support implementation
2024-02-02 14:04:15 -07:00

56 lines
1.4 KiB
CMake

# - Find GLIB
# Find the GLIB includes and libraries.
# This module defines:
# GLIB_FOUND
# GLIB_INCLUDE_DIRS
# GLIB_LIBRARIES
find_package(PkgConfig QUIET)
pkg_check_modules(GLIB QUIET glib-2.0)
find_path(GLIB_INCLUDE_DIR
NAMES glib.h
PATHS ${GLIB_INCLUDE_DIRS}
PATH_SUFFIXES glib-2.0
)
if((NOT GLIB_INCLUDE_DIRS) AND (GLIB_INCLUDE_DIR))
set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR})
elseif(GLIB_INCLUDE_DIRS AND GLIB_INCLUDE_DIR)
list(APPEND GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR})
endif()
find_library(GLIB_LIBRARY
NAMES ${GLIB_LIBRARIES} glib-2.0
)
if((NOT GLIB_LIBRARIES) AND (GLIB_LIBRARY))
set(GLIB_LIBRARIES ${GLIB_LIBRARY})
elseif(GLIB_LIBRARIES AND GLIB_LIBRARY)
list(APPEND GLIB_LIBRARIES ${GLIB_LIBRARY})
endif()
message(VERBOSE "GLIB_INCLUDE_DIRS=${GLIB_INCLUDE_DIRS}")
message(VERBOSE "GLIB_INCLUDE_DIR=${GLIB_INCLUDE_DIR}")
message(VERBOSE "GLIB_LIBRARIES=${GLIB_LIBRARIES}")
message(VERBOSE "GLIB_LIBRARY=${GLIB_LIBRARY}")
if((NOT GLIB_FOUND) AND (GLIB_INCLUDE_DIRS) AND (GLIB_LIBRARIES))
set(GLIB_FOUND True)
endif()
include(FindPackageHandleStandardArgs)
if(GLIB_FOUND)
find_package_handle_standard_args(GLIB
REQUIRED_VARS GLIB_FOUND GLIB_INCLUDE_DIRS GLIB_LIBRARIES
VERSION_VAR GLIB_VERSION
)
else()
find_package_handle_standard_args(GLIB
REQUIRED_VARS GLIB_FOUND
)
endif()
mark_as_advanced(GLIB_INCLUDE_DIR GLIB_LIBRARY)