@@ -25,21 +25,22 @@ Building QGIS from source - step by step
25
25
3.10. Compilation and installation
26
26
3.11. Run qgis.exe from the directory where it's installed (CMAKE_INSTALL_PREFIX)
27
27
3.12. Create the installation package: (optional)
28
- 4. Building on Mac OSX using frameworks and cmake (QGIS > 0.8)
29
- 4.1. Install XCODE
28
+ 4. Building on Mac OSX using frameworks and cmake or Xcode
29
+ 4.1. Install Xcode
30
30
4.2. Install Qt4 from .dmg
31
31
4.3. Install development frameworks for QGIS dependencies
32
32
4.3.1. Additional Dependencies : General compatibility note
33
- 4.3.2. Additional Dependencies : GSL
34
- 4.3.3. Additional Dependencies : Expat
33
+ 4.3.2. Additional Dependencies : Expat
34
+ 4.3.3. Additional Dependencies : Python
35
35
4.3.4. Additional Dependencies : SIP
36
36
4.3.5. Additional Dependencies : PyQt
37
- 4.3.6. Additional Dependencies : Bison
38
- 4.4. Install CMAKE for OSX
37
+ 4.3.6. Additional Dependencies : Qwt/PyQwt
38
+ 4.3.7. Additional Dependencies : Bison
39
+ 4.4. Install CMake for OSX
39
40
4.5. Install subversion for OSX
40
41
4.6. Check out QGIS from SVN
41
42
4.7. Configure the build
42
- 4.7.1. Configure the Cmake build
43
+ 4.7.1. Configure the CMake build
43
44
4.7.2. Configure the Xcode build
44
45
4.8. Building
45
46
4.8.1. Building with Cmake
@@ -140,7 +141,7 @@ always welcome for indicating possible mistakes.
140
141
You can download this document as part of the Quantum GIS 'User and
141
142
Installation Guide' in HTML and PDF format via http://www.qgis.org. A current
142
143
version is also available at the wiki, see:
143
- http://wiki .qgis.org/qgiswiki/BuildingFromSource
144
+ http://www .qgis.org/wiki/Installation_Guide
144
145
145
146
Translations of this document can also be downloaded at the documentation area
146
147
of the Quantum GIS project at http://www.qgis.org. More information is
@@ -173,33 +174,32 @@ number of major projects (eg. KDE 4.0), now uses CMake (http://www.cmake.org)
173
174
for building from source. The configure script in this directory simply checks
174
175
for the existence of cmake and provides some clues to build QGIS.
175
176
176
- For complete information, see the wiki at:
177
- http://wiki.qgis.org/qgiswiki/Building_with_CMake
178
-
179
177
180
178
2.1. An overview of the dependencies required for building
181
179
==========================================================
182
180
183
181
'''Required build deps:'''
184
- * CMake >= 2.4.3
185
- * Flex, Bison
182
+ * CMake >= 2.4.3
183
+ * Flex, Bison
186
184
187
185
'''Required runtime deps:'''
188
- * Qt >= 4.3.0
189
- * Proj >= ? (known to work with 4.4.x)
190
- * GEOS >= 2.2 ( 3.0 is supported, maybe 2.1.x works too)
191
- * Sqlite3 >= ? (probably 3.0.0)
192
- * GDAL/OGR >= 1.4.x
186
+ * Qt >= 4.3.0
187
+ * Proj >= 4.4.x
188
+ * GEOS >= 3.0
189
+ * Sqlite3 >= 3.0.0
190
+ * GDAL/OGR >= 1.4.x
193
191
194
192
'''Optional dependencies:'''
195
- * for GRASS plugin - GRASS >= 6.0.0
196
- * for georeferencer - GSL >= ? (works with 1.8)
197
- * for postgis support and SPIT plugin - PostgreSQL >= 8.0.x
198
- * for gps plugin - expat >= ? (1.95 is OK)
199
- * for mapserver export and PyQGIS - Python >= 2.3 (2.5+ preferred)
200
- * for PyQGIS - SIP >= 4.5, PyQt >= must match Qt version
193
+ * for GRASS plugin - GRASS >= 6.0.0
194
+ * for georeferencer - GSL >= 1.8
195
+ * for postgis support and SPIT plugin - PostgreSQL >= 8.0.x
196
+ * for gps plugin - expat >= 1.95
197
+ * for mapserver export and PyQGIS - Python >= 2.3 (2.5+ preferred)
198
+ * for PyQGIS - SIP >= 4.8, PyQt >= must match Qt version
199
+ * for GPS tracking - Qwt >= 5.0
200
+
201
201
'''Recommended runtime deps:'''
202
- * for gps plugin - gpsbabel
202
+ * for gps plugin - gpsbabel
203
203
204
204
205
205
3. Building under windows using msys
@@ -236,7 +236,7 @@ document.
236
236
Download qt4.3 opensource precompiled edition exe and install (including the
237
237
download and install of mingw) from here:
238
238
239
- http://www.trolltech .com/developer/ downloads/qt/windows
239
+ http://qt.nokia .com/downloads
240
240
241
241
When the installer will ask for MinGW, you don't need to download and install
242
242
it, just point the installer to c:\msys\mingw
@@ -460,29 +460,31 @@ tree. Read the READMEfile there and follow the instructions. Next right click
460
460
on qgis.nsi and choose the option 'Compile NSIS Script'.
461
461
462
462
463
- 4. Building on Mac OSX using frameworks and cmake (QGIS > 0.8)
464
- ==============================================================
463
+ 4. Building on Mac OSX using frameworks and cmake or Xcode
464
+ ==========================================================
465
465
466
466
In this approach I will try to avoid as much as possible building dependencies
467
467
from source and rather use frameworks wherever possible.
468
468
469
- Included are a few notes for building on Mac OS X 10.5 (Leopard ) and 10.6
470
- (Snow Leopard).
469
+ The base system here is Mac OS X 10.4 (Tiger ) and below. Included are a few notes
470
+ for building on Mac OS X 10.5 (Leopard) and 10.6 (Snow Leopard).
471
471
472
472
Snow Leopard note: A cmake/qt/sip bug currently exists where a 32-bit
473
473
cmake build fails to provide python bindings. This means that python plugin support
474
474
is currently lacking for 32-bit builds using cmake in Snow Leopard. See the Xcode
475
475
build method to if you require python support.
476
476
477
477
478
- 4.1. Install XCODE
478
+ 4.1. Install Xcode
479
479
==================
480
480
481
- I recommend to get the latest xcode dmg from the Apple XDC Web site. Install
482
- XCODE after the ~1gb download is complete.
481
+ I recommend to get the latest Xcode dmg from the Apple XDC Web site
482
+ (http:/developer.apple.com). The Mac system install disks come with a copy of
483
+ Xcode, but it's likely out of date.
484
+ Install Xcode after the ~1gb download is complete.
483
485
484
486
/!\ Note: It may be that you need to create some symlinks after installing
485
- the XCODE SDK (in particular if you are using XCODE 2.5 on tiger ):
487
+ Xcode (in particular if you are using Xcode 2.5 on Tiger ):
486
488
487
489
488
490
cd /Developer/SDKs/MacOSX10.4u.sdk/usr/
@@ -494,68 +496,56 @@ the XCODE SDK (in particular if you are using XCODE 2.5 on tiger):
494
496
4.2. Install Qt4 from .dmg
495
497
==========================
496
498
497
- You need a minimum of Qt-4.3.0. I suggest getting the latest (at time of writing) .
499
+ You need a minimum of Qt-4.3.0. I suggest getting the latest.
498
500
499
501
Snow Leopard note: If you are building on Snow Leopard, you will need to
500
502
decide between 32-bit support in the older, Qt Carbon branch, or 64-bit
501
503
support in the Qt Cocoa branch. Appropriate installers are available for both
502
- as of Qt-4.6.0, but the beta version of Qt-4.6.0 has proven to introduce numerous
503
- bugs in Qgis. Unfortunately, the 32-bit branch of Qt currently does not build with
504
- python bindings (see notes below). You can achieve support for python in Qgis with
505
- the Xcode build method noted below.
506
-
507
-
508
- ftp://ftp.trolltech.com/qt/source/
504
+ as of Qt-4.5.2. Qt 4.6+ is recommended for Cocoa.
509
505
510
506
511
- Mac versions are named as:
507
+ http://qt.nokia.com/downloads
512
508
513
509
514
- qt-mac-opensource-x.y.z.dmg
515
-
516
-
517
- x, y, z being the major, minor and revision version.
518
-
519
- If you want debug frameworks, Qt also provide a dmg with these. These are in
510
+ If you want debug frameworks, Qt also provides a dmg with these. These are in
520
511
addition to the non-debug frameworks.
521
512
522
513
Once downloaded open the dmg and run the installer. Note you need admin
523
514
privileges to install.
524
515
525
- After installing you need to make two small changes:
526
-
527
- First edit /Library/Frameworks/QtCore.framework/Headers/qconfig.h and
528
- change
529
-
530
- /!\ Note: this isn't needed since version 4.2.3
531
-
532
- QT_EDITION_Unknown to QT_EDITION_OPENSOURCE
516
+ Qt 4.4+ note: Starting in Qt 4.4 (?) libQtCLucene was added, and in 4.5
517
+ libQtUiTools was added, both in /usr/lib. When using a system SDK (which will
518
+ happen in the Xcode build), these libraries will not be found. To fix this problem,
519
+ add symlinks to /usr/local:
533
520
534
- Second change the default mkspec symlink so that it points to macx-g++:
535
521
522
+ sudo ln -s /usr/lib/libQtUiTools.a /usr/local/lib/
523
+ sudo ln -s /usr/lib/libQtCLucene.dylib /usr/local/lib/
536
524
537
- cd /usr/local/Qt4.3/mkspecs/
538
- sudo rm default
539
- sudo ln -sf macx-g++ default
540
525
541
-
542
- /!\ Note: this doesn't seem to be needed since version 4.4.
526
+ These should then be found automatically on Leopard and above. Earlier systems
527
+ may need some help by adding '-L/usr/local/lib' to CMAKE_SHARED_LINKER_FLAGS,
528
+ CMAKE_MODULE_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS in the cmake build, or
529
+ adding '/usr/local/lib' to LIBRARY_SEARCH_PATHS in the Xcode build.
543
530
544
531
545
532
4.3. Install development frameworks for QGIS dependencies
546
533
=========================================================
547
534
548
- Download William Kyngesburye's excellent all in one framework that includes
549
- proj, gdal, sqlite3, etc.
535
+ Download William Kyngesburye's excellent GDAL Complete package that includes
536
+ PROJ, GEOS, GDAL, SQLite3, and image libraries, as frameworks. There is also
537
+ a GSL framework.
550
538
551
539
552
540
http://www.kyngchaos.com/wiki/software:frameworks
553
541
554
542
555
543
Once downloaded, open and install the frameworks.
556
544
557
- William provides an additional installer package for Postgresql/PostGIS. It's
558
- available here:
545
+ William provides an additional installer package for Postgresql (for PostGIS support).
546
+ Qgis just needs the libpq client library, so unless you want to setup the full
547
+ Postgres + PostGIS server, all you need is the client-only package.
548
+ It's available here:
559
549
560
550
561
551
http://www.kyngchaos.com/wiki/software:postgres
@@ -567,6 +557,7 @@ Also available is a GRASS application:
567
557
http://www.kyngchaos.com/wiki/software:grass
568
558
569
559
560
+
570
561
4.3.1. Additional Dependencies : General compatibility note
571
562
===========================================================
572
563
@@ -575,83 +566,64 @@ provided as frameworks or installers so we will need to build these from source.
575
566
If you are wanting to build Qgis as a 64-bit application, you will need to
576
567
provide the appropriate build commands to produce 64-bit support in dependencies.
577
568
Likewise, for 32-bit support on Snow Leopard, you will need to override the
578
- default system architecture, which is 64-bit according to instructions for
569
+ default system architecture, which is 64-bit, according to instructions for
579
570
individual dependency packages.
580
571
581
572
582
- 4.3.2. Additional Dependencies : GSL
583
- ====================================
584
-
585
- Retrieve the current version of the Gnu Scientific Library from:
586
-
587
-
588
- ftp://ftp.gnu.org/gnu/gsl/
589
-
590
-
591
- Then extract it and build it to a prefix of /usr/local. Double-click the source
592
- tarball to unpack it, then cd to the source folder and:
593
-
573
+ 4.3.2. Additional Dependencies : Expat
574
+ ======================================
594
575
595
- ./configure
596
- make
597
- sudo make install
576
+ Snow Leopard note: Snow Leopard includes a usable expat, so this step is
577
+ not necessary on Snow Leopard.
598
578
579
+ Get the expat sources:
599
580
600
- Snow Leopard note: For explicit 32-bit support in gsl, substitute the standard
601
- configure line with:
602
581
582
+ http://sourceforge.net/project/showfiles.php?group_id=10127
603
583
604
- ./configure --build=i386
605
584
585
+ Double-click the source tarball to unpack, then, in Terminal.app, cd to the source folder and:
606
586
607
- And for 64-bit gsl:
608
587
588
+ ./configure
589
+ make
590
+ sudo make install
609
591
610
- ./configure --build=x86_64
611
592
593
+ Leopard note: To compile for 64bit, substitute the standard configure line with:
612
594
613
595
614
- 4.3.3. Additional Dependencies : Expat
615
- ======================================
596
+ ./configure CFLAGS="-Os -arch x86_64"
616
597
617
- Snow Leopard note: Snow Leopard includes a usable expat, so this step is
618
- not necessary.
619
598
620
- Get the expat sources:
621
599
600
+ 4.3.3. Additional Dependencies : Python
601
+ =======================================
622
602
623
- http://sourceforge.net/project/showfiles.php?group_id=10127
603
+ Leopard and Snow Leopard note: Leopard and Snow Leopard include a usable
604
+ Python 2.5 and 2.6, respectively. So there is no need to install Python on
605
+ Leopard and Snow Leopard. You can still install Python from python.org if preferred.
624
606
607
+ Make sure you install at least the latest Python 2.5 from
625
608
626
- Double-click the source tarball to unpack, then cd to the source folder and:
627
609
610
+ http://www.python.org/download/
628
611
629
- ./configure
630
- make
631
- sudo make install
632
612
613
+ Python 3 is a major change, and may have compatibility issues, so try it at your own risk.
633
614
634
615
635
616
4.3.4. Additional Dependencies : SIP
636
617
====================================
637
618
638
- Leopard and Snow Leopard note: Leopard and Snow Leopard include a usable Python
639
- 2.5 or 2.6, respectively. You can install Python from python.org if preferred.
640
-
641
- Make sure you have the latest Python 2.5 from
642
-
643
-
644
- http://www.python.org/download/mac/
645
-
646
-
647
619
Retrieve the python bindings toolkit SIP from
648
620
649
621
650
622
http://www.riverbankcomputing.com/software/sip/download
651
623
652
624
653
- Double-click the source tarball to unpack it, then cd to the source folder
654
- and (this installs by default into the Python framework):
625
+ Double-click the source tarball to unpack it, then, in Terminal.app, cd to the source folder
626
+ and (this installs by default into the Python framework, and is appropriate only for python.org Python installs ):
655
627
656
628
657
629
python configure.py
@@ -666,44 +638,41 @@ system path -- this is not a good idea. Use this configure command instead of t
666
638
basic configure above:
667
639
668
640
669
- python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip
641
+ python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin \
642
+ -e /usr/local/include -v /usr/local/share/sip
670
643
671
644
672
645
Snow Leopard notes
673
646
674
- If building on Snow Leopard, you need to use one of the following configure lines
675
- based on your installed version of Qt. If you are using 32-bit Qt (Qt Carbon):
647
+ Similar to Leopard, you should install outside the system Python path.
648
+ Also, you need to specify the architecture you want (requires at least SIP 4.9),
649
+ and make sure to run the versioned python binary (this one responds to the
650
+ 'arch' command, 'python' does not). If you are using 32-bit Qt (Qt Carbon):
676
651
677
652
678
- python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip --arch i386
653
+ python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin \
654
+ -e /usr/local/include -v /usr/local/share/sip --arch=i386
679
655
680
656
681
657
For 64-bit Qt (Qt Cocoa), use this configure line:
682
658
683
659
684
- python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip --arch x86_64
660
+ python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin \
661
+ -e /usr/local/include -v /usr/local/share/sip --arch=x86_64
685
662
686
663
687
664
688
665
4.3.5. Additional Dependencies : PyQt
689
666
=====================================
690
667
691
- If you encounter problems compiling PyQt using the instructions
692
- below you can also try adding python from your frameworks dir
693
- explicitly to your path e.g.
694
-
695
-
696
- export PATH=/Library/Frameworks/Python.framework/Versions/Current/bin:$PATH
697
-
698
-
699
668
Retrieve the python bindings toolkit for Qt from
700
669
701
670
702
671
http://www.riverbankcomputing.com/software/pyqt/download
703
672
704
673
705
- Double-click the source tarball to unpack it, then cd to the source folder
706
- and (this installs by default into the Python framework):
674
+ Double-click the source tarball to unpack it, then, in Terminal.app, cd to the source folder
675
+ and (this installs by default into the Python framework, and is appropriate only for python.org Python installs ):
707
676
708
677
709
678
export QTDIR=/Developer/Applications/Qt
@@ -715,7 +684,9 @@ and (this installs by default into the Python framework):
715
684
716
685
Leopard notes
717
686
718
- If building on Leopard, using Leopard's bundled Python, PyQt wants to install in the system path -- this is not a good idea. Use this configure command instead of the basic configure above:
687
+ If building on Leopard, using Leopard's bundled Python, PyQt wants to install
688
+ in the system path -- this is not a good idea. Use this configure command
689
+ instead of the basic configure above:
719
690
720
691
721
692
python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin
@@ -727,23 +698,82 @@ Then make again.
727
698
728
699
Snow Leopard notes
729
700
730
- If building on Snow Leopard, you need to use one of the following configure lines based on your installed version of Qt. If you are using 32-bit Qt (Qt Carbon):
701
+ Similar to Leopard, you should install outside the system Python path.
702
+ Also, you need to specify the architecture you want (requires at least PyQt 4.6),
703
+ and make sure to run the versioned python binary (this one responds to the
704
+ 'arch' command, which is important for pyuic4, 'python' does not).
705
+ If you are using 32-bit Qt (Qt Carbon):
731
706
732
707
733
- python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch i386
708
+ python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch i386
734
709
735
710
736
711
For 64-bit Qt (Qt Cocoa), use this configure line:
737
712
738
713
739
- python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch x86_64
714
+ python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch x86_64
715
+
716
+
717
+
718
+ 4.3.6. Additional Dependencies : Qwt/PyQwt
719
+ ==========================================
720
+
721
+ The GPS tracking feature uses Qwt. Some popular 3rd-party plugins use PyQwt.
722
+ You can take care of both with the PyQwt source from:
723
+
724
+
725
+ http://pyqwt.sourceforge.net/
726
+
727
+
728
+ Double-click the tarball to unpack it.
729
+
730
+ Now, first edit qwtconfig.pri in the qwt-5.2 subdir and change some settings so
731
+ you don't get a bloated debug static library (too bad they are configurable from
732
+ qmake). Scroll down to the 'release/debug mode' block. Edit the last 'CONFIG +='
733
+ line, within an 'else' block, and change 'debug' to 'release'. Also uncomment
734
+ (remove # prefix) the line 'CONFIG += QwtDll'.
740
735
736
+ Save and close.
741
737
738
+ Now, cd into the qwt-5.2 subdir in a Terminal. Type these commands to build and install:
739
+
740
+
741
+ qmake -spec macx-g++
742
+ make
743
+ sudo make install
744
+
745
+
746
+ The Qwt shared library is now installed in /usr/local/qwt-5.x.x[-svn] (x.x is the
747
+ minor.point version, and it may be an SVN version). Remember this for QGIS and PyQwt configuration.
748
+
749
+ Now for PyQwt. Still in the Terminal:
750
+
751
+
752
+ python configure.py --extra-include-dirs=/usr/local/qwt-5.2.1-svn/include \
753
+ --extra-lib-dirs=/usr/local/qwt-5.2.1-svn/lib --extra-libs=qwt
754
+ make
755
+ sudo make install
742
756
743
- 4.3.6. Additional Dependencies : Bison
757
+
758
+ Make sure to use the qwt install path from the Qwt build above.
759
+
760
+ Snow Leopard note
761
+
762
+ If using Qt Carbon, you need to specify which architectures to build, otherwise
763
+ it will default to a combination that does not work (ie x86_64 for a Carbon Qt).
764
+ This is not needed for Qt Cocoa. Configure as follows:
765
+
766
+
767
+ python configure.py --extra-cflags="-arch i386" --extra-cxxflags="-arch i386" \
768
+ --extra-lflags="-arch i386" --extra-include-dirs=/usr/local/qwt-5.2.1-svn/include \
769
+ --extra-lib-dirs=/usr/local/qwt-5.2.1-svn/lib --extra-libs=qwt
770
+
771
+
772
+
773
+ 4.3.7. Additional Dependencies : Bison
744
774
======================================
745
775
746
- Leopard and Snow Leopard note: Leopard and Snow Leopard includes Bison 2.3, so this step can be skipped on Leopard and Snow Leopard.
776
+ Leopard and Snow Leopard note: Leopard and Snow Leopard include Bison 2.3, so this step can be skipped on Leopard and Snow Leopard.
747
777
748
778
The version of bison available by default on Mac OS X 10.4 and older is too old so you need to
749
779
get a more recent one on your system. Download at least version 2.3 from:
@@ -762,7 +792,7 @@ tarball to unpack it, then cd to the source folder and:
762
792
763
793
764
794
765
- 4.4. Install CMAKE for OSX
795
+ 4.4. Install CMake for OSX
766
796
==========================
767
797
768
798
Get the latest source release from here:
@@ -786,9 +816,10 @@ then cd to the source folder and:
786
816
4.5. Install subversion for OSX
787
817
===============================
788
818
789
- Leopard and Snow Leopard note: Leopard and Snow Leopard include SVN, so this step can be skipped on these Operating Systems.
819
+ Leopard and Snow Leopard note: Leopard and Snow Leopard (Xcode 3+)
820
+ include SVN, so this step can be skipped on Leopard and Snow Leopard.
790
821
791
- The http://sourceforge.net/projects/macsvn/ ( MacSVN) project has a downloadable
822
+ The [ http://sourceforge.net/projects/macsvn/MacSVN] project has a downloadable
792
823
build of svn. If you are a GUI inclined person you may want to grab their gui
793
824
client too. Get the command line client here:
794
825
@@ -832,7 +863,7 @@ Now close and reopen your shell to get the updated vars.
832
863
============================
833
864
834
865
Now we are going to check out the sources for QGIS. First we will create a
835
- directory for working in:
866
+ directory for working in (or some folder of your choice) :
836
867
837
868
838
869
mkdir -p ~/dev/cpp cd ~/dev/cpp
@@ -872,93 +903,91 @@ I suggest you press 'p' to accept the key permanently.
872
903
4.7. Configure the build
873
904
========================
874
905
875
- There are 2 different methods to build QGIS: the traditional Cmake method,
906
+ There are 2 different methods to build QGIS: the traditional CMake method,
876
907
and the new Xcode project (starting with QGIS 1.1). The Xcode project has
877
- additional bundling steps, though some optional Qgis features must be explicitly
878
- stated in a user configuration file. The Cmake build handles optional features,
908
+ additional bundling steps, though some optional QGIS features must be explicitly
909
+ stated in a user configuration file. The CMake build handles optional features,
879
910
and some bundling steps are available with scripts in the mac directory.
880
911
881
912
882
- 4.7.1. Configure the Cmake build
913
+ 4.7.1. Configure the CMake build
883
914
================================
884
915
885
916
CMake supports out of source build so we will create a 'build' dir for the
886
- build process. By convention I build my software into a dir called 'apps' in
887
- my home directory. If you have the correct permissions you may want to build
917
+ build process. OS X uses ${HOME}/Applications as a standard user app folder (it gives it the system app folder icon).
918
+ If you have the correct permissions you may want to build
888
919
straight into your /Applications folder. The instructions below assume you are
889
- building into a pre-existing ${HOME}/apps directory ...
920
+ building into a pre-existing ${HOME}/Applications directory ...
890
921
891
922
892
923
cd qgis
893
924
mkdir build
894
925
cd build
895
- cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ -D CMAKE_BUILD_TYPE=Release ..
896
-
897
-
898
- Leopard note: To find the custom install of SIP on Leopard, add ""-
899
- D SIP_BINARY_PATH=/usr/local/bin/sip"" to the cmake command above,
900
- before the .. at the end, ie:
901
-
902
-
903
- cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ \
904
- -D CMAKE_BUILD_TYPE=Release \
905
- -D SIP_BINARY_PATH=/usr/local/bin/sip \
906
- ..
926
+ cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release ..
907
927
908
928
909
929
To use the application build of GRASS on OSX, you can optionally use the
910
930
following cmake invocation (minimum GRASS 6.3 required, substitute the GRASS
911
931
version as required):
912
932
913
933
914
- cmake -D CMAKE_INSTALL_PREFIX=${HOME}/apps/ \
915
- -D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/
916
- include \
917
- -D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
918
- -D CMAKE_BUILD_TYPE=Release \
919
- ..
934
+ cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
935
+ -D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/include \
936
+ -D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
937
+ ..
920
938
921
939
922
940
Or, to use a Unix-style build of GRASS, use the following cmake invocation
923
941
(minimum GRASS version as stated in the Qgis requirements, substitute the GRASS
924
942
path and version as required):
925
943
926
944
927
- cmake -D CMAKE_INSTALL_PREFIX=${HOME}/apps/ \
928
- -D GRASS_INCLUDE_DIR=/user/local/grass-6.4.0/include \
929
- -D GRASS_PREFIX=/user/local/grass-6.4.0 \
930
- -D CMAKE_BUILD_TYPE=Release \
931
- ..
945
+ cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
946
+ -D GRASS_INCLUDE_DIR=/user/local/grass-6.4.0/include \
947
+ -D GRASS_PREFIX=/user/local/grass-6.4.0 \
948
+ ..
949
+
950
+
951
+ Leopard note: To find the custom install of SIP on Leopard, add
952
+ '-D SIP_BINARY_PATH=/usr/local/bin/sip' to the cmake commands above,
953
+ before the '..' at the end, ie:
932
954
933
955
934
- Snow Leopard note: To handle the appropriate version of Qt (32-bit or 64-bit), you will need to invoke cmake based on which version of Qt you installed.
956
+ cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
957
+ -D SIP_BINARY_PATH=/usr/local/bin/sip \
958
+ ..
935
959
936
- For 32-bit Qt (Carbon) with GRASS-6.4:
937
960
961
+ Snow Leopard note: To handle the appropriate version of Qt (32-bit or 64-bit), you will need to invoke cmake based on which version of Qt you installed. Also, SIP/PyQt detection will fail for 32bit because Python runs 64bit.
938
962
939
- cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ \
940
- -D CMAKE_BUILD_TYPE=Release \
941
- -D SIP_BINARY_PATH=/usr/local/bin/sip
942
- -D CMAKE_C_FLAGS=-m32 \
943
- -D CMAKE_CXX_FLAGS=-m32
944
- -D CMAKE_OSX_ARCHITECTURES=i386
945
- -D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
946
- -D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/include\
947
- ..
963
+ For 32-bit Qt (Carbon) with GRASS-6.4, create a 32bit python script and add arch flags to the configuration:
964
+
965
+
966
+ sudo cat >/usr/local/bin/python32 <<EOF
967
+ #!/bin/sh
968
+ exec arch -i386 /usr/bin/python2.6 \${1+"\$@"}
969
+ EOF
970
+
971
+ sudo chmod +x /usr/local/bin/python32
972
+
973
+ cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
974
+ -D SIP_BINARY_PATH=/usr/local/bin/sip \
975
+ -D CMAKE_CXX_FLAGS="-arch i386" -D CMAKE_OSX_ARCHITECTURES=i386 \
976
+ -D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/include \
977
+ -D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
978
+ -D PYTHON_EXECUTABLE=/usr/local/bin/python32 \
979
+ ..
948
980
949
981
950
982
For 64-bit Qt (Cocoa) with GRASS-6.4:
951
983
952
984
953
- cmake -D CMAKE_INSTALL_PREFIX=$HOME/apps/ \
954
- -D CMAKE_BUILD_TYPE=Release \
955
- -D SIP_BINARY_PATH=/usr/local/bin/sip
956
- -D CMAKE_C_FLAGS=-m64 \
957
- -D CMAKE_CXX_FLAGS=-m64
958
- -D CMAKE_OSX_ARCHITECTURES=x86_64
959
- -D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
960
- -D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/include\
961
- ..
985
+ cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D CMAKE_BUILD_TYPE=Release \
986
+ -D SIP_BINARY_PATH=/usr/local/bin/sip \
987
+ -D CMAKE_CXX_FLAGS="-arch x86_64" -D CMAKE_OSX_ARCHITECTURES=x86_64 \
988
+ -D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/include \
989
+ -D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
990
+ ..
962
991
963
992
964
993
@@ -967,10 +996,10 @@ For 64-bit Qt (Cocoa) with GRASS-6.4:
967
996
968
997
In the mac/xcode folder in the source, duplicate the 'qgis_user-template.xcconfig'
969
998
file and name it 'qgis_user.xcconfig'. A default build will use the KyngChaos
970
- frameworks, Postgres, GRASS 6.4, the python.org Python 2.5 and extra dependencies
999
+ frameworks, Postgres, GRASS 6.4, the python.org Python 2.5 (for Tiger)
1000
+ or the system Python (for Leopard and Snow Leopard) and extra dependencies
971
1001
as described above, and compile for the current OSX architecture and version, so no
972
- extra configuration is necessary. If building on Leopard or newer, you may want to
973
- use the system Python, which requires editing qgis_user.xcconfig.
1002
+ extra configuration is necessary.
974
1003
975
1004
See the mac/xcode/readme.rtf for details, if you need to customize the build.
976
1005
The default build will also bundle the Qt frameworks, Postgres library, and
@@ -1017,17 +1046,10 @@ Alternatively, from within the mac/xcode directory, build with the command:
1017
1046
1018
1047
xcodebuild
1019
1048
1020
- Snow Leopard note: You can also build Qgis using the new llvm compilers supplied
1021
- with Xcode 3.2.x. To do this, you first need to export the proper compiler settings:
1022
-
1023
-
1024
- export CC=/Developer/usr/bin/llvm-gcc
1025
- export CXX=/Developer/usr/bin/llvm-g++
1026
- xcodebuild
1027
-
1028
1049
1029
- The Qgis application will be found in the 'build/$SYSTEM/Release' folder in the xcode folder.
1030
- Copy this to whereever you like.
1050
+ The Qgis application will be found in the 'build/$SDKSYS/Release' folder
1051
+ in the xcode folder, where $SDKSYS is the system you configured for in your
1052
+ qgis_user.xcconfig. Copy this to whereever you like.
1031
1053
1032
1054
1033
1055
5. Building on GNU/Linux
@@ -2173,7 +2195,7 @@ Get QGIS source from svn (svn co https://svn.osgeo.org/qgis/trunk/qgis qgis).
2173
2195
2174
2196
Create a 'Build' directory in the top level QGIS directory. This will be where all the build output will be generated.
2175
2197
2176
- Run Start-- >All Programs-- >CMake-->CMake.
2198
+ Run Start>All Programs>CMake-->CMake.
2177
2199
2178
2200
In the 'Where is the source code:' box, browse to the top level QGIS directory.
2179
2201
@@ -2516,7 +2538,7 @@ support building the open source version of Qt for windows under MSVC.
2516
2538
Download Qt 4.x.x source for windows from
2517
2539
2518
2540
2519
- http:\\www.trolltech .com
2541
+ http://qt.nokia .com/downloads
2520
2542
2521
2543
2522
2544
Unpack the source to
0 commit comments