]> git.openstreetmap.org Git - nominatim.git/blob - nominatim/CMakeLists.txt
Add options to compile only PG module/frontend
[nominatim.git] / nominatim / CMakeLists.txt
1 add_executable(nominatim export.c geometry.cpp import.c index.c input.c nominatim.c postgresql.c sprompt.c)
2 include(CheckSymbolExists)
3
4 CHECK_SYMBOL_EXISTS(bswap_32 "byteswap.h" HAVE_BYTESWAP)
5 CHECK_SYMBOL_EXISTS(bswap32 "sys/endian.h" HAVE_SYS_ENDIAN)
6
7 find_package(ZLIB REQUIRED)
8 find_package(BZip2 REQUIRED)
9 find_package(LibXml2 REQUIRED)
10 find_package(Threads REQUIRED)
11
12 unset(PostgreSQL_TYPE_INCLUDE_DIR CACHE)
13 set(PostgreSQL_TYPE_INCLUDE_DIR "/usr/include/")
14 find_package(PostgreSQL REQUIRED)
15 include_directories(${PostgreSQL_INCLUDE_DIRS})
16 link_directories(${PostgreSQL_LIBRARY_DIRS})
17
18 include_directories(${LIBXML2_INCLUDE_DIR})
19
20 target_compile_definitions(nominatim
21     PRIVATE HAVE_BYTESWAP=$<BOOL:${HAVE_BYTESWAP}>
22     PRIVATE HAVE_SYS_ENDIAN=$<BOOL:${HAVE_SYS_ENDIAN}>
23 )
24
25 target_link_libraries(nominatim ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${PostgreSQL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
26