make mapnik::core a public dependency of mapnik::mapnik

This commit is contained in:
Mathis Logemann 2021-09-14 20:46:43 +02:00
parent 737e7a69c2
commit 8bd463d4fc
25 changed files with 24 additions and 52 deletions

View file

@ -31,7 +31,7 @@ function(mapnik_create_benchmark)
set(TARGET_NAME "mapnik-benchmark-${BENCHNAME}") set(TARGET_NAME "mapnik-benchmark-${BENCHNAME}")
add_executable(${TARGET_NAME} ${ARGV0}) add_executable(${TARGET_NAME} ${ARGV0})
target_include_directories(${TARGET_NAME} PRIVATE include) target_include_directories(${TARGET_NAME} PRIVATE include)
target_link_libraries(${TARGET_NAME} PRIVATE mapnik::core mapnik::agg mapnik::mapnik) target_link_libraries(${TARGET_NAME} PRIVATE mapnik::agg mapnik::mapnik)
mapnik_copy_dependencies(TARGETS ${TARGET_NAME}) mapnik_copy_dependencies(TARGETS ${TARGET_NAME})
endfunction() endfunction()

View file

@ -2,7 +2,7 @@ project(mapnik-demo)
add_executable(mapnik-demo rundemo.cpp) add_executable(mapnik-demo rundemo.cpp)
target_link_libraries(mapnik-demo PRIVATE mapnik::core mapnik::agg mapnik::mapnik) target_link_libraries(mapnik-demo PRIVATE mapnik::agg mapnik::mapnik)
mapnik_install(TARGET mapnik-demo) mapnik_install(TARGET mapnik-demo)
mapnik_copy_plugins(TARGET mapnik-demo DESTINATION plugins/input PLUGINS input-shape) mapnik_copy_plugins(TARGET mapnik-demo DESTINATION plugins/input PLUGINS input-shape)

View file

@ -46,7 +46,6 @@ set_target_properties(mapnik-viewer PROPERTIES
target_link_libraries(mapnik-viewer PRIVATE target_link_libraries(mapnik-viewer PRIVATE
Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Widgets
mapnik::core
mapnik::agg mapnik::agg
mapnik::mapnik mapnik::mapnik
) )

View file

@ -16,4 +16,4 @@ install(TARGETS agg
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
PUBLIC_HEADER DESTINATION include PUBLIC_HEADER DESTINATION include
) )
# todo install headers # agg headers would be installed in the top level CMakeLists.txt

View file

@ -25,8 +25,13 @@ To use Mapnik in your project add the following lines to your CMakeLists.tzt.
``` ```
find_package(mapnik CONFIG REQUIRED) find_package(mapnik CONFIG REQUIRED)
[...] [...]
target_link_libraries(mytarget ... mapnik::core mapnik::mapnik) target_link_libraries(mytarget ... mapnik::mapnik)
``` ```
All targets:
* `mapnik::core`: All compile definitions and headers.
* `mapnik::mapnik`: libmapnik. Has a public dependency on mapnik::core
* `mapnik::json`: json support for libmapnik.
* `mapnik::wkt`: wkt support for libmapnik.
All mapnik executables and targets are exported within `mapnikTargets.cmake`. All mapnik executables and targets are exported within `mapnikTargets.cmake`.

View file

