]> git.openstreetmap.org Git - nominatim.git/blob - CMakeLists.txt
Merge pull request #416 from lonvia/dead-code-removal
[nominatim.git] / CMakeLists.txt
1 #-----------------------------------------------------------------------------
2 #
3 #  CMake Config
4 #
5 #  Nominatim
6 #
7 #-----------------------------------------------------------------------------
8
9 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
10 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
11
12
13 #-----------------------------------------------------------------------------
14 #
15 #  Project version
16 #
17 #-----------------------------------------------------------------------------
18
19 project(nominatim)
20
21 set(NOMINATIM_VERSION_MAJOR 2)
22 set(NOMINATIM_VERSION_MINOR 5)
23
24 set(NOMINATIM_VERSION "${NOMINATIM_VERSION_MAJOR}.${NOMINATIM_VERSION_MINOR}")
25
26 add_definitions(-DNOMINATIM_VERSION="${NOMINATIM_VERSION}")
27
28
29 #-----------------------------------------------------------------------------
30 #
31 #  Find external dependencies
32 #
33 #-----------------------------------------------------------------------------
34
35 set(BUILD_TESTS on)
36 set(WITH_LUA off)
37 add_subdirectory(osm2pgsql)
38
39 find_package(Threads REQUIRED)
40
41 unset(PostgreSQL_TYPE_INCLUDE_DIR CACHE)
42 set(PostgreSQL_TYPE_INCLUDE_DIR "/usr/include/")
43 find_package(PostgreSQL REQUIRED)
44 include_directories(${PostgreSQL_INCLUDE_DIRS})
45
46 find_program(PG_CONFIG pg_config)
47 execute_process(COMMAND ${PG_CONFIG} --pgxs
48                 OUTPUT_VARIABLE PGXS
49                 OUTPUT_STRIP_TRAILING_WHITESPACE)
50
51 find_package(ZLIB REQUIRED)
52
53 find_package(BZip2 REQUIRED)
54
55 find_package(LibXml2 REQUIRED)
56 include_directories(${LIBXML2_INCLUDE_DIR})
57
58 #-----------------------------------------------------------------------------
59 #
60 # Setup settings and paths
61 #
62 #-----------------------------------------------------------------------------
63
64 set(CUSTOMFILES
65     settings/settings.php
66     settings/phrase_settings.php
67     website/deletable.php
68     website/details.php
69     website/hierarchy.php
70     website/lookup.php
71     website/polygons.php
72     website/reverse.php
73     website/search.php
74     website/status.php
75     utils/blocks.php
76     utils/country_languages.php
77     utils/imports.php
78     utils/importWikipedia.php
79     utils/query.php
80     utils/server_compare.php
81     utils/setup.php
82     utils/specialphrases.php
83     utils/update.php
84     utils/warm.php
85    )
86
87 foreach (cfile ${CUSTOMFILES})
88     configure_file(${PROJECT_SOURCE_DIR}/${cfile} ${PROJECT_BINARY_DIR}/${cfile})
89 endforeach()
90
91 set(WEBPATHS css images js)
92
93 foreach (wp ${WEBPATHS})
94     execute_process(
95         COMMAND ln -sf ${PROJECT_SOURCE_DIR}/website/${wp} ${PROJECT_BINARY_DIR}/website/
96     )
97 endforeach()
98
99
100 #-----------------------------------------------------------------------------
101 #
102 # Tests
103 #
104 #-----------------------------------------------------------------------------
105
106 include(CTest)
107
108 set(TEST_BDD db osm2pgsql api)
109
110 foreach (test ${TEST_BDD})
111     add_test(NAME bdd_${test}
112              COMMAND lettuce features/${test}
113              WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests)
114     set_tests_properties(bdd_${test}
115         PROPERTIES ENVIRONMENT "NOMINATIM_DIR=${PROJECT_BINARY_DIR}")
116 endforeach()
117
118 add_test(NAME php
119          COMMAND phpunit ./
120          WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests-php)
121
122 #-----------------------------------------------------------------------------
123
124 add_subdirectory(module)
125 add_subdirectory(nominatim)
126
127 #-----------------------------------------------------------------------------