2006-10-27 13:13:45 +00:00
|
|
|
Procedure for setup of a windows build environment for QGIS
|
2006-11-06 03:47:00 +00:00
|
|
|
Tim Sutton and Godofredo Contreras 2006
|
2006-10-27 13:13:45 +00:00
|
|
|
With thanks to Tisham Dhar for preparing the initial msys environment
|
|
|
|
---------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
This document describes the process you need to follow to get QGIS built directly
|
|
|
|
under windows (rather than using a cross compiler under linux).
|
|
|
|
|
|
|
|
Note: The process for building under windows is still being sorted out so
|
|
|
|
check this document regularly for updates.
|
|
|
|
|
|
|
|
Msys:
|
2006-11-23 10:58:37 +00:00
|
|
|
-----
|
|
|
|
get this:
|
2006-10-27 13:13:45 +00:00
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
http://qgis.org/uploadfiles/msys/msys.tar.bz2
|
2006-10-27 13:13:45 +00:00
|
|
|
|
|
|
|
and unpack to c:\msys
|
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
The file is compressed using bzip2 - you can get a free windows application
|
|
|
|
for creating and decompressing files here:
|
2006-10-27 15:26:04 +00:00
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
http://www.7-zip.org/
|
2006-10-27 15:26:04 +00:00
|
|
|
|
2006-10-27 13:13:45 +00:00
|
|
|
Qt4.2:
|
2006-11-23 10:58:37 +00:00
|
|
|
------
|
2006-11-23 13:04:01 +00:00
|
|
|
|
2006-10-27 13:13:45 +00:00
|
|
|
Download qt4.2 opensource precompiled edition exe and install (including the
|
2006-11-23 10:58:37 +00:00
|
|
|
download and install of mingw) from here:
|
|
|
|
|
|
|
|
http://www.trolltech.com/developer/downloads/qt/windows
|
2006-10-27 13:13:45 +00:00
|
|
|
|
|
|
|
Edit C:\Qt\4.2.0\bin\qtvars.bat and add the following line (the second is only
|
|
|
|
needed if you like vim in your shell):
|
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
set PATH=%PATH%;C:\msys\local\bin;c:\msys\local\lib
|
2006-10-27 13:13:45 +00:00
|
|
|
set PATH=%PATH%;"c:\Program Files\Vim\vim70\
|
|
|
|
|
2006-11-23 13:04:01 +00:00
|
|
|
If you plan to do some debugging, you'll need to complie debug version of Qt:
|
|
|
|
C:\Qt\4.2.0\bin\qtvars.bat compile_debug
|
|
|
|
|
2006-10-27 13:13:45 +00:00
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
QGIS:
|
|
|
|
-----
|
|
|
|
Check out to c:\dev\cpp\qgis:
|
2006-10-27 13:13:45 +00:00
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
cd c:\dev\cpp
|
|
|
|
svn co https://svn.qgis.org/repos/qgis/trunk/qgis
|
2006-10-27 13:13:45 +00:00
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
Currently you need to put it into that location in case you plan to create
|
|
|
|
the NSIS installer because so far it contains hardcoded paths for this location.
|
2006-10-27 13:13:45 +00:00
|
|
|
|
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
Source changes:
|
|
|
|
---------------
|
2006-10-27 13:13:45 +00:00
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
Next you need to shift some files around. For convenience we've made an archive
|
|
|
|
that handles all the changes for you. Download it and unpack to qgis source directory:
|
2006-10-27 13:13:45 +00:00
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
http://qgis.org/uploadfiles/msys/qgis-qmake-files.zip
|
2006-10-27 13:13:45 +00:00
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
List of what has been changed / added by this archive to enable compilation:
|
2006-10-27 13:13:45 +00:00
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
- moved qgscsexception.h, qgsspatialrefsys* and qgscoordinatetransform* into core dir from gui
|
|
|
|
- moved qgspluginregistry.* from core to gui
|
|
|
|
- qgsspatialrefsys.cpp - commented out SRS validation using projection selector
|
2006-10-27 13:13:45 +00:00
|
|
|
- qgsspatialrefsys.cpp - commented out lines using qgsproject as it depends on gui stuff
|
|
|
|
- qgsdistancearea.cpp - commented out lines using qgsproject as it depends on
|
|
|
|
gui stuff and moved to core
|
2006-11-23 10:58:37 +00:00
|
|
|
- lexer and parser generated by genlexyacc.bat
|
|
|
|
- added custom qgsconfig.h and qgssvnversion.h
|
2006-10-27 13:13:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
Building:
|
2006-11-23 10:58:37 +00:00
|
|
|
---------
|
2006-10-27 13:13:45 +00:00
|
|
|
|
2006-11-23 13:04:01 +00:00
|
|
|
Now open the qt command shell (or start "cmd" and run c:\Qt\4.2.0\bin\qtvars.bat)
|
2006-10-27 13:13:45 +00:00
|
|
|
|
|
|
|
cd c:\dev\cpp\qgis
|
|
|
|
qmake
|
|
|
|
make
|
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
This will compile both debug and release version. To make just a one of them
|
|
|
|
use "make debug" or "make release" respectively.
|
|
|
|
|
|
|
|
Note: debug version uses debug version of Qt library thus if linking fails
|
2006-11-23 13:04:01 +00:00
|
|
|
on not founding library QtSvgd4 (or similar), you need to compile them
|
|
|
|
as described in section for Qt.
|
2006-11-23 10:58:37 +00:00
|
|
|
|
|
|
|
Running: (optional)
|
|
|
|
--------
|
|
|
|
|
|
|
|
After successfull make you can run QGIS directly from the directory
|
|
|
|
where it has been built: qgis-debug and/or qgis-release in qgis root dir.
|
|
|
|
You only need to add data files - we have provided an archive for convenience
|
|
|
|
which you can just unpack there and run QGIS:
|
2006-10-27 13:13:45 +00:00
|
|
|
|
2006-11-23 10:58:37 +00:00
|
|
|
http://qgis.org/uploadfiles/msys/qgis_data.zip
|
|
|
|
|
|
|
|
Then just run qgis.exe
|
|
|
|
|
|
|
|
GDB: (optional)
|
|
|
|
----
|
|
|
|
|
|
|
|
If you plan to do some debugging, download and install gdb-6.3.2.exe from
|
|
|
|
|
|
|
|
http://prdownloads.sourceforge.net/mingw/gdb-6.3-2.exe?download
|
|
|
|
|
|
|
|
and install to c:\msys\mingw
|
|
|
|
|
|
|
|
|
|
|
|
Create the installation package: (optional)
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
Downlad and install NSIS from (http://nsis.sourceforge.net/Main_Page)
|
2006-10-27 13:13:45 +00:00
|
|
|
|
|
|
|
Download both the QGIS debug and release installer packages from
|
|
|
|
|
|
|
|
http://qgis.org/uploadfiles/testbuilds/
|
|
|
|
|
|
|
|
and install them. Now copy the installation dirs from C:\Program Files\QGIS* into
|
|
|
|
c:\dev\cpp\qgis\qgis-debug and c:\dev\cpp\qgis\qgis-release respectively. After
|
|
|
|
making these copies uninstall the release and debug versions of QGIS from
|
|
|
|
your c:\Program Files directories using the provided uninstaller. Double check
|
|
|
|
that both dirs are complete gone under program files afterwards.
|
|
|
|
|
|
|
|
Now using windows explorer, enter the c:\dev\cpp\qgis\win_build directory and right
|
|
|
|
click on qgis.nsi and choose the option 'Compile NSIS Script'. Do the same
|
|
|
|
for qgis-debug.nsi. Congratulations you should have two installable qgis
|
|
|
|
setup files in the win_build directory now..
|