forked from COVESA/dlt-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_parser_windows_qt5_MSVC.bat
198 lines (145 loc) · 5.15 KB
/
build_parser_windows_qt5_MSVC.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
@echo off
echo ************************************
echo *** DLT Parser ***
echo ************************************
echo .
echo ************************************
echo *** Configuration ***
echo ************************************
setlocal enabledelayedexpansion
rem parameter of this batch script can be either x86 or x86_amd64
if "%ARCHITECTURE%"=="" (
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
set ARCHITECTURE=x86_amd64
) else (
set ARCHITECTURE=x86
)
set USE_ARCH_PARAM=false
if "%1" NEQ "" (
if "%1"=="x86" set USE_ARCH_PARAM=true
if "%1"=="x86_amd64" set USE_ARCH_PARAM=true
)
if "!USE_ARCH_PARAM!"=="true" set ARCHITECTURE=%1
)
echo Target architecture is !ARCHITECTURE!
echo *** Setting up environment ***
if "%QTDIR%"=="" (
if "%ARCHITECTURE%"=="x86_amd64" (
set QTDIR=C:\Qt\Qt5.5.1\5.5\msvc2013_64
) else (set QTDIR=C:\Qt\Qt5.5.1\5.5\msvc2013)
)
IF "%MSVC_DIR%"=="" set MSVC_DIR=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
set PATH=%QTDIR%\bin;%MSVC_DIR%;%MSVC_DIR%\bin;%PATH%
set QTSDK=%QTDIR%
IF "%DLT_PARSER_DIR%"=="" (
set DLT_PARSER_DIR=c:\DltParser
)
set SOURCE_DIR=%CD%
set BUILD_DIR=%CD%\build\release
echo ************************************
echo * QTDIR = %QTDIR%
echo * QTSDK = %QTSDK%
echo * MSVC_DIR = %MSVC_DIR%
echo * PATH = %PATH%
echo * DLT_PARSER_DIR = %DLT_PARSER_DIR%
echo * SOURCE_DIR = %SOURCE_DIR%
echo * BUILD_DIR = %BUILD_DIR%
echo ************************************
IF exist build (
echo ************************************
echo *** Delete old build Directory ***
echo ************************************
rmdir /s/q build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
)
IF exist %DLT_PARSER_DIR% (
echo ************************************
echo *** Delete old SDK Directory ***
echo ************************************
rmdir /s/q %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
)
echo ************************************
echo *** Configure MSVC environment ***
echo ************************************
call vcvarsall.bat %ARCHITECTURE%
if %ERRORLEVEL% NEQ 0 goto error
echo configuring was successful
echo ************************************
echo *** Build DLT Parser ***
echo ************************************
mkdir build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
cd build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
qmake ../BuildDltParser.pro
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
nmake release
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
echo ************************************
echo *** Install Parser ***
echo ************************************
echo *** Create directories ***
mkdir %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
mkdir %DLT_PARSER_DIR%\examples
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
echo *** Copy files ***
copy %QTDIR%\bin\icuin54.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\icuuc54.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\icudt54.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
rem copy %QTDIR%\bin\libwinpthread-1.dll %DLT_PARSER_DIR%
rem IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
rem
rem copy %QTDIR%\bin\libgcc_s_dw2-1.dll %DLT_PARSER_DIR%
rem IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
rem
rem copy "%QTDIR%\bin\libstdc++-6.dll" %DLT_PARSER_DIR%
rem IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\Qt5Core.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\Qt5Gui.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\Qt5Network.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\Qt5Sql.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\Qt5Svg.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\Qt5Widgets.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\Qt5PrintSupport.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\Qt5Xml.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %QTDIR%\bin\Qt5OpenGL.dll %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %BUILD_DIR%\dlt_parser.exe %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %SOURCE_DIR%\ReleaseNotes_Parser.txt %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %SOURCE_DIR%\README_Parser.txt %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %SOURCE_DIR%\LICENSE.txt %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
copy %SOURCE_DIR%\MPL.txt %DLT_PARSER_DIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
xcopy %SOURCE_DIR%\parser\examples %DLT_PARSER_DIR%\examples /E
IF %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER
GOTO QUIT
:ERROR_HANDLER
echo ####################################
echo ### ERROR occured ###
echo ####################################
set /p name= Continue
exit 1
:QUIT
echo ************************************
echo *** SUCCESS finish ***
echo ************************************
echo SDK installed in: %DLT_PARSER_DIR%
set /p name= Continue
exit 0