@echo off
rem Modifier au besoin QTDIR

set VCID=11

set QTDIR=C:\Qt\Qt5.0.2\5.0.2\msvc2012_64
set PATH=%QTDIR%\bin;%PATH%

call "C:\Program Files (x86)\Microsoft Visual Studio %VCID%.0\VC\vcvarsall.bat" x86_amd64

qmake ..\WinCaml.pro
nmake -f Makefile.release
nmake -f Makefile.release clean

xcopy /q /s /y /i ..\..\caml\ocaml\windows WinCaml5\ocaml\windows\
move /y release\WinCaml.exe WinCaml5

copy a\unlock.exe WinCaml5
copy ..\..\sources\Win\WinCamlInit.bat WinCaml5
xcopy /q /s /y /i ..\..\caml\ocaml\htmlman WinCaml5\ocaml\htmlman\
xcopy /q /s /y /i ..\..\caml\"caml-light"  WinCaml5\"caml-light"\
del WinCaml5\"caml-light"\bin\lin*
del WinCaml5\caml-light"\bin\mac*
xcopy /q /s /y /i ..\..\caml\exemples WinCaml5\exemples\

copy %QTDIR%\bin\D3DCompiler_46.dll WinCaml5
copy %QTDIR%\bin\icudt49.dll WinCaml5
copy %QTDIR%\bin\icuin49.dll WinCaml5
copy %QTDIR%\bin\icuuc49.dll WinCaml5
copy %QTDIR%\bin\libEGL.dll WinCaml5
copy %QTDIR%\bin\libGLESv2.dll WinCaml5
copy %QTDIR%\bin\Qt5Core.dll WinCaml5
copy %QTDIR%\bin\Qt5Gui.dll WinCaml5
copy %QTDIR%\bin\Qt5Widgets.dll WinCaml5
copy %QTDIR%\bin\Qt5PrintSupport.dll WinCaml5

rmdir debug
rmdir release
del Makefile*