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 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. if [ "$OV_PATH_ROOT" == "" ]; then
  8. SOURCE="${BASH_SOURCE[0]}"
  9. while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  10. OV_PATH_ROOT="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  11. SOURCE="$(readlink "$SOURCE")"
  12. [[ $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
  13. done
  14. OV_PATH_ROOT="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  15. fi
  16. export LD_LIBRARY_PATH="$OV_PATH_LIB:@CMAKE_SOURCE_DIR@/dependencies/lib:$LD_LIBRARY_PATH"
  17. export LC_ALL=C
  18. # The following line is there to help in cases where OpenViBE can consume excessive
  19. # amounts of CPU or grind the swap. You can remove it if you know what you're doing.
  20. renice 19 $$
  21. ov_debugger=
  22. if [ "$1" == "--debug" ]; then
  23. ov_debugger="gdb --args"
  24. shift
  25. fi
  26. if [ "$1" == "--memcheck" ]; then
  27. ov_debugger="valkyrie "
  28. #ov_debugger="valgrind --tool=memcheck --log-file='valgrind_@OV_CMD_EXECUTABLE@_%p.log'"
  29. shift
  30. fi
  31. ov_run_bg=0
  32. if [ "$1" == "--run-bg" ]; then
  33. ov_run_bg=1
  34. shift
  35. fi
  36. ret_code=0
  37. if [ $ov_run_bg == 0 ]; then
  38. eval $ov_debugger "$OV_PATH_BIN/@OV_CMD_EXECUTABLE@" @OV_CMD_ARGS@ $*
  39. ret_code=$?
  40. else
  41. $ov_debugger "$OV_PATH_BIN/@OV_CMD_EXECUTABLE@" @OV_CMD_ARGS@ $* &
  42. fi
  43. exit $ret_code