--- python/CMakeLists.txt.orig 2026-01-22 21:19:35 +++ python/CMakeLists.txt 2026-01-30 08:25:51 @@ -2,7 +2,7 @@ # For find_package (Python) cmake_minimum_required(VERSION 3.12) -find_package (Python COMPONENTS Interpreter Development) +find_package (Python __PYVER__ EXACT COMPONENTS Interpreter Development) if(NOT Python_FOUND) message(FATAL_ERROR "Could not find Python. Set RSGIS_PYTHON=OFF to disable.") endif(NOT Python_FOUND) @@ -12,14 +12,14 @@ endif(APPLE) #set(PYRSGIS_ROOT_PATH "${Python_SITELIB}") -file(TO_CMAKE_PATH "${Python_SITELIB}" PYRSGIS_ROOT_PATH) -if(NOT MSVC AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - # user has set CMAKE_INSTALL_PREFIX - ensure we install - # under there rather than the default Python install location. - # BUT we want to keep the last part of the path the same as Python_SITELIB - # (ie the lib/pythonX.X/site-packages part) - string(REPLACE "${_Python_PREFIX}" "${CMAKE_INSTALL_PREFIX}" PYRSGIS_ROOT_PATH "${PYRSGIS_ROOT_PATH}") -endif(NOT MSVC AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +file(TO_CMAKE_PATH "${Python3_SITELIB}" PYRSGIS_ROOT_PATH) +# if(NOT MSVC AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +# # user has set CMAKE_INSTALL_PREFIX - ensure we install +# # under there rather than the default Python install location. +# # BUT we want to keep the last part of the path the same as Python_SITELIB +# # (ie the lib/pythonX.X/site-packages part) +# string(REPLACE "${_Python_PREFIX}" "${CMAKE_INSTALL_PREFIX}" PYRSGIS_ROOT_PATH "${PYRSGIS_ROOT_PATH}") +# endif(NOT MSVC AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(STATUS "installing Python libs to ${PYRSGIS_ROOT_PATH}") #set(PYRSGIS_INSTALL_PATH "${PYRSGIS_ROOT_PATH}/rsgislib") @@ -232,4 +232,4 @@ # custom install step to create .pyc files file(TO_CMAKE_PATH "${Python_EXECUTABLE}" SAFE_PYTHON_EXECUTABLE) -install(CODE "execute_process(COMMAND \"${SAFE_PYTHON_EXECUTABLE}\" -m compileall \"${PYRSGIS_INSTALL_PATH}\")") +#install(CODE "execute_process(COMMAND \"${SAFE_PYTHON_EXECUTABLE}\" -m compileall \"${PYRSGIS_INSTALL_PATH}\")")