@ -9,8 +9,7 @@ add_library(input-csv MODULE
) )
add_library(mapnik::plugin::input::csv ALIAS input-csv) add_library(mapnik::plugin::input::csv ALIAS input-csv)
target_link_libraries(input-csv PRIVATE target_link_libraries(input-csv PRIVATE
mapnik::core
mapnik::mapnik mapnik::mapnik
mapnik::wkt mapnik::wkt
mapnik::json mapnik::json

View file

@ -10,7 +10,6 @@ add_library(mapnik::plugin::input::gdal ALIAS input-gdal)
target_include_directories(input-gdal PRIVATE ${GDAL_INCLUDE_DIRS}) target_include_directories(input-gdal PRIVATE ${GDAL_INCLUDE_DIRS})
target_link_libraries(input-gdal PRIVATE target_link_libraries(input-gdal PRIVATE
mapnik::core
mapnik::mapnik mapnik::mapnik
${GDAL_LIBRARIES} ${GDAL_LIBRARIES}
) )

View file

@ -6,10 +6,8 @@ add_library(input-geobuf MODULE
) )
add_library(mapnik::plugin::input::geobuf ALIAS input-geobuf) add_library(mapnik::plugin::input::geobuf ALIAS input-geobuf)
target_link_libraries(input-geobuf PRIVATE target_link_libraries(input-geobuf PRIVATE mapnik::mapnik)
mapnik::core
mapnik::mapnik
)
set_target_properties(input-geobuf PROPERTIES PREFIX "") set_target_properties(input-geobuf PROPERTIES PREFIX "")
set_target_properties(input-geobuf PROPERTIES OUTPUT_NAME "geobuf") set_target_properties(input-geobuf PROPERTIES OUTPUT_NAME "geobuf")
set_target_properties(input-geobuf PROPERTIES SUFFIX ".input") set_target_properties(input-geobuf PROPERTIES SUFFIX ".input")

View file

@ -8,8 +8,7 @@ add_library(input-geojson MODULE
) )
add_library(mapnik::plugin::input::geojson ALIAS input-geojson) add_library(mapnik::plugin::input::geojson ALIAS input-geojson)
target_link_libraries(input-geojson PRIVATE target_link_libraries(input-geojson PRIVATE
mapnik::core
mapnik::mapnik mapnik::mapnik
mapnik::json mapnik::json
) )

View file

@ -11,8 +11,7 @@ add_library(input-ogr MODULE
add_library(mapnik::plugin::input::ogr ALIAS input-ogr) add_library(mapnik::plugin::input::ogr ALIAS input-ogr)
target_include_directories(input-ogr PRIVATE ${GDAL_INCLUDE_DIRS}) target_include_directories(input-ogr PRIVATE ${GDAL_INCLUDE_DIRS})
target_link_libraries(input-ogr PRIVATE target_link_libraries(input-ogr PRIVATE
mapnik::core
mapnik::mapnik mapnik::mapnik
${GDAL_LIBRARIES} ${GDAL_LIBRARIES}
) )

View file

@ -10,8 +10,7 @@ add_library(input-pgraster MODULE
add_library(mapnik::plugin::input::pgraster ALIAS input-pgraster) add_library(mapnik::plugin::input::pgraster ALIAS input-pgraster)
target_link_libraries(input-pgraster PRIVATE target_link_libraries(input-pgraster PRIVATE
mapnik::core
mapnik::mapnik mapnik::mapnik
PostgreSQL::PostgreSQL PostgreSQL::PostgreSQL
) )

View file

@ -8,8 +8,7 @@ add_library(input-postgis MODULE
) )
add_library(mapnik::plugin::input::postgis ALIAS input-postgis) add_library(mapnik::plugin::input::postgis ALIAS input-postgis)
target_link_libraries(input-postgis PRIVATE target_link_libraries(input-postgis PRIVATE
mapnik::core
mapnik::mapnik mapnik::mapnik
PostgreSQL::PostgreSQL PostgreSQL::PostgreSQL
) )

View file

@ -7,10 +7,7 @@ add_library(input-raster MODULE
) )
add_library(mapnik::plugin::input::raster ALIAS input-raster) add_library(mapnik::plugin::input::raster ALIAS input-raster)
target_link_libraries(input-raster PRIVATE target_link_libraries(input-raster PRIVATE mapnik::mapnik)
mapnik::core
mapnik::mapnik
)
set_target_properties(input-raster PROPERTIES PREFIX "") set_target_properties(input-raster PROPERTIES PREFIX "")
set_target_properties(input-raster PROPERTIES OUTPUT_NAME "raster") set_target_properties(input-raster PROPERTIES OUTPUT_NAME "raster")

