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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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_ROOT" == "" ]; then
  16. SOURCE="${BASH_SOURCE[0]}"
  17. while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  18. OV_PATH_ROOT="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  19. SOURCE="$(readlink "$SOURCE")"
  20. [[ $SOURCE != /* ]] && SOURCE="$OV_PATH_ROOT/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
  21. done
  22. OV_PATH_ROOT="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  23. fi
  24. export DYLD_LIBRARY_PATH="$OV_PATH_LIB:@CMAKE_SOURCE_DIR@/dependencies/lib:$DYLD_LIBRARY_PATH"
  25. export LC_ALL=C
  26. export GTK_PATH=/usr/local/lib/gtk-2.0
  27. export LUA_CPATH="$OV_PATH_LIB/lib?.dylib;`echo 'print(package.cpath)' | lua - `"
  28. export LUA_PATH="$OV_PATH_BIN/?.lua;`echo 'print(package.path)' | lua - `"
  29. # The following line is there to help in cases where OpenViBE can consume excessive
  30. # amounts of CPU or grind the swap. You can remove it if you know what you're doing.
  31. renice 19 $$
  32. ov_debugger=
  33. if [ "$1" == "--debug" ]; then
  34. ov_debugger="gdb --args"
  35. shift
  36. fi
  37. ov_run_bg=0
  38. if [ "$1" == "--run-bg" ]; then
  39. ov_run_bg=1
  40. shift
  41. fi
  42. ret_code=0
  43. if [ $ov_run_bg == 0 ]; then
  44. eval $ov_debugger "$OV_PATH_BIN/@OV_CMD_EXECUTABLE@" @OV_CMD_ARGS@ $*
  45. ret_code=$?
  46. else
  47. $ov_debugger "$OV_PATH_BIN/@OV_CMD_EXECUTABLE@" @OV_CMD_ARGS@ $* &
  48. fi
  49. exit $ret_code