diff --git a/cmake/multipython/MakePythonWheel.cmake b/cmake/multipython/MakePythonWheel.cmake
index 2b0994219bdfea78bfac2fac2464633c1fc1f181..9a3fc3ba5eb67dff74d99194a220194b5c5e7072 100644
--- a/cmake/multipython/MakePythonWheel.cmake
+++ b/cmake/multipython/MakePythonWheel.cmake
@@ -75,12 +75,12 @@ endforeach()
 # external library dependencies
 
 if(WIN32)
-    set(_sources "${BA_Dependencies_WIN32}")
+    set(_extra_libs "${BA_Dependencies_WIN32}")
 else()
-    set(_sources "${BA_Dependencies}")
+    set(_extra_libs "${BA_Dependencies}")
 endif()
 
-foreach(_src ${_sources})
+foreach(_src ${_extra_libs})
     configure_file(${_src} ${BA_PY_EXTRA_LIBRARY_OUTPUT_DIR} COPYONLY)
 endforeach()
 
@@ -90,11 +90,12 @@ if(APPLE)
     # On MacOS, building the Python packages needs further effort
     # which is performed in a dedicated shell script which
     # should be executed after build process is done (like CPack).
-    set(BA_PY_MODE "ON")
     set(MACPKG_EXTRA_LIBS "${_extra_libs}")
 
+    set(BA_PY_MODE "ON")
     configure_file("${CMAKE_SOURCE_DIR}/devtools/deploy/mac/mac_package.py.in"
         ${BUILD_VAR_DIR}/mac_py_package.py @ONLY)
+    unset(BA_PY_MODE)
 
     add_custom_target(BAPyWheel ALL
         COMMENT "${header} Script to build the Python wheel: "
diff --git a/devtools/deploy/mac/mk_pypack_macos.zsh.in b/devtools/deploy/mac/mk_pypack_macos.zsh.in
index 88cd79c24c31a43b63f240b6ba5b816c4ff9e9e4..a4c12fc710087b9654cabbd006d4e5b1dd4911cf 100755
--- a/devtools/deploy/mac/mk_pypack_macos.zsh.in
+++ b/devtools/deploy/mac/mk_pypack_macos.zsh.in
@@ -66,7 +66,7 @@ pyoutdir="@PY_OUTPUT_DIR@"
 libdir="@BA_PY_LIBRARY_OUTPUT_DIR@"
 xlibdir="@BA_PY_EXTRA_LIBRARY_OUTPUT_DIR@"
 wheeldir="@WHEEL_DIR@"
-PYTHON="@__Py3_EXECUTABLE@"
+PYTHON="@Python3_EXECUTABLE@"
 
 # constants
 TITLE="MacOS PyPack"