11Quantum GIS (QGIS)
22Building QGIS from source - step by step
3- Wednesday April 04 , 2012
3+ Saturday April 07 , 2012
44
55
6- Last Updated: Wednesday April 04 , 2012
7- Last Change : Monday December 26, 2011
6+ Last Updated: Saturday April 07 , 2012
7+ Last Change : Saturday April 07, 2012
88
99
1010 1. Introduction
@@ -26,8 +26,8 @@ Last Change : Monday December 26, 2011
2626 5. Building on MacOS X
2727 5.1. Install Developer Tools
2828 5.2. Install Qt4 from disk image
29- 5.3. Install development frameworks for QGIS dependencies
30- 5.4. Install CMake for OSX
29+ 5.3. Install CMake for OSX
30+ 5.4. Install development frameworks for QGIS dependencies
3131 5.5. QGIS source
3232 5.6. Configure the build
3333 5.7. Building
@@ -1245,7 +1245,25 @@ may need some help by adding '-L/usr/local/lib' to CMAKE_SHARED_LINKER_FLAGS,
12451245CMAKE_MODULE_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS in the cmake build.
12461246
12471247
1248- 5.3. Install development frameworks for QGIS dependencies
1248+ 5.3. Install CMake for OSX
1249+ ==========================
1250+
1251+ Get the latest source release from here:
1252+
1253+ http://www.cmake.org/cmake/resources/software.html
1254+
1255+ Binary installers are available for OS X, but they are not recommended
1256+ (2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
1257+ strange application). Instead, download the source.
1258+ NOTE: 2.8.5 is broken for detecting part of Qt. Fixed in 2.8.6.
1259+ Double-click the source tarball, then cd to the source folder and:
1260+
1261+ ./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
1262+ make
1263+ sudo make install
1264+
1265+
1266+ 5.4. Install development frameworks for QGIS dependencies
12491267 =========================================================
12501268
12511269Download William Kyngesburye's excellent GDAL Complete package that includes
@@ -1271,7 +1289,7 @@ Old versions of these packages for older systems are available in the
12711289software archive section.
12721290
12731291
1274- 5.3 .1. Additional Dependencies: General compatibility note
1292+ 5.4 .1. Additional Dependencies: General compatibility note
12751293 ==========================================================
12761294
12771295There are some additional dependencies that, at the time of writing, are not
@@ -1286,7 +1304,7 @@ Stable release versions are preferred. Beta and other development versions may
12861304have problems and you are on your own with those.
12871305
12881306
1289- 5.3 .2. Additional Dependencies: Expat
1307+ 5.4 .2. Additional Dependencies: Expat
12901308 =====================================
12911309
12921310Snow Leopard+ note: Snow Leopard includes a usable expat, so this step is
@@ -1304,7 +1322,7 @@ source folder and:
13041322 sudo make install
13051323
13061324
1307- 5.3 .3. Additional Dependencies: Python
1325+ 5.4 .3. Additional Dependencies: Python
13081326 ======================================
13091327
13101328Leopard+ note: Starting with Leopard a usable Python is included
@@ -1321,7 +1339,7 @@ Python 3 is a major change, and may have compatibility issues, so try it at
13211339your own risk.
13221340
13231341
1324- 5.3 .4. Additional Dependencies: SIP
1342+ 5.4 .4. Additional Dependencies: SIP
13251343 ===================================
13261344
13271345Retrieve the python bindings toolkit SIP from
@@ -1380,7 +1398,7 @@ Then continue with compilation and installation:
13801398 sudo make install
13811399
13821400
1383- 5.3 .5. Additional Dependencies: PyQt
1401+ 5.4 .5. Additional Dependencies: PyQt
13841402 ====================================
13851403
13861404Retrieve the python bindings toolkit for Qt from
@@ -1435,7 +1453,7 @@ QtOpenGL/makefile and add -undefined dynamic_lookup to LFLAGS.
14351453Then make again.
14361454
14371455
1438- 5.3 .6. Additional Dependencies: Qwt
1456+ 5.4 .6. Additional Dependencies: Qwt
14391457 ===================================
14401458
14411459The GPS tracking feature uses Qwt.
@@ -1461,7 +1479,7 @@ The Qwt shared library is now installed in /usr/local/qwt-5.x.x (x.x is
14611479the minor.point version). Remember this for QGIS configuration.
14621480
14631481
1464- 5.3 .7. Additional Dependencies: Bison
1482+ 5.4 .7. Additional Dependencies: Bison
14651483 =====================================
14661484
14671485The version of bison available by default on Mac OS X is too old so you
@@ -1477,23 +1495,92 @@ tarball to unpack it, then cd to the source folder and:
14771495 sudo make install
14781496
14791497
1480- 5.4. Install CMake for OSX
1481- ==========================
1498+ 5.4.8. Additional Dependencies: OSG & osgEarth
1499+ ==================== ==========================
14821500
1483- Get the latest source release from here:
1501+ If you want the Globe plugin in QGIS (default OFF), OSG and osgEarth are needed.
14841502
1485- http://www.cmake.org/cmake/resources/software.html
1503+ First, OpenSceneGraph. The main site is:
14861504
1487- Binary installers are available for OS X, but they are not recommended
1488- (2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
1489- strange application). Instead, download the source.
1490- NOTE: 2.8.5 is broken for detecting part of Qt. Fixed in 2.8.6.
1491- Double-click the source tarball, then cd to the source folder and:
1505+ http://www.openscenegraph.org/
14921506
1493- ./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
1507+ Get the tarball (or zip) for the the latest 3.x version.
1508+ Binary availability is unknown at this time as the site is down.
1509+
1510+ Another place to get the source is github:
1511+
1512+ http://github.com/openscenegraph/osg/tags
1513+
1514+ Download the latest 3.1 version (you can select a tarball when you hover over
1515+ the entry). Double-click the source tarball to unpack it.
1516+ (There is a version numbering oddity in the source, but since we'll be
1517+ bundling OSG as it's meant to be, it really doesn't matter).
1518+
1519+ Installation is a bit out of touch with OS X standards, so we'll stage it to a
1520+ temporary location first. You could stage it to the folder that the OSG source
1521+ folder is in, or a common staging area like /Users/Shared/unix/osg. Pick a
1522+ folder not hidden and that doesn't need admin permissions to write to for simplicity.
1523+
1524+ In a new Terminal cd to the source folder and:
1525+
1526+ mkdir build
1527+ cd build
1528+ cmake -D CMAKE_INSTALL_PREFIX=/path/to/some/staging/folder \
1529+ -D OSG_COMPILE_FRAMEWORKS=ON \
1530+ -D OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS=OFF \
1531+ ..
1532+ make
1533+ make install
1534+ sudo mkdir -p "/Library/Application Support/OpenSceneGraph/PlugIns"
1535+
1536+ Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.
1537+
1538+ Now move all .frameworks from the lib/ folder in the staging area to /Library/Frameworks. Move the files in the osgPlugins folder in the lib/ folder
1539+ to /Library/Application Support/OpenSceneGraph/PlugIns. The bin/ executables
1540+ can be left where they are, we don't need them.
1541+
1542+ Next up is libzip. Get the latest tarball at:
1543+
1544+ http://nih.at/libzip/
1545+
1546+ Double-click the source tarball to unpack it.
1547+ In a new Terminal cd to the source folder and:
1548+
1549+ ./configure --disable-dependency-tracking --disable-shared CFLAGS=-Os
14941550 make
14951551 sudo make install
14961552
1553+ Then it's time for osgEarth. Downloads are also on github:
1554+
1555+ http://github.com/gwaldron/osgearth/tags
1556+
1557+ Download a tarball for the latest stable release (sorting can be confusing here).
1558+ Double-click the source tarball to unpack it.
1559+
1560+ This one also needs an intermediate staging area. Choose a folder similar to OSG.
1561+
1562+ In a new Terminal cd to the source folder and:
1563+
1564+ mkdir build
1565+ cd build
1566+ export PATH="/path/to/osg/staging/folder/bin:$PATH"
1567+ cmake -D CMAKE_INSTALL_PREFIX=/path/to/some/staging/folder \
1568+ -D CMAKE_BUILD_TYPE=MinSizeRel \
1569+ -D OSGEARTH_BUILD_FRAMEWORKS=true \
1570+ ..
1571+ make
1572+ make install
1573+ sudo mkdir -p "/Library/Application Support/OpenSceneGraph/Headers"
1574+
1575+ Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.
1576+ Also enter the OSG staging path /bin folder in the export above.
1577+
1578+ Move all the .frameworks from the lib/ folder to /Library/Frameworks.
1579+ Move the files in the osgPlugins folder in the lib/ folder to
1580+ /Library/Application Support/OpenSceneGraph/PlugIns. Move the osgEarthDrivers
1581+ folder in the include/ folder to /Library/Application Support/OpenSceneGraph/Headers. And as for OSG, you can leave the bin/
1582+ executables where they are.
1583+
14971584
14981585 5.5. QGIS source
14991586 ================
@@ -1527,8 +1614,8 @@ In a Terminal cd to the qgis source folder previously downloaded, then:
15271614 mkdir build
15281615 cd build
15291616 cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
1530- -D CMAKE_BUILD_TYPE=MinSizeRel \
1531- -D WITH_INTERNAL_SPATIALITE=FALSE \
1617+ -D CMAKE_BUILD_TYPE=MinSizeRel -D ENABLE_TESTS=FALSE \
1618+ -D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
15321619 -D QWT_LIBRARY=/usr/local/qwt-5.2.2/lib/libqwt.dylib \
15331620 -D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.2/include \
15341621 -D BISON_EXECUTABLE=/usr/local/bin/bison \
@@ -1549,8 +1636,8 @@ script and add arch flags to the configuration:
15491636 sudo chmod +x /usr/local/bin/python32
15501637
15511638 cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D \
1552- -D CMAKE_BUILD_TYPE=MinSizeRel \
1553- -D WITH_INTERNAL_SPATIALITE=FALSE \
1639+ -D CMAKE_BUILD_TYPE=MinSizeRel -D ENABLE_TESTS=FALSE \
1640+ -D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
15541641 -D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
15551642 -D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
15561643 -D BISON_EXECUTABLE=/usr/local/bin/bison \
@@ -1567,19 +1654,19 @@ the above configuration:
15671654On Lion you are on your own to figure out how to install libfcgi and add fcgi
15681655support to the system Apache. Not recommended for the average user.
15691656
1570- Bundling note: Older Qt versions may have problems with some Qt plugins and
1571- QGIS. The way to handle this is to bundle Qt inside the QGIS application. You
1572- can do this now or wait to see if there are immediate crashes when running QGIS.
1573- It's also a good idea to bundle Qt if you need to copy QGIS to other Macs (where
1574- you would have to install Xcode just so Qt would install!).
1657+ If you want the Globe plugin (and you compiled and installed OSG/osgEarth),
1658+ add the following lines before the last line in the above configuration:
15751659
1576- To bundle Qt, add the following line before the last line (the ".." line) in
1577- the above cmake configurations:
1660+ -D WITH_GLOBE=true \
1661+ -D OSGEARTH_INCLUDE_DIR="/Library/Application Support/OpenSceneGraph/Headers" \
1662+ -D OSG_PLUGINS_PATH="/Library/Application Support/OpenSceneGraph/PlugIns" \
15781663
1579- -D QGIS_MACAPP_BUNDLE=1 \
1664+ Bundling note: Older Qt versions may have problems with some Qt plugins and
1665+ QGIS. The way to handle this is to bundle Qt inside the QGIS application. The
1666+ default is to bundle Qt (and osg/osgEarth, if configured).
15801667
15811668Even better for distribution purposes, to also bundle any extra non-framework,
1582- non-standard, libs (ie postgres' libpq) bump the bundle number to 2:
1669+ non-standard, libs (ie postgres' libpq) set the bundle value to 2:
15831670
15841671 -D QGIS_MACAPP_BUNDLE=2 \
15851672
0 commit comments