Build mod_tile with cmake

This commit is contained in:
David Hummel
2022-05-16 18:40:59 -07:00
committed by ǝɹʇʇɐʃǝ◖ xıʃǝɟ
parent 6c8a1d9aec
commit f4ee376b35
15 changed files with 1113 additions and 0 deletions

49
cmake/FindAPR.cmake Normal file
View File

@ -0,0 +1,49 @@
# - Find APR
# Find the APR includes and libraries.
# This module defines:
# APR_FOUND
# APR_INCLUDE_DIRS
# APR_LIBRARIES
find_package(PkgConfig QUIET)
pkg_check_modules(APR QUIET apr-1)
find_path(APR_INCLUDE_DIR
NAMES apr.h
PATHS ${APR_INCLUDE_DIRS}
PATH_SUFFIXES apr-1
)
if((NOT APR_INCLUDE_DIRS) AND (APR_INCLUDE_DIR))
set(APR_INCLUDE_DIRS ${APR_INCLUDE_DIR})
elseif(APR_INCLUDE_DIRS AND APR_INCLUDE_DIR)
list(APPEND APR_INCLUDE_DIRS ${APR_INCLUDE_DIR})
endif()
find_library(APR_LIBRARY
NAMES ${APR_LIBRARIES} apr-1
)
if((NOT APR_LIBRARIES) AND (APR_LIBRARY))
set(APR_LIBRARIES ${APR_LIBRARY})
elseif(APR_LIBRARIES AND APR_LIBRARY)
list(APPEND APR_LIBRARIES ${APR_LIBRARY})
endif()
message(VERBOSE "APR_INCLUDE_DIRS=${APR_INCLUDE_DIRS}")
message(VERBOSE "APR_INCLUDE_DIR=${APR_INCLUDE_DIR}")
message(VERBOSE "APR_LIBRARIES=${APR_LIBRARIES}")
message(VERBOSE "APR_LIBRARY=${APR_LIBRARY}")
if((NOT APR_FOUND) AND (APR_INCLUDE_DIRS) AND (APR_LIBRARIES))
set(APR_FOUND True)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(APR
FOUND_VAR APR_FOUND
REQUIRED_VARS APR_FOUND APR_INCLUDE_DIRS APR_LIBRARIES
VERSION_VAR APR_VERSION
)
mark_as_advanced(APR_INCLUDE_DIR APR_LIBRARY)

49
cmake/FindCairo.cmake Normal file
View File

@ -0,0 +1,49 @@
# - Find Cairo
# Find the Cairo includes and libraries.
# This module defines:
# Cairo_FOUND
# Cairo_INCLUDE_DIRS
# Cairo_LIBRARIES
find_package(PkgConfig QUIET)
pkg_check_modules(Cairo QUIET cairo)
find_path(Cairo_INCLUDE_DIR
NAMES cairo.h
PATHS ${Cairo_INCLUDE_DIRS}
PATH_SUFFIXES cairo
)
if((NOT Cairo_INCLUDE_DIRS) AND (Cairo_INCLUDE_DIR))
set(Cairo_INCLUDE_DIRS ${Cairo_INCLUDE_DIR})
elseif(Cairo_INCLUDE_DIRS AND Cairo_INCLUDE_DIR)
list(APPEND Cairo_INCLUDE_DIRS ${Cairo_INCLUDE_DIR})
endif()
find_library(Cairo_LIBRARY
NAMES ${Cairo_LIBRARIES} cairo
)
if((NOT Cairo_LIBRARIES) AND (Cairo_LIBRARY))
set(Cairo_LIBRARIES ${Cairo_LIBRARY})
elseif(Cairo_LIBRARIES AND Cairo_LIBRARY)
list(APPEND Cairo_LIBRARIES ${Cairo_LIBRARY})
endif()
message(VERBOSE "Cairo_INCLUDE_DIRS=${Cairo_INCLUDE_DIRS}")
message(VERBOSE "Cairo_INCLUDE_DIR=${Cairo_INCLUDE_DIR}")
message(VERBOSE "Cairo_LIBRARIES=${Cairo_LIBRARIES}")
message(VERBOSE "Cairo_LIBRARY=${Cairo_LIBRARY}")
if((NOT Cairo_FOUND) AND (Cairo_INCLUDE_DIRS) AND (Cairo_LIBRARIES))
set(Cairo_FOUND True)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Cairo
FOUND_VAR Cairo_FOUND
REQUIRED_VARS Cairo_FOUND Cairo_INCLUDE_DIRS Cairo_LIBRARIES
VERSION_VAR Cairo_VERSION
)
mark_as_advanced(Cairo_INCLUDE_DIR Cairo_LIBRARY)

49
cmake/FindGLib.cmake Normal file
View File

