aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-12-09 19:13:00 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-12-09 19:13:00 +0300
commit7ca658607cdeebe0cecbeb310cf2c99af800306f (patch)
tree0fdca11c2ac98ed15ae54414cd92cd1be8697f85 /CMakeLists.txt
parent46ceb4ad592937ac210d1fcdfe5ee0f53d317b39 (diff)
downloadrspamd-7ca658607cdeebe0cecbeb310cf2c99af800306f.tar.gz
rspamd-7ca658607cdeebe0cecbeb310cf2c99af800306f.zip
Add detecting of libhiredis for communicating with kvstorage.
Add internal hiredis if it is not found in system.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dcc7da2fe..1e8867a27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -336,6 +336,15 @@ ELSE(ENABLE_STATIC MATCHES "ON")
ENDIF(ENABLE_STATIC MATCHES "ON")
pkg_check_modules(GMIME2 gmime-2.0)
+# Try to find hiredis library
+pkg_check_modules(HIREDIS libhiredis)
+IF(HIREDIS_INCLUDE_DIRS)
+ INCLUDE_DIRECTORIES("${HIREDIS_INCLUDE_DIRS}")
+ENDIF(HIREDIS_INCLUDE_DIRS)
+IF(HIREDIS_LIBRARY_DIRS)
+ LINK_DIRECTORIES("${HIREDIS_LIBRARY_DIRS}")
+ENDIF(HIREDIS_LIBRARY_DIRS)
+
# Try to link with gmime24
IF(NOT GMIME2_FOUND OR FORCE_GMIME24)
pkg_check_modules(GMIME24 REQUIRED gmime-2.4)
@@ -797,6 +806,9 @@ SET(PLUGINSSRC src/plugins/surbl.c
src/plugins/fuzzy_check.c
src/plugins/spf.c)
+
+################################ SUBDIRS SECTION ###########################
+
ADD_CUSTOM_COMMAND(OUTPUT src/modules.c
COMMAND ${CMAKE_SOURCE_DIR}/utils/gen-modules.sh ${PLUGINSSRC}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src)
@@ -816,6 +828,11 @@ ADD_SUBDIRECTORY(src/client)
ADD_SUBDIRECTORY(utils)
ADD_SUBDIRECTORY(test)
+IF(NOT HIREDIS_FOUND)
+ ADD_SUBDIRECTORY(contrib/hiredis)
+ INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/contrib/hiredis")
+ENDIF(NOT HIREDIS_FOUND)
+
LIST(LENGTH PLUGINSSRC RSPAMD_MODULES_NUM)
############################ TARGETS SECTION ###############################
@@ -861,6 +878,8 @@ IF(ENABLE_STATIC MATCHES "ON")
TARGET_LINK_LIBRARIES(rspamd ${PCRE_LIBRARIES})
ENDIF(ENABLE_STATIC MATCHES "ON")
+TARGET_LINK_LIBRARIES(rspamd hiredis)
+
IF(ENABLE_LUAJIT MATCHES "ON")
TARGET_LINK_LIBRARIES(rspamd "${LUAJIT_LIBRARY}")
ELSE(ENABLE_LUAJIT MATCHES "ON")