@echo off

if [%1] == [] (
  echo This scripts takes the ConfigurationName {Debug, Release} as parameter
  echo Example: %0 Debug
  goto exitScript
)

set OutDir=..\..\bin\%1
set ExtLibDir=..\..\..\win-external-libs\lib

echo Create directories ...
if not exist %OutDir% mkdir %OutDir%

echo Copy MS Runtime libraries ...
if [%1] == [Debug] (
  copy %ExtLibDir%\windows\msvcr80d.dll %OutDir%\msvcr80d.dll 1> nul 
  copy %ExtLibDir%\windows\msvcp80d.dll %OutDir%\msvcp80d.dll 1> nul 
  copy %ExtLibDir%\windows\msvcm80d.dll %OutDir%\msvcm80d.dll 1> nul
) else (
  copy %ExtLibDir%\windows\msvcr80.dll %OutDir%\msvcr80.dll 1> nul 
  copy %ExtLibDir%\windows\msvcp80.dll %OutDir%\msvcp80.dll 1> nul 
  copy %ExtLibDir%\windows\msvcm80.dll %OutDir%\msvcm80.dll 1> nul 
)

echo Copy glib libraries ...
copy %ExtLibDir%\glib-2.12\libglib-2.0-0.dll %OutDir%\. 1> nul 
copy %ExtLibDir%\glib-2.12\libgmodule-2.0-0.dll %OutDir%\. 1> nul 
copy %ExtLibDir%\glib-2.12\libgobject-2.0-0.dll %OutDir%\. 1> nul 
copy %ExtLibDir%\glib-2.12\libgthread-2.0-0.dll %OutDir%\. 1> nul 
copy %ExtLibDir%\glib-2.0\intl.dll %OutDir%\. 1> nul 

echo Copy libxml2 libraries ...
copy %ExtLibDir%\libxml\libxml2.dll %OutDir%\. 1> nul 
copy %ExtLibDir%\libxml\iconv.dll %OutDir%\. 1> nul 
copy %ExtLibDir%\libxml\zlib.dll %OutDir%\. 1> nul 

echo Copy zlib library ...
copy %ExtLibDir%\zlib\zlib1.dll %OutDir%\. 1> nul 

:exitScript