@ -0,0 +1,49 @@
# - 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)
find_package_handle_standard_args(GLib
FOUND_VAR GLib_FOUND
REQUIRED_VARS GLib_FOUND GLib_INCLUDE_DIRS GLib_LIBRARIES
VERSION_VAR GLib_VERSION
)
mark_as_advanced(GLib_INCLUDE_DIR GLib_LIBRARY)

47
cmake/FindHTTPD.cmake Normal file
View File

@ -0,0 +1,47 @@
# - Find HTTPD
# Find the HTTPD includes and libraries.
# This module defines:
# HTTPD_FOUND
# HTTPD_INCLUDE_DIRS
find_package(PkgConfig QUIET)
pkg_check_modules(HTTPD QUIET httpd)
find_path(HTTPD_INCLUDE_DIR
NAMES httpd.h
PATHS ${HTTPD_INCLUDE_DIRS}
PATH_SUFFIXES apache2 apache24 httpd
)
if((NOT HTTPD_INCLUDE_DIRS) AND (HTTPD_INCLUDE_DIR))
set(HTTPD_INCLUDE_DIRS ${HTTPD_INCLUDE_DIR})
elseif(HTTPD_INCLUDE_DIRS AND HTTPD_INCLUDE_DIR)
list(APPEND HTTPD_INCLUDE_DIRS ${HTTPD_INCLUDE_DIR})
endif()
message(VERBOSE "HTTPD_INCLUDE_DIRS=${HTTPD_INCLUDE_DIRS}")
message(VERBOSE "HTTPD_INCLUDE_DIR=${HTTPD_INCLUDE_DIR}")
if((NOT HTTPD_FOUND) AND (HTTPD_INCLUDE_DIRS))
set(HTTPD_FOUND True)
endif()
if((NOT HTTPD_VERSION) AND (HTTPD_FOUND))
file(STRINGS "${HTTPD_INCLUDE_DIR}/ap_release.h" _contents REGEX "#define AP_SERVER_[A-Z]+_NUMBER[ \t]+")
if (_contents)
string(REGEX REPLACE ".*#define AP_SERVER_MAJORVERSION_NUMBER[ \t]+([0-9]+).*" "\\1" HTTPD_MAJOR_VERSION "${_contents}")
string(REGEX REPLACE ".*#define AP_SERVER_MINORVERSION_NUMBER[ \t]+([0-9]+).*" "\\1" HTTPD_MINOR_VERSION "${_contents}")
string(REGEX REPLACE ".*#define AP_SERVER_PATCHLEVEL_NUMBER[ \t]+([0-9]+).*" "\\1" HTTPD_PATCH_VERSION "${_contents}")
set(HTTPD_VERSION ${HTTPD_MAJOR_VERSION}.${HTTPD_MINOR_VERSION}.${HTTPD_PATCH_VERSION})
endif ()
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HTTPD
FOUND_VAR HTTPD_FOUND
REQUIRED_VARS HTTPD_FOUND HTTPD_INCLUDE_DIRS
VERSION_VAR HTTPD_VERSION
)
mark_as_advanced(HTTPD_INCLUDE_DIR)

48
cmake/FindIniParser.cmake Normal file
View File

@ -0,0 +1,48 @@
# - Find IniParser
# Find the IniParser includes and libraries.
# This module defines:
# IniParser_FOUND
# IniParser_INCLUDE_DIRS
# IniParser_LIBRARIES
find_package(PkgConfig QUIET)
pkg_check_modules(IniParser QUIET iniparser)
find_path(IniParser_INCLUDE_DIR
NAMES iniparser.h
PATHS ${IniParser_INCLUDE_DIRS}
PATH_SUFFIXES iniparser
)
if((NOT IniParser_INCLUDE_DIRS) AND (IniParser_INCLUDE_DIR))
set(IniParser_INCLUDE_DIRS ${IniParser_INCLUDE_DIR})
elseif(IniParser_INCLUDE_DIRS AND IniParser_INCLUDE_DIR)
list(APPEND IniParser_INCLUDE_DIRS ${IniParser_INCLUDE_DIR})
endif()
find_library(IniParser_LIBRARY
NAMES ${IniParser_LIBRARIES} iniparser
)
if((NOT IniParser_LIBRARIES) AND (IniParser_LIBRARY))
set(IniParser_LIBRARIES ${IniParser_LIBRARY})
elseif(IniParser_LIBRARIES AND IniParser_LIBRARY)
list(APPEND IniParser_LIBRARIES ${IniParser_LIBRARY})
endif()
message(VERBOSE "IniParser_INCLUDE_DIRS=${IniParser_INCLUDE_DIRS}")
message(VERBOSE "IniParser_INCLUDE_DIR=${IniParser_INCLUDE_DIR}")
message(VERBOSE "IniParser_LIBRARIES=${IniParser_LIBRARIES}")
message(VERBOSE "IniParser_LIBRARY=${IniParser_LIBRARY}")
if((NOT IniParser_FOUND) AND (IniParser_INCLUDE_DIRS) AND (IniParser_LIBRARIES))
set(IniParser_FOUND True)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IniParser
FOUND_VAR IniParser_FOUND
REQUIRED_VARS IniParser_FOUND IniParser_INCLUDE_DIRS IniParser_LIBRARIES
)
mark_as_advanced(IniParser_INCLUDE_DIR IniParser_LIBRARY)

