1 #-----------------------------------------------------------------------------
7 #-----------------------------------------------------------------------------
9 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
10 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
13 #-----------------------------------------------------------------------------
17 #-----------------------------------------------------------------------------
21 set(NOMINATIM_VERSION_MAJOR 2)
22 set(NOMINATIM_VERSION_MINOR 5)
24 set(NOMINATIM_VERSION "${NOMINATIM_VERSION_MAJOR}.${NOMINATIM_VERSION_MINOR}")
26 add_definitions(-DNOMINATIM_VERSION="${NOMINATIM_VERSION}")
29 #-----------------------------------------------------------------------------
31 # Find external dependencies
33 #-----------------------------------------------------------------------------
36 add_subdirectory(osm2pgsql)
38 find_package(Threads REQUIRED)
40 unset(PostgreSQL_TYPE_INCLUDE_DIR CACHE)
41 set(PostgreSQL_TYPE_INCLUDE_DIR "/usr/include/")
42 find_package(PostgreSQL REQUIRED)
43 include_directories(${PostgreSQL_INCLUDE_DIRS})
45 find_program(PG_CONFIG pg_config)
46 execute_process(COMMAND ${PG_CONFIG} --pgxs
48 OUTPUT_STRIP_TRAILING_WHITESPACE)
50 find_package(ZLIB REQUIRED)
52 find_package(BZip2 REQUIRED)
54 find_package(LibXml2 REQUIRED)
55 include_directories(${LIBXML2_INCLUDE_DIR})
57 #-----------------------------------------------------------------------------
59 # Setup settings and paths
61 #-----------------------------------------------------------------------------
64 ${PROJECT_SOURCE_DIR}/settings/settings.php
65 ${PROJECT_BINARY_DIR}/settings/settings.php
69 ${PROJECT_SOURCE_DIR}/settings/phrase_settings.php
70 ${PROJECT_BINARY_DIR}/settings/phrase_settings.php
74 COMMAND ln -s -t ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/utils
77 #-----------------------------------------------------------------------------
81 #-----------------------------------------------------------------------------
85 set(TEST_BDD db osm2pgsql api)
87 foreach (test ${TEST_BDD})
88 add_test(NAME bdd_${test}
89 COMMAND lettuce features/${test}
90 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests)
91 set_tests_properties(bdd_${test}
92 PROPERTIES ENVIRONMENT "NOMINATIM_DIR=${PROJECT_BINARY_DIR}")
97 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests-php)
99 #-----------------------------------------------------------------------------
101 add_subdirectory(module)
102 add_subdirectory(nominatim)
104 #-----------------------------------------------------------------------------