]> git.openstreetmap.org Git - nominatim.git/blob - module/CMakeLists.txt
PHPUnit 9 changed configuration schema slightly
[nominatim.git] / module / CMakeLists.txt
1 # just use the pgxs makefile
2
3 foreach(suffix ${PostgreSQL_ADDITIONAL_VERSIONS} "14" "13" "12" "11" "10" "9.6")
4     list(APPEND PG_CONFIG_HINTS
5          "/usr/pgsql-${suffix}/bin")
6 endforeach()
7
8 find_program(PG_CONFIG pg_config HINTS ${PG_CONFIG_HINTS})
9
10
11
12 execute_process(COMMAND ${PG_CONFIG} --pgxs
13             OUTPUT_VARIABLE PGXS
14             OUTPUT_STRIP_TRAILING_WHITESPACE)
15
16 if (NOT EXISTS "${PGXS}")
17 message(FATAL_ERROR "Postgresql server package not found.")
18 endif()
19
20 ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/dummy
21         COMMAND PGXS=${PGXS} PG_CONFIG=${PG_CONFIG} MODSRCDIR=${CMAKE_CURRENT_SOURCE_DIR} $(MAKE) -f ${CMAKE_CURRENT_SOURCE_DIR}/Makefile
22         COMMENT "Running external makefile ${PGXS}"
23         )
24
25 ADD_CUSTOM_TARGET( nominatim_lib ALL
26         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dummy
27         )
28