View File

@ -0,0 +1,49 @@
# - Find LibMemcached
# Find the LibMemcached includes and libraries.
# This module defines:
# LibMemcached_FOUND
# LibMemcached_INCLUDE_DIRS
# LibMemcached_LIBRARIES
find_package(PkgConfig QUIET)
pkg_check_modules(LibMemcached QUIET libmemcached)
find_path(LibMemcached_INCLUDE_DIR
NAMES memcached.h
PATHS ${LibMemcached_INCLUDE_DIRS}
PATH_SUFFIXES libmemcached
)
if((NOT LibMemcached_INCLUDE_DIRS) AND (LibMemcached_INCLUDE_DIR))
set(LibMemcached_INCLUDE_DIRS ${LibMemcached_INCLUDE_DIR})
elseif(LibMemcached_INCLUDE_DIRS AND LibMemcached_INCLUDE_DIR)
list(APPEND LibMemcached_INCLUDE_DIRS ${LibMemcached_INCLUDE_DIR})
endif()
find_library(LibMemcached_LIBRARY
NAMES ${LibMemcached_LIBRARIES} memcached
)
if((NOT LibMemcached_LIBRARIES) AND (LibMemcached_LIBRARY))
set(LibMemcached_LIBRARIES ${LibMemcached_LIBRARY})
elseif(LibMemcached_LIBRARIES AND LibMemcached_LIBRARY)
list(APPEND LibMemcached_LIBRARIES ${LibMemcached_LIBRARY})
endif()
message(VERBOSE "LibMemcached_INCLUDE_DIRS=${LibMemcached_INCLUDE_DIRS}")
message(VERBOSE "LibMemcached_INCLUDE_DIR=${LibMemcached_INCLUDE_DIR}")
message(VERBOSE "LibMemcached_LIBRARIES=${LibMemcached_LIBRARIES}")
message(VERBOSE "LibMemcached_LIBRARY=${LibMemcached_LIBRARY}")
if((NOT LibMemcached_FOUND) AND (LibMemcached_INCLUDE_DIRS) AND (LibMemcached_LIBRARIES))
set(LibMemcached_FOUND True)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibMemcached
FOUND_VAR LibMemcached_FOUND
REQUIRED_VARS LibMemcached_FOUND LibMemcached_INCLUDE_DIRS LibMemcached_LIBRARIES
VERSION_VAR LibMemcached_VERSION
)
mark_as_advanced(LibMemcached_INCLUDE_DIR LibMemcached_LIBRARY)

60
cmake/FindLibRados.cmake Normal file
View File

@ -0,0 +1,60 @@
# - Find LibRados
# Find the LibRados includes and libraries.
# This module defines:
# LibRados_FOUND
# LibRados_INCLUDE_DIRS
# LibRados_LIBRARIES
find_package(PkgConfig QUIET)
pkg_check_modules(LibRados QUIET rados)
find_path(LibRados_INCLUDE_DIR
NAMES librados.h
PATHS ${LibRados_INCLUDE_DIRS}
PATH_SUFFIXES rados
)
if((NOT LibRados_INCLUDE_DIRS) AND (LibRados_INCLUDE_DIR))
set(LibRados_INCLUDE_DIRS ${LibRados_INCLUDE_DIR})
elseif(LibRados_INCLUDE_DIRS AND LibRados_INCLUDE_DIR)
list(APPEND LibRados_INCLUDE_DIRS ${LibRados_INCLUDE_DIR})
endif()
find_library(LibRados_LIBRARY
NAMES ${LibRados_LIBRARIES} rados
)
if((NOT LibRados_LIBRARIES) AND (LibRados_LIBRARY))
set(LibRados_LIBRARIES ${LibRados_LIBRARY})
elseif(LibRados_LIBRARIES AND LibRados_LIBRARY)
list(APPEND LibRados_LIBRARIES ${LibRados_LIBRARY})
endif()
message(VERBOSE "LibRados_INCLUDE_DIRS=${LibRados_INCLUDE_DIRS}")
message(VERBOSE "LibRados_INCLUDE_DIR=${LibRados_INCLUDE_DIR}")
message(VERBOSE "LibRados_LIBRARIES=${LibRados_LIBRARIES}")
message(VERBOSE "LibRados_LIBRARY=${LibRados_LIBRARY}")
if((NOT LibRados_FOUND) AND (LibRados_INCLUDE_DIRS) AND (LibRados_LIBRARIES))
set(LibRados_FOUND True)
endif()
if((NOT LibRados_VERSION) AND (LibRados_FOUND))
file(STRINGS "${LibRados_INCLUDE_DIR}/librados.h" _contents REGEX "#define LIBRADOS_VER_[A-Z]+[ \t]+")
if (_contents)
string(REGEX REPLACE ".*#define LIBRADOS_VER_MAJOR[ \t]+([0-9]+).*" "\\1" LibRados_MAJOR_VERSION "${_contents}")
string(REGEX REPLACE ".*#define LIBRADOS_VER_MINOR[ \t]+([0-9]+).*" "\\1" LibRados_MINOR_VERSION "${_contents}")
string(REGEX REPLACE ".*#define LIBRADOS_VER_EXTRA[ \t]+([0-9]+).*" "\\1" LibRados_EXTRA_VERSION "${_contents}")
set(LibRados_VERSION ${LibRados_MAJOR_VERSION}.${LibRados_MINOR_VERSION}.${LibRados_EXTRA_VERSION})
endif ()
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibRados
FOUND_VAR LibRados_FOUND
REQUIRED_VARS LibRados_FOUND LibRados_INCLUDE_DIRS LibRados_LIBRARIES
VERSION_VAR LibRados_VERSION
)
mark_as_advanced(LibRados_INCLUDE_DIR LibRados_LIBRARY)

