1
1
Procedure for setup of a windows build environment for QGIS
2
2
Tim Sutton and Godofredo Contreras 2006
3
+ CMake additions Magnus Homann 2007
3
4
With thanks to Tisham Dhar for preparing the initial msys environment
4
5
---------------------------------------------------------------------------------
5
6
@@ -51,63 +52,50 @@ Currently you need to put it into that location in case you plan to create
51
52
the NSIS installer because so far it contains hardcoded paths for this location.
52
53
53
54
54
- Source changes :
55
- ---------------
55
+ USING CMAKE :
56
+ -----------
56
57
57
- Next you need to shift some files around. For convenience we've made an archive
58
- that handles all the changes for you. Download it and unpack to qgis source directory:
58
+ Instead of shifting around files, you could use CMake. CMake compiles
59
+ raster, compaser, legend, gui and core libraries into one core
60
+ library. So it is not 100% compatible with 'normal' 0.8 Makefiles.
59
61
60
- http://qgis.org/uploadfiles/msys/qgis-qmake-files.zip
62
+ Below are the steps to configure and make the source. The building
63
+ takes plac in a separate directory from the source. If you have built
64
+ the source with 'normal' Makefiels first, please do a make clean (or
65
+ remove and check out everything). Previoussly made intermediate files
66
+ can disturb the CMake process.
61
67
62
- List of what has been changed / added by this archive to enable compilation:
68
+ As a background read http://wiki.qgis.org/qgiswiki/Building_with_CMake
63
69
64
- - moved qgscsexception.h, qgsspatialrefsys* and qgscoordinatetransform* into core dir from gui
65
- - moved qgspluginregistry.* from core to gui
66
- - qgsspatialrefsys.cpp - commented out SRS validation using projection selector
67
- - qgsspatialrefsys.cpp - commented out lines using qgsproject as it depends on gui stuff
68
- - qgsdistancearea.cpp - commented out lines using qgsproject as it depends on
69
- gui stuff and moved to core
70
- - lexer and parser generated by genlexyacc.bat
71
- - added custom qgsconfig.h and qgssvnversion.h
70
+ *) Make sure %QTDIR%\bin;c:\msys\local\bin;c:\msys\bin;c;\msys\mingw\bin is in your Path
72
71
72
+ *) Start a cmd.exe window ( Start -> Run -> cmd.exe ) if you don't have one already.
73
73
74
- Building:
75
- ---------
74
+ *) > mkdir build
76
75
77
- Now open the qt command shell (or start "cmd" and run c:\Qt\4.2.0\bin\qtvars.bat)
76
+ *) > cd build
78
77
79
- cd c:\dev\cpp\qgis
80
- qmake
81
- make
78
+ *) > cmakesetup ..
82
79
83
- This will compile both debug and release version. To make just a one of them
84
- use "make debug" or "make release" respectively.
80
+ If asked, you should chose 'MSYS Makefiles' as generator.
85
81
86
- Note: debug version uses debug version of Qt library thus if linking fails
87
- on not founding library QtSvgd4 (or similar), you need to compile them
88
- as described in section for Qt .
82
+ All dependencies should be picked up automatically, if you have set
83
+ up the Paths correctly. The only thing you need to change is the
84
+ installation destination and/or set 'Debug' .
89
85
90
- Running: (optional)
91
- --------
92
86
93
- After successfull make you can run QGIS directly from the directory
94
- where it has been built: qgis-debug and/or qgis-release in qgis root dir.
95
- You only need to add data files - we have provided an archive for convenience
96
- which you can just unpack there and run QGIS:
87
+ *) Now, start sh.exe and run 'make.exe install' from within that shell
97
88
98
- http://qgis.org/uploadfiles/msys/qgis_data.zip
89
+ It should now start compiling. The reason for this is that we use
90
+ the mingw compiler included in the msys tar, but that compiler is
91
+ not found from within sh.exe. (MSYS magic). So, if you delete
92
+ CMakeCache, you have to generate it from cmd.exe.
99
93
100
- Then just run qgis.exe
101
-
102
- GDB: (optional)
103
- ----
104
-
105
- If you plan to do some debugging, download and install gdb-6.3.2.exe from
106
-
107
- http://prdownloads.sourceforge.net/mingw/gdb-6.3-2.exe?download
108
-
109
- and install to c:\msys\mingw
94
+ Why not run make from cmd.exe? Because creating 'qgssvnversion.h'
95
+ requires the 'mv' command...
110
96
97
+ *) Make sure to copy all .dll:s needed to the same directory as the
98
+ qgis.exe binary is installed to, if not already done so.
111
99
112
100
Create the installation package: (optional)
113
101
--------------------------------
@@ -128,3 +116,4 @@ Now using windows explorer, enter the c:\dev\cpp\qgis\win_build directory and ri
128
116
click on qgis.nsi and choose the option 'Compile NSIS Script'. Do the same
129
117
for qgis-debug.nsi. Congratulations you should have two installable qgis
130
118
setup files in the win_build directory now..
119
+
0 commit comments