]> git.openstreetmap.org Git - nominatim.git/blob - CMakeLists.txt
add actual cmake file
[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 add_subdirectory(osm2pgsql)
36
37 find_package(Threads REQUIRED)
38
39 unset(PostgreSQL_TYPE_INCLUDE_DIR CACHE)
40 set(PostgreSQL_TYPE_INCLUDE_DIR "/usr/include/")
41 find_package(PostgreSQL REQUIRED)
42 include_directories(${PostgreSQL_INCLUDE_DIRS})
43
44 find_program(PG_CONFIG pg_config)
45 execute_process(COMMAND ${PG_CONFIG} --pgxs
46                 OUTPUT_VARIABLE PGXS
47                 OUTPUT_STRIP_TRAILING_WHITESPACE)
48
49 find_package(ZLIB REQUIRED)
50
51 find_package(BZip2 REQUIRED)
52
53 find_package(LibXml2 REQUIRED)
54 include_directories(${LIBXML2_INCLUDE_DIR})
55
56 #-----------------------------------------------------------------------------
57
58 add_subdirectory(module)
59 add_subdirectory(nominatim)
60
61 #-----------------------------------------------------------------------------