From a912987c3b585e6c83dfa8426872ba7dbe419840 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 27 Jan 2025 09:38:47 +0100 Subject: [PATCH] Fix relative python path --- cmake/VcpkgInstallDeps.cmake | 6 +++--- platform/macos/python.in | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmake/VcpkgInstallDeps.cmake b/cmake/VcpkgInstallDeps.cmake index 10fc6fe800b..b057d7c8c6b 100644 --- a/cmake/VcpkgInstallDeps.cmake +++ b/cmake/VcpkgInstallDeps.cmake @@ -44,10 +44,10 @@ if(WITH_BINDINGS) cmake_path(GET Python_SITEARCH PARENT_PATH _SOURCE_PYTHON_DIR) set(_TARGET_PYTHON_DIR "${APP_FRAMEWORKS_DIR}/lib") - set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}") - install(PROGRAMS ${PYTHON_EXECUTABLE} + get_filename_component(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" NAME) + install(PROGRAMS ${Python_EXECUTABLE} DESTINATION "${QGIS_BIN_SUBDIR}") - configure_file("${CMAKE_SOURCE_DIR}/platform/macos/python.in" "${CMAKE_BINARY_DIR}/platform/macos/python") + configure_file("${CMAKE_SOURCE_DIR}/platform/macos/python.in" "${CMAKE_BINARY_DIR}/platform/macos/python" @ONLY) install(PROGRAMS "${CMAKE_BINARY_DIR}/platform/macos/python" DESTINATION "${QGIS_BIN_SUBDIR}") endif() diff --git a/platform/macos/python.in b/platform/macos/python.in index 230ae18eac2..67274c3f01f 100644 --- a/platform/macos/python.in +++ b/platform/macos/python.in @@ -1,5 +1,6 @@ #!/bin/bash # This is a wrapper for python, to launch python with the proper PYTHONHOME set # to make it relocatable. -export PYTHONHOME="$(cd "$(dirname "$0")/../Frameworks" && pwd)" -exec @PYTHON_EXECUTABLE@ "$@" +BASEDIR="$(cd "$(dirname "$0")" && pwd)" +export PYTHONHOME="${BASEDIR}/../Frameworks" +exec ${BASEDIR}/@PYTHON_EXECUTABLE@ "$@"