From 7ad616d62bdd049cf4e2090bd2899e8cad25fb85 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Mon, 15 Nov 2021 17:20:06 +0100 Subject: [PATCH] finished set_library_path for MacOS .app build --- macos/set_library_path.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/macos/set_library_path.sh b/macos/set_library_path.sh index d245d529..a92d8697 100644 --- a/macos/set_library_path.sh +++ b/macos/set_library_path.sh @@ -1,14 +1,18 @@ #!/bin/sh set -e +# Options WANTED_LIB=$1 NEW_PATH=$2 EXEC=$3 +# Function to extract the first element of a space seperated list get_first_arg() { echo $1 } -CURRENT_RPATH=$(get_first_arg $(otool -L $EXEC | grep $WANTED_LIB)) +# Get current path +CURRENT_PATH=$(get_first_arg $(otool -L $EXEC | grep $WANTED_LIB)) -echo $CURRENT_RPATH \ No newline at end of file +# Change to the new path +install_name_tool -change $CURRENT_PATH $NEW_PATH $EXEC \ No newline at end of file