Skip to content

Commit f021162

Browse files
committed
Support Mapnik v4 built with SCONS
1 parent e8ac8f1 commit f021162

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.github/workflows/docker-image-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ name: Docker Image Build
44
on:
55
pull_request:
66
push:
7+
branches:
8+
- "*CI*"
79
paths:
810
- "docker/**"
911
- ".github/workflows/docker-image-build.yml"

CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,26 @@ execute_process(COMMAND ${APXS_EXECUTABLE} -q sysconfdir
122122
OUTPUT_STRIP_TRAILING_WHITESPACE
123123
)
124124

125-
if(LIBMAPNIK_VERSION VERSION_LESS 4)
125+
pkg_get_variable(MAPNIK_FONTS_DIR libmapnik fonts_dir)
126+
pkg_get_variable(MAPNIK_PLUGINS_DIR libmapnik plugins_dir)
127+
if(MAPNIK_FONTS_DIR STREQUAL "" AND MAPNIK_PLUGINS_DIR STREQUAL "")
126128
find_program(MAPNIK_CONFIG_EXECUTABLE NAMES mapnik-config REQUIRED)
129+
if(LIBMAPNIK_VERSION VERSION_GREATER_EQUAL 4)
130+
message(WARNING "Mapnik >= 4 not built with CMake doesn't provide pkg-config support.")
131+
endif()
127132
execute_process(COMMAND ${MAPNIK_CONFIG_EXECUTABLE} --fonts
128133
OUTPUT_STRIP_TRAILING_WHITESPACE
129134
OUTPUT_VARIABLE MAPNIK_FONTS_DIR
130135
)
136+
message(STATUS "Found Mapnik Fonts directory: ${MAPNIK_FONTS_DIR}")
131137
execute_process(COMMAND ${MAPNIK_CONFIG_EXECUTABLE} --input-plugins
132138
OUTPUT_STRIP_TRAILING_WHITESPACE
133139
OUTPUT_VARIABLE MAPNIK_PLUGINS_DIR
134140
)
135-
elseif(LIBMAPNIK_VERSION VERSION_GREATER_EQUAL 4)
136-
pkg_get_variable(MAPNIK_FONTS_DIR libmapnik fonts_dir)
137-
pkg_get_variable(MAPNIK_PLUGINS_DIR libmapnik plugins_dir)
141+
message(STATUS "Found Mapnik Plugins directory: ${MAPNIK_PLUGINS_DIR}")
142+
if(EXISTS "${LIBMAPNIK_INCLUDE_DIR}/deps")
143+
list(APPEND LIBMAPNIK_INCLUDE_DIRS "${LIBMAPNIK_INCLUDE_DIR}/deps")
144+
endif()
138145
endif()
139146

140147
if(NOT CMAKE_INSTALL_MODULESDIR)

0 commit comments

Comments
 (0)