Skip to content

Commit 94b5f99

Browse files
committed
Merge remote branch 'pb/master' into network-analysis
Conflicts: python/CMakeLists.txt src/analysis/network/qgsgraphbuilder.h src/plugins/roadgraph/graphbuilder.h src/plugins/roadgraph/linevectorlayerdirector.cpp src/plugins/roadgraph/simplegraphbuilder.cpp src/plugins/roadgraph/utils.cpp src/plugins/roadgraph/utils.h
2 parents af91b48 + 224f0e3 commit 94b5f99

File tree

1,024 files changed

+101239
-24038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,024 files changed

+101239
-24038
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ debian/*.substvars
1212
Makefile
1313
*-stamp
1414
api_doc
15-
build
15+
build*
1616
ms-windows/Installer-Files/postinstall.bat
1717
ms-windows/Installer-Files/preremove.bat
1818
ms-windows/osgeo4w/packages/
@@ -37,3 +37,5 @@ scripts/astyle.exe
3737
doc/CODING.html
3838
doc/CODING.tex
3939
doc/INSTALL.tex
40+
scripts/Debug
41+
scripts/RelWithDebInfo

CHANGELOG

+2,123
Large diffs are not rendered by default.

CMakeLists.txt

+39-10
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ MESSAGE(STATUS "Quantum GIS version: ${COMPLETE_VERSION} ${RELEASE_NAME} (${QGIS
1818
#############################################################
1919
# CMake settings
2020

21-
# 2.6 required for QtWebkit
22-
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
21+
# 2.6.2 required for VERSION_LESS
22+
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2)
2323

2424
SET(CMAKE_COLOR_MAKEFILE ON)
2525

@@ -76,6 +76,12 @@ IF (WITH_BINDINGS)
7676
SET (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global python directory? (might need root)")
7777
ENDIF (WITH_BINDINGS)
7878

79+
SET (WITH_GLOBE FALSE CACHE BOOL "Determines whether Globe plugin should be built")
80+
IF (WITH_GLOBE)
81+
SET(QT_USE_QTOPENGL 1)
82+
FIND_PACKAGE(OSGEARTH REQUIRED)
83+
ENDIF (WITH_GLOBE)
84+
7985
# Compile flag. Make it possible to turn it off.
8086
SET (PEDANTIC TRUE CACHE BOOL "Determines if we should compile in pedantic mode.")
8187

@@ -213,7 +219,7 @@ IF (PEDANTIC)
213219
ADD_DEFINITIONS( /wd4610 ) # user defined constructor required (sqlite3_index_info)
214220
ADD_DEFINITIONS( /wd4706 ) # assignment within conditional expression (pal)
215221
ELSE (MSVC)
216-
ADD_DEFINITIONS( -Wall -Wno-long-long -Wformat-security -Wno-strict-aliasing )
222+
ADD_DEFINITIONS( -Wall -Wextra -Wredundant-decls -Wno-long-long -Wformat-security -Wno-strict-aliasing )
217223
# Qt produces lots of warnings with strict aliasing (as of Qt 4.4.0 & GCC 4.3)
218224
# ADD_DEFINITIONS( -fstrict-aliasing -Wstrict-aliasing=1 )
219225
ENDIF (MSVC)
@@ -269,16 +275,20 @@ ELSE (WIN32)
269275

270276
IF (APPLE)
271277
# for Mac OS X, everything is put inside an application bundle
278+
# save the root install prefix for the app later
279+
SET (QGIS_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
272280
SET (QGIS_MACAPP_PREFIX ${CMAKE_INSTALL_PREFIX}/${QGIS_APP_NAME}.app/Contents)
281+
# common prefix for components, let cmake handle it
273282
SET (CMAKE_INSTALL_PREFIX ${QGIS_MACAPP_PREFIX}/MacOS)
274-
# path for library references
275-
SET (CMAKE_INSTALL_NAME_DIR @executable_path/lib)
276283
# 4 bundling levels, each includes previous
277284
# 0 nothing
278285
# 1 Qt frameworks
279286
# 2 non-system libraries, "standard"
280287
# 3 non-system frameworks, "standalone"
281-
SET (QGIS_MACAPP_BUNDLE 0 CACHE STRING "What to bundle into app package")
288+
SET (QGIS_MACAPP_BUNDLE 1 CACHE STRING "What to bundle into app package")
289+
SET (QGIS_MACAPP_BUNDLE_USER "" CACHE STRING "Path to user bundling script")
290+
SET (QGIS_MACAPP_INSTALL_DEV FALSE CACHE BOOL "Install developer frameworks")
291+
SET (QGIS_MACAPP_DEV_PREFIX "/Library/Frameworks" CACHE STRING "Path to install developer frameworks")
282292
# if we have @loader_path, >=OSX 10.5 (darwin 9+)
283293
IF (CMAKE_SYSTEM_VERSION VERSION_GREATER 9.0.0 OR CMAKE_SYSTEM_VERSION VERSION_EQUAL 9.0.0)
284294
SET (OSX_HAVE_LOADERPATH 1)
@@ -303,6 +313,8 @@ ELSE (WIN32)
303313
SET (DEFAULT_PLUGIN_SUBDIR ../PlugIns/qgis)
304314
SET (QGIS_PLUGIN_SUBDIR_REV ../../MacOS)
305315
SET (DEFAULT_INCLUDE_SUBDIR include/qgis)
316+
# path for framework references
317+
SET (CMAKE_INSTALL_NAME_DIR @executable_path/${QGIS_FW_SUBDIR})
306318

307319
ELSE (APPLE)
308320
# UNIX
@@ -366,13 +378,23 @@ SET (QGIS_DATA_DIR ${QGIS_DATA_SUBDIR})
366378
SET (QGIS_PLUGIN_DIR ${QGIS_PLUGIN_SUBDIR})
367379
SET (QGIS_INCLUDE_DIR ${QGIS_INCLUDE_SUBDIR})
368380

381+
# set the default locations where the targets (executables, libraries) will land when compiled
382+
# this is to allow running qgis from the source tree without having to actually do a "make install"
383+
SET (QGIS_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
384+
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_BIN_SUBDIR})
385+
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_LIB_SUBDIR})
386+
387+
# write a marker with source directory path into the output's bin directory
388+
# if run from the build directory QGIS will detect it and alter the paths
389+
FILE(WRITE ${QGIS_OUTPUT_DIRECTORY}/${QGIS_BIN_SUBDIR}/source_path.txt "${CMAKE_SOURCE_DIR}")
390+
369391
# manual page - makes sense only on unix systems
370-
IF (UNIX)
392+
IF (UNIX AND NOT APPLE)
371393
SET (DEFAULT_MANUAL_SUBDIR man)
372394
SET (QGIS_MANUAL_SUBDIR ${DEFAULT_MANUAL_SUBDIR} CACHE STRING "Subdirectory where manual files will be installed")
373395
MARK_AS_ADVANCED (QGIS_MANUAL_SUBDIR)
374396
SET (QGIS_MANUAL_DIR ${CMAKE_INSTALL_PREFIX}/${QGIS_MANUAL_SUBDIR})
375-
ENDIF (UNIX)
397+
ENDIF (UNIX AND NOT APPLE)
376398

377399
#############################################################
378400
# Python bindings
@@ -402,9 +424,9 @@ ENDIF (WITH_BINDINGS)
402424

403425
#############################################################
404426
# create qgsconfig.h
427+
# installed with app target
405428

406429
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake_templates/qgsconfig.h.in ${CMAKE_BINARY_DIR}/qgsconfig.h)
407-
INSTALL(FILES ${CMAKE_BINARY_DIR}/qgsconfig.h DESTINATION ${QGIS_INCLUDE_DIR})
408430
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
409431

410432
# Added by Jef to prevent python core and gui libs linking to other qgisCore and qgisGui libs
@@ -427,18 +449,25 @@ IF (GIT_MARKER)
427449
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
428450
)
429451
ELSE(MSVC)
452+
EXECUTE_PROCESS(
453+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
454+
COMMAND ${GIT} log -n1 --pretty=%h OUTPUT_VARIABLE REVISION
455+
)
456+
STRING(STRIP "${REVISION}" REVISION)
430457
ADD_CUSTOM_COMMAND(
431458
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
432-
COMMAND echo \\\#define QGSVERSION \\\"$$\( ${GIT} log -n1 --pretty=%h \)\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
459+
COMMAND echo \\\#define QGSVERSION \\\"${REVISION}\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
433460
MAIN_DEPENDENCY ${GIT_MARKER}
434461
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
435462
)
436463
ENDIF(MSVC)
437464
ELSE(GIT)
438465
MESSAGE(STATUS "git marker, but no git found - version will be unknown")
466+
SET(REVISION "unknown")
439467
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"unknown\"")
440468
ENDIF(GIT)
441469
ELSE (GIT_MARKER)
470+
SET(REVISION "exported")
442471
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"exported\"")
443472
ENDIF (GIT_MARKER)
444473

CODING

+169-7
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ Developers guide for QGIS
5858
3.4. The ADD_QGIS_TEST macro explained
5959
3.5. Building your unit test
6060
3.6. Run your tests
61-
4. HIG (Human Interface Guidelines)
62-
5. Authors
61+
4. Getting up and running with QtCreator and QGIS
62+
4.1. Installing QtCreator
63+
4.2. Setting up your project
64+
4.3. Setting up your build environment
65+
4.4. Setting your run environment
66+
4.5. Running and debugging
67+
5. HIG (Human Interface Guidelines)
68+
6. Authors
6369

6470

6571
------------------------------------------------------------------------
@@ -596,10 +602,10 @@ easily, and help us deal with the patches that are sent to use easily.
596602

597603
If the patch is a fix for a specific bug, please name the file with the bug
598604
number in it e.g. bug777fix.patch, and attach it to the original bug report
599-
in trac (https://trac.osgeo.org/qgis/).
605+
in trac (http://hub.qgis.org/projects/quantum-gis).
600606

601607
If the bug is an enhancement or new feature, its usually a good idea to create
602-
a ticket in trac (https://trac.osgeo.org/qgis/) first and then attach you
608+
a ticket in trac (http://hub.qgis.org/projects/quantum-gis) first and then attach you
603609

604610

605611
2.7.2. Create your patch in the top level QGIS source dir
@@ -868,7 +874,7 @@ test before fixing the bug will let you automate the testing for bug
868874
resolution in an efficient manner.
869875

870876
To implement your regression test, you should follow the naming convention of
871-
regression<TicketID> for your test functions. If no trac ticket exists for the
877+
regression<TicketID> for your test functions. If no redmine ticket exists for the
872878
regression, you should create one first. Using this approach allows the person
873879
running a failed regression test easily go and find out more information.
874880

@@ -1208,7 +1214,163 @@ works in a truly platform way. I will update this document as things
12081214
progress.
12091215

12101216

1211-
4. HIG (Human Interface Guidelines)
1217+
4. Getting up and running with QtCreator and QGIS
1218+
=================================================
1219+
1220+
QtCreator is a newish IDE from the makers of the Qt library. With QtCreator you
1221+
can build any C++ project, but it's really optimised for people working on
1222+
Qt(4) based applications (including mobile apps). Everything I describe below
1223+
assumes you are running Ubuntu 11.04 'Natty'.
1224+
1225+
1226+
4.1. Installing QtCreator
1227+
=========================
1228+
1229+
This part is easy:
1230+
1231+
sudo apt-get install qtcreator qtcreator-doc
1232+
1233+
After installing you should find it in your gnome menu.
1234+
1235+
1236+
4.2. Setting up your project
1237+
============================
1238+
1239+
I'm assuming you have already got a local Quantum-GIS clone containing the
1240+
source code, and have installed all needed build dependencies etc. There are
1241+
detailed in instructions on doing that here:
1242+
1243+
http://github.com/qgis/Quantum-GIS/blob/master/CODING
1244+
1245+
On my system I have checked out the code into $HOME/dev/cpp/Quantum-GIS and the
1246+
rest of the article is written assuming that, you should update these paths as
1247+
appropriate for your local system.
1248+
1249+
On launching QtCreator do:
1250+
1251+
File->Open File or Project
1252+
1253+
Then use the resulting file selection dialog to browse to and open this file:
1254+
1255+
$HOME/dev/cpp/Quantum-GIS/CMakeLists.txt
1256+
1257+
[images/image01.jpeg]
1258+
1259+
Next you will be prompted for a build location. I create a specific build dir
1260+
for QtCreator to work in under:
1261+
1262+
$HOME/dev/cpp/Quantum-GIS/build-master-qtcreator
1263+
1264+
Its probably a good idea to create separate build directories for different
1265+
branches if you can afford the disk space.
1266+
1267+
[images/image02.jpeg]
1268+
1269+
Next you will be asked if you have any CMake build options to pass to CMake. We
1270+
will tell CMake that we want a debug build by adding this option:
1271+
1272+
-DCMAKE_BUILD_TYPE=Debug
1273+
1274+
[images/image03.jpeg]
1275+
1276+
Thats the basics of it. When you complete the Wizard, QtCreator will start
1277+
scanning the source tree for autocompletion support and do some other
1278+
housekeeping stuff in the background. We want to tweak a few things before we
1279+
start to build though.
1280+
1281+
1282+
4.3. Setting up your build environment
1283+
======================================
1284+
1285+
Click on the 'Projects' icon on the left of the QtCreator window.
1286+
1287+
[images/image04.jpeg]
1288+
1289+
Select the build settings tab (normally active by default).
1290+
1291+
[images/image05.jpeg]
1292+
1293+
We now want to add a custom process step. Why? Because QGIS can currently only
1294+
run from an install directory, not its build directory, so we need to ensure
1295+
that it is installed whenever we build it. Under 'Build Steps', click on the
1296+
'Add Build Step' combo button and choose 'Custom Process Step'.
1297+
1298+
[images/image06.jpeg]
1299+
1300+
Now we set the following details:
1301+
1302+
Enable custom process step [yes]
1303+
Command: make
1304+
Working directory: $HOME/dev/cpp/Quantum-GIS/build-master-qtcreator
1305+
Command arguments: install
1306+
1307+
[images/image07.jpeg]
1308+
1309+
You are almost ready to build. Just one note: QtCreator will need write
1310+
permissions on the install prefix. By default (which I am using here) QGIS is
1311+
going to get installed to /usr/local. For my purposes on my development
1312+
machine, I just gave myself write permissions to the /usr/local directory.
1313+
1314+
To start the build, click that big hammer icon on the bottom left of the
1315+
window.
1316+
1317+
[images/image08.jpeg]
1318+
1319+
1320+
4.4. Setting your run environment
1321+
=================================
1322+
1323+
As mentioned above, we cannot run QGIS from directly in the build directly, so
1324+
we need to create a custom run target to tell QtCreator to run QGIS from the
1325+
install dir (in my case /usr/local/). To do that, return to the projects
1326+
configuration screen.
1327+
1328+
[images/image04.jpeg]
1329+
1330+
Now select the 'Run Settings' tab
1331+
1332+
[images/image09.jpeg]
1333+
1334+
We need to update the default run settings from using the 'qgis' run
1335+
configuration to using a custom one.
1336+
1337+
[images/image10.jpeg]
1338+
1339+
Do do that, click the 'Add v' combo button next to the Run configuration
1340+
combo and choose 'Custom Executable' from the top of the list.
1341+
1342+
[images/image11.jpeg]
1343+
1344+
Now in the properties area set the following details:
1345+
1346+
Executable: /usr/local/bin/qgis
1347+
Arguments :
1348+
Working directory: $HOME
1349+
Run in terminal: [no]
1350+
Debugger: C++ [yes]
1351+
Qml [no]
1352+
1353+
Then click the 'Rename' button and give your custom executable a meaning full
1354+
name e.g. 'Installed QGIS'
1355+
1356+
[images/image12.jpeg]
1357+
1358+
1359+
4.5. Running and debugging
1360+
==========================
1361+
1362+
Now you are ready to run and debug QGIS. To set a break point, simply open a
1363+
source file and click in the left column.
1364+
1365+
[images/image14.jpeg]
1366+
1367+
Now launch QGIS under the debugger by clicking the icon with a bug on it in the
1368+
bottom left of the window.
1369+
1370+
[images/image13.jpeg]
1371+
1372+
1373+
5. HIG (Human Interface Guidelines)
12121374
===================================
12131375

12141376
In order for all graphical user interface elements to appear consistant and to
@@ -1257,7 +1419,7 @@ guidelines are followed in layout and design of GUIs.
12571419
suffixed to the button text.
12581420

12591421

1260-
5. Authors
1422+
6. Authors
12611423
==========
12621424

12631425
- Tim Sutton (author and editor)

0 commit comments

Comments
 (0)