mirror of https://github.com/CGAL/cgal
85 lines
2.2 KiB
Bash
Executable File
85 lines
2.2 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# This script creates the appropriate directory structure so that a CGAL
|
|
# Qt demo can be run on MacOSX
|
|
#
|
|
# Authors: Herve Bronnimann
|
|
# Menelaos Karavelas (minor modifications/adaptations)
|
|
#
|
|
|
|
usage()
|
|
{
|
|
echo "Usage: make_macosx_app executable"
|
|
}
|
|
|
|
|
|
case $# in
|
|
0) usage
|
|
exit 1
|
|
esac
|
|
|
|
|
|
for i do
|
|
if [ -x "$i" ] ; then
|
|
EXECUTABLE=$i
|
|
else
|
|
usage
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
if [ -z "$EXECUTABLE.app" ] ; then
|
|
mkdir $EXECUTABLE.app
|
|
fi
|
|
|
|
test -d $EXECUTABLE.app/Contents/MacOS/ || mkdir -p $EXECUTABLE.app/Contents/MacOS/
|
|
strip $EXECUTABLE
|
|
cp $EXECUTABLE $EXECUTABLE.app/Contents/MacOS/$EXECUTABLE
|
|
|
|
rm -f $EXECUTABLE.app/Contents/PkgInfo
|
|
echo "APPL????" > $EXECUTABLE.app/Contents/PkgInfo
|
|
|
|
rm -f $EXECUTABLE.app/Contents/Info.plist
|
|
cat > $EXECUTABLE.app/Contents/Info.plist <<ENDINFO
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist SYSTEM
|
|
"file://localhost/System/Library/DTDs/PropertyList.dtd">
|
|
<plist version=\"0.9\">
|
|
<dict>
|
|
<key>CFBundleIconFile</key>
|
|
<string>cgal_app.icns</string>
|
|
<key>CFBundlePackageType</key>
|
|
<string>APPL</string>
|
|
<key>CFBundleGetInfoString</key>
|
|
<string>Created by CGAL</string>
|
|
<key>CFBundleSignature</key>
|
|
<string>ttxt</string>
|
|
<key>CFBundleExecutable</key>
|
|
<string>$EXECUTABLE</string>
|
|
ENDINFO
|
|
|
|
if [ -d "help" ] ; then
|
|
cat >> $EXECUTABLE.app/Contents/Info.plist <<ENDINFO
|
|
<key>CFBundleHelpBookFolder</key>
|
|
<string>Help</string>
|
|
<key>CFBundleHelpBookName</key>
|
|
<string>Help</string>
|
|
ENDINFO
|
|
test -d $EXECUTABLE.app/Contents/Resources/Help || mkdir -p $EXECUTABLE.app/Contents/Resources/Help
|
|
cp -r help/* $EXECUTABLE.app/Contents/Resources/Help
|
|
ln -s index.html $EXECUTABLE.app/Contents/Resources/Help/Help.html
|
|
fi
|
|
|
|
cat >> $EXECUTABLE.app/Contents/Info.plist <<ENDINFO
|
|
<key>NOTE</key>
|
|
<string>This file was generated by CGAL/scripts/make_macosx_app.</string>
|
|
</dict>
|
|
</plist>
|
|
ENDINFO
|
|
|
|
test -d $EXECUTABLE.app/Contents/Resources || mkdir -p $EXECUTABLE.app/Contents/Resources
|
|
CGALMAKEDIR=`dirname $CGAL_MAKEFILE`
|
|
CGALDIR="$CGALMAKEDIR/../"
|
|
cp $CGALDIR/auxiliary/cgal_app.icns $EXECUTABLE.app/Contents/Resources
|
|
echo "created $EXECUTABLE.app ..."
|