ports/graphics/py-s2/files/patch-CMakeLists.txt
Sunpoet Po-Chuan Hsieh eddb9d1bf4 Add py-s2 0.9.0
S2 Geometry Library is a package for manipulating geometric shapes. Unlike many
geometry libraries, S2 is primarily designed to work with spherical geometry,
i.e., shapes drawn on a sphere rather than on a planar 2D map. This makes it
especially suitable for working with geographic data.

This port is the Python binding of S2 Geometry Library.

WWW: https://s2geometry.io/
WWW: https://github.com/google/s2geometry
2020-09-12 12:07:17 +00:00

35 lines
1.2 KiB
Text

--- CMakeLists.txt.orig 2019-03-04 16:53:16 UTC
+++ CMakeLists.txt
@@ -1,5 +1,15 @@
+cmake_minimum_required(VERSION 3.5)
+
+project(s2-geometry)
+
+find_path(S2_INCLUDE_DIR s2/s2cell.h)
+
+find_package(SWIG)
+find_package(PythonInterp)
+find_package(PythonLibs)
+
include(${SWIG_USE_FILE})
-include_directories(${PYTHON_INCLUDE_PATH})
+include_directories(${S2_INCLUDE_DIR} ${PYTHON_INCLUDE_PATH})
set(CMAKE_SWIG_FLAGS "")
set_property(SOURCE s2.i PROPERTY SWIG_FLAGS "-module" "pywraps2")
@@ -18,7 +28,7 @@ add_test(NAME pywraps2_test COMMAND
${PYTHON_EXECUTABLE}
"${PROJECT_SOURCE_DIR}/src/python/pywraps2_test.py")
set_property(TEST pywraps2_test PROPERTY ENVIRONMENT
- "PYTHONPATH=$ENV{PYTHONPATH}:${PROJECT_BINARY_DIR}/python")
+ "PYTHONPATH=$ENV{PYTHONPATH}:${PROJECT_BINARY_DIR}")
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "if True:
from distutils import sysconfig as sc;
@@ -28,5 +38,5 @@ execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "if
# Install the wrapper.
install(TARGETS _pywraps2 DESTINATION ${PYTHON_SITE})
-install(FILES "${PROJECT_BINARY_DIR}/python/pywraps2.py"
+install(FILES "${PROJECT_BINARY_DIR}/pywraps2.py"
DESTINATION ${PYTHON_SITE})