1 @echo off |
1 @echo off |
2 ::edit these variables if you need |
2 ::edit these variables if you need |
3 set PASCAL=C:\FPC\2.4.4\bin\i386-win32\ |
3 set PASCAL=C:\FPC\2.4.4\bin\i386-win32\ |
4 set QTDIR=C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin |
4 set QTDIR=C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin |
5 set PATH=%PATH%;%PASCAL% |
5 set PATH=%PATH%;%PASCAL% |
|
6 set BUILD_TYPE="Debug" |
6 |
7 |
7 :setup |
8 :setup |
8 set CURRDIR="%CD%" |
9 set CURRDIR="%CD%" |
9 cd .. |
10 cd .. |
10 |
11 |
11 echo Fetching all DLLs... |
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 ) |
12 for %%G in (QtCore4 QtGui4 QtNetwork4 libgcc_s_dw2-1 mingwm10) do ( |
16 for %%G in (QtCore4 QtGui4 QtNetwork4 libgcc_s_dw2-1 mingwm10) do ( |
13 xcopy /d/y/l %QTDIR%\%%G.dll bin\ |
17 xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\ |
14 ) |
18 ) |
15 |
19 |
16 if not exist %CD%\misc\winutils\bin\ mkdir %CD%\misc\winutils\bin\ |
20 if not exist %CD%\misc\winutils\bin\ mkdir %CD%\misc\winutils\bin\ |
17 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 |
21 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 |
18 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 |
22 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 |
20 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 |
24 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 |
21 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 |
25 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 |
22 |
26 |
23 ::for video recording |
27 ::for video recording |
24 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 |
28 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 |
|
29 if not exist %CD%\misc\winutils\bin\glut32.dll cscript %CD%\tools\w32DownloadUnzip.vbs https://user.xmission.com/~nate/glut/glut-3.7.6-bin.zip %CD%\misc\winutils\bin |
|
30 copy /y %CD%\misc\winutils\bin\glut-3.7.6-bin\glut32.dll %CD%\misc\winutils\bin\glut32.dll |
25 |
31 |
26 ::this is needed because fpc png unit hardcodes libpng-1.2.12 |
32 ::this is needed because fpc png unit hardcodes libpng-1.2.12 |
27 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 if not exist %CD%\misc\winutils\bin\libpng13.dll copy /y %CD%\misc\winutils\bin\libpng15-15.dll %CD%\misc\winutils\bin\libpng13.dll |
28 |
34 |
29 xcopy /d/y %CD%\misc\winutils\bin\*.dll bin |
35 xcopy /d/y %CD%\misc\winutils\bin\*.dll %CD%\bin\ |
30 xcopy /d/y %CD%\misc\winutils\bin\*.txt bin |
|
31 |
36 |
32 ::setting up the environment... |
37 ::setting up the environment... |
33 call %QTDIR%\qtenv2.bat |
38 call %QTDIR%\qtenv2.bat |
34 |
39 |
35 echo Running cmake... |
40 echo Running cmake... |
36 set ERRORLEVEL= |
41 set ERRORLEVEL= |
37 cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH="%CD%\misc\winutils\include" -DCMAKE_LIBRARY_PATH="%CD%\misc\winutils\lib" -DPNG_LIBRARY="%CD%\misc\winutils\bin\libpng13.dll" . |
42 cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH="%CD%\misc\winutils\include" -DCMAKE_LIBRARY_PATH="%CD%\misc\winutils\lib" -DPNG_LIBRARY="%CD%\misc\winutils\bin\libpng13.dll" . -DCMAKE_BUILD_TYPE=%BUILD_TYPE% |
38 |
43 |
39 if %ERRORLEVEL% NEQ 0 goto exitpoint |
44 if %ERRORLEVEL% NEQ 0 goto exitpoint |
40 |
45 |
41 echo Running make... |
46 echo Running make... |
42 set ERRORLEVEL= |
47 set ERRORLEVEL= |