#! /bin/bash
# Shell script to ease the launch of a FW4SPL application on linux.
#
# This exports the proper LD_LIBRARY_PATH, and append the profile.xml of the application

# Don't modify this file, it is automatically be generated by Cmake.

me=$(cd "$(dirname "$0")"; pwd)

# Setup the directories
bindir="$me"
rootdir=`cd "$me/.." ; pwd`
libdir="$rootdir/lib"
bundledir="$rootdir/share"

# export LD_LIBRARY_PATH
LD_LIBRARY_PATH=$libdir:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

# export the path to the fonts if it exists (mandatory for Qt)
QT_QPA_FONTDIR="$libdir/fonts"
if [ -d $QT_QPA_FONTDIR ]; then
    export QT_QPA_FONTDIR
fi

# Use CMAKE Variable of fwlauncher and Profile.xml path
exec "$bindir/fwlauncher-0.1" "$bundledir/VRRender-0.9/profile.xml" "-B" "$bundledir" "--rwd" "$me/.."
