2021-09-17 01:16:18 +02:00
|
|
|
# test application for this port: https://github.com/mathisloge/mapnik-vcpkg-test
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO mapnik/mapnik
|
2024-05-10 05:29:06 +02:00
|
|
|
REF 283e2762d4c2175aa30f4f18ca383d1f69dcfaf6
|
|
|
|
SHA512 8ce914249c54d7d30e53fcccb7400fd98696390e53d18d97848b46ff99945bb76772dc8d3e7d37aad87db3ea67c6b00fd6bea04d5bc6ea09449d429caccea339
|
2021-09-17 01:16:18 +02:00
|
|
|
HEAD_REF master
|
2024-05-10 05:29:06 +02:00
|
|
|
PATCHES fix-compatibility-with-boost-1.85.patch
|
2021-09-17 01:16:18 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
"jpeg" USE_JPEG
|
|
|
|
"png" USE_PNG
|
|
|
|
"tiff" USE_TIFF
|
|
|
|
"webp" USE_WEBP
|
|
|
|
"libxml2" USE_LIBXML2
|
|
|
|
"cairo" USE_CAIRO
|
|
|
|
"proj" USE_PROJ
|
|
|
|
"grid-renderer" USE_GRID_RENDERER
|
|
|
|
"svg-renderer" USE_SVG_RENDERER
|
|
|
|
"input-csv" USE_PLUGIN_INPUT_CSV
|
|
|
|
"input-gdal" USE_PLUGIN_INPUT_GDAL
|
|
|
|
"input-geobuf" USE_PLUGIN_INPUT_GEOBUF
|
|
|
|
"input-geojson" USE_PLUGIN_INPUT_GEOJSON
|
|
|
|
"input-ogr" USE_PLUGIN_INPUT_OGR
|
|
|
|
"input-pgraster" USE_PLUGIN_INPUT_PGRASTER
|
|
|
|
"input-postgis" USE_PLUGIN_INPUT_POSTGIS
|
|
|
|
"input-raster" USE_PLUGIN_INPUT_RASTER
|
|
|
|
"input-shape" USE_PLUGIN_INPUT_SHAPE
|
|
|
|
"input-sqlite" USE_PLUGIN_INPUT_SQLITE
|
|
|
|
"input-topojson" USE_PLUGIN_INPUT_TOPOJSON
|
|
|
|
"viewer" BUILD_DEMO_VIEWER
|
|
|
|
"utility-geometry-to-wkb" BUILD_UTILITY_GEOMETRY_TO_WKB
|
|
|
|
"utility-mapnik-index" BUILD_UTILITY_MAPNIK_INDEX
|
|
|
|
"utility-mapnik-render" BUILD_UTILITY_MAPNIK_RENDER
|
|
|
|
"utility-ogrindex" BUILD_UTILITY_OGRINDEX
|
|
|
|
"utility-pgsql2sqlite" BUILD_UTILITY_PGSQL2SQLITE
|
|
|
|
"utility-shapeindex" BUILD_UTILITY_SHAPEINDEX
|
|
|
|
"utility-svg2png" BUILD_UTILITY_SVG2PNG
|
|
|
|
)
|
|
|
|
|
2023-01-27 04:22:14 +01:00
|
|
|
if (VCPKG_CRT_LINKAGE STREQUAL dynamic)
|
|
|
|
set(BUILD_SHARED_CRT ON)
|
|
|
|
else()
|
|
|
|
set(BUILD_SHARED_CRT OFF)
|
|
|
|
endif()
|
|
|
|
vcpkg_find_acquire_program(PKGCONFIG)
|
|
|
|
|
2021-09-17 01:16:18 +02:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2023-01-27 04:22:14 +01:00
|
|
|
-DBUILD_SHARED_CRT=${BUILD_SHARED_CRT}
|
2021-09-17 01:16:18 +02:00
|
|
|
-DINSTALL_DEPENDENCIES=OFF
|
2021-11-17 01:42:49 +01:00
|
|
|
-DBUILD_TESTING=OFF
|
2021-09-17 01:16:18 +02:00
|
|
|
-DBUILD_BENCHMARK=OFF
|
2021-10-16 04:14:06 +02:00
|
|
|
-DBUILD_DEMO_CPP=OFF
|
2021-09-17 01:16:18 +02:00
|
|
|
-DUSE_EXTERNAL_MAPBOX_GEOMETRY=ON
|
|
|
|
-DUSE_EXTERNAL_MAPBOX_POLYLABEL=ON
|
|
|
|
-DUSE_EXTERNAL_MAPBOX_PROTOZERO=ON
|
|
|
|
-DUSE_EXTERNAL_MAPBOX_VARIANT=ON
|
2022-04-29 11:40:30 -07:00
|
|
|
-DBOOST_REGEX_HAS_ICU=ON
|
2021-10-16 04:14:06 +02:00
|
|
|
-DMAPNIK_CMAKE_DIR=share/mapnik/cmake
|
2021-09-17 01:16:18 +02:00
|
|
|
-DFONTS_INSTALL_DIR=share/mapnik/fonts
|
2021-10-16 04:14:06 +02:00
|
|
|
-DMAPNIK_PKGCONF_DIR=lib/pkgconfig
|
2023-01-27 04:22:14 +01:00
|
|
|
-DPKG_CONFIG_EXECUTABLE="${PKGCONFIG}"
|
2021-09-17 01:16:18 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_cmake_install()
|
|
|
|
# copy plugins into tool path, if any plugin is installed
|
|
|
|
if(IS_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin/plugins")
|
2021-10-16 04:14:06 +02:00
|
|
|
file(COPY "${CURRENT_PACKAGES_DIR}/bin/plugins" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
2021-09-17 01:16:18 +02:00
|
|
|
endif()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-10-16 04:14:06 +02:00
|
|
|
set(_tool_names "")
|
2021-09-17 01:16:18 +02:00
|
|
|
if("viewer" IN_LIST FEATURES)
|
2021-10-16 04:14:06 +02:00
|
|
|
# copy the ini file to reference the plugins correctly
|
|
|
|
file(COPY "${CURRENT_PACKAGES_DIR}/bin/viewer.ini" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
list(APPEND _tool_names mapnik-viewer)
|
2021-09-17 01:16:18 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if("utility-geometry-to-wkb" IN_LIST FEATURES)
|
2021-10-16 04:14:06 +02:00
|
|
|
list(APPEND _tool_names geometry_to_wkb)
|
2021-09-17 01:16:18 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if("utility-mapnik-index" IN_LIST FEATURES)
|
2021-10-16 04:14:06 +02:00
|
|
|
list(APPEND _tool_names mapnik-index)
|
2021-09-17 01:16:18 +02:00
|
|
|
endif()
|
|
|
|
if("utility-mapnik-render" IN_LIST FEATURES)
|
2021-10-16 04:14:06 +02:00
|
|
|
list(APPEND _tool_names mapnik-render)
|
2021-09-17 01:16:18 +02:00
|
|
|
endif()
|
|
|
|
if("utility-ogrindex" IN_LIST FEATURES)
|
2021-10-16 04:14:06 +02:00
|
|
|
# build is currently not supported
|
|
|
|
# vcpkg_copy_tools(TOOL_NAMES ogrindex AUTO_CLEAN)
|
2021-09-17 01:16:18 +02:00
|
|
|
endif()
|
|
|
|
if("utility-pgsql2sqlite" IN_LIST FEATURES)
|
2021-10-16 04:14:06 +02:00
|
|
|
list(APPEND _tool_names pgsql2sqlite)
|
2021-09-17 01:16:18 +02:00
|
|
|
endif()
|
|
|
|
if("utility-shapeindex" IN_LIST FEATURES)
|
2021-10-16 04:14:06 +02:00
|
|
|
list(APPEND _tool_names shapeindex)
|
2021-09-17 01:16:18 +02:00
|
|
|
endif()
|
|
|
|
if("utility-svg2png" IN_LIST FEATURES)
|
2021-10-16 04:14:06 +02:00
|
|
|
list(APPEND _tool_names svg2png)
|
|
|
|
endif()
|
|
|
|
if(_tool_names)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES ${_tool_names} AUTO_CLEAN)
|
2021-09-17 01:16:18 +02:00
|
|
|
endif()
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH share/mapnik/cmake)
|
2021-10-16 04:14:06 +02:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2021-09-17 01:16:18 +02:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
|
2021-10-16 04:14:06 +02:00
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/share/mapnik/mapnikPlugins-debug.cmake" "set(MAPNIK_PLUGINS_DIR_DEBUG \"\${PACKAGE_PREFIX_DIR}/debug/bin/mapnik/input\" CACHE STRING \"\")")
|
|
|
|
|
2021-09-17 01:16:18 +02:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
|
|
|
file(INSTALL "${SOURCE_PATH}/fonts/unifont_license.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME fonts_copyright)
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|