tools/build_windows.bat
author nemo
Sun, 03 Jun 2012 23:04:21 -0400
changeset 7174 80480d21e6ed
parent 6569 64f9fbd48b9e
child 7799 a88a02c19a5b
permissions -rw-r--r--
Workaround for bug #144. This workaround had occurred to me a while ago, but wasn't sure if placing them unfairly was better than not placing them at all. Argument for not placing at all is people should probably abort the game when they notice it. Argument for placing unfairly is people can still abort, and if we really wanted them to abort, we should probably just have halted launch if all hogs failed to spawn. This way at least play can continue.

@echo off
:edit these variables if you need
SET PASCAL=C:\FPC\2.4.4\bin\i386-win32\
SET QTDIR=C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin
SET PATH=%PATH%;%PASCAL%

:SETUP
cd ..
if not exist bin mkdir bin
cd bin

echo Copying the DLLs...
xcopy /d/y ..\misc\winutils\bin\* .
xcopy /d/y %QTDIR%\QtCore4.dll .
xcopy /d/y %QTDIR%\QtGui4.dll .
xcopy /d/y %QTDIR%\QtNetwork4.dll .
xcopy /d/y %QTDIR%\libgcc_s_dw2-1.dll .
xcopy /d/y %QTDIR%\mingwm10.dll .

echo Setting up the environment...
call %QTDIR%\qtenv2.bat

echo Running cmake...
set errorlevel=
cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH="%CD%\..\misc\winutils\include" -DCMAKE_LIBRARY_PATH="%CD%\..\misc\winutils\lib" ..

if %errorlevel% NEQ 0 goto exit

echo Running make...
set errorlevel=
mingw32-make -lSDL -lSDL_Mixer install

if %errorlevel% NEQ 0 goto exit

echo Creating shortcut...
if /i "%PROGRAMFILES(X86)%"=="" (
	COPY /y ..\misc\winutils\Hedgewars_x86.lnk C:\%HOMEPATH%\Desktop\Hedgewars.lnk 
) else (
	COPY /y ..\misc\winutils\Hedgewars_x64.lnk C:\%HOMEPATH%\Desktop\Hedgewars.lnk
)
echo ALL DONE, Hedgewars has been successfully compiled and installed

:exit
cd ../tools
pause