Skip to content

Commit

Permalink
Also check Postgres version in cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell committed Nov 20, 2019
1 parent dcff55d commit 3fef338
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ find_package (PostgreSQL REQUIRED)
if (NOT PostgreSQL_FOUND)
message (SEND_ERROR "The PostgreSQL library is required.")
endif (NOT PostgreSQL_FOUND)
string (REGEX MATCH "^[ \t]*\([0-9]+\)\\.\([0-9]+\)\(.*\)" TEMP ${PostgreSQL_VERSION_STRING})
if (NOT CMAKE_MATCH_1)
message (SEND_ERROR "Error matching PostgreSQL version.")
elseif ((CMAKE_MATCH_1 EQUAL 9 AND CMAKE_MATCH_2 LESS 6)
OR (CMAKE_MATCH_1 LESS 9))
message (SEND_ERROR "PostgreSQL version >= 9.6 is required")
message (STATUS "PostgreSQL version ${CMAKE_MATCH_1}.${CMAKE_MATCH_2}${CMAKE_MATCH_3}")
endif (NOT CMAKE_MATCH_1)

message (STATUS "Looking for gpgme...")
find_library (GPGME gpgme)
Expand Down

0 comments on commit 3fef338

Please sign in to comment.