View file

@ -10,10 +10,7 @@ add_library(input-shape MODULE
) )
add_library(mapnik::plugin::input::shape ALIAS input-shape) add_library(mapnik::plugin::input::shape ALIAS input-shape)
target_link_libraries(input-shape PRIVATE target_link_libraries(input-shape PRIVATE mapnik::mapnik)
mapnik::core
mapnik::mapnik
)
set_target_properties(input-shape PROPERTIES PREFIX "") set_target_properties(input-shape PROPERTIES PREFIX "")
set_target_properties(input-shape PROPERTIES OUTPUT_NAME "shape") set_target_properties(input-shape PROPERTIES OUTPUT_NAME "shape")

View file

@ -8,8 +8,7 @@ add_library(input-sqlite MODULE
) )
add_library(mapnik::plugin::input::sqlite ALIAS input-sqlite) add_library(mapnik::plugin::input::sqlite ALIAS input-sqlite)
target_link_libraries(input-sqlite PRIVATE target_link_libraries(input-sqlite PRIVATE
mapnik::core
mapnik::mapnik mapnik::mapnik
SQLite::SQLite3 SQLite::SQLite3
) )

View file

@ -6,8 +6,7 @@ add_library(input-topojson MODULE
) )
add_library(mapnik::plugin::input::topojson ALIAS input-topojson) add_library(mapnik::plugin::input::topojson ALIAS input-topojson)
target_link_libraries(input-topojson PRIVATE target_link_libraries(input-topojson PRIVATE
mapnik::core
mapnik::mapnik mapnik::mapnik
mapnik::json mapnik::json
) )

View file

