@@ -13,6 +13,9 @@ REM * the Free Software Foundation; either version 2 of the License, or *
13
13
REM * (at your option) any later version. *
14
14
REM * *
15
15
REM ***************************************************************************
16
+
17
+ setlocal enabledelayedexpansion
18
+
16
19
set VERSION = %1
17
20
set PACKAGE = %2
18
21
set PACKAGENAME = %3
@@ -49,19 +52,23 @@ if "%ARCH%"=="x86" goto devenv_x86
49
52
goto devenv_x86_64
50
53
51
54
:devenv_x86
52
- set GRASS_VERSION = 6.4.4
55
+ set GRASS_VERSIONS = 6.4.4 7.0.1RC1
53
56
call " %PF86% \Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
54
57
if exist " c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call " c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x86 /Release
55
58
path %path% ;%PF86% \Microsoft Visual Studio 10.0\VC\bin
56
59
57
60
set CMAKE_OPT = ^
58
61
-G " Visual Studio 10" ^
59
62
-D SIP_BINARY_PATH=%O4W_ROOT% /apps/Python27/sip.exe ^
60
- -D QWT_LIBRARY=%O4W_ROOT% /lib/qwt.lib
63
+ -D QWT_LIBRARY=%O4W_ROOT% /lib/qwt.lib ^
64
+ -D WITH_GRASS=TRUE ^
65
+ -D WITH_GRASS7=TRUE ^
66
+ -D GRASS_PREFIX=%O4W_ROOT% /apps/grass/grass-6.4.4 ^
67
+ -D GRASS_PREFIX7=%O4W_ROOT% /apps/grass/grass-7.0.1RC1
61
68
goto devenv
62
69
63
70
:devenv_x86_64
64
- set GRASS_VERSION = 6.4.3
71
+ set GRASS_VERSIONS = 6.4.3
65
72
call " %PF86% \Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
66
73
if exist " c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call " c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x64 /Release
67
74
path %path% ;%PF86% \Microsoft Visual Studio 10.0\VC\bin
@@ -73,6 +80,9 @@ if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)
73
80
set CMAKE_OPT = ^
74
81
-G " Visual Studio 10 Win64" ^
75
82
-D SPATIALINDEX_LIBRARY=%O4W_ROOT% /lib/spatialindex-64.lib ^
83
+ -D WITH_GRASS=TRUE ^
84
+ -D WITH_GRASS7=FALSE ^
85
+ -D GRASS_PREFIX=%O4W_ROOT% /apps/grass/grass-6.4.3 ^
76
86
-D SIP_BINARY_PATH=%O4W_ROOT% /bin/sip.exe ^
77
87
-D QWT_LIBRARY=%O4W_ROOT% /lib/qwt5.lib ^
78
88
-D SETUPAPI_LIBRARY=" %SETUPAPI_LIBRARY% " ^
@@ -92,6 +102,8 @@ set SRCDIR=%CD%
92
102
if " %BUILDDIR:~1 ,1 % " == " :" %BUILDDIR:~0 ,2 %
93
103
cd %BUILDDIR%
94
104
105
+ set PKGDIR = %OSGEO4W_ROOT% \apps\%PACKAGENAME%
106
+
95
107
if exist repackage goto package
96
108
97
109
if not exist build.log goto build
@@ -132,7 +144,6 @@ if errorlevel 1 goto error
132
144
133
145
set LIB = %LIB% ;%OSGEO4W_ROOT% \lib
134
146
set INCLUDE = %INCLUDE% ;%OSGEO4W_ROOT% \include
135
- set GRASS_PREFIX = %O4W_ROOT% /apps/grass/grass-%GRASS_VERSION%
136
147
137
148
cmake %CMAKE_OPT% ^
138
149
-D PEDANTIC=TRUE ^
@@ -142,7 +153,6 @@ cmake %CMAKE_OPT% ^
142
153
-D WITH_GLOBE=TRUE ^
143
154
-D WITH_TOUCH=TRUE ^
144
155
-D WITH_ORACLE=TRUE ^
145
- -D WITH_GRASS=TRUE ^
146
156
-D WITH_CUSTOM_WIDGETS=TRUE ^
147
157
-D CMAKE_CXX_FLAGS_RELEASE=" /MD /MP /O2 /Ob2 /D NDEBUG" ^
148
158
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
@@ -181,13 +191,24 @@ cmake --build %BUILDDIR% --config %BUILDCONF%
181
191
if errorlevel 1 cmake --build %BUILDDIR% --config %BUILDCONF%
182
192
if errorlevel 1 (echo build failed twice & goto error)
183
193
184
- if not exist ..\skiptests (
185
- echo RUN_TESTS: %DATE% %TIME%
186
- cmake --build %BUILDDIR% --target Experimental --config %BUILDCONF%
187
- if errorlevel 1 echo TESTS WERE NOT SUCCESSFUL.
194
+ if exist ..\skiptests goto skiptests
195
+
196
+ echo RUN_TESTS: %DATE% %TIME%
197
+
198
+ set oldpath = %PATH%
199
+ for %%g IN (%GRASS_VERSIONS% ) do (
200
+ set path = !path! ;%OSGEO4W_ROOT% \apps\grass\grass-%%g \lib
201
+ set GISBASE = %OSGEO4W_ROOT% \apps\grass\grass-%%g
188
202
)
203
+ PATH %path% ;%BUILDDIR% \output\plugins\%BUILDCONF%
189
204
190
- set PKGDIR = %OSGEO4W_ROOT% \apps\%PACKAGENAME%
205
+ cmake --build %BUILDDIR% --target Experimental --config %BUILDCONF%
206
+ if errorlevel 1 echo TESTS WERE NOT SUCCESSFUL.
207
+
208
+ PATH %oldpath%
209
+
210
+ :skiptests
211
+ :package
191
212
192
213
if exist %PKGDIR% (
193
214
echo REMOVE: %DATE% %TIME%
@@ -198,40 +219,65 @@ echo INSTALL: %DATE% %TIME%
198
219
cmake --build %BUILDDIR% --target INSTALL --config %BUILDCONF%
199
220
if errorlevel 1 (echo INSTALL failed & goto error)
200
221
201
- :package
202
222
echo PACKAGE: %DATE% %TIME%
203
223
204
224
cd ..
205
- sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/ @ grassversion @ / %GRASS_VERSION% /g' postinstall-common.bat > %OSGEO4W_ROOT% \etc\postinstall\%PACKAGENAME% -common.bat
225
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' postinstall-common.bat > %OSGEO4W_ROOT% \etc\postinstall\%PACKAGENAME% -common.bat
206
226
if errorlevel 1 (echo creation of common postinstall failed & goto error)
207
- sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%GRASS_VERSION% /g' postinstall-desktop.bat > %OSGEO4W_ROOT% \etc\postinstall\%PACKAGENAME% .bat
227
+
228
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' postinstall-desktop.bat > %OSGEO4W_ROOT% \etc\postinstall\%PACKAGENAME% .bat
208
229
if errorlevel 1 (echo creation of desktop postinstall failed & goto error)
209
- sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%GRASS_VERSION% /g' preremove-desktop.bat > %OSGEO4W_ROOT% \etc\preremove\%PACKAGENAME% .bat
230
+
231
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' preremove-desktop.bat > %OSGEO4W_ROOT% \etc\preremove\%PACKAGENAME% .bat
210
232
if errorlevel 1 (echo creation of desktop preremove failed & goto error)
211
- sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%GRASS_VERSION% /g' qgis.bat.tmpl > %OSGEO4W_ROOT% \bin\%PACKAGENAME% .bat.tmpl
233
+
234
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' qgis.bat.tmpl > %OSGEO4W_ROOT% \bin\%PACKAGENAME% .bat.tmpl
212
235
if errorlevel 1 (echo creation of desktop template failed & goto error)
213
- sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%GRASS_VERSION% /g' designer-qgis.bat.tmpl > %OSGEO4W_ROOT% \bin\designer-%PACKAGENAME% .bat.tmpl
214
- if errorlevel 1 (echo creation of designer template failed & goto error)
215
- sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%GRASS_VERSION% /g' browser.bat.tmpl > %OSGEO4W_ROOT% \bin\%PACKAGENAME% -browser.bat.tmpl
236
+
237
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' browser.bat.tmpl > %OSGEO4W_ROOT% \bin\%PACKAGENAME% -browser.bat.tmpl
216
238
if errorlevel 1 (echo creation of browser template & goto error)
217
- sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%GRASS_VERSION% /g' qgis.reg.tmpl > %PKGDIR% \bin\qgis.reg.tmpl
239
+
240
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' designer.bat.tmpl > %OSGEO4W_ROOT% \bin\%PACKAGENAME% -designer.bat.tmpl
241
+ if errorlevel 1 (echo creation of designer template failed & goto error)
242
+
243
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' python.bat.tmpl > %OSGEO4W_ROOT% \bin\python-%PACKAGENAME% .bat.tmpl
244
+ if errorlevel 1 (echo creation of python wrapper template failed & goto error)
245
+
246
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' qgis.reg.tmpl > %PKGDIR% \bin\qgis.reg.tmpl
218
247
if errorlevel 1 (echo creation of registry template & goto error)
219
- sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%GRASS_VERSION% /g' postinstall-server.bat > %OSGEO4W_ROOT% \etc\postinstall\%PACKAGENAME% -server.bat
248
+
249
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' postinstall-server.bat > %OSGEO4W_ROOT% \etc\postinstall\%PACKAGENAME% -server.bat
220
250
if errorlevel 1 (echo creation of server postinstall failed & goto error)
221
- sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%GRASS_VERSION% /g' preremove-server.bat > %OSGEO4W_ROOT% \etc\preremove\%PACKAGENAME% -server.bat
251
+
252
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' preremove-server.bat > %OSGEO4W_ROOT% \etc\preremove\%PACKAGENAME% -server.bat
222
253
if errorlevel 1 (echo creation of server preremove failed & goto error)
254
+
223
255
if not exist %OSGEO4W_ROOT% \httpd.d mkdir %OSGEO4W_ROOT% \httpd.d
224
- sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/ @ grassversion @ / %GRASS_VERSION% /g' httpd.conf.tmpl > %OSGEO4W_ROOT% \httpd.d\httpd_%PACKAGENAME% .conf.tmpl
256
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' httpd.conf.tmpl > %OSGEO4W_ROOT% \httpd.d\httpd_%PACKAGENAME% .conf.tmpl
225
257
if errorlevel 1 (echo creation of httpd.conf template failed & goto error)
226
258
227
- REM sed -e 's/%OSGEO4W_ROOT:\=\\\\\\\\%/@osgeo4w@/' %PKGDIR%\python\qgis\qgisconfig.py > %PKGDIR%\python\qgis\qgisconfig.py.tmpl
228
- REM if errorlevel 1 (echo creation of qgisconfig.py.tmpl failed & goto error)
259
+ set packages = " " " -common" " -server" " -devel" " -globe-plugin" " -oracle-provider" " -grass-plugin-common"
260
+
261
+ for %%g IN (%GRASS_VERSIONS% ) do (
262
+ for /F " delims=." %%i in (" %%g " ) do set v = %%i
263
+ set w = !v!
264
+ if !v! == 6 set w =
265
+
266
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%%g /g' -e 's/@ grassmajor@ /!v! /g' postinstall-grass.bat > %OSGEO4W_ROOT% \etc\postinstall\%PACKAGENAME% -grass-plugin!w! .bat
267
+ if errorlevel 1 (echo creation of grass desktop postinstall failed & goto error)
268
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%%g /g' -e 's/@ grassmajor@ /!v! /g' preremove-grass.bat > %OSGEO4W_ROOT% \etc\preremove\%PACKAGENAME% -grass-plugin!w! .bat
269
+ if errorlevel 1 (echo creation of grass desktop preremove failed & goto error)
270
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%%g /g' -e 's/@ grassmajor@ /!v! /g' qgis-grass.bat.tmpl > %OSGEO4W_ROOT% \bin\%PACKAGENAME% -grass!v! .bat.tmpl
271
+ if errorlevel 1 (echo creation of grass desktop template failed & goto error)
272
+ sed -e 's/@ package@ /%PACKAGENAME% /g' -e 's/@ version@ /%VERSION% /g' -e 's/@ grassversion@ /%%g /g' -e 's/@ grassmajor@ /!v! /g' browser-grass.bat.tmpl > %OSGEO4W_ROOT% \bin\%PACKAGENAME% -browser-grass!v! .bat.tmpl
273
+ if errorlevel 1 (echo creation of grass browser template & goto error)
229
274
230
- REM del %PKGDIR%\python\qgis\qgisconfig.py
275
+ set packages = !packages! " -grass-plugin!w! "
276
+ )
231
277
232
278
touch exclude
233
279
234
- for %%i in (" " " -common " " -server " " -devel " " -grass-plugin " " -globe-plugin " " -oracle-provider " ) do (
280
+ for %%i in (%packages% ) do (
235
281
if not exist %ARCH% \release\qgis\%PACKAGENAME% %%i mkdir %ARCH% \release\qgis\%PACKAGENAME% %%i
236
282
)
237
283
@@ -273,6 +319,7 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-server/%PACKAGENAME
273
319
" apps/%PACKAGENAME% /bin/qgis_server.dll" ^
274
320
" apps/%PACKAGENAME% /bin/admin.sld" ^
275
321
" apps/%PACKAGENAME% /bin/wms_metadata.xml" ^
322
+ " apps/%PACKAGENAME% /bin/schemaExtension.xsd" ^
276
323
" apps/%PACKAGENAME% /python/qgis/_server.pyd" ^
277
324
" apps/%PACKAGENAME% /python/qgis/_server.lib" ^
278
325
" apps/%PACKAGENAME% /python/qgis/server/" ^
@@ -306,7 +353,7 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERS
306
353
--exclude " *.pyc" ^
307
354
--exclude " apps/%PACKAGENAME% /python/qgis/_server.pyd" ^
308
355
--exclude " apps/%PACKAGENAME% /python/qgis/_server.lib" ^
309
- --exclude " apps/%PACKAGENAME% /python/qgis/server/ " ^
356
+ --exclude " apps/%PACKAGENAME% /python/qgis/server" ^
310
357
" bin/%PACKAGENAME% -browser-bin.exe" ^
311
358
" bin/%PACKAGENAME% -bin.exe" ^
312
359
" apps/%PACKAGENAME% /bin/qgis.reg.tmpl" ^
@@ -335,22 +382,52 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERS
335
382
" apps/%PACKAGENAME% /resources/customization.xml" ^
336
383
" bin/%PACKAGENAME% .bat.tmpl" ^
337
384
" bin/%PACKAGENAME% -browser.bat.tmpl" ^
385
+ " bin/%PACKAGENAME% -designer.bat.tmpl" ^
338
386
" etc/postinstall/%PACKAGENAME% .bat" ^
339
387
" etc/preremove/%PACKAGENAME% .bat"
340
388
if errorlevel 1 (echo tar desktop failed & goto error)
341
389
342
- tar -C %OSGEO4W_ROOT% -cjf %ARCH% /release/qgis/%PACKAGENAME% -grass-plugin/%PACKAGENAME% -grass-plugin-%VERSION% -%PACKAGE% .tar.bz2 ^
390
+ tar -C %OSGEO4W_ROOT% -cjf %ARCH% /release/qgis/%PACKAGENAME% -grass-plugin-common /%PACKAGENAME% -grass-plugin-common -%VERSION% -%PACKAGE% .tar.bz2 ^
343
391
--exclude-from exclude ^
344
392
--exclude " *.pyc" ^
345
- " apps/%PACKAGENAME% /grass" ^
346
- " apps/%PACKAGENAME% /bin/qgisgrass.dll" ^
347
- " apps/%PACKAGENAME% /plugins/grassrasterprovider.dll" ^
348
- " apps/%PACKAGENAME% /plugins/grassplugin.dll" ^
349
- " apps/%PACKAGENAME% /plugins/grassprovider.dll"
393
+ --exclude " apps/%PACKAGENAME% /grass/modules/qgis.d.rast6.exe" ^
394
+ --exclude " apps/%PACKAGENAME% /grass/modules/qgis.d.rast7.exe" ^
395
+ --exclude " apps/%PACKAGENAME% /grass/modules/qgis.g.info6.exe" ^
396
+ --exclude " apps/%PACKAGENAME% /grass/modules/qgis.g.info7.exe" ^
397
+ --exclude " apps/%PACKAGENAME% /grass/modules/qgis.r.in6.exe" ^
398
+ --exclude " apps/%PACKAGENAME% /grass/modules/qgis.r.in7.exe" ^
399
+ --exclude " apps/%PACKAGENAME% /grass/modules/qgis.v.in6.exe" ^
400
+ --exclude " apps/%PACKAGENAME% /grass/modules/qgis.v.in7.exe" ^
401
+ --exclude " apps/%PACKAGENAME% /grass/bin/qgis.g.browser6.exe" ^
402
+ --exclude " apps/%PACKAGENAME% /grass/bin/qgis.g.browser7.exe" ^
403
+ " apps/%PACKAGENAME% /grass"
350
404
if errorlevel 1 (echo tar grass-plugin failed & goto error)
351
405
352
- REM grass direct library disabled
353
- REM "apps/%PACKAGENAME%/plugins/libgrass_gis.%GRASS_VERSION%.dll"
406
+ for %%g IN (%GRASS_VERSIONS% ) do (
407
+ for /F " delims=." %%i in (" %%g " ) do set v = %%i
408
+ set w = !v!
409
+ if !v! == 6 set w =
410
+
411
+ set files = " apps/%PACKAGENAME% /bin/qgisgrass!v! .dll" ^
412
+ " apps/%PACKAGENAME% /grass/modules/qgis.d.rast!v! .exe" ^
413
+ " apps/%PACKAGENAME% /grass/modules/qgis.g.info!v! .exe" ^
414
+ " apps/%PACKAGENAME% /grass/modules/qgis.r.in!v! .exe" ^
415
+ " apps/%PACKAGENAME% /grass/modules/qgis.v.in!v! .exe" ^
416
+ " apps/%PACKAGENAME% /plugins/grassrasterprovider!v! .dll" ^
417
+ " apps/%PACKAGENAME% /plugins/grassprovider!v! .dll" ^
418
+ " etc/preremove/%PACKAGENAME% -grass-plugin!v! .bat" ^
419
+ " bin/%PACKAGENAME% -grass!v! .bat.tmpl" ^
420
+ " bin/%PACKAGENAME% -browser-grass!v! .bat.tmpl" ^
421
+ " etc/postinstall/%PACKAGENAME% -grass-plugin!v! .bat"
422
+
423
+ if !v! == 6 set files = !files! ^
424
+ " apps/%PACKAGENAME% /plugins/grassplugin!v! .dll" ^
425
+ " apps/%PACKAGENAME% /grass/bin/qgis.g.browser!v! .exe"
426
+
427
+ tar -C %OSGEO4W_ROOT% -cjf %ARCH% /release/qgis/%PACKAGENAME% -grass-plugin!w! /%PACKAGENAME% -grass-plugin!w! -%VERSION% -%PACKAGE% .tar.bz2 ^
428
+ !files!
429
+ if errorlevel 1 (echo tar grass-plugin!w! failed & goto error)
430
+ )
354
431
355
432
tar -C %OSGEO4W_ROOT% -cjf %ARCH% /release/qgis/%PACKAGENAME% -globe-plugin/%PACKAGENAME% -globe-plugin-%VERSION% -%PACKAGE% .tar.bz2 ^
356
433
--exclude-from exclude ^
@@ -387,3 +464,5 @@ for %%i in ("" "-common" "-server" "-devel" "-grass-plugin" "-globe-plugin" "-or
387
464
388
465
:end
389
466
echo FINISHED: %DATE% %TIME%
467
+
468
+ endlocal
0 commit comments