Skip to content

Commit bfed787

Browse files
committed
update for visual c++ 2010:
* use shorter target names for python plugins * add build scripts for 64bit * use nircmd in postinstall
1 parent ec2992e commit bfed787

File tree

6 files changed

+566
-10
lines changed

6 files changed

+566
-10
lines changed
+200
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
REM ***************************************************************************
2+
REM package-nightly64.cmd
3+
REM ---------------------
4+
REM begin : August 2013
5+
REM copyright : (C) 2013 by Juergen E. Fischer
6+
REM email : jef at norbit dot de
7+
REM ***************************************************************************
8+
REM * *
9+
REM * This program is free software; you can redistribute it and/or modify *
10+
REM * it under the terms of the GNU General Public License as published by *
11+
REM * the Free Software Foundation; either version 2 of the License, or *
12+
REM * (at your option) any later version. *
13+
REM * *
14+
REM ***************************************************************************
15+
@echo off
16+
set GRASS_VERSION=6.4.3
17+
18+
set BUILDDIR=%CD%\build64
19+
set LOG=%BUILDDIR%\build.log
20+
21+
if not exist "%BUILDDIR%" mkdir %BUILDDIR%
22+
if not exist "%BUILDDIR%" goto error
23+
24+
set VERSION=%1
25+
set PACKAGE=%2
26+
set PACKAGENAME=%3
27+
if "%VERSION%"=="" goto error
28+
if "%PACKAGE%"=="" goto error
29+
if "%PACKAGENAME%"=="" set PACKAGENAME=qgis-dev
30+
31+
path %SYSTEMROOT%\system32;%SYSTEMROOT%;%SYSTEMROOT%\System32\Wbem;%PROGRAMFILES(X86)%\CMake 2.8\bin
32+
set PYTHONPATH=
33+
34+
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
35+
path %PATH%;%PROGRAMFILES(X86)%\Microsoft Visual Studio 10.0\Common7\IDE
36+
37+
if "%OSGEO4W_ROOT%"=="" set OSGEO4W_ROOT=C:\OSGeo4W64
38+
if not exist "%OSGEO4W_ROOT%\bin\o4w_env.bat" goto error
39+
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
40+
path %PATH%;c:\cygwin\bin
41+
echo on
42+
43+
set O4W_ROOT=%OSGEO4W_ROOT:\=/%
44+
set LIB_DIR=%O4W_ROOT%
45+
46+
set DEVENV=devenv
47+
48+
PROMPT qgis%VERSION%$g
49+
50+
set BUILDCONF=RelWithDebInfo
51+
REM set BUILDCONF=Release
52+
53+
54+
cd ..\..
55+
set SRCDIR=%CD%
56+
57+
if "%BUILDDIR:~1,1%"==":" %BUILDDIR:~0,2%
58+
cd %BUILDDIR%
59+
60+
if exist repackage goto package
61+
62+
if not exist build.log goto build
63+
64+
REM
65+
REM try renaming the logfile to see if it's locked
66+
REM
67+
68+
if exist build.tmp del build.tmp
69+
if exist build.tmp goto error
70+
71+
ren build.log build.tmp
72+
if exist build.log goto locked
73+
if not exist build.tmp goto locked
74+
75+
ren build.tmp build.log
76+
if exist build.tmp goto locked
77+
if not exist build.log goto locked
78+
79+
goto build
80+
81+
:locked
82+
echo Logfile locked
83+
if exist build.tmp del build.tmp
84+
goto error
85+
86+
:build
87+
echo Logging to %LOG%
88+
echo BEGIN: %DATE% %TIME%>>%LOG% 2>&1
89+
if errorlevel 1 goto error
90+
91+
set >buildenv.log
92+
93+
if exist CMakeCache.txt goto skipcmake
94+
95+
echo CMAKE: %DATE% %TIME%>>%LOG% 2>&1
96+
if errorlevel 1 goto error
97+
98+
set LIB=%LIB%;%OSGEO4W_ROOT%\lib
99+
set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
100+
set GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION%
101+
102+
cmake -G "Visual Studio 10 Win64" ^
103+
-D BUILDNAME="OSGeo4W-Nightly-VC10-64" ^
104+
-D SITE="qgis.org" ^
105+
-D PEDANTIC=TRUE ^
106+
-D WITH_QSPATIALITE=TRUE ^
107+
-D WITH_MAPSERVER=TRUE ^
108+
-D MAPSERVER_SKIP_ECW=TRUE ^
109+
-D WITH_ASTYLE=TRUE ^
110+
-D WITH_GLOBE=TRUE ^
111+
-D WITH_TOUCH=TRUE ^
112+
-D WITH_ORACLE=TRUE ^
113+
-D WITH_GRASS=TRUE ^
114+
-D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^
115+
-D GEOS_LIBRARY=%O4W_ROOT%/lib/geos_c.lib ^
116+
-D SQLITE3_LIBRARY=%O4W_ROOT%/lib/sqlite3_i.lib ^
117+
-D SPATIALITE_LIBRARY=%O4W_ROOT%/lib/spatialite_i.lib ^
118+
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex-64.lib ^
119+
-D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python.exe ^
120+
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python27/include ^
121+
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python27/libs/python27.lib ^
122+
-D SIP_BINARY_PATH=%O4W_ROOT%/bin/sip.exe ^
123+
-D QT_BINARY_DIR=%O4W_ROOT%/bin ^
124+
-D QT_LIBRARY_DIR=%O4W_ROOT%/lib ^
125+
-D QT_HEADERS_DIR=%O4W_ROOT%/include/qt4 ^
126+
-D QWT_INCLUDE_DIR=%O4W_ROOT%/include/qwt ^
127+
-D QWT_LIBRARY=%O4W_ROOT%/lib/qwt5.lib ^
128+
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^
129+
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /Zi /Od /D NDEBUG /D QGISDEBUG" ^
130+
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
131+
-D FCGI_LIBRARY=%O4W_ROOT%/lib/libfcgi.lib ^
132+
-D SETUPAPI_LIBRARY="%PROGRAMFILES(X86)%/Microsoft SDKs/Windows/v7.0A/Lib/x64/SetupAPI.Lib" ^
133+
%SRCDIR%>>%LOG% 2>&1
134+
if errorlevel 1 goto error
135+
136+
REM bail out if python or grass was not found
137+
grep -Eq "^(Python not being built|Could not find GRASS)" %LOG%
138+
if not errorlevel 1 goto error
139+
140+
:skipcmake
141+
142+
echo ZERO_CHECK: %DATE% %TIME%>>%LOG% 2>&1
143+
%DEVENV% qgis%VERSION%.sln /Project ZERO_CHECK /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1
144+
if errorlevel 1 goto error
145+
146+
echo ALL_BUILD: %DATE% %TIME%>>%LOG% 2>&1
147+
%DEVENV% qgis%VERSION%.sln /Project ALL_BUILD /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1
148+
if errorlevel 1 goto error
149+
150+
echo RUN_TESTS: %DATE% %TIME%>>%LOG% 2>&1
151+
%DEVENV% qgis%VERSION%.sln /Project Experimental /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1
152+
REM if errorlevel 1 echo "TESTS WERE NOT SUCCESSFUL."
153+
154+
echo INSTALL: %DATE% %TIME%>>%LOG% 2>&1
155+
%DEVENV% qgis%VERSION%.sln /Project INSTALL /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1
156+
if errorlevel 1 goto error
157+
158+
:package
159+
echo PACKAGE: %DATE% %TIME%>>%LOG% 2>&1
160+
161+
cd ..
162+
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall-dev64.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%.bat
163+
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
164+
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
165+
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
166+
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' qgis.reg.tmpl >%OSGEO4W_ROOT%\apps\%PACKAGENAME%\bin\qgis.reg.tmpl
167+
168+
REM sed -e 's/%OSGEO4W_ROOT:\=\\\\\\\\%/@osgeo4w@/' %OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py >%OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py.tmpl
169+
REM if errorlevel 1 goto error
170+
171+
REM del %OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py
172+
173+
touch exclude
174+
175+
move %OSGEO4W_ROOT%\apps\%PACKAGENAME%\bin\qgis.exe %OSGEO4W_ROOT%\bin\%PACKAGENAME%-bin.exe
176+
move %OSGEO4W_ROOT%\apps\%PACKAGENAME%\bin\qbrowser.exe %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.exe
177+
178+
tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
179+
--exclude-from exclude ^
180+
apps/%PACKAGENAME% ^
181+
bin/%PACKAGENAME%-bin.exe ^
182+
bin/%PACKAGENAME%-browser-bin.exe ^
183+
bin/%PACKAGENAME%.bat.tmpl ^
184+
bin/%PACKAGENAME%-browser.bat.tmpl ^
185+
apps/qt4/plugins/sqldrivers/qsqlocispatial.dll ^
186+
apps/qt4/plugins/sqldrivers/qsqlspatialite.dll ^
187+
etc/postinstall/%PACKAGENAME%.bat ^
188+
etc/preremove/%PACKAGENAME%.bat ^
189+
>>%LOG% 2>&1
190+
if errorlevel 1 goto error
191+
192+
goto end
193+
194+
:error
195+
echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%
196+
echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%>>%LOG% 2>&1
197+
if exist %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2
198+
199+
:end
200+
echo FINISHED: %DATE% %TIME% >>%LOG% 2>&1

0 commit comments

Comments
 (0)