diff --git a/devtools/deploy/mac/adjust_mac_bundle.zsh b/devtools/deploy/mac/adjust_mac_bundle.zsh
index 56f2d55c270c86aa08be31ccc755cd2f96d5e66e..fb55a97494a06c2cdd4fd4a519438bec47436b17 100644
--- a/devtools/deploy/mac/adjust_mac_bundle.zsh
+++ b/devtools/deploy/mac/adjust_mac_bundle.zsh
@@ -54,13 +54,12 @@ setopt nullglob
 
 # include shell helper functions
 # (expected to be in the same folder as the current script)
-scriptdir="$(dirname $0)"
-source "$scriptdir"/shutils.zsh
+source "@CMAKE_SOURCE_DIR@/devtools/deploy/mac/shutils.zsh"
 #========================================
 declare -r TITLE="* MacOS Package"
 
 #-- directories for the package binaries
-pkg_root="$1/Contents" # root dir, eg. '/tmp/bornagain.app/Contents'
+pkg_root="$1" # root dir, eg. '/tmp/bornagain.app/Contents'
 main_exe="$pkg_root/MacOS/@MACPK_MAIN_EXE@"
 extra_libs="@MACPK_EXTRA_LIBS@"
 # eg. input Qt dir = '/usr/local/opt/qt@5/lib/cmake/Qt'
@@ -83,6 +82,12 @@ then
     exit 1
 fi
 
+if [[ ! -f "$main_exe" ]]
+then
+    echo "$TITLE: Error: Main executable does not exist ($main_exe)."
+    exit 1
+fi
+
 echo "$TITLE: package root = '$pkg_root'"
 echo "$TITLE: main executable = '$main_exe'"
 echo "$TITLE: Qt framework root = '$qt_framework_root'"