From bc0ddfef9cb4b0f0abe9d61a12275a498dbca1ec Mon Sep 17 00:00:00 2001 From: Hummeltech <6109326+hummeltech@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:17:22 -0700 Subject: [PATCH] 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` --- .../mapnik/latest/action.yml | 2 +- .github/workflows/build-and-test.yml | 38 ++++++------ .github/workflows/coverage.yml | 11 +++- .github/workflows/flawfinder-analysis.yml | 14 ++--- .github/workflows/lint.yml | 34 +++++++++-- CMakeLists.txt | 50 ++++++++-------- cmake/FindCAIRO.cmake | 49 +++++++++++++++ cmake/FindCairo.cmake | 49 --------------- cmake/FindGLIB.cmake | 49 +++++++++++++++ cmake/FindGLib.cmake | 49 --------------- cmake/FindHTTPD.cmake | 16 ++--- cmake/FindINIPARSER.cmake | 48 +++++++++++++++ cmake/FindIniParser.cmake | 48 --------------- cmake/FindLIBMAPNIK.cmake | 60 +++++++++++++++++++ cmake/FindLIBMEMCACHED.cmake | 49 +++++++++++++++ cmake/FindLIBRADOS.cmake | 60 +++++++++++++++++++ cmake/FindLibMapnik.cmake | 60 ------------------- cmake/FindLibMemcached.cmake | 49 --------------- cmake/FindLibRados.cmake | 60 ------------------- docs/build/building_on_centos.md | 5 +- docs/build/building_on_centos_stream.md | 3 + docs/build/building_on_debian.md | 1 + docs/build/building_on_fedora.md | 1 + docs/build/building_on_freebsd.md | 3 +- docs/build/building_on_macos.md | 1 + docs/build/building_on_ubuntu.md | 1 + src/CMakeLists.txt | 32 ++++++---- tests/CMakeLists.txt | 12 +++- utils/example-map/index.html | 10 ++-- 29 files changed, 460 insertions(+), 404 deletions(-) create mode 100644 cmake/FindCAIRO.cmake delete mode 100644 cmake/FindCairo.cmake create mode 100644 cmake/FindGLIB.cmake delete mode 100644 cmake/FindGLib.cmake create mode 100644 cmake/FindINIPARSER.cmake delete mode 100644 cmake/FindIniParser.cmake create mode 100644 cmake/FindLIBMAPNIK.cmake create mode 100644 cmake/FindLIBMEMCACHED.cmake create mode 100644 cmake/FindLIBRADOS.cmake delete mode 100644 cmake/FindLibMapnik.cmake delete mode 100644 cmake/FindLibMemcached.cmake delete mode 100644 cmake/FindLibRados.cmake diff --git a/.github/actions/dependencies/build-and-install/mapnik/latest/action.yml b/.github/actions/dependencies/build-and-install/mapnik/latest/action.yml index 14c80be..3a7fd23 100644 --- a/.github/actions/dependencies/build-and-install/mapnik/latest/action.yml +++ b/.github/actions/dependencies/build-and-install/mapnik/latest/action.yml @@ -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 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4f198c6..a21ef52 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 461228c..8aa9502 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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: diff --git a/.github/workflows/flawfinder-analysis.yml b/.github/workflows/flawfinder-analysis.yml index e71af93..68c96eb 100644 --- a/.github/workflows/flawfinder-analysis.yml +++ b/.github/workflows/flawfinder-analysis.yml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dea0466..fc167a3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 . diff --git a/CMakeLists.txt b/CMakeLists.txt index c75334a..81e627b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/cmake/FindCAIRO.cmake b/cmake/FindCAIRO.cmake new file mode 100644 index 0000000..b95d5b1 --- /dev/null +++ b/cmake/FindCAIRO.cmake @@ -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) diff --git a/cmake/FindCairo.cmake b/cmake/FindCairo.cmake deleted file mode 100644 index 30b2e2e..0000000 --- a/cmake/FindCairo.cmake +++ /dev/null @@ -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) diff --git a/cmake/FindGLIB.cmake b/cmake/FindGLIB.cmake new file mode 100644 index 0000000..87b2012 --- /dev/null +++ b/cmake/FindGLIB.cmake @@ -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) diff --git a/cmake/FindGLib.cmake b/cmake/FindGLib.cmake deleted file mode 100644 index 2338d6b..0000000 --- a/cmake/FindGLib.cmake +++ /dev/null @@ -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) diff --git a/cmake/FindHTTPD.cmake b/cmake/FindHTTPD.cmake index 8875c97..523f3ff 100644 --- a/cmake/FindHTTPD.cmake +++ b/cmake/FindHTTPD.cmake @@ -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 diff --git a/cmake/FindINIPARSER.cmake b/cmake/FindINIPARSER.cmake new file mode 100644 index 0000000..79dafba --- /dev/null +++ b/cmake/FindINIPARSER.cmake @@ -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) diff --git a/cmake/FindIniParser.cmake b/cmake/FindIniParser.cmake deleted file mode 100644 index ee719c7..0000000 --- a/cmake/FindIniParser.cmake +++ /dev/null @@ -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) diff --git a/cmake/FindLIBMAPNIK.cmake b/cmake/FindLIBMAPNIK.cmake new file mode 100644 index 0000000..6959de0 --- /dev/null +++ b/cmake/FindLIBMAPNIK.cmake @@ -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) diff --git a/cmake/FindLIBMEMCACHED.cmake b/cmake/FindLIBMEMCACHED.cmake new file mode 100644 index 0000000..9faa04c --- /dev/null +++ b/cmake/FindLIBMEMCACHED.cmake @@ -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) diff --git a/cmake/FindLIBRADOS.cmake b/cmake/FindLIBRADOS.cmake new file mode 100644 index 0000000..575b5c8 --- /dev/null +++ b/cmake/FindLIBRADOS.cmake @@ -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) diff --git a/cmake/FindLibMapnik.cmake b/cmake/FindLibMapnik.cmake deleted file mode 100644 index d70b723..0000000 --- a/cmake/FindLibMapnik.cmake +++ /dev/null @@ -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) diff --git a/cmake/FindLibMemcached.cmake b/cmake/FindLibMemcached.cmake deleted file mode 100644 index 0be4c73..0000000 --- a/cmake/FindLibMemcached.cmake +++ /dev/null @@ -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) diff --git a/cmake/FindLibRados.cmake b/cmake/FindLibRados.cmake deleted file mode 100644 index 1cacf6f..0000000 --- a/cmake/FindLibRados.cmake +++ /dev/null @@ -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) diff --git a/docs/build/building_on_centos.md b/docs/build/building_on_centos.md index 52c9246..e5224a5 100644 --- a/docs/build/building_on_centos.md +++ b/docs/build/building_on_centos.md @@ -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 diff --git a/docs/build/building_on_centos_stream.md b/docs/build/building_on_centos_stream.md index 2f25e9b..2d740ca 100644 --- a/docs/build/building_on_centos_stream.md +++ b/docs/build/building_on_centos_stream.md @@ -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 diff --git a/docs/build/building_on_debian.md b/docs/build/building_on_debian.md index 2183881..b25a734 100644 --- a/docs/build/building_on_debian.md +++ b/docs/build/building_on_debian.md @@ -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 diff --git a/docs/build/building_on_fedora.md b/docs/build/building_on_fedora.md index 5011745..0ea95fb 100644 --- a/docs/build/building_on_fedora.md +++ b/docs/build/building_on_fedora.md @@ -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 diff --git a/docs/build/building_on_freebsd.md b/docs/build/building_on_freebsd.md index 88dc1ce..9e74f7f 100644 --- a/docs/build/building_on_freebsd.md +++ b/docs/build/building_on_freebsd.md @@ -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 diff --git a/docs/build/building_on_macos.md b/docs/build/building_on_macos.md index 782d1ee..ebc0c5a 100644 --- a/docs/build/building_on_macos.md +++ b/docs/build/building_on_macos.md @@ -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 diff --git a/docs/build/building_on_ubuntu.md b/docs/build/building_on_ubuntu.md index 7e27720..1607aea 100644 --- a/docs/build/building_on_ubuntu.md +++ b/docs/build/building_on_ubuntu.md @@ -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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0450c3f..7710c6f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 773bfb2..cdb16b2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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 ) diff --git a/utils/example-map/index.html b/utils/example-map/index.html index 26b1231..e5aa3ae 100644 --- a/utils/example-map/index.html +++ b/utils/example-map/index.html @@ -1,4 +1,4 @@ - +