=== CMakeLists.txt
==================================================================
|
|
|
5 | 5 | # PGROUTING version number. |
6 | 6 | SET(PGROUTING_VERSION_MAJOR "1") |
7 | 7 | SET(PGROUTING_VERSION_MINOR "0") |
8 | | SET(PGROUTING_VERSION_PATCH "0") |
| 8 | SET(PGROUTING_VERSION_PATCH "1") |
9 | 9 | |
10 | | SET(PGROUTING_VERSION_STRING "${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}.${PGROUTING_VERSION_PATCH}-RC1") |
| 10 | SET(PGROUTING_VERSION_STRING "${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}.${PGROUTING_VERSION_PATCH}") |
11 | 11 | |
12 | 12 | add_subdirectory(cmake) |
13 | 13 | SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") |
… |
… |
|
15 | 15 | include (MacroLibrary) |
16 | 16 | |
17 | 17 | macro_optional_find_package(PostgreSQL) |
| 18 | IF(NOT POSTGRESQL_FOUND) |
| 19 | MESSAGE(FATAL ERROR " Please check your Boost installation.") |
| 20 | ENDIF(NOT POSTGRESQL_FOUND) |
18 | 21 | |
19 | 22 | FIND_PACKAGE(Boost) |
20 | 23 | IF(Boost_INCLUDE_DIRS) |
21 | 24 | MESSAGE("Boost headers were found here: ${Boost_INCLUDE_DIR}") |
| 25 | ELSE(Boost_INCLUDE_DIRS) |
| 26 | MESSAGE(FATAL ERROR " Please check your Boost installation ") |
22 | 27 | ENDIF(Boost_INCLUDE_DIRS) |
23 | 28 | |
24 | 29 | EXEC_PROGRAM(pg_config |
… |
… |
|
57 | 62 | OPTION(WITH_TSP "Build TSP library" OFF) |
58 | 63 | OPTION(WITH_DD "Build Driving distance library" OFF) |
59 | 64 | |
60 | | # Recurse into the subdirectories. This does not actually |
61 | | # cause another cmake executable to run. The same process will walk through |
62 | | # the project's entire directory structure. |
63 | | SUBDIRS(core/src) |
64 | | |
65 | | IF(WITH_TSP) |
66 | | ADD_SUBDIRECTORY(extra/tsp/src) |
67 | | macro_optional_find_package(GAUL) |
68 | | ENDIF(WITH_TSP) |
69 | | |
70 | | IF(WITH_DD) |
71 | | ADD_SUBDIRECTORY(extra/driving_distance/src) |
72 | | macro_optional_find_package(CGAL) |
73 | | ENDIF(WITH_DD) |
74 | | |
75 | | #SET(LIBRARY_OUTPUT_PATH ${PGROUTING_BINARY_DIR}/lib) |
76 | | |
77 | 65 | IF(UNIX) |
78 | | SET(LIBRARY_OUTPUT_PATH ${LIB_DIR}) |
| 66 | SET(LIBRARY_INSTALL_PATH ${LIB_DIR}) |
79 | 67 | SET(SQL_INSTALL_PATH /usr/share/postlbs) |
80 | 68 | ELSE(UNIX) |
81 | | SET(LIBRARY_OUTPUT_PATH ${PGROUTING_BINARY_DIR}/lib) |
| 69 | SET(LIBRARY_INSTALL_PATH ${PGROUTING_BINARY_DIR}/lib) |
82 | 70 | SET(SQL_INSTALL_PATH ${PGROUTING_BINARY_DIR}/lib) |
83 | 71 | ENDIF(UNIX) |
84 | 72 | |
85 | 73 | SET(PGROUTING_INCLUDE_DIRECTORIES ${PGROUTING_SOURCE_DIR}/core ${PGROUTING_SOURCE_DIR}/core/src ${PGROUTING_SOURCE_DIR}/extra ${PGROUTING_SOURCE_DIR}/extra/tsp ${PGROUTING_SOURCE_DIR}/extra/tsp/src ${PGROUTING_SOURCE_DIR}/extra/driving_distance ${PGROUTING_SOURCE_DIR}/extra/driving_distance/src |
86 | 74 | ) |
87 | 75 | |
88 | | INCLUDE_DIRECTORIES(. ${PGROUTING_INCLUDE_DIRECTORIES} ${Boost_INCLUDE_DIRS}/boost) |
| 76 | INCLUDE_DIRECTORIES(. ${PGROUTING_INCLUDE_DIRECTORIES} ${POSTGRESQL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) |
| 77 | IF(WIN32) |
| 78 | INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${POSTGRESQL_INCLUDE_DIR}/port/win32) |
| 79 | ENDIF(WIN32) |
89 | 80 | |
| 81 | # we need link libpostgres.a on win32 env |
| 82 | IF(WIN32) |
| 83 | LINK_DIRECTORIES(${LIB_DIR}) |
| 84 | LINK_LIBRARIES(postgres) |
| 85 | ENDIF(WIN32) |
| 86 | |
90 | 87 | SET(CMAKE_C_FLAGS "-O2 -g") |
91 | 88 | SET(CMAKE_CXX_FLAGS "-O2 -g") |
92 | 89 | |
93 | | CONFIGURE_FILE(core/sql/routing_core.sql ${SQL_INSTALL_PATH}/routing_core.sql COPYONLY) |
94 | | CONFIGURE_FILE(core/sql/routing_core_wrappers.sql ${SQL_INSTALL_PATH}/routing_core_wrappers.sql COPYONLY) |
| 90 | # Recurse into the subdirectories. This does not actually |
| 91 | # cause another cmake executable to run. The same process will walk through |
| 92 | # the project's entire directory structure. |
| 93 | SUBDIRS(core) |
95 | 94 | |
96 | 95 | IF(WITH_TSP) |
97 | | CONFIGURE_FILE(extra/tsp/sql/routing_tsp.sql ${SQL_INSTALL_PATH}/routing_tsp.sql COPYONLY) |
98 | | CONFIGURE_FILE(extra/tsp/sql/routing_tsp_wrappers.sql ${SQL_INSTALL_PATH}/routing_tsp_wrappers.sql COPYONLY) |
| 96 | macro_optional_find_package(GAUL) |
| 97 | IF(NOT GAUL_FOUND) |
| 98 | message(FATAL ERROR " Please check your gaul installation, or set correct path to GAUL_INCLUDE_DIR and GAUL_LIBRARIES.") |
| 99 | ENDIF(NOT GAUL_FOUND) |
| 100 | INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${GAUL_INCLUDE_DIR}) |
| 101 | LINK_LIBRARIES(${GAUL_LIBRARIES}) |
| 102 | ADD_SUBDIRECTORY(extra/tsp) |
99 | 103 | ENDIF(WITH_TSP) |
100 | 104 | |
101 | 105 | IF(WITH_DD) |
102 | | CONFIGURE_FILE(extra/driving_distance/sql/routing_dd.sql ${SQL_INSTALL_PATH}/routing_dd.sql COPYONLY) |
103 | | CONFIGURE_FILE(extra/driving_distance/sql/routing_dd_wrappers.sql ${SQL_INSTALL_PATH}/routing_dd_wrappers.sql COPYONLY) |
| 106 | macro_optional_find_package(CGAL) |
| 107 | IF(NOT CGAL_FOUND) |
| 108 | message(FATAL ERROR " Please check your CGAL installation, or set correct path to CGAL_INCLUDE_DIR and CGAL_LIBRARIES.") |
| 109 | ENDIF(NOT CGAL_FOUND) |
| 110 | INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${CGAL_INCLUDE_DIR}) |
| 111 | LINK_LIBRARIES(${CGAL_LIBRARIES}) |
| 112 | ADD_SUBDIRECTORY(extra/driving_distance) |
104 | 113 | ENDIF(WITH_DD) |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
=== cmake/FindCGAL.cmake
==================================================================
|
|
|
10 | 10 | |
11 | 11 | else(CGAL_INCLUDE_DIR AND CGAL_LIBRARIES) |
12 | 12 | |
13 | | FIND_PATH(CGAL_INCLUDE_DIR basic.h |
14 | | /usr/include/CGAL |
15 | | /usr/local/include/CGAL |
16 | | $ENV{ProgramFiles}/CGAL/*/include/CGAL |
17 | | $ENV{SystemDrive}/CGAL/*/include/CGAL |
| 13 | FIND_PATH(CGAL_INCLUDE_DIR CGAL/basic.h |
| 14 | /usr/include |
| 15 | /usr/local/include |
| 16 | $ENV{ProgramFiles}/CGAL/*/include |
| 17 | $ENV{SystemDrive}/CGAL/*/include |
18 | 18 | ) |
19 | 19 | |
20 | 20 | find_library(CGAL_LIBRARIES NAMES CGAL libCGAL |
… |
… |
|
25 | 25 | /usr/lib64 |
26 | 26 | /usr/local/lib64 |
27 | 27 | /usr/lib64/CGAL |
28 | | $ENV{ProgramFiles}/CGAL/*/lib/ms |
29 | | $ENV{SystemDrive}/CGAL/*/lib/ms |
| 28 | $ENV{ProgramFiles}/CGAL/*/lib |
| 29 | $ENV{SystemDrive}/CGAL/*/lib |
30 | 30 | ) |
31 | 31 | |
32 | 32 | if(CGAL_INCLUDE_DIR AND CGAL_LIBRARIES) |
=== cmake/FindGAUL.cmake
==================================================================
|
|
|
5 | 5 | # GAUL_FOUND, If false, do not try to use GAUL. |
6 | 6 | # |
7 | 7 | |
8 | | if(GAUL_LIBRARIES) |
| 8 | if(GAUL_INCLUDE_DIR AND GAUL_LIBRARIES) |
9 | 9 | set(GAUL_FOUND TRUE) |
10 | 10 | |
11 | | else(GAUL_LIBRARIES) |
| 11 | else(GAUL_INCLUDE_DIR AND GAUL_LIBRARIES) |
12 | 12 | |
| 13 | FIND_PATH(GAUL_INCLUDE_DIR gaul.h |
| 14 | /usr/include |
| 15 | /usr/local/include |
| 16 | $ENV{ProgramFiles}/gaul/*/include |
| 17 | $ENV{SystemDrive}/gaul/*/include |
| 18 | ) |
| 19 | |
13 | 20 | find_library(GAUL_LIBRARIES NAMES gaul gaul_util libgaul libgaul_util |
14 | 21 | PATHS |
15 | 22 | /usr/lib |
… |
… |
|
18 | 25 | /usr/lib64 |
19 | 26 | /usr/local/lib64 |
20 | 27 | /usr/lib64/gaul |
21 | | $ENV{ProgramFiles}/GAUL/*/lib/ms |
22 | | $ENV{SystemDrive}/GAUL/*/lib/ms |
| 28 | $ENV{ProgramFiles}/GAUL/*/lib/ |
| 29 | $ENV{SystemDrive}/GAUL/*/lib/ |
23 | 30 | ) |
24 | 31 | |
25 | | if(GAUL_LIBRARIES) |
| 32 | if(GAUL_INCLUDE_DIR AND GAUL_LIBRARIES) |
26 | 33 | set(GAUL_FOUND TRUE) |
27 | 34 | message(STATUS "Found GAUL: ${GAUL_LIBRARIES}") |
28 | | else(GAUL_LIBRARIES) |
| 35 | else(GAUL_INCLUDE_DIR AND GAUL_LIBRARIES) |
29 | 36 | set(GAUL_FOUND FALSE) |
30 | 37 | message(STATUS "GAUL not found.") |
31 | | endif(GAUL_LIBRARIES) |
| 38 | endif(GAUL_INCLUDE_DIR AND GAUL_LIBRARIES) |
32 | 39 | |
33 | | mark_as_advanced(GAUL_LIBRARIES) |
| 40 | mark_as_advanced(GAUL_INCLUDE_DIR GAUL_LIBRARIES) |
34 | 41 | |
35 | | endif(GAUL_LIBRARIES) |
| 42 | endif(GAUL_INCLUDE_DIR AND GAUL_LIBRARIES) |
=== core/CMakeLists.txt
==================================================================
|
|
|
1 | | SUBDIRS(src) |
| 1 | SUBDIRS(src sql) |
| 2 | |
=== core/sql/CMakeLists.txt
==================================================================
|
|
|
| 1 | INSTALL(FILES routing_core.sql DESTINATION ${SQL_INSTALL_PATH} ) |
| 2 | INSTALL(FILES routing_core_wrappers.sql DESTINATION ${SQL_INSTALL_PATH} ) |
| 3 | |
=== core/src/CMakeLists.txt
==================================================================
|
|
|
| 1 | |
| 2 | SET(LIBRARY_OUTPUT_PATH ../../lib/) |
1 | 3 | ADD_LIBRARY(routing SHARED dijkstra.c astar.c shooting_star.c boost_wrapper.cpp astar_boost_wrapper.cpp shooting_star_boost_wrapper.cpp) |
| 4 | INSTALL(TARGETS routing DESTINATION ${LIBRARY_INSTALL_PATH}) |
2 | 5 | |
3 | 6 | |
4 | | |
=== extra/driving_distance/CMakeLists.txt
==================================================================
|
|
|
1 | | SUBDIRS(src) |
| 1 | SUBDIRS(src sql) |
=== extra/driving_distance/sql/CMakeLists.txt
==================================================================
|
|
|
| 1 | INSTALL(FILES routing_dd.sql DESTINATION ${SQL_INSTALL_PATH}) |
| 2 | INSTALL(FILES routing_dd_wrappers.sql DESTINATION ${SQL_INSTALL_PATH}) |
| 3 | |
=== extra/driving_distance/src/CMakeLists.txt
==================================================================
|
|
|
1 | | EXEC_PROGRAM(pg_config |
2 | | ARGS --libdir |
3 | | OUTPUT_VARIABLE LIB_DIR) |
4 | | |
5 | | IF(LIB_DIR) |
6 | | MESSAGE("Output directory for libraries is set to ${LIB_DIR}") |
7 | | ELSE(LIB_DIR) |
8 | | SET(LIB_DIR ${PGROUTING_BINARY_DIR}/lib) |
9 | | MESSAGE("pg_config not found, output directory for libraries is set to ${PGROUTING_BINARY_DIR}/lib") |
10 | | ENDIF(LIB_DIR) |
11 | | |
12 | | IF(UNIX) |
13 | | SET(LIBRARY_OUTPUT_PATH ${LIB_DIR}) |
14 | | SET(SQL_INSTALL_PATH /usr/share/postlbs) |
15 | | ELSE(UNIX) |
16 | | SET(LIBRARY_OUTPUT_PATH ${PGROUTING_BINARY_DIR}/lib) |
17 | | SET(SQL_INSTALL_PATH ${PGROUTING_BINARY_DIR}/lib) |
18 | | ENDIF(UNIX) |
19 | | |
| 1 | SET(LIBRARY_OUTPUT_PATH ../../../lib/) |
20 | 2 | ADD_LIBRARY(routing_dd SHARED alpha.c alpha_drivedist.cpp alpha.h boost_drivedist.cpp drivedist.c drivedist.h) |
| 3 | INSTALL(TARGETS routing_dd DESTINATION ${LIBRARY_INSTALL_PATH}) |
21 | 4 | |
22 | 5 | |
23 | | |
24 | | |
=== extra/tsp/CMakeLists.txt
==================================================================
|
|
|
1 | | SUBDIRS(src) |
| 1 | SUBDIRS(src sql) |
=== extra/tsp/sql/CMakeLists.txt
==================================================================
|
|
|
| 1 | INSTALL(FILES routing_tsp.sql DESTINATION ${SQL_INSTALL_PATH}) |
| 2 | INSTALL(FILES routing_tsp_wrappers.sql DESTINATION ${SQL_INSTALL_PATH}) |
| 3 | |
=== extra/tsp/src/CMakeLists.txt
==================================================================
|
|
|
1 | | EXEC_PROGRAM(pg_config |
2 | | ARGS --libdir |
3 | | OUTPUT_VARIABLE LIB_DIR) |
4 | | |
5 | | IF(LIB_DIR) |
6 | | MESSAGE("Output directory for libraries is set to ${LIB_DIR}") |
7 | | ELSE(LIB_DIR) |
8 | | SET(LIB_DIR ${PGROUTING_BINARY_DIR}/lib) |
9 | | MESSAGE("pg_config not found, output directory for libraries is set to ${PGROUTING_BINARY_DIR}/lib") |
10 | | ENDIF(LIB_DIR) |
11 | | |
12 | | IF(UNIX) |
13 | | SET(LIBRARY_OUTPUT_PATH ${LIB_DIR}) |
14 | | SET(SQL_INSTALL_PATH /usr/share/postlbs) |
15 | | ELSE(UNIX) |
16 | | SET(LIBRARY_OUTPUT_PATH ${PGROUTING_BINARY_DIR}/lib) |
17 | | SET(SQL_INSTALL_PATH ${PGROUTING_BINARY_DIR}/lib) |
18 | | ENDIF(UNIX) |
19 | | |
| 1 | SET(LIBRARY_OUTPUT_PATH ../../../lib/) |
20 | 2 | ADD_LIBRARY(routing_tsp SHARED tsp.c tsp.h tsp_solver.cpp) |
| 3 | INSTALL(TARGETS routing_tsp DESTINATION ${LIBRARY_INSTALL_PATH}) |
| 4 | |