From 8f06ea42d93edb3e0134a2420101ffe1eeef1127 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Sat, 15 Oct 2022 01:32:33 +0200 Subject: [PATCH] Find Python interpreter to used for scripts/buildsystems/osx/applocal.py (#27179) The deployment script works with Python 2 and 3. On modern macOS machines Python 2 may not be available. Find either version and use it. Co-authored-by: Lily Wang <494550702@qq.com> --- scripts/buildsystems/vcpkg.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index db422b0349..cc6ed29d1b 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -603,8 +603,9 @@ function(add_executable) ) elseif(Z_VCPKG_TARGET_TRIPLET_PLAT MATCHES "osx") if(NOT MACOSX_BUNDLE_IDX EQUAL -1) + find_package(Python COMPONENTS Interpreter) add_custom_command(TARGET "${target_name}" POST_BUILD - COMMAND python "${Z_VCPKG_TOOLCHAIN_DIR}/osx/applocal.py" + COMMAND "${Python_EXECUTABLE}" "${Z_VCPKG_TOOLCHAIN_DIR}/osx/applocal.py" "$" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>" VERBATIM