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.cmd-base 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. @ECHO OFF
  2. SETLOCAL EnableExtensions
  3. SETLOCAL EnableDelayedExpansion
  4. REM If not set to PASSIVE, OpenMP (Eigen) boxes may load the cores fully even if there's little to do.
  5. SET "OMP_WAIT_POLICY=@OV_OMP_WAIT_POLICY@"
  6. REM Get the directory location of this script, assume it contains the OpenViBE dist tree. These variables will be used by OpenViBE executables.
  7. SET "OV_PATH_ROOT=%~dp0"
  8. SET "OV_PATH_BIN=%OV_PATH_ROOT%\bin"
  9. SET "OV_PATH_LIB=%OV_PATH_ROOT%\bin"
  10. SET "OV_PATH_DATA=%OV_PATH_ROOT%\share\openvibe"
  11. REM Default behavior
  12. SET OV_PAUSE=@OV_PAUSE@
  13. SET OV_RUN_IN_BG=
  14. REM Parse out Windows specific args ...
  15. SET "ARGS="
  16. SET EMPTY=
  17. :loop
  18. SET "STRIPPEDARG=%~1"
  19. if NOT !STRIPPEDARG! == !EMPTY! (
  20. IF /i "!STRIPPEDARG!" == "--no-pause" (
  21. SET OV_PAUSE=
  22. goto found:
  23. )
  24. IF /i "!STRIPPEDARG!" == "--pause" (
  25. SET OV_PAUSE=PAUSE
  26. goto found:
  27. )
  28. IF /i "!STRIPPEDARG!" == "--run-bg" (
  29. REM Run in background, disable pause. The second parameter below is because CMD requires a 'title'
  30. SET OV_RUN_IN_BG=START "@OV_CMD_EXECUTABLE@"
  31. SET OV_PAUSE=
  32. goto found:
  33. )
  34. REM Pass the non-stripped arg to the launched application...
  35. SET ARGS=%ARGS% %1
  36. :found
  37. SHIFT
  38. goto loop:
  39. )
  40. REM Set dependency paths etc...
  41. REM SET "OV_ENVIRONMENT_FILE=%OV_PATH_ROOT%\bin\OpenViBE-set-env.cmd"
  42. REM IF NOT EXIST "%OV_ENVIRONMENT_FILE%" (
  43. REM ECHO Error: "%OV_ENVIRONMENT_FILE%" was not found
  44. REM GOTO EndOfScript
  45. REM )
  46. REM CALL "%OV_ENVIRONMENT_FILE%"
  47. SET PATH=%OV_PATH_LIB%;%PATH%
  48. REM cmake variable OV_CMD_ARGS below may specify additional arguments outside this script
  49. %OV_RUN_IN_BG% "@OV_CMD_EXECUTABLE@" @OV_CMD_ARGS@ %ARGS%
  50. :EndOfScript
  51. %OV_PAUSE%