more cmake
This commit is contained in:
parent
7d46eda60d
commit
6254f7c09e
22 changed files with 473 additions and 45 deletions
114
CMakeLists.txt
114
CMakeLists.txt
|
@ -20,6 +20,18 @@ option(USE_WEBP "Adds webp support" ON)
|
|||
option(USE_LIBXML2 "Adds libxml2 support" ON)
|
||||
option(USE_CAIRO "Adds the cairo renderer" ON)
|
||||
|
||||
option(USE_PLUGIN_INPUT_CSV "adds plugin input csv" ON)
|
||||
option(USE_PLUGIN_INPUT_GDAL "adds plugin input gdal" ON)
|
||||
option(USE_PLUGIN_INPUT_GEOBUF "adds plugin input geobuf" ON)
|
||||
option(USE_PLUGIN_INPUT_GEOJSON "adds plugin input geojson" ON)
|
||||
option(USE_PLUGIN_INPUT_OGR "adds plugin input ogr" ON)
|
||||
option(USE_PLUGIN_INPUT_PGRASTER "adds plugin input pgraster" ON)
|
||||
option(USE_PLUGIN_INPUT_POSTGIS "adds plugin input postgis" ON)
|
||||
option(USE_PLUGIN_INPUT_RASTER "adds plugin input raster" ON)
|
||||
option(USE_PLUGIN_INPUT_SHAPE "adds plugin input shape" ON)
|
||||
option(USE_PLUGIN_INPUT_SQLITE "adds plugin input sqlite" ON)
|
||||
option(USE_PLUGIN_INPUT_TOPOJSON "adds plugin input topojson" ON)
|
||||
|
||||
set(CXX_STANDARD 17)
|
||||
|
||||
find_package(Boost 1.74 REQUIRED COMPONENTS filesystem system regex program_options)
|
||||
|
@ -28,36 +40,61 @@ find_package(Freetype REQUIRED)
|
|||
find_package(harfbuzz CONFIG REQUIRED)
|
||||
|
||||
if(USE_EXTERNAL_MAPBOX_GEOMETRY)
|
||||
find_path(MAPBOX_GEOMETRY_INCLUDE_DIRS "mapbox/geometry.hpp")
|
||||
# provide a way to specify the include dirs with the CACHE VARIABLES
|
||||
if(NOT MAPBOX_GEOMETRY_INCLUDE_DIRS)
|
||||
message(STATUS "Searching for the include dir of mapbox/geometry.hpp")
|
||||
find_path(MAPBOX_GEOMETRY_INCLUDE_DIRS "mapbox/geometry.hpp" REQUIRED)
|
||||
endif()
|
||||
else()
|
||||
set(MAPBOX_GEOMETRY_INCLUDE_DIRS deps/mapbox/geometry/include)
|
||||
set(MAPBOX_GEOMETRY_INCLUDE_DIRS
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/geometry/include>
|
||||
$<INSTALL_INTERFACE:deps/mapbox/geometry/include>
|
||||
)
|
||||
endif()
|
||||
if(NOT MAPBOX_GEOMETRY_INCLUDE_DIRS)
|
||||
message(FATAL_ERROR "Set MAPBOX_GEOMETRY_INCLUDE_DIRS to the mapbox/geometry.hpp include dir")
|
||||
message(FATAL_ERROR "Set -DMAPBOX_GEOMETRY_INCLUDE_DIRS to the mapbox/geometry.hpp include dir")
|
||||
endif()
|
||||
|
||||
if(USE_EXTERNAL_MAPBOX_POLYLABEL)
|
||||
find_path(MAPBOX_POLYLABEL_INCLUDE_DIRS "mapbox/polylabel.hpp")
|
||||
if(NOT MAPBOX_POLYLABEL_INCLUDE_DIRS)
|
||||
message(STATUS "Searching for the include dir of mapbox/polylabel")
|
||||
find_path(MAPBOX_POLYLABEL_INCLUDE_DIRS "mapbox/polylabel.hpp")
|
||||
endif()
|
||||
else()
|
||||
set(MAPBOX_POLYLABEL_INCLUDE_DIRS deps/mapbox/polylabel/include)
|
||||
set(MAPBOX_POLYLABEL_INCLUDE_DIRS
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/polylabel/include>
|
||||
$<INSTALL_INTERFACE:deps/mapbox/polylabel/include>
|
||||
)
|
||||
endif()
|
||||
if(NOT MAPBOX_POLYLABEL_INCLUDE_DIRS)
|
||||
message(FATAL_ERROR "Set MAPBOX_POLYLABEL_INCLUDE_DIRS to the mapbox/geometry include dir")
|
||||
endif()
|
||||
|
||||
if(USE_EXTERNAL_MAPBOX_PROTOZERO)
|
||||
find_path(MAPBOX_PROTOZERO_INCLUDE_DIRS "protozero/pbf_message.hpp")
|
||||
if(NOT MAPBOX_PROTOZERO_INCLUDE_DIRS)
|
||||
message(STATUS "Searching for the include dir of mapbox/protozero")
|
||||
find_path(MAPBOX_PROTOZERO_INCLUDE_DIRS "protozero/pbf_message.hpp")
|
||||
endif()
|
||||
else()
|
||||
set(MAPBOX_PROTOZERO_INCLUDE_DIRS deps/mapbox/protozero/include)
|
||||
set(MAPBOX_PROTOZERO_INCLUDE_DIRS
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/protozero/include>
|
||||
$<INSTALL_INTERFACE:deps/mapbox/protozero/include>
|
||||
)
|
||||
endif()
|
||||
if(NOT MAPBOX_PROTOZERO_INCLUDE_DIRS)
|
||||
message(FATAL_ERROR "Set MAPBOX_PROTOZERO_INCLUDE_DIRS to the mapbox/protozero include dir")
|
||||
endif()
|
||||
|
||||
if(USE_EXTERNAL_MAPBOX_VARIANT)
|
||||
find_path(MAPBOX_VARIANT_INCLUDE_DIRS "mapbox/variant.hpp")
|
||||
if(NOT MAPBOX_VARIANT_INCLUDE_DIRS)
|
||||
message(STATUS "Searching for the include dir of mapbox/variant")
|
||||
find_path(MAPBOX_VARIANT_INCLUDE_DIRS "mapbox/variant.hpp")
|
||||
endif()
|
||||
else()
|
||||
set(MAPBOX_VARIANT_INCLUDE_DIRS deps/mapbox/variant/include)
|
||||
set(MAPBOX_VARIANT_INCLUDE_DIRS
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/deps/mapbox/variant/include>
|
||||
$<INSTALL_INTERFACE:deps/mapbox/variant/include>
|
||||
)
|
||||
endif()
|
||||
if(NOT MAPBOX_VARIANT_INCLUDE_DIRS)
|
||||
message(FATAL_ERROR "Set MAPBOX_VARIANT_INCLUDE_DIRS to the mapbox/variant include dir")
|
||||
|
@ -69,47 +106,48 @@ set(MAPNIK_OPTIONAL_LIBS "")
|
|||
if(USE_LIBXML2)
|
||||
message(STATUS "Using LibXml2")
|
||||
find_package(LibXml2 REQUIRED)
|
||||
set(MAPNIK_COMPILE_DEFS ${MAPNIK_COMPILE_DEFS} HAVE_LIBXML2)
|
||||
set(MAPNIK_OPTIONAL_LIBS ${MAPNIK_OPTIONAL_LIBS} LibXml2::LibXml2)
|
||||
list(APPEND MAPNIK_COMPILE_DEFS HAVE_LIBXML2)
|
||||
list(APPEND MAPNIK_OPTIONAL_LIBS LibXml2::LibXml2)
|
||||
endif()
|
||||
if(USE_PNG)
|
||||
message(STATUS "Using PNG")
|
||||
find_package(PNG REQUIRED)
|
||||
set(MAPNIK_COMPILE_DEFS ${MAPNIK_COMPILE_DEFS} HAVE_PNG)
|
||||
set(MAPNIK_OPTIONAL_LIBS ${MAPNIK_OPTIONAL_LIBS} PNG::PNG)
|
||||
list(APPEND MAPNIK_COMPILE_DEFS HAVE_PNG)
|
||||
list(APPEND MAPNIK_OPTIONAL_LIBS PNG::PNG)
|
||||
endif()
|
||||
|
||||
if(USE_JPEG)
|
||||
message(STATUS "Using JPEG")
|
||||
find_package(JPEG REQUIRED)
|
||||
set(MAPNIK_COMPILE_DEFS ${MAPNIK_COMPILE_DEFS} HAVE_JPEG)
|
||||
set(MAPNIK_OPTIONAL_LIBS ${MAPNIK_OPTIONAL_LIBS} JPEG::JPEG)
|
||||
list(APPEND MAPNIK_COMPILE_DEFS HAVE_JPEG)
|
||||
list(APPEND MAPNIK_OPTIONAL_LIBS JPEG::JPEG)
|
||||
endif()
|
||||
|
||||
if(USE_TIFF)
|
||||
find_package(TIFF REQUIRED)
|
||||
message(STATUS "Using TIFF")
|
||||
set(MAPNIK_COMPILE_DEFS ${MAPNIK_COMPILE_DEFS} HAVE_TIFF)
|
||||
set(MAPNIK_OPTIONAL_LIBS ${MAPNIK_OPTIONAL_LIBS} TIFF::TIFF)
|
||||
list(APPEND MAPNIK_COMPILE_DEFS HAVE_TIFF)
|
||||
list(APPEND MAPNIK_OPTIONAL_LIBS TIFF::TIFF)
|
||||
endif()
|
||||
|
||||
if(USE_WEBP)
|
||||
message(STATUS "Using WEBP")
|
||||
find_package(WebP CONFIG REQUIRED)
|
||||
set(MAPNIK_COMPILE_DEFS ${MAPNIK_COMPILE_DEFS} HAVE_WEBP)
|
||||
set(MAPNIK_OPTIONAL_LIBS ${MAPNIK_OPTIONAL_LIBS} WebP::webp)
|
||||
list(APPEND MAPNIK_COMPILE_DEFS HAVE_WEBP)
|
||||
list(APPEND MAPNIK_OPTIONAL_LIBS WebP::webp)
|
||||
endif()
|
||||
|
||||
if(USE_CAIRO)
|
||||
message(STATUS "Using Cairo renderer")
|
||||
find_package(Cairo REQUIRED)
|
||||
set(MAPNIK_COMPILE_DEFS ${MAPNIK_COMPILE_DEFS} HAVE_CAIRO)
|
||||
set(MAPNIK_OPTIONAL_LIBS ${MAPNIK_OPTIONAL_LIBS} Cairo::Cairo)
|
||||
list(APPEND MAPNIK_COMPILE_DEFS HAVE_CAIRO)
|
||||
list(APPEND MAPNIK_OPTIONAL_LIBS Cairo::Cairo)
|
||||
endif()
|
||||
|
||||
add_library(mapnik-headers INTERFACE)
|
||||
add_library(mapnik::headers ALIAS mapnik-headers)
|
||||
|
||||
# todo: mapbox includes need to included private.
|
||||
target_include_directories(mapnik-headers INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
|
@ -117,7 +155,8 @@ target_include_directories(mapnik-headers INTERFACE
|
|||
${MAPBOX_POLYLABEL_INCLUDE_DIRS}
|
||||
${MAPBOX_VARIANT_INCLUDE_DIRS}
|
||||
${MAPBOX_PROTOZERO_INCLUDE_DIRS}
|
||||
deps
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/deps>
|
||||
$<INSTALL_INTERFACE:deps>
|
||||
)
|
||||
target_link_libraries(mapnik-headers INTERFACE
|
||||
Boost::boost
|
||||
|
@ -128,9 +167,7 @@ target_link_libraries(mapnik-headers INTERFACE
|
|||
harfbuzz::harfbuzz
|
||||
${MAPNIK_OPTIONAL_LIBS}
|
||||
)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(mapnik-headers INTERFACE MAPNIK_EXPORTS)
|
||||
endif()
|
||||
target_compile_definitions(mapnik-headers INTERFACE ${MAPNIK_COMPILE_DEFS})
|
||||
|
||||
install(TARGETS mapnik-headers
|
||||
EXPORT MapnikTargets
|
||||
|
@ -143,6 +180,31 @@ install(TARGETS mapnik-headers
|
|||
|
||||
add_subdirectory(deps)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(utils)
|
||||
add_subdirectory(plugins)
|
||||
#add_subdirectory(utils)
|
||||
#add_subdirectory(utils)
|
||||
#add_subdirectory(plugins)
|
||||
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/MapnikConfigVersion.cmake"
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/MapnikConfig.cmake.in
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/MapnikConfig.cmake"
|
||||
INSTALL_DESTINATION lib/cmake/mapnik
|
||||
)
|
||||
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/MapnikConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/MapnikConfigVersion.cmake"
|
||||
DESTINATION lib/cmake/mapnik
|
||||
)
|
||||
install(EXPORT MapnikTargets
|
||||
FILE MapnikTargets.cmake
|
||||
NAMESPACE mapnik::
|
||||
DESTINATION lib/cmake/mapnik
|
||||
)
|
||||
|
|
5
cmake/MapnikConfig.cmake.in
Normal file
5
cmake/MapnikConfig.cmake.in
Normal file
|
@ -0,0 +1,5 @@
|
|||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/MapnikTargets.cmake")
|
||||
|
||||
check_required_components(mapnik)
|
|
@ -1,12 +1,45 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
add_subdirectory(csv)
|
||||
add_subdirectory(gdal)
|
||||
add_subdirectory(geobuf)
|
||||
add_subdirectory(geojson)
|
||||
add_subdirectory(ogr)
|
||||
add_subdirectory(pgraster)
|
||||
add_subdirectory(postgis)
|
||||
add_subdirectory(raster)
|
||||
add_subdirectory(shape)
|
||||
add_subdirectory(sqlite)
|
||||
add_subdirectory(topojson)
|
||||
if(USE_PLUGIN_INPUT_CSV)
|
||||
message(STATUS "using input plugin csv")
|
||||
add_subdirectory(csv)
|
||||
endif()
|
||||
if(USE_PLUGIN_INPUT_GDAL)
|
||||
message(STATUS "using input plugin gdal")
|
||||
add_subdirectory(gdal)
|
||||
endif()
|
||||
if(USE_PLUGIN_INPUT_GEOBUF)
|
||||
message(STATUS "using input plugin geobuf")
|
||||
add_subdirectory(geobuf)
|
||||
endif()
|
||||
if(USE_PLUGIN_INPUT_GEOJSON)
|
||||
message(STATUS "using input plugin geojson")
|
||||
add_subdirectory(geojson)
|
||||
endif()
|
||||
if(USE_PLUGIN_INPUT_OGR)
|
||||
message(STATUS "using input plugin ogr")
|
||||
add_subdirectory(ogr)
|
||||
endif()
|
||||
if(USE_PLUGIN_INPUT_PGRASTER)
|
||||
message(STATUS "using input plugin pgraster")
|
||||
add_subdirectory(pgraster)
|
||||
endif()
|
||||
if(USE_PLUGIN_INPUT_POSTGIS)
|
||||
message(STATUS "using input plugin postgis")
|
||||
add_subdirectory(postgis)
|
||||
endif()
|
||||
if(USE_PLUGIN_INPUT_RASTER)
|
||||
message(STATUS "using input plugin raster")
|
||||
add_subdirectory(raster)
|
||||
endif()
|
||||
if(USE_PLUGIN_INPUT_SHAPE)
|
||||
message(STATUS "using input plugin shape")
|
||||
add_subdirectory(shape)
|
||||
endif()
|
||||
if(USE_PLUGIN_INPUT_SQLITE)
|
||||
message(STATUS "using input plugin sqlite")
|
||||
add_subdirectory(sqlite)
|
||||
endif()
|
||||
if(USE_PLUGIN_INPUT_TOPOJSON)
|
||||
message(STATUS "using input plugin topojson")
|
||||
add_subdirectory(topojson)
|
||||
endif()
|
||||
|
|
31
plugins/input/csv/CMakeLists.txt
Normal file
31
plugins/input/csv/CMakeLists.txt
Normal file
|
@ -0,0 +1,31 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-csv)
|
||||
|
||||
add_library(input-csv SHARED
|
||||
csv_datasource.cpp
|
||||
csv_featureset.cpp
|
||||
csv_index_featureset.cpp
|
||||
csv_inline_featureset.cpp
|
||||
csv_utils.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::csv ALIAS input-csv)
|
||||
|
||||
target_link_libraries(input-csv PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
mapnik::wkt
|
||||
mapnik::json
|
||||
)
|
||||
set_target_properties(input-csv PROPERTIES PREFIX "")
|
||||
set_target_properties(input-csv PROPERTIES OUTPUT_NAME "csv")
|
||||
set_target_properties(input-csv PROPERTIES SUFFIX ".input")
|
||||
#install(TARGETS input-csv DESTINATION bin/plugins/input)
|
||||
|
||||
install(TARGETS input-csv
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
29
plugins/input/gdal/CMakeLists.txt
Normal file
29
plugins/input/gdal/CMakeLists.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-gdal)
|
||||
|
||||
find_package(GDAL REQUIRED)
|
||||
|
||||
add_library(input-gdal SHARED
|
||||
gdal_datasource.cpp
|
||||
gdal_featureset.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::gdal ALIAS input-gdal)
|
||||
|
||||
target_include_directories(input-gdal PRIVATE ${GDAL_INCLUDE_DIR})
|
||||
target_link_libraries(input-gdal PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
${GDAL_LIBRARY}
|
||||
)
|
||||
set_target_properties(input-gdal PROPERTIES PREFIX "")
|
||||
set_target_properties(input-gdal PROPERTIES OUTPUT_NAME "gdal")
|
||||
set_target_properties(input-gdal PROPERTIES SUFFIX ".input")
|
||||
|
||||
install(TARGETS input-gdal
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
25
plugins/input/geobuf/CMakeLists.txt
Normal file
25
plugins/input/geobuf/CMakeLists.txt
Normal file
|
@ -0,0 +1,25 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-geobuf)
|
||||
|
||||
add_library(input-geobuf SHARED
|
||||
geobuf_datasource.cpp
|
||||
geobuf_featureset.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::geobuf ALIAS input-geobuf)
|
||||
|
||||
target_link_libraries(input-geobuf PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
)
|
||||
set_target_properties(input-geobuf PROPERTIES PREFIX "")
|
||||
set_target_properties(input-geobuf PROPERTIES OUTPUT_NAME "geobuf")
|
||||
set_target_properties(input-geobuf PROPERTIES SUFFIX ".input")
|
||||
|
||||
install(TARGETS input-geobuf
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
29
plugins/input/geojson/CMakeLists.txt
Normal file
29
plugins/input/geojson/CMakeLists.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-geojson)
|
||||
|
||||
add_library(input-geojson SHARED
|
||||
geojson_datasource.cpp
|
||||
geojson_featureset.cpp
|
||||
geojson_index_featureset.cpp
|
||||
geojson_memory_index_featureset.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::geojson ALIAS input-geojson)
|
||||
|
||||
target_link_libraries(input-geojson PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
mapnik::json
|
||||
)
|
||||
|
||||
set_target_properties(input-geojson PROPERTIES PREFIX "")
|
||||
set_target_properties(input-geojson PROPERTIES OUTPUT_NAME "geojson")
|
||||
set_target_properties(input-geojson PROPERTIES SUFFIX ".input")
|
||||
|
||||
install(TARGETS input-geojson
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
31
plugins/input/ogr/CMakeLists.txt
Normal file
31
plugins/input/ogr/CMakeLists.txt
Normal file
|
@ -0,0 +1,31 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-ogr)
|
||||
|
||||
find_package(GDAL REQUIRED)
|
||||
|
||||
add_library(input-ogr SHARED
|
||||
ogr_converter.cpp
|
||||
ogr_datasource.cpp
|
||||
ogr_featureset.cpp
|
||||
ogr_index_featureset.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::ogr ALIAS input-ogr)
|
||||
|
||||
target_include_directories(input-ogr PRIVATE ${GDAL_INCLUDE_DIR})
|
||||
target_link_libraries(input-ogr PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
${GDAL_LIBRARY}
|
||||
)
|
||||
set_target_properties(input-ogr PROPERTIES PREFIX "")
|
||||
set_target_properties(input-ogr PROPERTIES OUTPUT_NAME "ogr")
|
||||
set_target_properties(input-ogr PROPERTIES SUFFIX ".input")
|
||||
|
||||
install(TARGETS input-ogr
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
30
plugins/input/pgraster/CMakeLists.txt
Normal file
30
plugins/input/pgraster/CMakeLists.txt
Normal file
|
@ -0,0 +1,30 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-pgraster)
|
||||
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
|
||||
add_library(input-pgraster SHARED
|
||||
pgraster_datasource.cpp
|
||||
pgraster_featureset.cpp
|
||||
pgraster_wkb_reader.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::pgraster ALIAS input-pgraster)
|
||||
|
||||
|
||||
target_link_libraries(input-pgraster PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
PostgreSQL::PostgreSQL
|
||||
)
|
||||
set_target_properties(input-pgraster PROPERTIES PREFIX "")
|
||||
set_target_properties(input-pgraster PROPERTIES OUTPUT_NAME "pgraster")
|
||||
set_target_properties(input-pgraster PROPERTIES SUFFIX ".input")
|
||||
|
||||
install(TARGETS input-pgraster
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
29
plugins/input/postgis/CMakeLists.txt
Normal file
29
plugins/input/postgis/CMakeLists.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-postgis)
|
||||
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
|
||||
add_library(input-postgis SHARED
|
||||
postgis_datasource.cpp
|
||||
postgis_featureset.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::postgis ALIAS input-postgis)
|
||||
|
||||
target_link_libraries(input-postgis PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
PostgreSQL::PostgreSQL
|
||||
)
|
||||
|
||||
set_target_properties(input-postgis PROPERTIES PREFIX "")
|
||||
set_target_properties(input-postgis PROPERTIES OUTPUT_NAME "postgis")
|
||||
set_target_properties(input-postgis PROPERTIES SUFFIX ".input")
|
||||
|
||||
install(TARGETS input-postgis
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
27
plugins/input/raster/CMakeLists.txt
Normal file
27
plugins/input/raster/CMakeLists.txt
Normal file
|
@ -0,0 +1,27 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-raster)
|
||||
|
||||
add_library(input-raster SHARED
|
||||
raster_datasource.cpp
|
||||
raster_featureset.cpp
|
||||
raster_info.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::raster ALIAS input-raster)
|
||||
|
||||
target_link_libraries(input-raster PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
)
|
||||
|
||||
set_target_properties(input-raster PROPERTIES PREFIX "")
|
||||
set_target_properties(input-raster PROPERTIES OUTPUT_NAME "raster")
|
||||
set_target_properties(input-raster PROPERTIES SUFFIX ".input")
|
||||
|
||||
install(TARGETS input-raster
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
30
plugins/input/shape/CMakeLists.txt
Normal file
30
plugins/input/shape/CMakeLists.txt
Normal file
|
@ -0,0 +1,30 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-shape)
|
||||
|
||||
add_library(input-shape SHARED
|
||||
dbfile.cpp
|
||||
dbf_test.cpp
|
||||
shape_datasource.cpp
|
||||
shape_featureset.cpp
|
||||
shape_index_featureset.cpp
|
||||
shape_io.cpp shape_utils.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::shape ALIAS input-shape)
|
||||
|
||||
target_link_libraries(input-shape PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
)
|
||||
|
||||
set_target_properties(input-shape PROPERTIES PREFIX "")
|
||||
set_target_properties(input-shape PROPERTIES OUTPUT_NAME "shape")
|
||||
set_target_properties(input-shape PROPERTIES SUFFIX ".input")
|
||||
|
||||
install(TARGETS input-shape
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
29
plugins/input/sqlite/CMakeLists.txt
Normal file
29
plugins/input/sqlite/CMakeLists.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-sqlite)
|
||||
|
||||
find_package(SQLite3 REQUIRED)
|
||||
|
||||
add_library(input-sqlite SHARED
|
||||
sqlite_datasource.cpp
|
||||
sqlite_featureset.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::sqlite ALIAS input-sqlite)
|
||||
|
||||
target_link_libraries(input-sqlite PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
SQLite::SQLite3
|
||||
)
|
||||
|
||||
set_target_properties(input-sqlite PROPERTIES PREFIX "")
|
||||
set_target_properties(input-sqlite PROPERTIES OUTPUT_NAME "sqlite")
|
||||
set_target_properties(input-sqlite PROPERTIES SUFFIX ".input")
|
||||
|
||||
install(TARGETS input-sqlite
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
27
plugins/input/topojson/CMakeLists.txt
Normal file
27
plugins/input/topojson/CMakeLists.txt
Normal file
|
@ -0,0 +1,27 @@
|
|||
cmake_minimum_required(VERSION 3.15.0)
|
||||
project(input-topojson)
|
||||
|
||||
add_library(input-topojson SHARED
|
||||
topojson_datasource.cpp
|
||||
topojson_featureset.cpp
|
||||
)
|
||||
add_library(mapnik::plugin::input::topojson ALIAS input-topojson)
|
||||
|
||||
target_link_libraries(input-topojson PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
mapnik::json
|
||||
)
|
||||
|
||||
set_target_properties(input-topojson PROPERTIES PREFIX "")
|
||||
set_target_properties(input-topojson PROPERTIES OUTPUT_NAME "topojson")
|
||||
set_target_properties(input-topojson PROPERTIES SUFFIX ".input")
|
||||
|
||||
install(TARGETS input-topojson
|
||||
EXPORT MapnikTargets
|
||||
LIBRARY DESTINATION lib/plugins/input
|
||||
ARCHIVE DESTINATION lib/plugins/input
|
||||
RUNTIME DESTINATION bin/plugins/input
|
||||
INCLUDES DESTINATION .
|
||||
PUBLIC_HEADER DESTINATION .
|
||||
)
|
|
@ -272,7 +272,7 @@ add_library(mapnik ${COMPILE_SRC})
|
|||
add_library(mapnik::mapnik ALIAS mapnik)
|
||||
|
||||
|
||||
target_compile_definitions(mapnik PRIVATE ${MAPNIK_EXPORTS} ${MAPNIK_COMPILE_DEFS})
|
||||
target_compile_definitions(mapnik PRIVATE MAPNIK_EXPORTS)
|
||||
target_link_libraries(mapnik PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::agg
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
add_executable(geometry_to_wkb main.cpp)
|
||||
|
||||
target_link_libraries(geometry_to_wkb PRIVATE mapnik::mapnik)
|
||||
target_link_libraries(geometry_to_wkb PRIVATE mapnik::headers mapnik::mapnik)
|
||||
|
||||
install(TARGETS geometry_to_wkb
|
||||
EXPORT MapnikTargets
|
||||
|
|
|
@ -2,8 +2,15 @@ add_executable(mapnik-index
|
|||
mapnik-index.cpp
|
||||
process_csv_file.cpp
|
||||
process_geojson_file_x3.cpp
|
||||
../../plugins/input/csv/csv_utils.cpp # this project depends on this file
|
||||
)
|
||||
target_link_libraries(mapnik-index PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
mapnik::json
|
||||
mapnik::wkt
|
||||
Boost::program_options
|
||||
)
|
||||
target_link_libraries(mapnik-index PRIVATE mapnik::mapnik)
|
||||
install(TARGETS mapnik-index
|
||||
EXPORT MapnikTargets
|
||||
RUNTIME DESTINATION bin
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
add_executable(mapnik-render mapnik-render.cpp)
|
||||
|
||||
target_link_libraries(mapnik-render PRIVATE mapnik::mapnik)
|
||||
target_link_libraries(mapnik-render PRIVATE
|
||||
mapnik::headers
|
||||
mapnik::mapnik
|
||||
Boost::program_options
|
||||
)
|
||||
install(TARGETS mapnik-render
|
||||
EXPORT MapnikTargets
|
||||
RUNTIME DESTINATION bin
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
add_executable(ogrindex ogrindex.cpp)
|
||||
|
||||
target_link_libraries(ogrindex PRIVATE mapnik::mapnik)
|
||||
target_link_libraries(ogrindex PRIVATE mapnik::headers mapnik::mapnik)
|
||||
install(TARGETS ogrindex
|
||||
EXPORT MapnikTargets
|
||||
RUNTIME DESTINATION bin
|
||||
|
|
|
@ -3,7 +3,7 @@ add_executable(pgsql2sqlite
|
|||
sqlite.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(pgsql2sqlite PRIVATE mapnik::mapnik)
|
||||
target_link_libraries(pgsql2sqlite PRIVATE mapnik::headers mapnik::mapnik)
|
||||
install(TARGETS pgsql2sqlite
|
||||
EXPORT MapnikTargets
|
||||
RUNTIME DESTINATION bin
|
||||
|
|
|
@ -2,7 +2,7 @@ add_executable(shapeindex
|
|||
shapeindex.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(shapeindex PRIVATE mapnik::mapnik)
|
||||
target_link_libraries(shapeindex PRIVATE mapnik::headers mapnik::mapnik)
|
||||
install(TARGETS shapeindex
|
||||
EXPORT MapnikTargets
|
||||
RUNTIME DESTINATION bin
|
||||
|
|
|
@ -2,7 +2,7 @@ add_executable(svg2png
|
|||
svg2png.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(svg2png PRIVATE mapnik::mapnik)
|
||||
target_link_libraries(svg2png PRIVATE mapnik::headers mapnik::mapnik)
|
||||
install(TARGETS svg2png
|
||||
EXPORT MapnikTargets
|
||||
RUNTIME DESTINATION bin
|
||||
|
|
Loading…
Reference in a new issue