--- s2geometry-0.11.1.orig/src/python/CMakeLists.txt 2024-02-16 20:39:34.592739300 +0300 +++ s2geometry-0.11.1/src/python/CMakeLists.txt 2024-02-16 21:59:49.168979900 +0300 @@ -11,7 +11,10 @@ else() # The Python package is installed directly in the folder of the # detected interpreter (system, user, or virtualenv) - set(S2GEOMETRY_INSTALL_PREFIX ${Python3_SITELIB}) + execute_process(COMMAND ${Python3_EXECUTABLE} -c + "import sys, sysconfig; print(sysconfig.get_path('platlib').replace(sys.prefix+'/','')+'/s2geometry')" + OUTPUT_VARIABLE S2GEOMETRY_INSTALL_PREFIX + OUTPUT_STRIP_TRAILING_WHITESPACE) endif() include(${SWIG_USE_FILE}) @@ -32,7 +35,9 @@ "PYTHONPATH=$ENV{PYTHONPATH}:${PROJECT_BINARY_DIR}/python") # Install the wrapper. -install(TARGETS s2geometry DESTINATION ${S2GEOMETRY_INSTALL_PREFIX}) +install(TARGETS s2geometry DESTINATION ${S2GEOMETRY_INSTALL_PREFIX} + COMPONENT python + EXCLUDE_FROM_ALL) # Install swig-generated Python file (we rename it to __init__.py as it will # ultimately end up in a directory called s2geometry in site-packages, which will @@ -40,4 +45,5 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/s2geometry.py" DESTINATION ${S2GEOMETRY_INSTALL_PREFIX} RENAME __init__.py - COMPONENT s2geometry) + COMPONENT python + EXCLUDE_FROM_ALL)