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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. REM Default behavior
  9. SET OV_PAUSE=PAUSE
  10. SET OV_RUN_IN_BG=
  11. REM Parse out Windows specific args ...
  12. SET "ARGS="
  13. SET EMPTY=
  14. :loop
  15. SET "STRIPPEDARG=%~1"
  16. if NOT !STRIPPEDARG! == !EMPTY! (
  17. IF /i "!STRIPPEDARG!" == "--no-pause" (
  18. SET OV_PAUSE=
  19. goto found:
  20. )
  21. IF /i "!STRIPPEDARG!" == "--run-bg" (
  22. REM Run in background, disable pause. The second parameter below is because CMD requires a 'title'
  23. SET OV_RUN_IN_BG=START "@OV_CMD_EXECUTABLE@"
  24. SET OV_PAUSE=
  25. goto found:
  26. )
  27. REM Pass the non-stripped arg to the launched application...
  28. SET ARGS=%ARGS% %1
  29. :found
  30. SHIFT
  31. goto loop:
  32. )
  33. REM Set dependency paths etc...
  34. SET "OV_ENVIRONMENT_FILE=%OV_PATH_ROOT%\bin\OpenViBE-set-env.cmd"
  35. IF NOT EXIST "%OV_ENVIRONMENT_FILE%" (
  36. ECHO Error: "%OV_ENVIRONMENT_FILE%" was not found
  37. GOTO EndOfScript
  38. )
  39. CALL "%OV_ENVIRONMENT_FILE%"
  40. REM cmake variable OV_CMD_ARGS below may specify additional arguments outside this script
  41. %OV_RUN_IN_BG% "%OV_PATH_ROOT%\bin\@OV_CMD_EXECUTABLE@" @OV_CMD_ARGS@ %ARGS%
  42. :EndOfScript
  43. %OV_PAUSE%