From 932abeb0e273310dd9e95f4e907205c636d6fc9f Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sat, 27 Feb 2016 19:06:32 +0100 Subject: [PATCH] add actual cmake file --- CMakeLists.txt | 61 ++++++++++++++++++++++++++++++++++++++++ module/CMakeLists.txt | 10 +++++++ nominatim/CMakeLists.txt | 4 +++ 3 files changed, 75 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 module/CMakeLists.txt create mode 100644 nominatim/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..e5587741 --- /dev/null +++ b/CMakeLists.txt @@ -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) + +#----------------------------------------------------------------------------- diff --git a/module/CMakeLists.txt b/module/CMakeLists.txt new file mode 100644 index 00000000..5e507a9e --- /dev/null +++ b/module/CMakeLists.txt @@ -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 + ) + diff --git a/nominatim/CMakeLists.txt b/nominatim/CMakeLists.txt new file mode 100644 index 00000000..53b5073b --- /dev/null +++ b/nominatim/CMakeLists.txt @@ -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}) + -- 2.39.5