summaryrefslogtreecommitdiff
path: root/accel-pppd/logs
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-01-15 11:48:14 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-01-15 11:48:14 +0300
commit5dbd7cb6a5ed4e118a7dd589456729d3fa7f115c (patch)
tree75e6cb8fb23dca23f9bcde564246c9d2d4f820e5 /accel-pppd/logs
parent568d50a7b810349db9567622e37924d44ee22a2d (diff)
downloadaccel-ppp-5dbd7cb6a5ed4e118a7dd589456729d3fa7f115c.tar.gz
accel-ppp-5dbd7cb6a5ed4e118a7dd589456729d3fa7f115c.zip
cmake: add error messages if postgresql or snmp libraries not found
Diffstat (limited to 'accel-pppd/logs')
-rw-r--r--accel-pppd/logs/CMakeLists.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/accel-pppd/logs/CMakeLists.txt b/accel-pppd/logs/CMakeLists.txt
index b25cbe2..4d8a631 100644
--- a/accel-pppd/logs/CMakeLists.txt
+++ b/accel-pppd/logs/CMakeLists.txt
@@ -34,8 +34,16 @@ IF(LOG_SYSLOG)
ENDIF(LOG_SYSLOG)
IF(LOG_PGSQL)
+ find_library(PGSQL_LIBRARY pq
+ HINTS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib
+ PATHS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib
+ )
+ IF(NOT PGSQL_LIBRARY)
+ message(FATAL_ERROR "${Esc}[31mRequired libpq not found.\n Install libpq-dev and run cmake again${Esc}[m")
+ ENDIF(NOT PGSQL_LIBRARY)
+
ADD_LIBRARY(log_pgsql SHARED log_pgsql.c)
- TARGET_LINK_LIBRARIES(log_pgsql pq)
+ TARGET_LINK_LIBRARIES(log_pgsql ${PGSQL_LIBRARY})
INSTALL(TARGETS log_pgsql
LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp
)