Skip to content

Commit 70a2f31

Browse files
committed
rework build system
1 parent 372dba1 commit 70a2f31

File tree

8 files changed

+110
-439
lines changed

8 files changed

+110
-439
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ mapnik/paths.py
1818
.mason/
1919
mason_packages/
2020
mapnik/plugins
21+
_skbuild/

Diff for: CMakeLists.txt

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
cmake_minimum_required(VERSION 3.15)
2+
include(cmake/vcpkg_setup.cmake)
3+
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX VERSION ${SKBUILD_PROJECT_VERSION})
4+
5+
find_package(Python COMPONENTS Interpreter Development.Module)
6+
find_package(mapnik CONFIG REQUIRED)
7+
find_package(Boost REQUIRED COMPONENTS thread python310)
8+
9+
set(Python_SOABI ${SKBUILD_SOABI})
10+
Python_add_library(_mapnik MODULE WITH_SOABI)
11+
target_link_libraries(_mapnik PRIVATE
12+
mapnik::mapnik
13+
mapnik::json
14+
mapnik::wkt
15+
# even though boost_thread is no longer used in mapnik core
16+
# we need to link in for boost_python to avoid missing symbol: _ZN5boost6detail12get_tss_dataEPKv / boost::detail::get_tss_data
17+
Boost::thread
18+
Boost::python310
19+
ICU::data ICU::i18n ICU::uc
20+
)
21+
target_sources(_mapnik PRIVATE
22+
src/boost_std_shared_shim.hpp
23+
src/mapnik_color.cpp
24+
src/mapnik_coord.cpp
25+
src/mapnik_datasource_cache.cpp
26+
src/mapnik_datasource.cpp
27+
src/mapnik_enumeration_wrapper_converter.hpp
28+
src/mapnik_enumeration.hpp
29+
src/mapnik_envelope.cpp
30+
src/mapnik_expression.cpp
31+
src/mapnik_feature.cpp
32+
src/mapnik_featureset.cpp
33+
src/mapnik_font_engine.cpp
34+
src/mapnik_fontset.cpp
35+
src/mapnik_gamma_method.cpp
36+
src/mapnik_geometry.cpp
37+
src/mapnik_grid_view.cpp
38+
src/mapnik_grid.cpp
39+
src/mapnik_image_view.cpp
40+
src/mapnik_image.cpp
41+
src/mapnik_label_collision_detector.cpp
42+
src/mapnik_layer.cpp
43+
src/mapnik_logger.cpp
44+
src/mapnik_map.cpp
45+
src/mapnik_palette.cpp
46+
src/mapnik_parameters.cpp
47+
src/mapnik_proj_transform.cpp
48+
src/mapnik_projection.cpp
49+
src/mapnik_python.cpp
50+
src/mapnik_query.cpp
51+
src/mapnik_raster_colorizer.cpp
52+
src/mapnik_rule.cpp
53+
src/mapnik_scaling_method.cpp
54+
src/mapnik_style.cpp
55+
src/mapnik_svg.hpp
56+
src/mapnik_symbolizer.cpp
57+
src/mapnik_threads.hpp
58+
src/mapnik_value_converter.hpp
59+
src/mapnik_view_transform.cpp
60+
src/python_grid_utils.cpp
61+
src/python_grid_utils.hpp
62+
src/python_optional.hpp
63+
src/python_to_value.hpp
64+
)
65+
66+
install(TARGETS _mapnik LIBRARY DESTINATION ${SKBUILD_PROJECT_NAME})

Diff for: build.py

-120
This file was deleted.

Diff for: cmake/vcpkg_setup.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if(WIN32)
2+
set(VCPKG_TARGET_TRIPLET x64-windows-static)
3+
endif()
4+
set(CMAKE_TOOLCHAIN_FILE "~/vcpkg/scripts/buildsystems/vcpkg.cmake")

Diff for: pyproject.toml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[project]
2+
name = "mapnik"
3+
version = "4.0.0"
4+
authors = [
5+
{ name="Blake Thompson", email="[email protected]" },
6+
]
7+
description = "Python bindings for Mapnik"
8+
readme = "README.md"
9+
requires-python = ">=3.7"
10+
license = "LGPL-2.1-only"
11+
12+
[project.urls]
13+
"Homepage" = "https://github.com/mapnik/python-mapnik"
14+
"Bug Tracker" = "https://github.com/mapnik/python-mapnik/issues"
15+
16+
[project.optional-dependencies]
17+
test = ["pytest"]
18+
19+
[build-system]
20+
requires = ["scikit-build-core"]
21+
build-backend = "scikit_build_core.build"
22+
23+
[tool.scikit-build]
24+
cmake.minimum-version = "3.15"
25+
cmake.build-type = "Release"
26+
sdist.reproducible = true
27+
wheel.packages = ["src", "mapnik"]

Diff for: setup.cfg

-2
This file was deleted.

0 commit comments

Comments
 (0)