80
80
< DIV CLASS ="header " ID ="header ">
81
81
< H1 > Quantum GIS (QGIS)</ H1 >
82
82
< H2 > Building QGIS from source - step by step</ H2 >
83
- < H3 > Wednesday April 04 , 2012</ H3 >
83
+ < H3 > Saturday April 07 , 2012</ H3 >
84
84
</ DIV >
85
85
86
86
< DIV CLASS ="body " ID ="body ">
87
87
< P >
88
- Last Updated: Wednesday April 04 , 2012
89
- Last Change : Monday December 26, 2011
88
+ Last Updated: Saturday April 07 , 2012
89
+ Last Change : Saturday April 07, 2012
90
90
</ P >
91
91
< DIV CLASS ="toc ">
92
92
@@ -115,8 +115,8 @@ <H3>Wednesday April 04, 2012</H3>
115
115
< UL >
116
116
< LI > < A HREF ="#toc18 "> 5.1. Install Developer Tools</ A >
117
117
< LI > < A HREF ="#toc19 "> 5.2. Install Qt4 from disk image</ A >
118
- < LI > < A HREF ="#toc20 "> 5.3. Install development frameworks for QGIS dependencies </ A >
119
- < LI > < A HREF ="#toc21 "> 5.4. Install CMake for OSX </ A >
118
+ < LI > < A HREF ="#toc20 "> 5.3. Install CMake for OSX </ A >
119
+ < LI > < A HREF ="#toc21 "> 5.4. Install development frameworks for QGIS dependencies </ A >
120
120
< LI > < A HREF ="#toc22 "> 5.5. QGIS source</ A >
121
121
< LI > < A HREF ="#toc23 "> 5.6. Configure the build</ A >
122
122
< LI > < A HREF ="#toc24 "> 5.7. Building</ A >
@@ -1775,7 +1775,30 @@ <H2>5.2. Install Qt4 from disk image</H2>
1775
1775
</ P >
1776
1776
1777
1777
< A NAME ="toc20 "> </ A >
1778
- < H2 > 5.3. Install development frameworks for QGIS dependencies</ H2 >
1778
+ < H2 > 5.3. Install CMake for OSX</ H2 >
1779
+
1780
+ < P >
1781
+ Get the latest source release from here:
1782
+ </ P >
1783
+ < P >
1784
+ < A HREF ="http://www.cmake.org/cmake/resources/software.html "> http://www.cmake.org/cmake/resources/software.html</ A >
1785
+ </ P >
1786
+ < P >
1787
+ Binary installers are available for OS X, but they are not recommended
1788
+ (2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
1789
+ strange application). Instead, download the source.
1790
+ NOTE: 2.8.5 is broken for detecting part of Qt. Fixed in 2.8.6.
1791
+ Double-click the source tarball, then cd to the source folder and:
1792
+ </ P >
1793
+
1794
+ < div class ="code "> < PRE >
1795
+ ./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
1796
+ make
1797
+ sudo make install
1798
+ </ PRE > </ div >
1799
+
1800
+ < A NAME ="toc21 "> </ A >
1801
+ < H2 > 5.4. Install development frameworks for QGIS dependencies</ H2 >
1779
1802
1780
1803
< P >
1781
1804
Download William Kyngesburye's excellent GDAL Complete package that includes
@@ -1808,7 +1831,7 @@ <H2>5.3. Install development frameworks for QGIS dependencies</H2>
1808
1831
software archive section.
1809
1832
</ P >
1810
1833
1811
- < H3 > 5.3 .1. Additional Dependencies: General compatibility note</ H3 >
1834
+ < H3 > 5.4 .1. Additional Dependencies: General compatibility note</ H3 >
1812
1835
1813
1836
< P >
1814
1837
There are some additional dependencies that, at the time of writing, are not
@@ -1824,7 +1847,7 @@ <H3>5.3.1. Additional Dependencies: General compatibility note</H3>
1824
1847
have problems and you are on your own with those.
1825
1848
</ P >
1826
1849
1827
- < H3 > 5.3 .2. Additional Dependencies: Expat</ H3 >
1850
+ < H3 > 5.4 .2. Additional Dependencies: Expat</ H3 >
1828
1851
1829
1852
< P >
1830
1853
< U > Snow Leopard+ note:</ U > Snow Leopard includes a usable expat, so this step is
@@ -1847,7 +1870,7 @@ <H3>5.3.2. Additional Dependencies: Expat</H3>
1847
1870
sudo make install
1848
1871
</ PRE > </ div >
1849
1872
1850
- < H3 > 5.3 .3. Additional Dependencies: Python</ H3 >
1873
+ < H3 > 5.4 .3. Additional Dependencies: Python</ H3 >
1851
1874
1852
1875
< P >
1853
1876
< U > Leopard+ note:</ U > Starting with Leopard a usable Python is included
@@ -1867,7 +1890,7 @@ <H3>5.3.3. Additional Dependencies: Python</H3>
1867
1890
your own risk.
1868
1891
</ P >
1869
1892
1870
- < H3 > 5.3 .4. Additional Dependencies: SIP</ H3 >
1893
+ < H3 > 5.4 .4. Additional Dependencies: SIP</ H3 >
1871
1894
1872
1895
< P >
1873
1896
Retrieve the python bindings toolkit SIP from
@@ -1956,7 +1979,7 @@ <H3>5.3.4. Additional Dependencies: SIP</H3>
1956
1979
sudo make install
1957
1980
</ PRE > </ div >
1958
1981
1959
- < H3 > 5.3 .5. Additional Dependencies: PyQt</ H3 >
1982
+ < H3 > 5.4 .5. Additional Dependencies: PyQt</ H3 >
1960
1983
1961
1984
< P >
1962
1985
Retrieve the python bindings toolkit for Qt from
@@ -2042,7 +2065,7 @@ <H3>5.3.5. Additional Dependencies: PyQt</H3>
2042
2065
Then make again.
2043
2066
</ P >
2044
2067
2045
- < H3 > 5.3 .6. Additional Dependencies: Qwt</ H3 >
2068
+ < H3 > 5.4 .6. Additional Dependencies: Qwt</ H3 >
2046
2069
2047
2070
< P >
2048
2071
The GPS tracking feature uses Qwt.
@@ -2077,7 +2100,7 @@ <H3>5.3.6. Additional Dependencies: Qwt</H3>
2077
2100
the minor.point version). Remember this for QGIS configuration.
2078
2101
</ P >
2079
2102
2080
- < H3 > 5.3 .7. Additional Dependencies: Bison</ H3 >
2103
+ < H3 > 5.4 .7. Additional Dependencies: Bison</ H3 >
2081
2104
2082
2105
< P >
2083
2106
The version of bison available by default on Mac OS X is too old so you
@@ -2099,29 +2122,122 @@ <H3>5.3.7. Additional Dependencies: Bison</H3>
2099
2122
sudo make install
2100
2123
</ PRE > </ div >
2101
2124
2102
- < A NAME ="toc21 "> </ A >
2103
- < H2 > 5.4. Install CMake for OSX</ H2 >
2125
+ < H3 > 5.4.8. Additional Dependencies: OSG & osgEarth</ H3 >
2104
2126
2105
2127
< P >
2106
- Get the latest source release from here:
2128
+ If you want the Globe plugin in QGIS (default OFF), OSG and osgEarth are needed.
2107
2129
</ P >
2108
2130
< P >
2109
- < A HREF =" http://www.cmake.org/cmake/resources/software.html " > http://www.cmake.org/cmake/resources/software.html </ A >
2131
+ First, < B > OpenSceneGraph </ B > . The main site is:
2110
2132
</ P >
2111
2133
< P >
2112
- Binary installers are available for OS X, but they are not recommended
2113
- (2.4 versions install in /usr instead of /usr/local, and 2.6+ versions are a
2114
- strange application). Instead, download the source.
2115
- NOTE: 2.8.5 is broken for detecting part of Qt. Fixed in 2.8.6.
2116
- Double-click the source tarball, then cd to the source folder and:
2134
+ < A HREF ="http://www.openscenegraph.org/ "> http://www.openscenegraph.org/</ A >
2135
+ </ P >
2136
+ < P >
2137
+ Get the tarball (or zip) for the the latest 3.x version.
2138
+ Binary availability is unknown at this time as the site is down.
2139
+ </ P >
2140
+ < P >
2141
+ Another place to get the source is github:
2142
+ </ P >
2143
+ < P >
2144
+ < A HREF ="http://github.com/openscenegraph/osg/tags "> http://github.com/openscenegraph/osg/tags</ A >
2145
+ </ P >
2146
+ < P >
2147
+ Download the latest 3.1 version (you can select a tarball when you hover over
2148
+ the entry). Double-click the source tarball to unpack it.
2149
+ (There is a version numbering oddity in the source, but since we'll be
2150
+ bundling OSG as it's meant to be, it really doesn't matter).
2151
+ </ P >
2152
+ < P >
2153
+ Installation is a bit out of touch with OS X standards, so we'll stage it to a
2154
+ temporary location first. You could stage it to the folder that the OSG source
2155
+ folder is in, or a common staging area like /Users/Shared/unix/osg. Pick a
2156
+ folder not hidden and that doesn't need admin permissions to write to for simplicity.
2157
+ </ P >
2158
+ < P >
2159
+ In a new Terminal cd to the source folder and:
2117
2160
</ P >
2118
2161
2119
2162
< div class ="code "> < PRE >
2120
- ./bootstrap --docdir=/share/doc/CMake --mandir=/share/man
2163
+ mkdir build
2164
+ cd build
2165
+ cmake -D CMAKE_INSTALL_PREFIX=/path/to/some/staging/folder \
2166
+ -D OSG_COMPILE_FRAMEWORKS=ON \
2167
+ -D OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS=OFF \
2168
+ ..
2169
+ make
2170
+ make install
2171
+ sudo mkdir -p "/Library/Application Support/OpenSceneGraph/PlugIns"
2172
+ </ PRE > </ div >
2173
+
2174
+ < P >
2175
+ Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.
2176
+ </ P >
2177
+ < P >
2178
+ 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
2179
+ to /Library/Application Support/OpenSceneGraph/PlugIns. The bin/ executables
2180
+ can be left where they are, we don't need them.
2181
+ </ P >
2182
+ < P >
2183
+ Next up is < B > libzip</ B > . Get the latest tarball at:
2184
+ </ P >
2185
+ < P >
2186
+ < A HREF ="http://nih.at/libzip/ "> http://nih.at/libzip/</ A >
2187
+ </ P >
2188
+ < P >
2189
+ Double-click the source tarball to unpack it.
2190
+ In a new Terminal cd to the source folder and:
2191
+ </ P >
2192
+
2193
+ < div class ="code "> < PRE >
2194
+ ./configure --disable-dependency-tracking --disable-shared CFLAGS=-Os
2121
2195
make
2122
2196
sudo make install
2123
2197
</ PRE > </ div >
2124
2198
2199
+ < P >
2200
+ Then it's time for < B > osgEarth</ B > . Downloads are also on github:
2201
+ </ P >
2202
+ < P >
2203
+ < A HREF ="http://github.com/gwaldron/osgearth/tags "> http://github.com/gwaldron/osgearth/tags</ A >
2204
+ </ P >
2205
+ < P >
2206
+ Download a tarball for the latest stable release (sorting can be confusing here).
2207
+ Double-click the source tarball to unpack it.
2208
+ </ P >
2209
+ < P >
2210
+ This one also needs an intermediate staging area. Choose a folder similar to OSG.
2211
+ </ P >
2212
+ < P >
2213
+ In a new Terminal cd to the source folder and:
2214
+ </ P >
2215
+
2216
+ < div class ="code "> < PRE >
2217
+ mkdir build
2218
+ cd build
2219
+ export PATH="/path/to/osg/staging/folder/bin:$PATH"
2220
+ cmake -D CMAKE_INSTALL_PREFIX=/path/to/some/staging/folder \
2221
+ -D CMAKE_BUILD_TYPE=MinSizeRel \
2222
+ -D OSGEARTH_BUILD_FRAMEWORKS=true \
2223
+ ..
2224
+ make
2225
+ make install
2226
+ sudo mkdir -p "/Library/Application Support/OpenSceneGraph/Headers"
2227
+ </ PRE > </ div >
2228
+
2229
+ < P >
2230
+ Enter the staging path you chose for the CMAKE_INSTALL_PREFIX option above.
2231
+ Also enter the OSG staging path /bin folder in the export above.
2232
+ </ P >
2233
+ < P >
2234
+ Move all the .frameworks from the lib/ folder to /Library/Frameworks.
2235
+ Move the files in the osgPlugins folder in the lib/ folder to
2236
+ /Library/Application Support/OpenSceneGraph/PlugIns. Move the osgEarthDrivers
2237
+ folder in the include/ folder to /Library/Application Support/OpenSceneGraph/Headers. And as for OSG, you can leave the bin/
2238
+ executables where they are.
2239
+ </ P >
2240
+
2125
2241
< A NAME ="toc22 "> </ A >
2126
2242
< H2 > 5.5. QGIS source</ H2 >
2127
2243
@@ -2162,8 +2278,8 @@ <H2>5.6. Configure the build</H2>
2162
2278
mkdir build
2163
2279
cd build
2164
2280
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
2165
- -D CMAKE_BUILD_TYPE=MinSizeRel \
2166
- -D WITH_INTERNAL_SPATIALITE=FALSE \
2281
+ -D CMAKE_BUILD_TYPE=MinSizeRel -D ENABLE_TESTS=FALSE \
2282
+ -D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
2167
2283
-D QWT_LIBRARY=/usr/local/qwt-5.2.2/lib/libqwt.dylib \
2168
2284
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.2/include \
2169
2285
-D BISON_EXECUTABLE=/usr/local/bin/bison \
@@ -2189,8 +2305,8 @@ <H2>5.6. Configure the build</H2>
2189
2305
sudo chmod +x /usr/local/bin/python32
2190
2306
2191
2307
cmake -D CMAKE_INSTALL_PREFIX=~/Applications -D \
2192
- -D CMAKE_BUILD_TYPE=MinSizeRel \
2193
- -D WITH_INTERNAL_SPATIALITE=FALSE \
2308
+ -D CMAKE_BUILD_TYPE=MinSizeRel -D ENABLE_TESTS=FALSE \
2309
+ -D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
2194
2310
-D QWT_LIBRARY=/usr/local/qwt-5.2.1-svn/lib/libqwt.dylib \
2195
2311
-D QWT_INCLUDE_DIR=/usr/local/qwt-5.2.1-svn/include \
2196
2312
-D BISON_EXECUTABLE=/usr/local/bin/bison \
@@ -2199,7 +2315,7 @@ <H2>5.6. Configure the build</H2>
2199
2315
</ PRE > </ div >
2200
2316
2201
2317
< P >
2202
- The QGIS Mapserver feature requires fastcgi support. This is included in
2318
+ The QGIS < B > Mapserver</ B > feature requires fastcgi support. This is included in
2203
2319
Leopard and Snow Leopard, but was dropped at Lion. To build the Mapserver
2204
2320
component on Leopard and Snow, add the followling line before the last line in
2205
2321
the above configuration:
@@ -2214,24 +2330,24 @@ <H2>5.6. Configure the build</H2>
2214
2330
support to the system Apache. Not recommended for the average user.
2215
2331
</ P >
2216
2332
< P >
2217
- < U > Bundling note:</ U > Older Qt versions may have problems with some Qt plugins and
2218
- QGIS. The way to handle this is to bundle Qt inside the QGIS application. You
2219
- can do this now or wait to see if there are immediate crashes when running QGIS.
2220
- It's also a good idea to bundle Qt if you need to copy QGIS to other Macs (where
2221
- you would have to install Xcode just so Qt would install!).
2222
- </ P >
2223
- < P >
2224
- To bundle Qt, add the following line before the last line (the ".." line) in
2225
- the above cmake configurations:
2333
+ If you want the < B > Globe</ B > plugin (and you compiled and installed OSG/osgEarth),
2334
+ add the following lines before the last line in the above configuration:
2226
2335
</ P >
2227
2336
2228
2337
< div class ="code "> < PRE >
2229
- -D QGIS_MACAPP_BUNDLE=1 \
2338
+ -D WITH_GLOBE=true \
2339
+ -D OSGEARTH_INCLUDE_DIR="/Library/Application Support/OpenSceneGraph/Headers" \
2340
+ -D OSG_PLUGINS_PATH="/Library/Application Support/OpenSceneGraph/PlugIns" \
2230
2341
</ PRE > </ div >
2231
2342
2343
+ < P >
2344
+ < U > Bundling note:</ U > Older Qt versions may have problems with some Qt plugins and
2345
+ QGIS. The way to handle this is to bundle Qt inside the QGIS application. The
2346
+ default is to bundle Qt (and osg/osgEarth, if configured).
2347
+ </ P >
2232
2348
< P >
2233
2349
Even better for distribution purposes, to also bundle any extra non-framework,
2234
- non-standard, libs (ie postgres' libpq) bump the bundle number to 2:
2350
+ non-standard, libs (ie postgres' libpq) set the bundle value to 2:
2235
2351
</ P >
2236
2352
2237
2353
< div class ="code "> < PRE >
0 commit comments