Skip to content
Permalink
Browse files
Use cmake provided FindPostgreSQL scripts where possible
  • Loading branch information
m-kuhn authored and nyalldawson committed Oct 22, 2021
1 parent 476b68f commit dae83c51d0514e6a7018f593ed08e29690cf6d3f
Showing with 12 additions and 0 deletions.
  1. +12 −0 cmake/FindPostgres.cmake
@@ -14,6 +14,18 @@
# POSTGRES_INCLUDE_DIR
# POSTGRES_LIBRARY

# First try using the cmake native FindPostgreSQL script.
# For cmake < 3.20 this also requires server components.
# Once the minimum cmake version for QGIS is bumped to 3.20
# we can get rid of our custom script
find_package(PostgreSQL)
if(${PostgreSQL_FOUND})
set(POSTGRES_INCLUDE_DIR ${PostgreSQL_INCLUDE_DIRS})
set(POSTGRES_LIBRARY ${PostgreSQL_LIBRARIES})
set(POSTGRES_FOUND TRUE)
return()
endif()

IF(ANDROID)
SET(POSTGRES_INCLUDE_DIR ${POSTGRES_INCLUDE_DIR} CACHE STRING INTERNAL)
SET(POSTGRES_LIBRARY ${PG_TMP}/libpq.so CACHE STRING INTERNAL)

0 comments on commit dae83c5

Please sign in to comment.