@ -286,10 +286,8 @@ if(BUILD_SHARED_LIBS)
endif() endif()
target_compile_definitions(mapnik PRIVATE ${COMPILE_DEFS}) target_compile_definitions(mapnik PRIVATE ${COMPILE_DEFS})
target_link_libraries(mapnik PRIVATE target_link_libraries(mapnik PUBLIC mapnik::core)
mapnik::core target_link_libraries(mapnik PRIVATE mapnik::agg)
mapnik::agg
)
set_target_properties(mapnik PROPERTIES set_target_properties(mapnik PROPERTIES
DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}" DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}"

View file

@ -109,7 +109,6 @@ add_executable(mapnik-test-unit
) )
target_link_libraries(mapnik-test-unit PUBLIC target_link_libraries(mapnik-test-unit PUBLIC
Catch Catch
mapnik::core
mapnik::agg mapnik::agg
mapnik::mapnik mapnik::mapnik
mapnik::json mapnik::json
@ -120,7 +119,6 @@ target_link_libraries(mapnik-test-unit PUBLIC
add_executable(agg_rasterizer_integer_overflow_test standalone/agg_rasterizer_integer_overflow_test.cpp) add_executable(agg_rasterizer_integer_overflow_test standalone/agg_rasterizer_integer_overflow_test.cpp)
target_link_libraries(agg_rasterizer_integer_overflow_test PUBLIC target_link_libraries(agg_rasterizer_integer_overflow_test PUBLIC
Catch Catch
mapnik::core
mapnik::mapnik mapnik::mapnik
mapnik::agg mapnik::agg
mapnik::json mapnik::json
@ -129,7 +127,6 @@ target_link_libraries(agg_rasterizer_integer_overflow_test PUBLIC
add_executable(datasource_registration_test standalone/datasource_registration_test.cpp) add_executable(datasource_registration_test standalone/datasource_registration_test.cpp)
target_link_libraries(datasource_registration_test PUBLIC target_link_libraries(datasource_registration_test PUBLIC
Catch Catch
mapnik::core
mapnik::mapnik mapnik::mapnik
mapnik::agg mapnik::agg
) )
@ -137,7 +134,6 @@ target_link_libraries(datasource_registration_test PUBLIC
add_executable(font_registration_test standalone/font_registration_test.cpp) add_executable(font_registration_test standalone/font_registration_test.cpp)
target_link_libraries(font_registration_test PUBLIC target_link_libraries(font_registration_test PUBLIC
Catch Catch
mapnik::core
mapnik::mapnik mapnik::mapnik
mapnik::agg mapnik::agg
mapnik::json mapnik::json
@ -147,7 +143,6 @@ target_link_libraries(font_registration_test PUBLIC
add_executable(map_xml_test standalone/map_xml_test.cpp) add_executable(map_xml_test standalone/map_xml_test.cpp)
target_link_libraries(map_xml_test PUBLIC target_link_libraries(map_xml_test PUBLIC
Catch Catch
mapnik::core
mapnik::mapnik mapnik::mapnik
mapnik::agg mapnik::agg
mapnik::json mapnik::json
@ -164,7 +159,6 @@ target_link_libraries(
Catch Catch
Boost::program_options Boost::program_options
Boost::filesystem Boost::filesystem
mapnik::core
mapnik::mapnik mapnik::mapnik
mapnik::agg mapnik::agg
) )

View file

@ -2,9 +2,6 @@ project(geometry_to_wkb)
add_executable(geometry_to_wkb main.cpp) add_executable(geometry_to_wkb main.cpp)
target_link_libraries(geometry_to_wkb PRIVATE target_link_libraries(geometry_to_wkb PRIVATE mapnik::mapnik)
mapnik::core
mapnik::mapnik
)
mapnik_install(TARGET geometry_to_wkb) mapnik_install(TARGET geometry_to_wkb)

View file

@ -9,7 +9,6 @@ add_executable(mapnik-index
../../plugins/input/csv/csv_utils.cpp # this project depends on this file ../../plugins/input/csv/csv_utils.cpp # this project depends on this file
) )
target_link_libraries(mapnik-index PRIVATE target_link_libraries(mapnik-index PRIVATE
mapnik::core
mapnik::mapnik mapnik::mapnik
mapnik::json mapnik::json
mapnik::wkt mapnik::wkt

View file

@ -5,7 +5,6 @@ find_package(Boost REQUIRED COMPONENTS program_options)
add_executable(mapnik-render mapnik-render.cpp) add_executable(mapnik-render mapnik-render.cpp)
target_link_libraries(mapnik-render PRIVATE target_link_libraries(mapnik-render PRIVATE
mapnik::core
mapnik::mapnik mapnik::mapnik
Boost::program_options Boost::program_options
) )

View file

@ -2,6 +2,6 @@ project(ogrindex)
add_executable(ogrindex ogrindex.cpp) add_executable(ogrindex ogrindex.cpp)
target_link_libraries(ogrindex PRIVATE mapnik::core mapnik::mapnik) target_link_libraries(ogrindex PRIVATE mapnik::mapnik)
mapnik_install(TARGET ogrindex) mapnik_install(TARGET ogrindex)

View file

@ -13,7 +13,6 @@ target_link_libraries(pgsql2sqlite PRIVATE
SQLite::SQLite3 SQLite::SQLite3
PostgreSQL::PostgreSQL PostgreSQL::PostgreSQL
Boost::program_options Boost::program_options
mapnik::core
mapnik::mapnik mapnik::mapnik
) )

View file

@ -9,7 +9,6 @@ add_executable(shapeindex
target_include_directories(shapeindex PRIVATE ../../plugins/input/shape) target_include_directories(shapeindex PRIVATE ../../plugins/input/shape)
target_link_libraries(shapeindex PRIVATE target_link_libraries(shapeindex PRIVATE
Boost::program_options Boost::program_options
mapnik::core
mapnik::mapnik mapnik::mapnik
) )

View file

@ -8,7 +8,6 @@ add_executable(svg2png
target_link_libraries(svg2png PRIVATE target_link_libraries(svg2png PRIVATE
Boost::program_options Boost::program_options
mapnik::core
mapnik::mapnik mapnik::mapnik
mapnik::agg mapnik::agg
) )