mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
add actual cmake file
This commit is contained in:
61
CMakeLists.txt
Normal file
61
CMakeLists.txt
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# CMake Config
|
||||||
|
#
|
||||||
|
# Nominatim
|
||||||
|
#
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Project version
|
||||||
|
#
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
project(nominatim)
|
||||||
|
|
||||||
|
set(NOMINATIM_VERSION_MAJOR 2)
|
||||||
|
set(NOMINATIM_VERSION_MINOR 5)
|
||||||
|
|
||||||
|
set(NOMINATIM_VERSION "${NOMINATIM_VERSION_MAJOR}.${NOMINATIM_VERSION_MINOR}")
|
||||||
|
|
||||||
|
add_definitions(-DNOMINATIM_VERSION="${NOMINATIM_VERSION}")
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Find external dependencies
|
||||||
|
#
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
add_subdirectory(osm2pgsql)
|
||||||
|
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
|
unset(PostgreSQL_TYPE_INCLUDE_DIR CACHE)
|
||||||
|
set(PostgreSQL_TYPE_INCLUDE_DIR "/usr/include/")
|
||||||
|
find_package(PostgreSQL REQUIRED)
|
||||||
|
include_directories(${PostgreSQL_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
find_program(PG_CONFIG pg_config)
|
||||||
|
execute_process(COMMAND ${PG_CONFIG} --pgxs
|
||||||
|
OUTPUT_VARIABLE PGXS
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
find_package(ZLIB REQUIRED)
|
||||||
|
|
||||||
|
find_package(BZip2 REQUIRED)
|
||||||
|
|
||||||
|
find_package(LibXml2 REQUIRED)
|
||||||
|
include_directories(${LIBXML2_INCLUDE_DIR})
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
add_subdirectory(module)
|
||||||
|
add_subdirectory(nominatim)
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
10
module/CMakeLists.txt
Normal file
10
module/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# just use the pgxs makefile
|
||||||
|
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/dummy
|
||||||
|
COMMAND PGXS=${PGXS} PG_CONFIG=${PG_CONFIG} make -f ${CMAKE_CURRENT_SOURCE_DIR}/Makefile
|
||||||
|
COMMENT "Running external makefile ${PGXS}"
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET( nominatim_lib ALL
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dummy
|
||||||
|
)
|
||||||
|
|
||||||
4
nominatim/CMakeLists.txt
Normal file
4
nominatim/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
add_executable(nominatim export.c geometry.cpp import.c index.c input.c nominatim.c postgresql.c sprompt.c)
|
||||||
|
|
||||||
|
target_link_libraries(nominatim ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${PostgreSQL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
Reference in New Issue
Block a user