Skip to content

Commit

Permalink
Fallback to pkg-config when libpq s not found with CMake. (jtv#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
skasperski committed Mar 24, 2023
1 parent 8b87309 commit 9e08f13
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@ if(NOT PostgreSQL_FOUND)
cmake_policy(SET CMP0074 NEW)
endif()

find_package(PostgreSQL REQUIRED)
find_package(PostgreSQL)

if(POLICY CMP0074)
cmake_policy(POP)
endif()
endif()

if(NOT PostgreSQL_FOUND)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PostgreSQL REQUIRED libpq)
endif()

check_function_exists("poll" PQXX_HAVE_POLL)

set(CMAKE_REQUIRED_LIBRARIES pq)
Expand Down

0 comments on commit 9e08f13

Please sign in to comment.