diff --git a/CMakeLists.txt b/CMakeLists.txt index ce92dadf662..77a2ce61838 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1022,6 +1022,14 @@ else() find_package(Python ${MIN_PYTHON_VERSION} REQUIRED COMPONENTS Interpreter) endif() +# Fix python site-packages for Fedora +# See https://github.com/qgis/QGIS/issues/54348#issuecomment-1694216152 +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if(EXISTS "/etc/fedora-release") + EXECUTE_PROCESS(COMMAND ${Python_EXECUTABLE} -c "import sysconfig;print(sysconfig.get_path(\"platlib\", \"rpm_prefix\"), end=\"\")" OUTPUT_VARIABLE Python_SITEARCH) + endif() +endif() + message("-- Found Python executable: ${Python_EXECUTABLE} (version ${Python_VERSION})") message("-- Python library: ${Python_LIBRARIES}") message("-- Python site-packages: ${Python_SITEARCH}")