diff --git a/tools/xcode/templates/SFML/SFML Application Base.xctemplate/TemplateInfo.plist b/tools/xcode/templates/SFML/SFML Application Base.xctemplate/TemplateInfo.plist index 1314e5eb..18c19873 100644 --- a/tools/xcode/templates/SFML/SFML Application Base.xctemplate/TemplateInfo.plist +++ b/tools/xcode/templates/SFML/SFML Application Base.xctemplate/TemplateInfo.plist @@ -715,39 +715,41 @@ while (window.isOpen()) # If you're using static libraries (which is not recommended) you should remove this script from your project. # Are we building a project that uses framework or dylibs ? -if [ $SFML_LINK_PREFIX = $SFML_LINK_FRAMEWORKS_PREFIX ] -then - frameworks=1 -else - frameworks=0 -fi +case "$SFML_BINARY_TYPE" in + DYLIBS) + frameworks="false" + ;; + *) + frameworks="true" + ;; +esac require () # $1 is a SFML module like 'system' or 'audio' { - dest=$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Contents/Frameworks + dest="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/Contents/Frameworks" - if [ -z $1 ] + if [ -z "$1" ] then echo "no parameter! ERROR!" exit else # clean potentially old stuff - rm -f $dest/libsfml-$1.2.dylib - rm -f $dest/libsfml-$1-d.2.dylib - rm -fr $dest/sfml-$1.framework + rm -f "$dest/libsfml-$1.2.dylib" + rm -f "$dest/libsfml-$1-d.2.dylib" + rm -fr "$dest/sfml-$1.framework" # copy SFML libraries - if [ $frameworks ] + if [ "$frameworks" = "true" ] then ditto "/Library/Frameworks/sfml-$1.framework" "$dest/sfml-$1.framework" - elif [ $CONFIGURATION = "Debug" ] + elif [ $CONFIGURATION = "Debug" ] && [ $SFML_LINK_DYLIBS_SUFFIX_DEBUG != "" ] then ditto "/usr/local/lib/libsfml-$1-d.2.dylib" "$dest/libsfml-$1-d.2.dylib" else ditto "/usr/local/lib/libsfml-$1.2.dylib" "$dest/libsfml-$1.2.dylib" fi - if [ $1 = "audio" ] + if [ "$1" = "audio" ] then # copy sndfile framework too ditto "/Library/Frameworks/sndfile.framework" "$dest/sndfile.framework" @@ -779,6 +781,7 @@ if [ -n "$SFML_GRAPHICS" ] then require "graphics" fi + RunOnlyForDeploymentPostprocessing