Use Postgresql Version number from pg_config.h

This commit is contained in:
reshke 2021-12-03 17:47:09 +00:00
parent 3137c74ec0
commit 2b261db9d3
3 changed files with 8 additions and 2 deletions

View File

@ -4,6 +4,7 @@
# POSTGRESQL_INCLUDE_DIR - PostgreSQL include directory
# POSTGRESQL_LIBRARY - PostgreSQL library
# PQ_LIBRARY - PostgreSQL PQ library
# PQ_LIBRARY - PostgreSQL version
if("${POSTGRESQL_INCLUDE_DIR}" STREQUAL "" OR "${POSTGRESQL_INCLUDE_DIR}" STREQUAL "POSTGRESQL_INCLUDE_DIR-NOTFOUND")
find_path(
@ -16,12 +17,17 @@ if("${POSTGRESQL_INCLUDE_DIR}" STREQUAL "" OR "${POSTGRESQL_INCLUDE_DIR}" STREQU
OUTPUT_VARIABLE PG_INCLUDE_SERVER
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process (
COMMAND pg_config --version
OUTPUT_VARIABLE PG_VERSION_NUM
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(POSTGRESQL_INCLUDE_DIR ${PG_INCLUDE_SERVER})
endif()
set(PG_VERSION_NUM "140000")
execute_process (
COMMAND pg_config --libdir

View File

@ -14,6 +14,5 @@
#cmakedefine PAM_FOUND @PAM_FOUND@
#cmakedefine LDAP_FOUND @LDAP_FOUND@
#cmakedefine PROM_FOUND @PROM_FOUND@
#cmakedefine PG_VERSION_NUM @PG_VERSION_NUM@
#endif /* ODYSSEY_BUILD_H */

View File

@ -27,5 +27,6 @@
#include <common/saslprep.h>
#include <common/scram-common.h>
#include <string.h>
#include <pg_config.h>
#endif /* ODYSSEY_POSTGRES_H */