--- 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})