Skip to content

Commit 4e3dd91

Browse files
committed
cmake: make pgsql REQUIRED if WITH_POSTGRESQL=ON
1 parent ecd0c30 commit 4e3dd91

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if(WITH_POSTGRESQL)
6969

7070
set(PostgreSQL_ADDITIONAL_VERSIONS "9.3" "9.2")
7171

72-
find_package(PostgreSQL)
72+
find_package(PostgreSQL REQUIRED)
7373

7474
if(PostgreSQL_FOUND)
7575
set(SQL_LIBRARIES ${PostgreSQL_LIBRARIES} ${SQL_LIBRARIES})

cmake/FindPostgreSQL.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ endif()
169169
# Did we find anything?
170170
include(FindPackageHandleStandardArgs)
171171
find_package_handle_standard_args(PostgreSQL
172-
REQUIRED_VARS PostgreSQL_LIBRARY
173-
VERSION_VAR PostgreSQL_VERSION_STRING)
172+
REQUIRED_VARS PostgreSQL_LIBRARY)
174173
set(PostgreSQL_FOUND ${POSTGRESQL_FOUND})
175174

176175
# Now try to get the include and library path.

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <cstring>
2626
#include <fstream>
2727

28+
#include <unistd.h>
29+
2830
#include "simpleopt.h"
2931
#include "common.h"
3032
#include "strtools.h"

0 commit comments

Comments
 (0)