@echo off
SETLOCAL

echo.
echo =============================================
echo = PROJ4 library                             =
echo =============================================
rmdir /S /Q proj-4.7.0
del /F ..\RadarVolumeExplorer\lib\proj.dll
del /F ..\RadarVolumeExplorer\lib\proj.lib
del /F ..\RadarVolumeExplorer\lib\proj_i.lib

7za.exe x -y proj-4.7.0.tar.gz
7za.exe x -y proj-4.7.0.tar
del /F proj-4.7.0.tar

cd proj-4.7.0
echo ===== Compiling SZIP
nmake -f makefile.vc

copy /Y src\proj.lib ..\..\RadarVolumeExplorer\lib
copy /Y src\proj_i.lib ..\..\RadarVolumeExplorer\lib
copy /Y src\proj.dll ..\..\RadarVolumeExplorer\lib
copy /Y src\proj.dll ..\..\RadarVolumeExplorer\bin

if %ERRORLEVEL% neq 0 goto ERROR

cd ..
cd ..

:ERROR
echo ===== Finished PROJ4
