aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-21 12:28:41 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-21 12:28:41 +0000
commitc2ff857a70752a83e9d19184d140826fbed9f467 (patch)
treea59a47ead6b6825fdf3b9fe999f87e35c5137fd3
parenta9dcf6a0b3f49b63be438d4cfefbcd315a14df6f (diff)
downloadrspamd-c2ff857a70752a83e9d19184d140826fbed9f467.tar.gz
rspamd-c2ff857a70752a83e9d19184d140826fbed9f467.zip
Add detection of libfann
-rw-r--r--CMakeLists.txt8
-rw-r--r--config.h.in1
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/rspamadm/CMakeLists.txt3
4 files changed, 15 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae77b8330..99c1f56c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,7 +53,7 @@ OPTION(WANT_SYSTEMD_UNITS "Install systemd unit files on Linux [default: OFF]"
OPTION(ENABLE_SNOWBALL "Enable snowball stemmer [default: ON]" ON)
OPTION(ENABLE_CLANG_PLUGIN "Enable clang static analysing plugin [default: OFF]" OFF)
OPTION(ENABLE_HYPERSCAN "Enable hyperscan for fast regexp processing [default: OFF]" OFF)
-
+OPTION(ENABLE_FANN "Enable fann for neural network plugin [default: OFF]" OFF)
INCLUDE(FindArch.cmake)
TARGET_ARCHITECTURE(ARCH)
@@ -644,6 +644,12 @@ IF(ENABLE_HYPERSCAN MATCHES "ON")
ROOT ${HYPERSCAN_ROOT_DIR} MODULES hs)
SET(WITH_HYPERSCAN 1)
ENDIF()
+IF (ENABLE_FANN MATCHES "ON")
+ ProcessPackage(FANN LIBRARY fann INCLUDE fann.h INCLUDE_SUFFIXES
+ include/fann
+ ROOT ${FANN_ROOT_DIR} MODULES fann)
+ SET(WITH_FANN 1)
+ENDIF ()
#Check for openssl (required for dkim)
IF(WITH_OPENSSL)
diff --git a/config.h.in b/config.h.in
index daa84f723..b976b701c 100644
--- a/config.h.in
+++ b/config.h.in
@@ -117,6 +117,7 @@
#cmakedefine LIBEVENT_EVHTTP 1
#cmakedefine PARAM_H_HAS_BITSET 1
#cmakedefine WITH_DB 1
+#cmakedefine WITH_FANN 1
#cmakedefine WITH_GPERF_TOOLS 1
#cmakedefine WITH_HIREDIS 1
#cmakedefine WITH_HYPERSCAN 1
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fc85428ca..385de9eb8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -127,6 +127,10 @@ IF (ENABLE_SNOWBALL MATCHES "ON")
ENDIF()
TARGET_LINK_LIBRARIES(rspamd rspamd-actrie)
+IF (ENABLE_FANN MATCHES "ON")
+ TARGET_LINK_LIBRARIES(rspamd fann)
+ENDIF ()
+
IF (ENABLE_HYPERSCAN MATCHES "ON")
TARGET_LINK_LIBRARIES(rspamd hs)
SET_TARGET_PROPERTIES(rspamd PROPERTIES LINKER_LANGUAGE CXX)
diff --git a/src/rspamadm/CMakeLists.txt b/src/rspamadm/CMakeLists.txt
index c69bf0cbe..d57325f0e 100644
--- a/src/rspamadm/CMakeLists.txt
+++ b/src/rspamadm/CMakeLists.txt
@@ -39,6 +39,9 @@ IF (NOT DEBIAN_BUILD)
SET_TARGET_PROPERTIES(rspamadm PROPERTIES VERSION ${RSPAMD_VERSION})
ENDIF (NOT DEBIAN_BUILD)
+IF (ENABLE_FANN MATCHES "ON")
+ TARGET_LINK_LIBRARIES(rspamadm fann)
+ENDIF ()
IF (ENABLE_HYPERSCAN MATCHES "ON")
TARGET_LINK_LIBRARIES(rspamadm hs)
SET_TARGET_PROPERTIES(rspamadm PROPERTIES LINKER_LANGUAGE CXX)