2021-09-22 17:52:39 +00:00
|
|
|
set(_plugin_prefix "")
|
|
|
|
set(_plugin_suffix ".input")
|
2022-02-02 16:20:29 +00:00
|
|
|
set(_plugin_library_output "${MAPNIK_OUTPUT_DIR}/plugins/input")
|
|
|
|
set(_plugin_runtime_output "${MAPNIK_OUTPUT_DIR}")
|
|
|
|
set(_plugin_archive_output "${MAPNIK_OUTPUT_DIR}/lib")
|
|
|
|
set(_plugin_fpic ON)
|
2022-01-29 11:52:23 +00:00
|
|
|
set(_plugin_linkage MODULE)
|
2022-02-02 16:20:29 +00:00
|
|
|
set(_plugin_visibility PRIVATE)
|
2022-02-09 14:57:03 +00:00
|
|
|
if(NOT BUILD_SHARED_PLUGINS)
|
2022-01-29 11:52:23 +00:00
|
|
|
set(_plugin_linkage INTERFACE)
|
|
|
|
set(_plugin_visibility INTERFACE)
|
|
|
|
endif()
|
|
|
|
|
2022-02-02 16:20:29 +00:00
|
|
|
macro(add_plugin_target plugin_target output_name)
|
|
|
|
add_library(${plugin_target} ${_plugin_linkage})
|
2022-08-17 15:35:25 +00:00
|
|
|
set_target_properties(${plugin_target} PROPERTIES
|
2022-02-02 16:20:29 +00:00
|
|
|
OUTPUT_NAME "${output_name}"
|
|
|
|
POSITION_INDEPENDENT_CODE ${_plugin_fpic}
|
|
|
|
PREFIX "${_plugin_prefix}"
|
|
|
|
SUFFIX "${_plugin_suffix}"
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${_plugin_library_output}"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${_plugin_runtime_output}"
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${_plugin_archive_output}"
|
2022-04-22 13:10:49 +00:00
|
|
|
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
|
2022-02-02 16:20:29 +00:00
|
|
|
)
|
|
|
|
mapnik_install_plugin(${plugin_target})
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
|
2022-01-29 11:52:23 +00:00
|
|
|
add_subdirectory(base)
|
2021-09-22 17:52:39 +00:00
|
|
|
|
2021-10-25 16:58:55 +00:00
|
|
|
# add a list with all build plugins so the copy dependencies command can wait for all build events
|
|
|
|
set(m_build_plugins "")
|
2020-11-21 10:34:45 +00:00
|
|
|
if(USE_PLUGIN_INPUT_CSV)
|
|
|
|
add_subdirectory(csv)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-csv)
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|
|
|
|
if(USE_PLUGIN_INPUT_GDAL)
|
|
|
|
add_subdirectory(gdal)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-gdal)
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|
|
|
|
if(USE_PLUGIN_INPUT_GEOBUF)
|
|
|
|
add_subdirectory(geobuf)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-geobuf)
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|
|
|
|
if(USE_PLUGIN_INPUT_GEOJSON)
|
|
|
|
add_subdirectory(geojson)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-geojson)
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|
|
|
|
if(USE_PLUGIN_INPUT_OGR)
|
|
|
|
add_subdirectory(ogr)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-ogr)
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|
|
|
|
if(USE_PLUGIN_INPUT_PGRASTER)
|
|
|
|
add_subdirectory(pgraster)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-pgraster)
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|
|
|
|
if(USE_PLUGIN_INPUT_POSTGIS)
|
|
|
|
add_subdirectory(postgis)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-postgis)
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|
|
|
|
if(USE_PLUGIN_INPUT_RASTER)
|
|
|
|
add_subdirectory(raster)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-raster)
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|
|
|
|
if(USE_PLUGIN_INPUT_SHAPE)
|
|
|
|
add_subdirectory(shape)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-shape)
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|
|
|
|
if(USE_PLUGIN_INPUT_SQLITE)
|
|
|
|
add_subdirectory(sqlite)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-sqlite)
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|
|
|
|
if(USE_PLUGIN_INPUT_TOPOJSON)
|
|
|
|
add_subdirectory(topojson)
|
2021-10-25 16:58:55 +00:00
|
|
|
list(APPEND m_build_plugins input-topojson)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
#
|
|
|
|
# Copy all plugin dlls, so that these are in the main output dir, since cmake copies those into ${MAPNIK_OUTPUT_DIR}/plugins/input, too.
|
|
|
|
#
|
2022-02-09 14:57:03 +00:00
|
|
|
if(BUILD_SHARED_PLUGINS AND WIN32)
|
2021-11-14 23:50:47 +00:00
|
|
|
list(LENGTH m_build_plugins m_number_plugins)
|
|
|
|
if(m_number_plugins GREATER 0)
|
|
|
|
string(CONFIGURE
|
|
|
|
[[
|
|
|
|
file(GLOB m_deps "./*.dll")
|
|
|
|
message(STATUS "plugin deps: ${m_deps}")
|
|
|
|
file(COPY ${m_deps} DESTINATION "@MAPNIK_OUTPUT_DIR@")
|
|
|
|
]] m_copy_dlls_str @ONLY
|
|
|
|
)
|
2022-08-11 20:54:50 +00:00
|
|
|
file (GENERATE OUTPUT "copy_dlls_$<CONFIG>.cmake"
|
2021-11-14 23:50:47 +00:00
|
|
|
CONTENT "${m_copy_dlls_str}"
|
|
|
|
)
|
|
|
|
add_custom_target(copy_plugin_dependencies ALL
|
|
|
|
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/copy_dlls_$<CONFIG>.cmake"
|
|
|
|
WORKING_DIRECTORY "${MAPNIK_OUTPUT_DIR}/plugins/input"
|
|
|
|
COMMENT "copying plugin dlls into build dir"
|
|
|
|
)
|
|
|
|
add_dependencies(copy_plugin_dependencies ${m_build_plugins})
|
|
|
|
endif()
|
2020-11-21 10:34:45 +00:00
|
|
|
endif()
|