tools/build_windows.bat
changeset 13536 282218ab1b28
parent 13535 80db7232b4b5
parent 13524 1232ab8206d4
child 13539 395a4c92e523
equal deleted inserted replaced
13535:80db7232b4b5 13536:282218ab1b28
     1 @echo off
       
     2 ::edit these variables if you need
       
     3 set PASCAL=C:\FPC\2.6.0\bin\i386-win32\
       
     4 set QTDIR=C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin
       
     5 set PATH=%PATH%;%PASCAL%
       
     6 set BUILD_TYPE="Debug"
       
     7 
       
     8 :setup
       
     9 set CURRDIR="%CD%"
       
    10 cd ..
       
    11 
       
    12 echo Fetching all DLLs...
       
    13 if %BUILD_TYPE%=="Debug" (
       
    14     for %%G in (QtCored4 QtGuid4 QtNetworkd4) do xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
       
    15 )
       
    16 :: should you libgcc dynamically you should try adding libgcc_s_dw2-1 and mingwm10
       
    17 for %%G in (QtCore4 QtGui4 QtNetwork4) do (
       
    18     xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
       
    19 )
       
    20 
       
    21 if not exist %CD%\misc\winutils\bin\ mkdir %CD%\misc\winutils\bin\
       
    22 if not exist %CD%\misc\winutils\bin\SDL.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/release/SDL-1.2.15-win32.zip %CD%\misc\winutils\bin
       
    23 if not exist %CD%\misc\winutils\bin\SDL_image.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12-win32.zip %CD%\misc\winutils\bin
       
    24 if not exist %CD%\misc\winutils\bin\SDL_net.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.8-win32.zip %CD%\misc\winutils\bin
       
    25 if not exist %CD%\misc\winutils\bin\SDL_mixer.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12-win32.zip %CD%\misc\winutils\bin
       
    26 if not exist %CD%\misc\winutils\bin\SDL_ttf.dll cscript %CD%\tools\w32DownloadUnzip.vbs  http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11-win32.zip %CD%\misc\winutils\bin
       
    27 
       
    28 ::for video recording
       
    29 if not exist %CD%\misc\winutils\bin\avformat-54.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://hedgewars.googlecode.com/files/libav-win32-20121022-dll.zip %CD%\misc\winutils\bin
       
    30 
       
    31 ::this is needed because fpc png unit hardcodes libpng-1.2.12
       
    32 if not exist %CD%\misc\winutils\bin\libpng13.dll copy /y %CD%\misc\winutils\bin\libpng15-15.dll %CD%\misc\winutils\bin\libpng13.dll
       
    33 
       
    34 xcopy /d/y %CD%\misc\winutils\bin\*.dll %CD%\bin\
       
    35 
       
    36 ::setting up the environment...
       
    37 call %QTDIR%\qtenv2.bat
       
    38 
       
    39 echo Running cmake...
       
    40 set ERRORLEVEL=
       
    41 cmake . -G "MinGW Makefiles" -DPNG_LIBRARY="%CD%\misc\winutils\bin\libpng13.dll" -DCMAKE_BUILD_TYPE="%BUILD_TYPE%" -DCMAKE_PREFIX_PATH="%CD%\misc\winutils\\"
       
    42 :: prefix should be last
       
    43 
       
    44 if %ERRORLEVEL% NEQ 0 goto exitpoint
       
    45 
       
    46 echo Running make...
       
    47 set ERRORLEVEL=
       
    48 mingw32-make VERBOSE=1
       
    49 if %ERRORLEVEL% NEQ 0 goto exitpoint
       
    50 
       
    51 echo Installing...
       
    52 set ERRORLEVEL=
       
    53 mingw32-make install > nul
       
    54 if %ERRORLEVEL% NEQ 0 goto exitpoint
       
    55 
       
    56 echo Creating commodity shortcut...
       
    57 copy /y %CD%\misc\winutils\Hedgewars.lnk C:%HOMEPATH%\Desktop\Hedgewars.lnk
       
    58 
       
    59 echo ALL DONE, Hedgewars has been successfully compiled and installed
       
    60 
       
    61 :exitpoint
       
    62 cd %CURRDIR%
       
    63 pause