@echo off

set SCRIPT_DIR=%~dp0
if "%SCRIPT_DIR:~-1%"=="\" set SCRIPT_DIR=%SCRIPT_DIR:~0,-1%

call :add_path %SCRIPT_DIR%\bin
call :add_path %SCRIPT_DIR%\cmake\bin
call :add_path %SCRIPT_DIR%\python3
call :add_path %SCRIPT_DIR%\python3\Scripts
call :add_path %SCRIPT_DIR%\make
call :add_path %SCRIPT_DIR%\winpty

if not "%PYTHONPATH%"=="" (
    set PYTHONPATH=
)

if not "%PYTHONHOME%"=="" (
    set PYTHONHOME=
)

if "%PYTHONNOUSERSITE%"=="" (
    set PYTHONNOUSERSITE=True
)

exit /B 0

:add_path
(echo ";%PATH%;" | find /C /I ";%1;" > nul) || set "PATH=%1;%PATH%"
goto :eof
