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-macos.sh-base 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. # Tries to locate matlab executable from $PATH, and set the library path to the corresponding matlab libs.
  8. if [ "`which matlab`" != "" ] ; then
  9. MATLAB_ROOT=`matlab -e | grep "^MATLAB=" | sed -e "s/^MATLAB=//"`
  10. MATLAB_ARCH=`matlab -e | grep "^ARCH=" | sed -e "s/^ARCH=//"`
  11. MATLAB_LIBPATH="$MATLAB_ROOT/bin/$MATLAB_ARCH"
  12. # echo Matlab libs expected at $MATLAB_LIBPATH
  13. export DYLD_LIBRARY_PATH="$MATLAB_LIBPATH:$DYLD_LIBRARY_PATH"
  14. fi
  15. if [ "$OV_PATH_BIN" == "" ]; then
  16. OV_PATH_BIN="@CMAKE_INSTALL_FULL_BINDIR@"
  17. fi
  18. if [ "$OV_PATH_LIB" == "" ]; then
  19. OV_PATH_LIB="@CMAKE_INSTALL_FULL_LIBDIR@"
  20. fi
  21. if [ "$OV_PATH_DATA" == "" ]; then
  22. OV_PATH_DATA="@CMAKE_INSTALL_FULL_DATADIR@"
  23. fi
  24. # if [ "$MENSIA_PATH_DATA" == "" ]; then
  25. # MENSIA_PATH_DATA="@CMAKE_INSTALL_FULL_DATADIR@"
  26. # fi
  27. export DYLD_LIBRARY_PATH="$OV_PATH_LIB:@CMAKE_SOURCE_DIR@/dependencies/lib:$DYLD_LIBRARY_PATH"
  28. export LC_ALL=C
  29. export GTK_PATH=/usr/local/lib/gtk-2.0
  30. export LUA_CPATH="$OV_PATH_LIB/lib?.dylib;`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