From 764c18bde1a4c071b411583964b981b213070f4a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 May 2014 20:35:49 +0200 Subject: [PATCH] OSX install script fixes. --- CMakeLists.txt | 2 +- scripts/osx_fixbundle.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 542667f1fc..575ddf773d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -451,7 +451,7 @@ if( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC ) if( KICAD_BUILD_DYNAMIC AND APPLE ) add_custom_target( osx_fix_bundles ALL DEPENDS cvpcb eeschema gerbview kicad pcbnew bitmap2component pcb_calculator pl_editor) - add_custom_command(TARGET osx_fix_bundles POST_BUILD COMMAND scripts/osx_fixbundle.sh COMMENT "Migrating dylibs to bundles") + add_custom_command(TARGET osx_fix_bundles POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/scripts/osx_fixbundle.sh ${PROJECT_SOURCE_DIR} COMMENT "Migrating dylibs to bundles") endif() endif( KICAD_BUILD_STATIC OR KICAD_BUILD_DYNAMIC) diff --git a/scripts/osx_fixbundle.sh b/scripts/osx_fixbundle.sh index d2c8726963..a1f21de16a 100755 --- a/scripts/osx_fixbundle.sh +++ b/scripts/osx_fixbundle.sh @@ -20,8 +20,9 @@ function fixbundle() { exec="$1" bzroot="$2" execpath="$3" + binary="$4" - LIBRARIES="`otool -L ${execpath}${exec}.app/Contents/MacOS/${exec} | cut -d' ' -f1`" + LIBRARIES="`otool -L ${binary} | cut -d' ' -f1`" for library in $LIBRARIES; do @@ -35,7 +36,7 @@ function fixbundle() { resolvelink "$library" "`dirname $library`" "${execpath}/${exec}.app/Contents/Frameworks" fi fi - install_name_tool -change $library @executable_path/../Frameworks/`basename $library` ${execpath}${exec}.app/Contents/MacOS/${exec} + install_name_tool -change $library @executable_path/../Frameworks/`basename $library` ${binary} fi done @@ -122,5 +123,7 @@ for executable in $EXECUTABLES; do myexecpath="`dirname ${executable}`/" myexec="`basename ${executable}|sed -e 's/\.app//'`" - fixbundle "${myexec}" "`pwd`" "${myexecpath}" + + fixbundle "${myexec}" "$1" "${myexecpath}" "${myexecpath}${myexec}.app/Contents/MacOS/${myexec}" + fixbundle "${myexec}" "$1" "${myexecpath}" "${myexecpath}${myexec}.app/Contents/MacOS/_${myexec}.kiface" done