aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-04-20 19:50:34 +0200
committerGitHub <noreply@github.com>2021-04-20 19:50:34 +0200
commita24899bf2dcd58916922d671ee8761448b6876e5 (patch)
tree3bee9dcc7f2c3f31b34b16a91d9d5507084b2ce0 /src
parent1da73418cd2ea0e03e8289f54a47dededcf8b331 (diff)
downloadminetest-a24899bf2dcd58916922d671ee8761448b6876e5.tar.gz
minetest-a24899bf2dcd58916922d671ee8761448b6876e5.tar.bz2
minetest-a24899bf2dcd58916922d671ee8761448b6876e5.zip
Look for PostgreSQL library properly and fix CI
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 16b5bf991..f70e77dcc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -146,7 +146,16 @@ option(ENABLE_POSTGRESQL "Enable PostgreSQL backend" TRUE)
set(USE_POSTGRESQL FALSE)
if(ENABLE_POSTGRESQL)
- find_package("PostgreSQL")
+ if(CMAKE_VERSION VERSION_LESS "3.20")
+ find_package(PostgreSQL QUIET)
+ # Before CMake 3.20 FindPostgreSQL.cmake always looked for server includes
+ # 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)
+ endif()
+ else()
+ find_package(PostgreSQL)
+ endif()
if(PostgreSQL_FOUND)
set(USE_POSTGRESQL TRUE)