mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2025-07-23 00:28:34 +00:00
Added more linters (cmakelint
& prettier
) (#341)
For linting `CMakeLists.txt` & `*.cmake` files (`cmakelint`) as well as various other formats such as `HTML`, `MarkDown` & `YAML` (`prettier`.) ### Also: * Upgrade `actions/checkout` from `v3` to `v4` * Output coverage summary to GitHub Job step summary * Minor build docs cleanup for `CentOS` & `FreeBSD`
This commit is contained in:
@ -12,7 +12,7 @@ runs:
|
||||
key: ${{ matrix.image }}-${{ matrix.compiler }}-mapnik-latest
|
||||
|
||||
- name: Checkout `Mapnik`
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: mapnik-src
|
||||
repository: mapnik/mapnik
|
||||
|
38
.github/workflows/build-and-test.yml
vendored
38
.github/workflows/build-and-test.yml
vendored
@ -2,8 +2,8 @@
|
||||
name: Build & Test
|
||||
|
||||
on:
|
||||
- pull_request
|
||||
- push
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
Linux:
|
||||
@ -16,14 +16,14 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
image:
|
||||
- 'centos:7'
|
||||
- 'debian:11'
|
||||
- 'debian:12'
|
||||
- 'debian:testing'
|
||||
- 'fedora:37'
|
||||
- 'fedora:38'
|
||||
- 'fedora:rawhide'
|
||||
- 'ubuntu:20.04'
|
||||
- "centos:7"
|
||||
- "debian:11"
|
||||
- "debian:12"
|
||||
- "debian:testing"
|
||||
- "fedora:37"
|
||||
- "fedora:38"
|
||||
- "fedora:rawhide"
|
||||
- "ubuntu:20.04"
|
||||
build_system:
|
||||
- CMake
|
||||
compiler:
|
||||
@ -33,23 +33,23 @@ jobs:
|
||||
on_default_branch:
|
||||
- ${{ contains(github.ref, 'master') || contains(github.ref, 'develop') }}
|
||||
include:
|
||||
- image: 'ubuntu:22.04'
|
||||
- image: "ubuntu:22.04"
|
||||
build_system: Autotools
|
||||
compiler: GNU
|
||||
- image: 'ubuntu:22.04'
|
||||
- image: "ubuntu:22.04"
|
||||
build_system: Autotools
|
||||
compiler: LLVM
|
||||
- image: 'ubuntu:22.04'
|
||||
- image: "ubuntu:22.04"
|
||||
build_system: CMake
|
||||
compiler: GNU
|
||||
- image: 'ubuntu:22.04'
|
||||
- image: "ubuntu:22.04"
|
||||
build_system: CMake
|
||||
compiler: LLVM
|
||||
- image: 'debian:12'
|
||||
- image: "debian:12"
|
||||
build_system: CMake
|
||||
compiler: GNU
|
||||
mapnik_latest: true
|
||||
- image: 'ubuntu:22.04'
|
||||
- image: "ubuntu:22.04"
|
||||
build_system: CMake
|
||||
compiler: GNU
|
||||
mapnik_latest: true
|
||||
@ -67,7 +67,7 @@ jobs:
|
||||
if: matrix.image == 'amazonlinux:2'
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/dependencies/install
|
||||
@ -114,7 +114,7 @@ jobs:
|
||||
- on_default_branch: false
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/dependencies/install
|
||||
@ -162,7 +162,7 @@ jobs:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Provision VM
|
||||
uses: hummeltech/freebsd-vagrant-action@v1.3
|
||||
|
11
.github/workflows/coverage.yml
vendored
11
.github/workflows/coverage.yml
vendored
@ -2,7 +2,11 @@
|
||||
name: Coverage
|
||||
|
||||
on:
|
||||
- push
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- master
|
||||
|
||||
jobs:
|
||||
Coverage:
|
||||
@ -14,7 +18,7 @@ jobs:
|
||||
CXXFLAGS: --coverage
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/dependencies/install
|
||||
@ -48,6 +52,9 @@ jobs:
|
||||
genhtml coverage.info --output-directory coverage
|
||||
working-directory: build
|
||||
|
||||
- name: Write coverage summary to `$GITHUB_STEP_SUMMARY`
|
||||
run: lcov --summary build/coverage.info | sed 's/^ /* /g' >> ${GITHUB_STEP_SUMMARY}
|
||||
|
||||
- name: Upload `mod_tile` coverage results artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
14
.github/workflows/flawfinder-analysis.yml
vendored
14
.github/workflows/flawfinder-analysis.yml
vendored
@ -2,15 +2,13 @@
|
||||
name: flawfinder
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches:
|
||||
- develop
|
||||
- master
|
||||
schedule:
|
||||
- cron: '44 0 * * 4'
|
||||
- cron: "44 0 * * 4"
|
||||
|
||||
jobs:
|
||||
flawfinder:
|
||||
@ -22,13 +20,13 @@ jobs:
|
||||
security-events: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: flawfinder_scan
|
||||
uses: david-a-wheeler/flawfinder@2.0.19
|
||||
with:
|
||||
arguments: '--sarif includes src'
|
||||
output: 'flawfinder_results.sarif'
|
||||
arguments: "--sarif includes src"
|
||||
output: "flawfinder_results.sarif"
|
||||
|
||||
- name: Upload analysis results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
|
34
.github/workflows/lint.yml
vendored
34
.github/workflows/lint.yml
vendored
@ -4,17 +4,14 @@ name: Lint
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
astyle:
|
||||
name: Lint with `astyle`
|
||||
name: Lint with `Artistic Style`
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
- name: Provision environment
|
||||
uses: ./.github/actions/dependencies/install/apt-get
|
||||
with:
|
||||
@ -43,3 +40,30 @@ jobs:
|
||||
printf "\t${ASTYLE_CMD}\n" | tr -s ' '
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cmakelint:
|
||||
name: Lint with `CMakeLint`
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Provision environment
|
||||
run: pip install --user cmakelint
|
||||
- name: Run linter
|
||||
run: |
|
||||
cmakelint --linelength=125 \
|
||||
CMakeLists.txt \
|
||||
*/CMakeLists.txt \
|
||||
*/*.cmake
|
||||
|
||||
prettier:
|
||||
name: Lint with `Prettier`
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Provision environment
|
||||
run: npm install prettier
|
||||
- name: Run linter
|
||||
run: |
|
||||
npx prettier --check .
|
||||
|
@ -39,15 +39,15 @@ find_package(ICU REQUIRED uc)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
find_package(APR REQUIRED)
|
||||
find_package(Cairo REQUIRED)
|
||||
find_package(GLib REQUIRED)
|
||||
find_package(CAIRO REQUIRED)
|
||||
find_package(GLIB REQUIRED)
|
||||
find_package(HTTPD REQUIRED)
|
||||
find_package(IniParser REQUIRED)
|
||||
find_package(LibMapnik REQUIRED)
|
||||
find_package(LibMemcached)
|
||||
find_package(LibRados)
|
||||
find_package(INIPARSER REQUIRED)
|
||||
find_package(LIBMAPNIK REQUIRED)
|
||||
find_package(LIBMEMCACHED)
|
||||
find_package(LIBRADOS)
|
||||
|
||||
if(LibMapnik_VERSION STRGREATER_EQUAL "4")
|
||||
if(LIBMAPNIK_VERSION STRGREATER_EQUAL "4")
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
|
||||
@ -111,7 +111,7 @@ execute_process(COMMAND ${APXS_EXECUTABLE} -q sysconfdir
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if(LibMapnik_VERSION STRLESS "4")
|
||||
if(LIBMAPNIK_VERSION STRLESS "4")
|
||||
find_program(MAPNIK_CONFIG_EXECUTABLE NAMES mapnik-config REQUIRED)
|
||||
execute_process(COMMAND ${MAPNIK_CONFIG_EXECUTABLE} --fonts
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
@ -121,7 +121,7 @@ if(LibMapnik_VERSION STRLESS "4")
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE MAPNIK_PLUGINS_DIR
|
||||
)
|
||||
elseif(LibMapnik_VERSION STRGREATER_EQUAL "4")
|
||||
elseif(LIBMAPNIK_VERSION STRGREATER_EQUAL "4")
|
||||
pkg_get_variable(MAPNIK_FONTS_DIR libmapnik fonts_dir)
|
||||
pkg_get_variable(MAPNIK_PLUGINS_DIR libmapnik plugins_dir)
|
||||
endif()
|
||||
@ -130,7 +130,7 @@ if(NOT CMAKE_INSTALL_MODULESDIR)
|
||||
set(CMAKE_INSTALL_MODULESDIR ${HTTPD_LIBEXECDIR})
|
||||
endif()
|
||||
|
||||
if(Cairo_FOUND)
|
||||
if(CAIRO_FOUND)
|
||||
set(HAVE_CAIRO 1)
|
||||
endif()
|
||||
|
||||
@ -138,11 +138,11 @@ if(CURL_FOUND)
|
||||
set(HAVE_LIBCURL 1)
|
||||
endif()
|
||||
|
||||
if(LibMemcached_FOUND)
|
||||
if(LIBMEMCACHED_FOUND)
|
||||
set(HAVE_LIBMEMCACHED 1)
|
||||
endif()
|
||||
|
||||
if(LibRados_FOUND)
|
||||
if(LIBRADOS_FOUND)
|
||||
set(HAVE_LIBRADOS 1)
|
||||
endif()
|
||||
|
||||
@ -266,16 +266,16 @@ install(
|
||||
)
|
||||
|
||||
# Man files
|
||||
if (ENABLE_MAN)
|
||||
install(
|
||||
FILES
|
||||
docs/man/render_expired.1
|
||||
docs/man/render_list.1
|
||||
docs/man/render_old.1
|
||||
docs/man/render_speedtest.1
|
||||
docs/man/renderd.1
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
|
||||
)
|
||||
if(ENABLE_MAN)
|
||||
install(
|
||||
FILES
|
||||
docs/man/render_expired.1
|
||||
docs/man/render_list.1
|
||||
docs/man/render_old.1
|
||||
docs/man/render_speedtest.1
|
||||
docs/man/renderd.1
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
|
||||
)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@ -284,7 +284,7 @@ endif()
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
if(ENABLE_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
49
cmake/FindCAIRO.cmake
Normal file
49
cmake/FindCAIRO.cmake
Normal 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)
|
@ -1,49 +0,0 @@
|
||||
# - 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
49
cmake/FindGLIB.cmake
Normal 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)
|
@ -1,49 +0,0 @@
|
||||
# - 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)
|
@ -27,15 +27,15 @@ if((NOT HTTPD_FOUND) AND (HTTPD_INCLUDE_DIRS))
|
||||
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}")
|
||||
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 ()
|
||||
set(HTTPD_VERSION ${HTTPD_MAJOR_VERSION}.${HTTPD_MINOR_VERSION}.${HTTPD_PATCH_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(HTTPD
|
||||
|
48
cmake/FindINIPARSER.cmake
Normal file
48
cmake/FindINIPARSER.cmake
Normal 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)
|
@ -1,48 +0,0 @@
|
||||
# - 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)
|
60
cmake/FindLIBMAPNIK.cmake
Normal file
60
cmake/FindLIBMAPNIK.cmake
Normal file
@ -0,0 +1,60 @@
|
||||
# - Find LIBMAPNIK
|
||||
# Find the LIBMAPNIK includes and libraries.
|
||||
# This module defines:
|
||||
# LIBMAPNIK_FOUND
|
||||
# LIBMAPNIK_INCLUDE_DIRS
|
||||
# LIBMAPNIK_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LIBMAPNIK QUIET libmapnik)
|
||||
|
||||
find_path(LIBMAPNIK_INCLUDE_DIR
|
||||
NAMES version.hpp
|
||||
PATHS ${LIBMAPNIK_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES mapnik
|
||||
)
|
||||
|
||||
if((NOT LIBMAPNIK_INCLUDE_DIRS) AND (LIBMAPNIK_INCLUDE_DIR))
|
||||
set(LIBMAPNIK_INCLUDE_DIRS ${LIBMAPNIK_INCLUDE_DIR})
|
||||
elseif(LIBMAPNIK_INCLUDE_DIRS AND LIBMAPNIK_INCLUDE_DIR)
|
||||
list(APPEND LIBMAPNIK_INCLUDE_DIRS ${LIBMAPNIK_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
find_library(LIBMAPNIK_LIBRARY
|
||||
NAMES ${LIBMAPNIK_LIBRARIES} mapnik
|
||||
)
|
||||
|
||||
if((NOT LIBMAPNIK_LIBRARIES) AND (LIBMAPNIK_LIBRARY))
|
||||
set(LIBMAPNIK_LIBRARIES ${LIBMAPNIK_LIBRARY})
|
||||
elseif(LIBMAPNIK_LIBRARIES AND LIBMAPNIK_LIBRARY)
|
||||
list(APPEND LIBMAPNIK_LIBRARIES ${LIBMAPNIK_LIBRARY})
|
||||
endif()
|
||||
|
||||
message(VERBOSE "LIBMAPNIK_INCLUDE_DIRS=${LIBMAPNIK_INCLUDE_DIRS}")
|
||||
message(VERBOSE "LIBMAPNIK_INCLUDE_DIR=${LIBMAPNIK_INCLUDE_DIR}")
|
||||
message(VERBOSE "LIBMAPNIK_LIBRARIES=${LIBMAPNIK_LIBRARIES}")
|
||||
message(VERBOSE "LIBMAPNIK_LIBRARY=${LIBMAPNIK_LIBRARY}")
|
||||
|
||||
if((NOT LIBMAPNIK_FOUND) AND (LIBMAPNIK_INCLUDE_DIRS) AND (LIBMAPNIK_LIBRARIES))
|
||||
set(LIBMAPNIK_FOUND True)
|
||||
endif()
|
||||
|
||||
if((NOT LIBMAPNIK_VERSION) AND (LIBMAPNIK_FOUND))
|
||||
file(STRINGS "${LIBMAPNIK_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" LIBMAPNIK_MAJOR_VERSION "${_contents}")
|
||||
string(REGEX REPLACE ".*#define MAPNIK_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" LIBMAPNIK_MINOR_VERSION "${_contents}")
|
||||
string(REGEX REPLACE ".*#define MAPNIK_PATCH_VERSION[ \t]+([0-9]+).*" "\\1" LIBMAPNIK_PATCH_VERSION "${_contents}")
|
||||
|
||||
set(LIBMAPNIK_VERSION ${LIBMAPNIK_MAJOR_VERSION}.${LIBMAPNIK_MINOR_VERSION}.${LIBMAPNIK_PATCH_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LIBMAPNIK
|
||||
FOUND_VAR LIBMAPNIK_FOUND
|
||||
REQUIRED_VARS LIBMAPNIK_FOUND LIBMAPNIK_INCLUDE_DIRS LIBMAPNIK_LIBRARIES
|
||||
VERSION_VAR LIBMAPNIK_VERSION
|
||||
)
|
||||
|
||||
mark_as_advanced(LIBMAPNIK_INCLUDE_DIR LIBMAPNIK_LIBRARY)
|
49
cmake/FindLIBMEMCACHED.cmake
Normal file
49
cmake/FindLIBMEMCACHED.cmake
Normal 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
60
cmake/FindLIBRADOS.cmake
Normal 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)
|
@ -1,60 +0,0 @@
|
||||
# - Find LibMapnik
|
||||
# Find the LibMapnik includes and libraries.
|
||||
# This module defines:
|
||||
# LibMapnik_FOUND
|
||||
# LibMapnik_INCLUDE_DIRS
|
||||
# LibMapnik_LIBRARIES
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(LibMapnik QUIET libmapnik)
|
||||
|
||||
find_path(LibMapnik_INCLUDE_DIR
|
||||
NAMES version.hpp
|
||||
PATHS ${LibMapnik_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES mapnik
|
||||
)
|
||||
|
||||
if((NOT LibMapnik_INCLUDE_DIRS) AND (LibMapnik_INCLUDE_DIR))
|
||||
set(LibMapnik_INCLUDE_DIRS ${LibMapnik_INCLUDE_DIR})
|
||||
elseif(LibMapnik_INCLUDE_DIRS AND LibMapnik_INCLUDE_DIR)
|
||||
list(APPEND LibMapnik_INCLUDE_DIRS ${LibMapnik_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
find_library(LibMapnik_LIBRARY
|
||||
NAMES ${LibMapnik_LIBRARIES} mapnik
|
||||
)
|
||||
|
||||
if((NOT LibMapnik_LIBRARIES) AND (LibMapnik_LIBRARY))
|
||||
set(LibMapnik_LIBRARIES ${LibMapnik_LIBRARY})
|
||||
elseif(LibMapnik_LIBRARIES AND LibMapnik_LIBRARY)
|
||||
list(APPEND LibMapnik_LIBRARIES ${LibMapnik_LIBRARY})
|
||||
endif()
|
||||
|
||||
message(VERBOSE "LibMapnik_INCLUDE_DIRS=${LibMapnik_INCLUDE_DIRS}")
|
||||
message(VERBOSE "LibMapnik_INCLUDE_DIR=${LibMapnik_INCLUDE_DIR}")
|
||||
message(VERBOSE "LibMapnik_LIBRARIES=${LibMapnik_LIBRARIES}")
|
||||
message(VERBOSE "LibMapnik_LIBRARY=${LibMapnik_LIBRARY}")
|
||||
|
||||
if((NOT LibMapnik_FOUND) AND (LibMapnik_INCLUDE_DIRS) AND (LibMapnik_LIBRARIES))
|
||||
set(LibMapnik_FOUND True)
|
||||
endif()
|
||||
|
||||
if((NOT LibMapnik_VERSION) AND (LibMapnik_FOUND))
|
||||
file(STRINGS "${LibMapnik_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" LibMapnik_MAJOR_VERSION "${_contents}")
|
||||
string(REGEX REPLACE ".*#define MAPNIK_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" LibMapnik_MINOR_VERSION "${_contents}")
|
||||
string(REGEX REPLACE ".*#define MAPNIK_PATCH_VERSION[ \t]+([0-9]+).*" "\\1" LibMapnik_PATCH_VERSION "${_contents}")
|
||||
|
||||
set(LibMapnik_VERSION ${LibMapnik_MAJOR_VERSION}.${LibMapnik_MINOR_VERSION}.${LibMapnik_PATCH_VERSION})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibMapnik
|
||||
FOUND_VAR LibMapnik_FOUND
|
||||
REQUIRED_VARS LibMapnik_FOUND LibMapnik_INCLUDE_DIRS LibMapnik_LIBRARIES
|
||||
VERSION_VAR LibMapnik_VERSION
|
||||
)
|
||||
|
||||
mark_as_advanced(LibMapnik_INCLUDE_DIR LibMapnik_LIBRARY)
|
@ -1,49 +0,0 @@
|
||||
# - 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)
|
@ -1,60 +0,0 @@
|
||||
# - 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)
|
5
docs/build/building_on_centos.md
vendored
5
docs/build/building_on_centos.md
vendored
@ -7,6 +7,7 @@ Please see our [Continuous Integration script](/.github/workflows/build-and-test
|
||||
_CentOS does not provide a `mapnik`/`mapnik-devel` package, so it will first need to be built & installed, which is beyond the scope of this document, please visit the project's [installation document on GitHub](https://github.com/mapnik/mapnik/blob/master/INSTALL.md) or our [Continuous Integration script](/.github/actions/dependencies/build-and-install/mapnik/action.yml) for more information._
|
||||
|
||||
## CentOS 7
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@ -39,7 +40,9 @@ sudo yum --assumeyes --setopt=install_weak_deps=False install \
|
||||
proj
|
||||
|
||||
# Download, Build, Test & Install `mod_tile`
|
||||
export CFLAGS="-I/usr/include/boost169"
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
|
||||
export CXXFLAGS="-I/usr/include/boost169"
|
||||
rm -rf /tmp/mod_tile_src /tmp/mod_tile_build
|
||||
mkdir /tmp/mod_tile_src /tmp/mod_tile_build
|
||||
cd /tmp/mod_tile_src
|
||||
@ -47,8 +50,6 @@ git clone --depth 1 https://github.com/openstreetmap/mod_tile.git .
|
||||
cd /tmp/mod_tile_build
|
||||
cmake3 -B . -S /tmp/mod_tile_src \
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release \
|
||||
-DCMAKE_CXX_FLAGS:STRING="-I/usr/include/boost169" \
|
||||
-DCMAKE_C_FLAGS:STRING="-I/usr/include/boost169" \
|
||||
-DENABLE_TESTS:BOOL=ON
|
||||
cmake3 --build .
|
||||
ctest3
|
||||
|
3
docs/build/building_on_centos_stream.md
vendored
3
docs/build/building_on_centos_stream.md
vendored
@ -7,6 +7,7 @@ Please see our [Continuous Integration script](/.github/workflows/build-and-test
|
||||
_CentOS Stream does not provide a `mapnik`/`mapnik-devel` package, so it will first need to be built & installed, which is beyond the scope of this document, please visit the project's [installation document on GitHub](https://github.com/mapnik/mapnik/blob/master/INSTALL.md) or our [Continuous Integration script](/.github/actions/dependencies/build-and-install/mapnik/action.yml) for more information._
|
||||
|
||||
## CentOS Stream 8
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@ -18,6 +19,7 @@ sudo dnf config-manager --save --setopt=powertools.enabled=1
|
||||
```
|
||||
|
||||
## CentOS Stream 9
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@ -29,6 +31,7 @@ sudo dnf config-manager --save --setopt=crb.enabled=1
|
||||
```
|
||||
|
||||
## CentOS Stream 8/9
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
1
docs/build/building_on_debian.md
vendored
1
docs/build/building_on_debian.md
vendored
@ -5,6 +5,7 @@ This document provides users with step-by-step instructions on how to compile an
|
||||
Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details.
|
||||
|
||||
## Debian 10/11/12
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
1
docs/build/building_on_fedora.md
vendored
1
docs/build/building_on_fedora.md
vendored
@ -5,6 +5,7 @@ This document provides users with step-by-step instructions on how to compile an
|
||||
Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details.
|
||||
|
||||
## Fedora 34/35/36/37/38
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
3
docs/build/building_on_freebsd.md
vendored
3
docs/build/building_on_freebsd.md
vendored
@ -5,6 +5,7 @@ This document provides users with step-by-step instructions on how to compile an
|
||||
Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details.
|
||||
|
||||
## FreeBSD 12/13
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env sh
|
||||
|
||||
@ -29,6 +30,7 @@ sudo pkg install --yes \
|
||||
|
||||
# Download, Build, Test & Install `mod_tile`
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.ncpu)
|
||||
export LIBRARY_PATH="/usr/local/lib"
|
||||
rm -rf /tmp/mod_tile_src /tmp/mod_tile_build
|
||||
mkdir /tmp/mod_tile_src /tmp/mod_tile_build
|
||||
cd /tmp/mod_tile_src
|
||||
@ -36,7 +38,6 @@ git clone --depth 1 https://github.com/openstreetmap/mod_tile.git .
|
||||
cd /tmp/mod_tile_build
|
||||
cmake -B . -S /tmp/mod_tile_src \
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release \
|
||||
-DCMAKE_LIBRARY_PATH:PATH=/usr/local/lib \
|
||||
-DENABLE_TESTS:BOOL=ON
|
||||
cmake --build .
|
||||
ctest
|
||||
|
1
docs/build/building_on_macos.md
vendored
1
docs/build/building_on_macos.md
vendored
@ -5,6 +5,7 @@ This document provides users with step-by-step instructions on how to compile an
|
||||
Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details.
|
||||
|
||||
## macOS 11/12/13
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
1
docs/build/building_on_ubuntu.md
vendored
1
docs/build/building_on_ubuntu.md
vendored
@ -5,6 +5,7 @@ This document provides users with step-by-step instructions on how to compile an
|
||||
Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details.
|
||||
|
||||
# Ubuntu 20.04/22.04
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
@ -6,8 +6,20 @@
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/includes)
|
||||
|
||||
include_directories(SYSTEM ${APR_INCLUDE_DIRS} ${Cairo_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${GLib_INCLUDE_DIRS} ${HTTPD_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${ICU_INCLUDE_DIRS} ${IniParser_INCLUDE_DIRS} ${LibMapnik_INCLUDE_DIRS} ${LibMemcached_INCLUDE_DIRS} ${LibRados_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM
|
||||
${APR_INCLUDE_DIRS}
|
||||
${CAIRO_INCLUDE_DIRS}
|
||||
${CURL_INCLUDE_DIRS}
|
||||
${GLIB_INCLUDE_DIRS}
|
||||
${HTTPD_INCLUDE_DIRS}
|
||||
)
|
||||
include_directories(SYSTEM
|
||||
${ICU_INCLUDE_DIRS}
|
||||
${INIPARSER_INCLUDE_DIRS}
|
||||
${LIBMAPNIK_INCLUDE_DIRS}
|
||||
${LIBMEMCACHED_INCLUDE_DIRS}
|
||||
${LIBRADOS_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_directories(${CMAKE_LIBRARY_PATH})
|
||||
|
||||
@ -16,7 +28,7 @@ set(COMMON_SRCS
|
||||
sys_utils.c
|
||||
)
|
||||
set(COMMON_LIBRARIES
|
||||
${GLib_LIBRARIES}
|
||||
${GLIB_LIBRARIES}
|
||||
Threads::Threads
|
||||
)
|
||||
|
||||
@ -31,10 +43,10 @@ set(STORE_SRCS
|
||||
store.c
|
||||
)
|
||||
set(STORE_LIBRARIES
|
||||
${Cairo_LIBRARIES}
|
||||
${CAIRO_LIBRARIES}
|
||||
${CURL_LIBRARIES}
|
||||
${LibMemcached_LIBRARIES}
|
||||
${LibRados_LIBRARIES}
|
||||
${LIBMEMCACHED_LIBRARIES}
|
||||
${LIBRADOS_LIBRARIES}
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@ -161,8 +173,8 @@ set(renderd_SRCS
|
||||
set(renderd_LIBS
|
||||
${COMMON_LIBRARIES}
|
||||
${ICU_LIBRARIES}
|
||||
${IniParser_LIBRARIES}
|
||||
${LibMapnik_LIBRARIES}
|
||||
${INIPARSER_LIBRARIES}
|
||||
${LIBMAPNIK_LIBRARIES}
|
||||
${STORE_LIBRARIES}
|
||||
)
|
||||
add_executable(renderd ${renderd_SRCS})
|
||||
@ -174,7 +186,7 @@ target_link_libraries(renderd ${renderd_LIBS})
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if(ENABLE_TESTS)
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# gen_tile_test
|
||||
@ -183,7 +195,7 @@ if (ENABLE_TESTS)
|
||||
|
||||
set(gen_tile_test_SRCS
|
||||
${renderd_SRCS}
|
||||
gen_tile_test.cpp
|
||||
gen_tile_test.cpp
|
||||
)
|
||||
set(gen_tile_test_LIBS
|
||||
${renderd_LIBS}
|
||||
|
@ -91,9 +91,11 @@ add_test(
|
||||
add_test(
|
||||
NAME start_renderd
|
||||
COMMAND ${BASH} -c "
|
||||
echo '${PROJECT_BINARY_DIR}/src/renderd --config ${PROJECT_BINARY_DIR}/tests/conf/renderd.conf --foreground --slave 0 > ${PROJECT_BINARY_DIR}/tests/logs/renderd0.log 2>&1 &' > ${PROJECT_BINARY_DIR}/tests/renderd_start.sh
|
||||
echo '${PROJECT_BINARY_DIR}/src/renderd --config ${PROJECT_BINARY_DIR}/tests/conf/renderd.conf --foreground \
|
||||
--slave 0 > ${PROJECT_BINARY_DIR}/tests/logs/renderd0.log 2>&1 &' > ${PROJECT_BINARY_DIR}/tests/renderd_start.sh
|
||||
echo 'printf \${!} > ${PROJECT_BINARY_DIR}/tests/run/renderd0.pid' >> ${PROJECT_BINARY_DIR}/tests/renderd_start.sh
|
||||
echo '${PROJECT_BINARY_DIR}/src/renderd --config ${PROJECT_BINARY_DIR}/tests/conf/renderd.conf --foreground --slave 1 > ${PROJECT_BINARY_DIR}/tests/logs/renderd1.log 2>&1 &' >> ${PROJECT_BINARY_DIR}/tests/renderd_start.sh
|
||||
echo '${PROJECT_BINARY_DIR}/src/renderd --config ${PROJECT_BINARY_DIR}/tests/conf/renderd.conf --foreground \
|
||||
--slave 1 > ${PROJECT_BINARY_DIR}/tests/logs/renderd1.log 2>&1 &' >> ${PROJECT_BINARY_DIR}/tests/renderd_start.sh
|
||||
echo 'printf \${!} > ${PROJECT_BINARY_DIR}/tests/run/renderd1.pid' >> ${PROJECT_BINARY_DIR}/tests/renderd_start.sh
|
||||
echo 'exit 0' >> ${PROJECT_BINARY_DIR}/tests/renderd_start.sh
|
||||
${BASH} ${PROJECT_BINARY_DIR}/tests/renderd_start.sh
|
||||
@ -186,7 +188,11 @@ add_test(
|
||||
(echo '${TILE_JPG_SHA256SUM} tile.jpg' | ${SHA256SUM_EXECUTABLE} -c) && \
|
||||
(echo '${TILE_PNG256_SHA256SUM} tile.png256' | ${SHA256SUM_EXECUTABLE} -c) && \
|
||||
(echo '${TILE_PNG32_SHA256SUM} tile.png32' | ${SHA256SUM_EXECUTABLE} -c) && \
|
||||
((echo '${TILE_WEBP_SHA256SUM_7} tile.webp' | ${SHA256SUM_EXECUTABLE} -c) || (echo '${TILE_WEBP_SHA256SUM_6} tile.webp' | ${SHA256SUM_EXECUTABLE} -c) || (echo '${TILE_WEBP_SHA256SUM_4} tile.webp' | ${SHA256SUM_EXECUTABLE} -c))
|
||||
( \
|
||||
(echo '${TILE_WEBP_SHA256SUM_7} tile.webp' | ${SHA256SUM_EXECUTABLE} -c) || \
|
||||
(echo '${TILE_WEBP_SHA256SUM_6} tile.webp' | ${SHA256SUM_EXECUTABLE} -c) || \
|
||||
(echo '${TILE_WEBP_SHA256SUM_4} tile.webp' | ${SHA256SUM_EXECUTABLE} -c) \
|
||||
)
|
||||
"
|
||||
WORKING_DIRECTORY tests
|
||||
)
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>renderd example map</title>
|
||||
@ -22,20 +22,20 @@
|
||||
|
||||
var png = L.tileLayer(
|
||||
"http://localhost:8081/tiles/renderd-example/{z}/{x}/{y}.png",
|
||||
options
|
||||
options,
|
||||
);
|
||||
|
||||
var jpg = L.tileLayer(
|
||||
"http://localhost:8081/tiles/renderd-example-jpg/{z}/{x}/{y}.jpg",
|
||||
options
|
||||
options,
|
||||
);
|
||||
var png32 = L.tileLayer(
|
||||
"http://localhost:8081/tiles/renderd-example-png32/{z}/{x}/{y}.png",
|
||||
options
|
||||
options,
|
||||
);
|
||||
var webp = L.tileLayer(
|
||||
"http://localhost:8081/tiles/renderd-example-webp/{z}/{x}/{y}.webp",
|
||||
options
|
||||
options,
|
||||
);
|
||||
|
||||
var map = L.map("map", {
|
||||
|
Reference in New Issue
Block a user