--- CMakeLists.txt.orig	2024-02-03 08:01:27 UTC
+++ CMakeLists.txt
@@ -1,3 +1,16 @@
+cmake_minimum_required(VERSION 3.12)
+
+project(s2-geometry)
+
+find_path(S2_INCLUDE_DIR s2/s2cell.h)
+
+# Should be easy to make it work with swig3, but some args to %pythonprepend
+# seem to be different and were changed.
+find_package(SWIG 4.0)
+# Use Python3_ROOT_DIR to help find python3, if the correct location is not
+# being found by default.
+find_package(Python3 COMPONENTS Interpreter Development)
+
 # Generate standard target names.
 cmake_policy(SET CMP0078 NEW)
 # Honor SWIG_MODULE_NAME via -module flag.
@@ -15,7 +28,7 @@ include(${SWIG_USE_FILE})
 endif()
 
 include(${SWIG_USE_FILE})
-include_directories(${Python3_INCLUDE_DIRS})
+include_directories(${S2_INCLUDE_DIR} ${Python3_INCLUDE_DIRS})
 
 set(CMAKE_SWIG_FLAGS "")
 set_property(SOURCE s2.i PROPERTY SWIG_FLAGS "-module" "s2geometry")
@@ -29,7 +42,7 @@ set_property(TEST s2geometry_test PROPERTY ENVIRONMENT
          ${Python3_EXECUTABLE}
          "${PROJECT_SOURCE_DIR}/src/python/s2geometry_test.py")
 set_property(TEST s2geometry_test PROPERTY ENVIRONMENT
-             "PYTHONPATH=$ENV{PYTHONPATH}:${PROJECT_BINARY_DIR}/python")
+             "PYTHONPATH=$ENV{PYTHONPATH}:${PROJECT_BINARY_DIR}")
 
 # Install the wrapper.
 install(TARGETS s2geometry DESTINATION ${S2GEOMETRY_INSTALL_PREFIX})
