|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# This file is part of the OpenKinect Project. http://www.openkinect.org |
| 4 | +# |
| 5 | +# Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file |
| 6 | +# for details. |
| 7 | +# |
| 8 | +# This code is licensed to you under the terms of the Apache License, version |
| 9 | +# 2.0, or, at your option, the terms of the GNU General Public License, |
| 10 | +# version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, |
| 11 | +# or the following URLs: |
| 12 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | +# http://www.gnu.org/licenses/gpl-2.0.txt |
| 14 | +# |
| 15 | +# If you redistribute this file in source form, modified or unmodified, |
| 16 | +# you may: |
| 17 | +# 1) Leave this header intact and distribute it under the same terms, |
| 18 | +# accompanying it with the APACHE20 and GPL20 files, or |
| 19 | +# 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or |
| 20 | +# 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file |
| 21 | +# In all cases you must keep the copyright notice intact and include a copy |
| 22 | +# of the CONTRIB file. |
| 23 | +# Binary distributions must follow the binary distribution requirements of |
| 24 | +# either License. |
| 25 | + |
| 26 | +# fakenect wrapper script: |
| 27 | +# simplifies calling libfreenect applications under fakenect |
| 28 | +# by taking the fakenect database, app to run, and its args |
| 29 | +# then filling out the necessary environment variables and calling the app |
| 30 | +# usage: fakenect /path/to/fakenect/dump app --arg=value |
| 31 | + |
| 32 | +# catch bad args |
| 33 | +if [ $# -lt 2 ] |
| 34 | +then |
| 35 | + echo "Usage: $0 <database> <application> <args>" |
| 36 | + exit -1 |
| 37 | +fi |
| 38 | + |
| 39 | +# set path to fakenect database |
| 40 | +export FAKENECT_PATH=$1 |
| 41 | + |
| 42 | +# set link path (LD_LIBRARY_PATH for Linux, DYLIB_LIBRARY_PATH for OS X) |
| 43 | +if [ `uname` == "Darwin" ]; |
| 44 | +then |
| 45 | + export DYLD_LIBRARY_PATH="@CMAKE_INSTALL_PREFIX@/@PROJECT_LIBRARY_INSTALL_DIR@/fakenect/:${LD_LIBRARY_PATH}" |
| 46 | +else |
| 47 | + export LD_LIBRARY_PATH="@CMAKE_INSTALL_PREFIX@/@PROJECT_LIBRARY_INSTALL_DIR@/fakenect/:${LD_LIBRARY_PATH}" |
| 48 | +fi |
| 49 | + |
| 50 | +# run desired app w/ args, now that environment is configured |
| 51 | +"${@:2}" |
0 commit comments