Skip to content
Permalink
Browse files

update OSX build, add Xcode build

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10696 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
kyngchaos
kyngchaos committed May 2, 2009
1 parent 0d2ef1c commit 859e19f2c367be21b216e74a30251b56d8950f6f
Showing with 82 additions and 41 deletions.
  1. +82 −41 INSTALL
123 INSTALL
@@ -38,7 +38,11 @@ Building QGIS from source - step by step
4.5. Install subversion for OSX
4.6. Check out QGIS from SVN
4.7. Configure the build
4.7.1. Configure the Cmake build
4.7.2. Configure the Xcode Build
4.8. Building
4.8.1 Building with Cmake
4.8.2. Building with Xcode
5. Building on GNU/Linux
5.1. Building QGIS with Qt4.x
5.2. Prepare apt
@@ -473,15 +477,19 @@ the XCODE SDK (in particular if you are using XCODE 2.5 on tiger):
You need a minimum of Qt4.3.0. I suggest getting the latest (at time of writing).


ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.3.2.dmg
ftp://ftp.trolltech.com/qt/source/


If you want debug libs, Qt also provide a dmg with these:
Mac versions are named as:


ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-4.3.2-debug-libs.dmg
qt-mac-opensource-x.y.z.dmg


x, y, z being the major, minor and revision version.

If you want debug libs, Qt also provide a dmg with these.

I am going to proceed using only release libs at this stage as the download for
the debug dmg is substantially bigger. If you plan to do any debugging though
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:
First edit /Library/Frameworks/QtCore.framework/Headers/qconfig.h and
change

/!\ Note this doesnt seem to be needed since version 4.2.3
/!\ Note: this isn't needed since version 4.2.3.

QT_EDITION_Unknown to QT_EDITION_OPENSOURCE

@@ -504,6 +512,8 @@ Second change the default mkspec symlink so that it points to macx-g++:
sudo ln -sf macx-g++ default


/!\ Note: this doesn't seem to be needed since version 4.4.


4.3. Install development frameworks for QGIS dependencies
=========================================================
@@ -517,35 +527,38 @@ proj, gdal, sqlite3 etc

Once downloaded, open and install the frameworks.

William provides an additional installer package for Postgresql/PostGIS. Its
William provides an additional installer package for Postgresql/PostGIS. It's
available here:


http://www.kyngchaos.com/wiki/software:postgres


Also available is a GRASS application:


http://www.kyngchaos.com/wiki/software:grass


There are some additional dependencies that at the time of writing are not
provided as frameworks so we will need to build these from source.
provided as frameworks or installers so we will need to build these from source.


4.3.1. Additional Dependencies : GSL
====================================

Retrieve the Gnu Scientific Library from
Retrieve the current version of the Gnu Scientific Library from


curl -O ftp://ftp.gnu.org/gnu/gsl/gsl-1.8.tar.gz
ftp://ftp.gnu.org/gnu/gsl/


Then extract it and build it to a prefix of /usr/local:
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:


tar xvfz gsl-1.8.tar.gz
cd gsl-1.8
./configure --prefix=/usr/local
./configure
make
sudo make install
cd ..



@@ -558,13 +571,12 @@ Get the expat sources:
http://sourceforge.net/project/showfiles.php?group_id=10127


Double-click the source tarball to unpack, then cd to the source folder and:

tar xvfz expat-2.0.0.tar.gz
cd expat-2.0.0
./configure --prefix=/usr/local

./configure
make
sudo make install
cd ..



@@ -585,15 +597,12 @@ Retrieve the python bindings toolkit SIP from
http://www.riverbankcomputing.com/software/sip/download


Then extract and build it (this installs by default into the Python framework):
Double-click the source tarball to unpack it, then cd to the source folder and (this installs by default into the Python framework):


tar xvfz sip-<version number>.tar.gz
cd sip-<version number>
python configure.py
make
sudo make install
cd ..


Leopard notes
@@ -622,17 +631,14 @@ Retrieve the python bindings toolkit for Qt from
http://www.riverbankcomputing.com/software/pyqt/download


Then extract and build it (this installs by default into the Python framework):
Double-click the source tarball to unpack it, then cd to the source folder and (this installs by default into the Python framework):


tar xvfz PyQt-mac<version number here>
cd PyQt-mac<version number here>
export QTDIR=/Developer/Applications/Qt
python configure.py
yes
make
sudo make install
cd ..


Leopard notes
@@ -643,7 +649,7 @@ If building on Leopard, using Leopard's bundled Python, PyQt wants to install in
python configure.py -d /Library/Python/2.5/site-packages -b /usr/local/bin


