env_windows.cmd 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. @ECHO OFF
  2. REM
  3. REM Copyright (c) Contributors to the Open 3D Engine Project.
  4. REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. REM
  6. REM SPDX-License-Identifier: Apache-2.0 OR MIT
  7. REM
  8. REM
  9. REM To get recursive folder creation
  10. SETLOCAL EnableExtensions EnableDelayedExpansion
  11. where /Q cmake
  12. IF NOT %ERRORLEVEL%==0 (
  13. ECHO [ci_build] CMake not found
  14. GOTO :errorlocal
  15. )
  16. REM Ending the local environment to be able to propagate the TMP/TEMP variables to the calling script
  17. ENDLOCAL
  18. IF NOT "%COMMAND_CWD%"=="" (
  19. call ECHO [ci_build] Changing CWD to %COMMAND_CWD%
  20. call CD %COMMAND_CWD%
  21. IF ERRORLEVEL 1 (
  22. ECHO [ci_build] Failed to change directory to %COMMAND_CWD%
  23. GOTO :error
  24. )
  25. )
  26. REM Jenkins does not defined TMP
  27. IF "%TMP%"=="" (
  28. IF "%WORKSPACE%"=="" (
  29. SET TMP=%APPDATA%\Local\Temp
  30. SET TEMP=%APPDATA%\Local\Temp
  31. ) ELSE (
  32. SET TMP=%WORKSPACE%\Temp
  33. SET TEMP=%WORKSPACE%\Temp
  34. REM This folder may not be created in the workspace
  35. IF NOT EXIST "!TMP!" (
  36. MKDIR "!TMP!"
  37. )
  38. )
  39. )
  40. EXIT /b 0
  41. :errorlocal
  42. ENDLOCAL
  43. :error
  44. EXIT /b 1