forked from treefrogframework/treefrog-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.bat
110 lines (93 loc) · 2.52 KB
/
configure.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
@echo OFF
@setlocal
set VERSION=1.8.0
set TFDIR=C:\TreeFrog\%VERSION%
if "%DevEnvDir%" == "" (
set MAKE=mingw32-make
) else (
set MAKE=nmake
)
:parse_loop
if "%1" == "" goto :start
if /i "%1" == "--prefix" goto :prefix
if /i "%1" == "--enable-debug" goto :enable_debug
if /i "%1" == "--enable-gui-mod" goto :enable_gui_mod
if /i "%1" == "--help" goto :help
if /i "%1" == "-h" goto :help
goto :help
:continue
shift
goto :parse_loop
:help
echo Usage: %0 [OPTION]... [VAR=VALUE]...
echo;
echo Configuration:
echo -h, --help display this help and exit
echo --enable-debug compile with debugging information
echo --enable-gui-mod compile and link with QtGui module
echo;
echo Installation directories:
echo --prefix=PREFIX install files in PREFIX [%TFDIR%]
goto :exit
:prefix
shift
if "%1" == "" goto :help
set TFDIR=%1
goto :continue
:enable_debug
set DEBUG=yes
goto :continue
:enable_gui_mod
set USE_GUI=use_gui=1
goto :continue
:start
if "%DEBUG%" == "yes" (
set OPT="CONFIG+=debug"
) else (
set OPT="CONFIG+=release"
)
::
:: Generates tfenv.bat
::
for %%I in (qtenv2.bat) do if exist %%~$path:I set QTENV=%%~$path:I
set TFENV=tfenv.bat
echo @echo OFF> %TFENV%
echo ::>> %TFENV%
echo :: This file is generated by configure.bat>> %TFENV%
echo ::>> %TFENV%
echo;>> %TFENV%
echo set TFDIR=%TFDIR%>> %TFENV%
echo set QTENV="%QTENV%">> %TFENV%
echo set QMAKESPEC=%QMAKESPEC%>> %TFENV%
echo if exist %%QTENV%% ( call %%QTENV%% )>> %TFENV%
echo set PATH=%%TFDIR^%%\bin;%%PATH%%>> %TFENV%
echo echo Setup a TreeFrog/Qt environment.>> %TFENV%
echo ::echo -- QMAKESPEC set to %%QMAKESPEC%%>> %TFENV%
echo echo -- TFDIR set to %%TFDIR%%>> %TFENV%
set TFDIR=%TFDIR:\=/%
:: Builds MongoDB driver
echo Compiling MongoDB driver library ...
cd 3rdparty\mongo-c-driver
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake -r %OPT%
%MAKE% >nul 2>&1
if ERRORLEVEL 1 (
echo Compile failed.
echo MongoDB driver not available.
exit /b
)
cd ..\..
cd src
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' %USE_GUI%
cd ..
cd tools
if exist Makefile ( %MAKE% -k distclean >nul 2>&1 )
qmake -recursive %OPT% target.path='%TFDIR%/bin' header.path='%TFDIR%/include' datadir='%TFDIR%'
%MAKE% qmake
cd ..
echo;
echo First, run "%MAKE% install" in src directory.
echo Next, run "%MAKE% install" in tools directory.
:exit
exit /b