@@ -38,7 +38,11 @@ Building QGIS from source - step by step
38
38
4.5. Install subversion for OSX
39
39
4.6. Check out QGIS from SVN
40
40
4.7. Configure the build
41
+ 4.7.1. Configure the Cmake build
42
+ 4.7.2. Configure the Xcode Build
41
43
4.8. Building
44
+ 4.8.1 Building with Cmake
45
+ 4.8.2. Building with Xcode
42
46
5. Building on GNU/Linux
43
47
5.1. Building QGIS with Qt4.x
44
48
5.2. Prepare apt
@@ -473,15 +477,19 @@ the XCODE SDK (in particular if you are using XCODE 2.5 on tiger):
473
477
You need a minimum of Qt4.3.0. I suggest getting the latest (at time of writing).
474
478
475
479
476
- ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.3.2.dmg
480
+ ftp://ftp.trolltech.com/qt/source/
477
481
478
482
479
- If you want debug libs, Qt also provide a dmg with these :
483
+ Mac versions are named as :
480
484
481
485
482
- ftp://ftp.trolltech.com/qt/source/qt -mac-opensource-4.3.2-debug-libs .dmg
486
+ qt -mac-opensource-x.y.z .dmg
483
487
484
488
489
+ x, y, z being the major, minor and revision version.
490
+
491
+ If you want debug libs, Qt also provide a dmg with these.
492
+
485
493
I am going to proceed using only release libs at this stage as the download for
486
494
the debug dmg is substantially bigger. If you plan to do any debugging though
487
495
you probably want to get the debug libs dmg. Once downloaded open the dmg and
@@ -492,7 +500,7 @@ After installing you need to make two small changes:
492
500
First edit /Library/Frameworks/QtCore.framework/Headers/qconfig.h and
493
501
change
494
502
495
- /!\ Note this doesnt seem to be needed since version 4.2.3
503
+ /!\ Note: this isn't needed since version 4.2.3.
496
504
497
505
QT_EDITION_Unknown to QT_EDITION_OPENSOURCE
498
506
@@ -504,6 +512,8 @@ Second change the default mkspec symlink so that it points to macx-g++:
504
512
sudo ln -sf macx-g++ default
505
513
506
514
515
+ /!\ Note: this doesn't seem to be needed since version 4.4.
516
+
507
517
508
518
4.3. Install development frameworks for QGIS dependencies
509
519
=========================================================
@@ -517,35 +527,38 @@ proj, gdal, sqlite3 etc
517
527
518
528
Once downloaded, open and install the frameworks.
519
529
520
- William provides an additional installer package for Postgresql/PostGIS. Its
530
+ William provides an additional installer package for Postgresql/PostGIS. It's
521
531
available here:
522
532
523
533
524
534
http://www.kyngchaos.com/wiki/software:postgres
525
535
526
536
537
+ Also available is a GRASS application:
538
+
539
+
540
+ http://www.kyngchaos.com/wiki/software:grass
541
+
542
+
527
543
There are some additional dependencies that at the time of writing are not
528
- provided as frameworks so we will need to build these from source.
544
+ provided as frameworks or installers so we will need to build these from source.
529
545
530
546
531
547
4.3.1. Additional Dependencies : GSL
532
548
====================================
533
549
534
- Retrieve the Gnu Scientific Library from
550
+ Retrieve the current version of the Gnu Scientific Library from
535
551
536
552
537
- curl -O ftp://ftp.gnu.org/gnu/gsl/gsl-1.8.tar.gz
553
+ ftp://ftp.gnu.org/gnu/gsl/
538
554
539
555
540
- Then extract it and build it to a prefix of /usr/local:
556
+ Then extract it and build it to a prefix of /usr/local. Double-click the source tarball to unpack it, then cd to the source folder and :
541
557
542
558
543
- tar xvfz gsl-1.8.tar.gz
544
- cd gsl-1.8
545
- ./configure --prefix=/usr/local
559
+ ./configure
546
560
make
547
561
sudo make install
548
- cd ..
549
562
550
563
551
564
@@ -558,13 +571,12 @@ Get the expat sources:
558
571
http://sourceforge.net/project/showfiles.php?group_id=10127
559
572
560
573
574
+ Double-click the source tarball to unpack, then cd to the source folder and:
561
575
562
- tar xvfz expat-2.0.0.tar.gz
563
- cd expat-2.0.0
564
- ./configure --prefix=/usr/local
576
+
577
+ ./configure
565
578
make
566
579
sudo make install
567
- cd ..
568
580
569
581
570
582
@@ -585,15 +597,12 @@ Retrieve the python bindings toolkit SIP from
585
597
http://www.riverbankcomputing.com/software/sip/download
586
598
587
599
588
- Then extract and build it (this installs by default into the Python framework):
600
+ Double-click the source tarball to unpack it, then cd to the source folder and (this installs by default into the Python framework):
589
601
590
602
591
- tar xvfz sip-<version number>.tar.gz
592
- cd sip-<version number>
593
603
python configure.py
594
604
make
595
605
sudo make install
596
- cd ..
597
606
598
607
599
608
Leopard notes
@@ -622,17 +631,14 @@ Retrieve the python bindings toolkit for Qt from
622
631
http://www.riverbankcomputing.com/software/pyqt/download
623
632
624
633
625
- Then extract and build it (this installs by default into the Python framework):
634
+ Double-click the source tarball to unpack it, then cd to the source folder and (this installs by default into the Python framework):
626
635
627
636
628
- tar xvfz PyQt-mac<version number here>
629
- cd PyQt-mac<version number here>
630
637
export QTDIR=/Developer/Applications/Qt
631
638
python configure.py
632
639
yes
633
640
make
634
641
sudo make install
635
- cd ..
636
642
637
643
638
644
Leopard notes
@@ -643,7 +649,7 @@ If building on Leopard, using Leopard's bundled Python, PyQt wants to install in
643
649
python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin
644
650
645
651
646
- There may be a problem with undefined symbols in QtOpenGL on Leopard. Edit QtOpenGL/makefile and add -undefined dynamic_lookup to LFLAGS.
652
+ If there is a problem with undefined symbols in QtOpenGL on Leopard, edit QtOpenGL/makefile and add -undefined dynamic_lookup to LFLAGS. Then make again .
647
653
648
654
649
655
4.3.5. Additional Dependencies : Bison
@@ -652,21 +658,18 @@ There may be a problem with undefined symbols in QtOpenGL on Leopard. Edit QtOp
652
658
Leopard note: Leopard includes Bison 2.3, so this step can be skipped on Leopard.
653
659
654
660
The version of bison available by default on Mac OSX is too old so you need to
655
- get a more recent one on your system. Download if from:
661
+ get a more recent one on your system. Download at least version 2.3 from:
656
662
657
663
658
- curl -O http ://ftp.gnu.org/gnu/bison/bison-2.3.tar.gz
664
+ ftp ://ftp.gnu.org/gnu/bison/
659
665
660
666
661
- Now build and install it to a prefix of /usr/local :
667
+ Now build and install it to a prefix of /usr/local. Double-click the source tarball, then cd to the source folder and :
662
668
663
669
664
- tar xvfz bison-2.3.tar.gz
665
- cd bison-2.3
666
670
./configure --prefix=/usr/local
667
671
make
668
672
sudo make install
669
- cd ..
670
673
671
674
672
675
@@ -676,16 +679,16 @@ Now build and install it to a prefix of /usr/local :
676
679
Get the latest release from here:
677
680
678
681
679
- http://www.cmake.org/HTML/Download.html
680
-
682
+ http://www.cmake.org/cmake/resources/software.html
681
683
682
- At the time of writing the file I grabbed was:
683
684
685
+ Binary installers are available for OS X, but they are not recommended (2.4 versions install in /usr instead of /usr/local, and 2.6 versions are a strange application). Download the source. Double-click the source tarball, then cd to the source folder and:
684
686
685
- curl -O http://www.cmake.org/files/v2.4/cmake-2.4.6-Darwin-universal.dmg
686
687
688
+ ./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
689
+ make
690
+ sudo make install
687
691
688
- Once downloaded open the dmg and run the installer
689
692
690
693
691
694
4.5. Install subversion for OSX
@@ -783,6 +786,16 @@ I suggest you press 'p' to accept the key permanently.
783
786
4.7. Configure the build
784
787
========================
785
788
789
+ There are 2 different methods to build QGIS. The traditional Cmake method,
790
+ and the new Xcode project (starting with QGIS 1.1). The Xcode project has
791
+ additional bundling steps, though some optional QGIS features are required due
792
+ to limited conditional compilation. The Cmake build handles optional features,
793
+ and some bundling steps are available with scripts in the mac directory.
794
+
795
+
796
+ 4.7.1. Configure the Cmake build
797
+ ================================
798
+
786
799
CMake supports out of source build so we will create a 'build' dir for the
787
800
build process. By convention I build my software into a dir called 'apps' in
788
801
my home directory. If you have the correct permissions you may want to build
@@ -811,9 +824,9 @@ version as required):
811
824
812
825
813
826
cmake -D CMAKE_INSTALL_PREFIX=${HOME}/apps/ \
814
- -D GRASS_INCLUDE_DIR=/Applications/GRASS-6.3 .app/Contents/MacOS/
827
+ -D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4 .app/Contents/MacOS/
815
828
include \
816
- -D GRASS_PREFIX=/Applications/GRASS-6.3 .app/Contents/MacOS \
829
+ -D GRASS_PREFIX=/Applications/GRASS-6.4 .app/Contents/MacOS \
817
830
-D CMAKE_BUILD_TYPE=Release \
818
831
..
819
832
@@ -824,16 +837,35 @@ path and version as required):
824
837
825
838
826
839
cmake -D CMAKE_INSTALL_PREFIX=${HOME}/apps/ \
827
- -D GRASS_INCLUDE_DIR=/user/local/grass-6.3 .0/include \
828
- -D GRASS_PREFIX=/user/local/grass-6.3 .0 \
840
+ -D GRASS_INCLUDE_DIR=/user/local/grass-6.4 .0/include \
841
+ -D GRASS_PREFIX=/user/local/grass-6.4 .0 \
829
842
-D CMAKE_BUILD_TYPE=Release \
830
843
..
831
844
832
845
846
+ 4.7.2. Configure the Xcode Build
847
+ =======================================
848
+
849
+ In the mac/xcode folder in the source, duplicate the 'qgis_user-template.xcconfig'
850
+ file and name it 'qgis_user.xcconfig'. A default build will use the KyngChaos
851
+ frameworks, Postgres, GRASS 6.4, the python.org Python 2.5 and extra dependencies
852
+ as described above, and compile for the build OSX version, so no extra configuration
853
+ is necessary. If building on Leopard, you may want to use the system Python, which
854
+ requires editing qgis_user.xcconfig.
855
+
856
+ See the mac/xcode/readme.rtf for details, if you need to customize the build.
857
+
858
+ The default build will also bundle the Qt frameworks, Postgres library, and
859
+ other dependency libraries to create a self-contained package. The KyngChaos
860
+ frameworks and GRASS application are not bundled.
861
+
833
862
834
863
4.8. Building
835
864
=============
836
865
866
+ 4.8.1 Building with Cmake
867
+ =========================
868
+
837
869
Now we can start the build process:
838
870
839
871
@@ -846,6 +878,15 @@ If all built without errors you can then install it:
846
878
make install
847
879
848
880
881
+ 4.8.2. Building with Xcode
882
+ ==========================
883
+
884
+ Open the xcode project file in Xcode. Select 'Release' build configuration
885
+ and the 'Full Qgis' target, then build.
886
+
887
+ The Qgis application will be found in the 'build/Release' folder in the xcode folder.
888
+ Copy this to whereever you like.
889
+
849
890
850
891
5. Building on GNU/Linux
851
892
========================
0 commit comments