There may be a problem with undefined symbols in QtOpenGL on Leopard. Edit QtOpenGL/makefile and add -undefined dynamic_lookup to LFLAGS.
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.


4.3.5. Additional Dependencies : Bison
@@ -652,21 +658,18 @@ There may be a problem with undefined symbols in QtOpenGL on Leopard. Edit QtOp
Leopard note: Leopard includes Bison 2.3, so this step can be skipped on Leopard.

The version of bison available by default on Mac OSX is too old so you need to
get a more recent one on your system. Download if from:
get a more recent one on your system. Download at least version 2.3 from:


curl -O http://ftp.gnu.org/gnu/bison/bison-2.3.tar.gz
ftp://ftp.gnu.org/gnu/bison/


Now build and install it to a prefix of /usr/local :
Now build and install it to a prefix of /usr/local. Double-click the source tarball, then cd to the source folder and:


tar xvfz bison-2.3.tar.gz
cd bison-2.3
./configure --prefix=/usr/local
make
sudo make install
cd ..



@@ -676,16 +679,16 @@ Now build and install it to a prefix of /usr/local :
Get the latest release from here:


http://www.cmake.org/HTML/Download.html

http://www.cmake.org/cmake/resources/software.html

At the time of writing the file I grabbed was:

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:

curl -O http://www.cmake.org/files/v2.4/cmake-2.4.6-Darwin-universal.dmg

./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
make
sudo make install

Once downloaded open the dmg and run the installer


4.5. Install subversion for OSX
@@ -783,6 +786,16 @@ I suggest you press 'p' to accept the key permanently.
4.7. Configure the build
========================

There are 2 different methods to build QGIS. The traditional Cmake method,
and the new Xcode project (starting with QGIS 1.1). The Xcode project has
additional bundling steps, though some optional QGIS features are required due
to limited conditional compilation. The Cmake build handles optional features,
and some bundling steps are available with scripts in the mac directory.


4.7.1. Configure the Cmake build
================================

CMake supports out of source build so we will create a 'build' dir for the
build process. By convention I build my software into a dir called 'apps' in
my home directory. If you have the correct permissions you may want to build
@@ -811,9 +824,9 @@ version as required):


cmake -D CMAKE_INSTALL_PREFIX=${HOME}/apps/ \
-D GRASS_INCLUDE_DIR=/Applications/GRASS-6.3.app/Contents/MacOS/
-D GRASS_INCLUDE_DIR=/Applications/GRASS-6.4.app/Contents/MacOS/
include \
-D GRASS_PREFIX=/Applications/GRASS-6.3.app/Contents/MacOS \
-D GRASS_PREFIX=/Applications/GRASS-6.4.app/Contents/MacOS \
-D CMAKE_BUILD_TYPE=Release \
..

@@ -824,16 +837,35 @@ path and version as required):


cmake -D CMAKE_INSTALL_PREFIX=${HOME}/apps/ \
-D GRASS_INCLUDE_DIR=/user/local/grass-6.3.0/include \
-D GRASS_PREFIX=/user/local/grass-6.3.0 \
-D GRASS_INCLUDE_DIR=/user/local/grass-6.4.0/include \
-D GRASS_PREFIX=/user/local/grass-6.4.0 \
-D CMAKE_BUILD_TYPE=Release \
..


4.7.2. Configure the Xcode Build
=======================================

In the mac/xcode folder in the source, duplicate the 'qgis_user-template.xcconfig'
file and name it 'qgis_user.xcconfig'. A default build will use the KyngChaos
frameworks, Postgres, GRASS 6.4, the python.org Python 2.5 and extra dependencies
as described above, and compile for the build OSX version, so no extra configuration
is necessary. If building on Leopard, you may want to use the system Python, which
requires editing qgis_user.xcconfig.

See the mac/xcode/readme.rtf for details, if you need to customize the build.

The default build will also bundle the Qt frameworks, Postgres library, and
other dependency libraries to create a self-contained package. The KyngChaos
frameworks and GRASS application are not bundled.


4.8. Building
=============

4.8.1 Building with Cmake
=========================

Now we can start the build process:


@@ -846,6 +878,15 @@ If all built without errors you can then install it:
make install


4.8.2. Building with Xcode
==========================

Open the xcode project file in Xcode. Select 'Release' build configuration
and the 'Full Qgis' target, then build.

The Qgis application will be found in the 'build/Release' folder in the xcode folder.
Copy this to whereever you like.


5. Building on GNU/Linux
========================

0 comments on commit 859e19f

Please sign in to comment.
You can’t perform that action at this time.