60
cmake/FindMapnik.cmake Normal file
View File

@ -0,0 +1,60 @@
# - Find Mapnik
# Find the Mapnik includes and libraries.
# This module defines:
# Mapnik_FOUND
# Mapnik_INCLUDE_DIRS
# Mapnik_LIBRARIES
find_package(PkgConfig QUIET)
pkg_check_modules(Mapnik QUIET mapnik)
find_path(Mapnik_INCLUDE_DIR
NAMES version.hpp
PATHS ${Mapnik_INCLUDE_DIRS}
PATH_SUFFIXES mapnik
)
if((NOT Mapnik_INCLUDE_DIRS) AND (Mapnik_INCLUDE_DIR))
set(Mapnik_INCLUDE_DIRS ${Mapnik_INCLUDE_DIR})
elseif(Mapnik_INCLUDE_DIRS AND Mapnik_INCLUDE_DIR)
list(APPEND Mapnik_INCLUDE_DIRS ${Mapnik_INCLUDE_DIR})
endif()
find_library(Mapnik_LIBRARY
NAMES ${Mapnik_LIBRARIES} mapnik
)
if((NOT Mapnik_LIBRARIES) AND (Mapnik_LIBRARY))
set(Mapnik_LIBRARIES ${Mapnik_LIBRARY})
elseif(Mapnik_LIBRARIES AND Mapnik_LIBRARY)
list(APPEND Mapnik_LIBRARIES ${Mapnik_LIBRARY})
endif()
message(VERBOSE "Mapnik_INCLUDE_DIRS=${Mapnik_INCLUDE_DIRS}")
message(VERBOSE "Mapnik_INCLUDE_DIR=${Mapnik_INCLUDE_DIR}")
message(VERBOSE "Mapnik_LIBRARIES=${Mapnik_LIBRARIES}")
message(VERBOSE "Mapnik_LIBRARY=${Mapnik_LIBRARY}")
if((NOT Mapnik_FOUND) AND (Mapnik_INCLUDE_DIRS) AND (Mapnik_LIBRARIES))
set(Mapnik_FOUND True)
endif()
if((NOT Mapnik_VERSION) AND (Mapnik_FOUND))
file(STRINGS "${Mapnik_INCLUDE_DIR}/version.hpp" _contents REGEX "#define MAPNIK_[A-Z]+_VERSION[ \t]+")
if (_contents)
string(REGEX REPLACE ".*#define MAPNIK_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" Mapnik_MAJOR_VERSION "${_contents}")
string(REGEX REPLACE ".*#define MAPNIK_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" Mapnik_MINOR_VERSION "${_contents}")
string(REGEX REPLACE ".*#define MAPNIK_PATCH_VERSION[ \t]+([0-9]+).*" "\\1" Mapnik_PATCH_VERSION "${_contents}")
set(Mapnik_VERSION ${Mapnik_MAJOR_VERSION}.${Mapnik_MINOR_VERSION}.${Mapnik_PATCH_VERSION})
endif ()
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Mapnik
FOUND_VAR Mapnik_FOUND
REQUIRED_VARS Mapnik_FOUND Mapnik_INCLUDE_DIRS Mapnik_LIBRARIES
VERSION_VAR Mapnik_VERSION
)
mark_as_advanced(Mapnik_INCLUDE_DIR Mapnik_LIBRARY)