You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openvibe-launcher.sh-base 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. ## By default, paths specified by CMake install will be used to locate OpenViBE components. If defined, these ENV variables can override the CMake defines.
  3. #export OV_PATH_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  4. #export OV_PATH_BIN="$OV_PATH_ROOT/bin"
  5. #export OV_PATH_LIB="$OV_PATH_ROOT/lib"
  6. #export OV_PATH_DATA="$OV_PATH_ROOT/share/openvibe"
  7. #export MENSIA_PATH_DATA="$OV_PATH_ROOT/share/mensia"
  8. # Tries to locate matlab executable from $PATH, and set the library path to the corresponding matlab libs.
  9. if [ "`which matlab`" != "" ] ; then
  10. MATLAB_ROOT=`matlab -e | grep "^MATLAB=" | sed -e "s/^MATLAB=//"`
  11. MATLAB_ARCH=`matlab -e | grep "^ARCH=" | sed -e "s/^ARCH=//"`
  12. MATLAB_LIBPATH="$MATLAB_ROOT/bin/$MATLAB_ARCH"
  13. # echo Matlab libs expected at $MATLAB_LIBPATH
  14. LD_LIBRARY_PATH="$MATLAB_LIBPATH:$LD_LIBRARY_PATH"
  15. fi
  16. if [ "$OV_PATH_BIN" == "" ]; then
  17. export OV_PATH_BIN="@CMAKE_INSTALL_FULL_BINDIR@"
  18. fi
  19. if [ "$OV_PATH_LIB" == "" ]; then
  20. export OV_PATH_LIB="@CMAKE_INSTALL_FULL_LIBDIR@"
  21. fi
  22. if [ "$OV_PATH_DATA" == "" ]; then
  23. export OV_PATH_DATA="@CMAKE_INSTALL_FULL_DATADIR@/openvibe"
  24. fi
  25. if [ "$MENSIA_PATH_DATA" == "" ]; then
  26. export MENSIA_PATH_DATA="@CMAKE_INSTALL_FULL_DATADIR@/mensia"
  27. fi
  28. export LD_LIBRARY_PATH="$OV_PATH_LIB:@CMAKE_SOURCE_DIR@/dependencies/lib:$LD_LIBRARY_PATH"
  29. export LC_ALL=C
  30. export LUA_CPATH="$OV_PATH_LIB/lib?.so;`echo 'print(package.cpath)' | lua - `"
  31. export LUA_PATH="$OV_PATH_BIN/?.lua;`echo 'print(package.path)' | lua - `"
  32. # The following line is there to help in cases where OpenViBE can consume excessive
  33. # amounts of CPU or grind the swap. You can remove it if you know what you're doing.
  34. renice 19 $$
  35. ov_debugger=
  36. if [ "$1" == "--debug" ]; then
  37. ov_debugger="gdb --args"
  38. shift
  39. fi
  40. ov_run_bg=0
  41. if [ "$1" == "--run-bg" ]; then
  42. ov_run_bg=1
  43. shift
  44. fi
  45. ret_code=0
  46. if [ $ov_run_bg == 0 ]; then
  47. eval $ov_debugger "$OV_PATH_BIN/@OV_CMD_EXECUTABLE@" @OV_CMD_ARGS@ $*
  48. ret_code=$?
  49. else
  50. $ov_debugger "$OV_PATH_BIN/@OV_CMD_EXECUTABLE@" @OV_CMD_ARGS@ $* &
  51. fi
  52. exit $ret_code