@@ -38,7 +38,11 @@ Building QGIS from source - step by step
3838 4.5. Install subversion for OSX
3939 4.6. Check out QGIS from SVN
4040 4.7. Configure the build
41+ 4.7.1. Configure the Cmake build
42+ 4.7.2. Configure the Xcode Build
4143 4.8. Building
44+ 4.8.1 Building with Cmake
45+ 4.8.2. Building with Xcode
4246 5. Building on GNU/Linux
4347 5.1. Building QGIS with Qt4.x
4448 5.2. Prepare apt
@@ -473,15 +477,19 @@ the XCODE SDK (in particular if you are using XCODE 2.5 on tiger):
473477You need a minimum of Qt4.3.0. I suggest getting the latest (at time of writing).
474478
475479
476- ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.3.2.dmg
480+ ftp://ftp.trolltech.com/qt/source/
477481
478482
479- If you want debug libs, Qt also provide a dmg with these :
483+ Mac versions are named as :
480484
481485
482- ftp://ftp.trolltech.com/qt/source/qt -mac-opensource-4.3.2-debug-libs .dmg
486+ qt -mac-opensource-x.y.z .dmg
483487
484488
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+
485493I am going to proceed using only release libs at this stage as the download for
486494the debug dmg is substantially bigger. If you plan to do any debugging though
487495you 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:
492500First edit /Library/Frameworks/QtCore.framework/Headers/qconfig.h and
493501change
494502
495- /!\ Note this doesnt seem to be needed since version 4.2.3
503+ /!\ Note: this isn't needed since version 4.2.3.
496504
497505QT_EDITION_Unknown to QT_EDITION_OPENSOURCE
498506
@@ -504,6 +512,8 @@ Second change the default mkspec symlink so that it points to macx-g++:
504512 sudo ln -sf macx-g++ default
505513
506514
515+ /!\ Note: this doesn't seem to be needed since version 4.4.
516+
507517
508518 4.3. Install development frameworks for QGIS dependencies
509519 =========================================================
@@ -517,35 +527,38 @@ proj, gdal, sqlite3 etc
517527
518528Once downloaded, open and install the frameworks.
519529
520- William provides an additional installer package for Postgresql/PostGIS. Its
530+ William provides an additional installer package for Postgresql/PostGIS. It's
521531available here:
522532
523533
524534 http://www.kyngchaos.com/wiki/software:postgres
525535
526536
537+ Also available is a GRASS application:
538+
539+
540+ http://www.kyngchaos.com/wiki/software:grass
541+
542+
527543There 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.
529545
530546
531547 4.3.1. Additional Dependencies : GSL
532548 ====================================
533549
534- Retrieve the Gnu Scientific Library from
550+ Retrieve the current version of the Gnu Scientific Library from
535551
536552
537- curl -O ftp://ftp.gnu.org/gnu/gsl/gsl-1.8.tar.gz
553+ ftp://ftp.gnu.org/gnu/gsl/
538554
539555
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 :
541557
542558
543- tar xvfz gsl-1.8.tar.gz
544- cd gsl-1.8
545- ./configure --prefix=/usr/local
559+ ./configure
546560 make
547561 sudo make install
548- cd ..
549562
550563
551564
@@ -558,13 +571,12 @@ Get the expat sources:
558571 http://sourceforge.net/project/showfiles.php?group_id=10127
559572
560573
574+ Double-click the source tarball to unpack, then cd to the source folder and:
561575
562- tar xvfz expat-2.0.0.tar.gz
563- cd expat-2.0.0
564- ./configure --prefix=/usr/local
576+
577+ ./configure
565578 make
566579 sudo make install
567- cd ..
568580
569581
570582
@@ -585,15 +597,12 @@ Retrieve the python bindings toolkit SIP from
585597 http://www.riverbankcomputing.com/software/sip/download
586598
587599
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):
589601
590602
591- tar xvfz sip-<version number>.tar.gz
592- cd sip-<version number>
593603 python configure.py
594604 make
595605 sudo make install
596- cd ..
597606
598607
599608Leopard notes
@@ -622,17 +631,14 @@ Retrieve the python bindings toolkit for Qt from
622631 http://www.riverbankcomputing.com/software/pyqt/download
623632
624633
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):
626635
627636
628- tar xvfz PyQt-mac<version number here>
629- cd PyQt-mac<version number here>
630637 export QTDIR=/Developer/Applications/Qt
631638 python configure.py
632639 yes
633640 make
634641 sudo make install
635- cd ..
636642
637643
638644Leopard notes
@@ -643,7 +649,7 @@ If building on Leopard, using Leopard's bundled Python, PyQt wants to install in
643649 python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin
644650
645651
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 .
647653
648654
649655 4.3.5. Additional Dependencies : Bison
@@ -652,21 +658,18 @@ There may be a problem with undefined symbols in QtOpenGL on Leopard. Edit QtOp
652658Leopard note: Leopard includes Bison 2.3, so this step can be skipped on Leopard.
653659
654660The 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:
656662
657663
658- curl -O http ://ftp.gnu.org/gnu/bison/bison-2.3.tar.gz
664+ ftp ://ftp.gnu.org/gnu/bison/
659665
660666
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 :
662668
663669
664- tar xvfz bison-2.3.tar.gz
665- cd bison-2.3
666670 ./configure --prefix=/usr/local
667671 make
668672 sudo make install
669- cd ..
670673
671674
672675
@@ -676,16 +679,16 @@ Now build and install it to a prefix of /usr/local :
676679Get the latest release from here:
677680
678681
679- http://www.cmake.org/HTML/Download.html
680-
682+ http://www.cmake.org/cmake/resources/software.html
681683
682- At the time of writing the file I grabbed was:
683684
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:
684686
685- curl -O http://www.cmake.org/files/v2.4/cmake-2.4.6-Darwin-universal.dmg
686687
688+ ./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
689+ make
690+ sudo make install
687691
688- Once downloaded open the dmg and run the installer
689692
690693
691694 4.5. Install subversion for OSX
@@ -783,6 +786,16 @@ I suggest you press 'p' to accept the key permanently.
783786 4.7. Configure the build
784787 ========================
785788
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+
786799CMake supports out of source build so we will create a 'build' dir for the
787800build process. By convention I build my software into a dir called 'apps' in
788801my home directory. If you have the correct permissions you may want to build
@@ -811,9 +824,9 @@ version as required):
811824
812825
813826 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/
815828 include \
816- -D GRASS_PREFIX=/Applications/GRASS-6.3 .app/Contents/MacOS \
829+ -D GRASS_PREFIX=/Applications/GRASS-6.4 .app/Contents/MacOS \
817830 -D CMAKE_BUILD_TYPE=Release \
818831 ..
819832
@@ -824,16 +837,35 @@ path and version as required):
824837
825838
826839 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 \
829842 -D CMAKE_BUILD_TYPE=Release \
830843 ..
831844
832845
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+
833862
834863 4.8. Building
835864 =============
836865
866+ 4.8.1 Building with Cmake
867+ =========================
868+
837869Now we can start the build process:
838870
839871
@@ -846,6 +878,15 @@ If all built without errors you can then install it:
846878 make install
847879
848880
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+
849890
850891 5. Building on GNU/Linux
851892 ========================
0 commit comments