forked from qgis/QGIS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsvc.t2t
196 lines (131 loc) · 6.16 KB
/
msvc.t2t
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
==Building with Microsoft Visual Studio==
This section describes how to build QGIS using Visual Studio on Windows. This
is currently also how the binary QGIS packages are made (earlier versions used
MinGW).
This section describes the setup required to allow Visual Studio to be used to
build QGIS.
===Visual C++ Express Edition===
The free (as in free beer) Express Edition installer is available under:
Currently we use Visual C++ 2008 Express for 32bit builds:
http://download.microsoft.com/download/d/c/3/dc3439e7-5533-4f4c-9ba0-8577685b6e7e/vcsetup.exe
And Visual C++ 2010 Express for 64bit builds:
http://download.microsoft.com/download/c/d/7/cd7d4dfb-5290-4cc7-9f85-ab9e3c9af796/vc_web.exe
You also need the Windows SDK for Windows 7 and .NET Framework 4:
http://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/winsdk_web.exe
===Other tools and dependencies===
Download and install following packages:
|| Tool | Website |
| CMake | http://www.cmake.org/files/v3.0/cmake-3.0.2-win32-x86.exe |
| GNU flex, GNU bison and GIT | http://cygwin.com/setup-x86.exe (32bit) or http://cygwin.com/setup-x86_64.exe (64bit) |
| OSGeo4W | http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86.exe (32bit) or http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe (64bit) |
OSGeo4W does not only provide ready packages for the current QGIS release and
nightly builds of master, but also offers most of the dependencies needs to
build it.
For the QGIS build you need to install following packages from cygwin:
- bison
- flex
- git
-
and from OSGeo4W (select //Advanced Installation//):
- expat
- fcgi
- gdal
- grass
- gsl-devel
- iconv
- pyqt4
- qt4-devel
- qwt5-devel-qt4
- sip
- spatialite
- libspatialindex-devel
- python-qscintilla
This will also select packages the above packages depend on.
Earlier versions of this document also covered how to build all above
dependencies. If you're interested in that, check the history of this page in the Wiki
or the SVN repository.
=== Setting up the Visual Studio project with CMake ===
/!\ Consider this section as example. It tends to outdate, when OSGeo4W and
SDKs move on. ``ms-windows/osgeo4w/package-nightly.cmd`` is used for the
nightly builds and constantly updated and hence might contain necessary
updates that are not yet reflected here.
To start a command prompt with an environment that both has the VC++ and the OSGeo4W
variables create the following batch file (assuming the above packages were
installed in the default locations):
```
@echo off
set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\
call "%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
set INCLUDE=%INCLUDE%;%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\include
set LIB=%LIB%;%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\lib
set OSGEO4W_ROOT=C:\OSGeo4W
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
path %PATH%;%PROGRAMFILES%\CMake\bin;c:\cygwin\bin
@set GRASS_PREFIX=c:/OSGeo4W/apps/grass/grass-6.4.4
@set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
@set LIB=%LIB%;%OSGEO4W_ROOT%\lib;%OSGEO4W_ROOT%\lib
@cmd
```
Start the batch file and on the command prompt checkout the QGIS source from
git to the source directory ``QGIS``:
```
git clone git://github.com/qgis/QGIS.git
```
Create a 'build' directory somewhere. This will be where all the build output
will be generated.
Now run ``cmake-gui`` (still from ``cmd``) and in the //Where is the source code://
box, browse to the top level QGIS directory.
In the //Where to build the binaries:// box, browse to the 'build' directory you
created.
If the path to bison and flex contains blanks, you need to use the short name
for the directory (i.e. ``C:\Program Files`` should be rewritten to
``C:\Progra~n``, where ``n`` is the number as shown in `dir /x C:\``).
Verify that the 'BINDINGS_GLOBAL_INSTALL' option is not checked, so that python
bindings are placed into the output directory when you run the INSTALL target.
Hit ``Configure`` to start the configuration and select ``Visual Studio 9 2008``
and keep ``native compilers`` and click ``Finish``.
The configuration should complete without any further questions and allow you to
click ``Generate``.
Now close ``cmake-gui`` and continue on the command prompt by starting
``vcexpress``. Use File / Open / Project/Solutions and open the
qgis-x.y.z.sln File in your project directory.
Change ``Solution Configuration`` from ``Debug`` to ``RelWithDebInfo`` (Release
with Debug Info) or ``Release`` before you build QGIS using the ALL_BUILD
target (otherwise you need debug libraries that are not included).
After the build completed you should install QGIS using the INSTALL target.
Install QGIS by building the INSTALL project. By default this will install to
c:\Program Files\qgis<version> (this can be changed by changing the
CMAKE_INSTALL_PREFIX variable in cmake-gui).
You will also either need to add all the dependency DLLs to the QGIS install
directory or add their respective directories to your PATH.
=== Packaging ===
To create a standalone installer there is a perl script named 'creatensis.pl'
in 'qgis/ms-windows/osgeo4w'. It downloads all required packages from OSGeo4W
and repackages them into an installer using NSIS.
The script can be run on both Windows and Linux.
On Debian/Ubuntu you can just install the 'nsis' package.
NSIS for Windows can be downloaded at:
http://nsis.sourceforge.net
And Perl for Windows (including other requirements like 'wget', 'unzip', 'tar'
and 'bzip2') is available at:
http://cygwin.com
=== Packaging your own build of QGIS ===
Assuming you have completed the above packaging step, if you want to include
your own hand built QGIS executables, you need to copy them in from your
windows installation into the ms-windows file tree created by the creatensis
script.
```
cd ms-windows/
rm -rf osgeo4w/unpacked/apps/qgis/*
cp -r /tmp/qgis1.7.0/* osgeo4w/unpacked/apps/qgis/
```
Now create a package.
```
./quickpackage.sh
```
After this you should now have a nsis installer containing your own build
of QGIS and all dependencies needed to run it on a windows machine.
=== Osgeo4w packaging ===
The actual packaging process is currently not documented, for now please take a
look at:
//ms-windows/osgeo4w/package.cmd//