Fix linking with Postgres libs on older cmake versions

* integrates https://github.com/minetest/minetest/pull/11215
  so it backported a24899bf2d
* closes https://github.com/minetest/minetest/issues/12149
* closes https://github.com/minetest/minetest/issues/11219
* backported 998e4820c9
This commit is contained in:
mckaygerhard 2023-09-12 21:43:25 -04:00
parent 9d87cd206c
commit 70fd300c5a

View File

@ -201,6 +201,8 @@ if(ENABLE_POSTGRESQL)
# but we don't need them, so continue anyway if only those are missing.
if(PostgreSQL_INCLUDE_DIR AND PostgreSQL_LIBRARY)
set(PostgreSQL_FOUND TRUE)
set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR})
set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY})
endif()
else()
find_package(PostgreSQL)