]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Add detection of libfann
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 21 Dec 2015 12:28:41 +0000 (12:28 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 21 Dec 2015 12:28:41 +0000 (12:28 +0000)
CMakeLists.txt
config.h.in
src/CMakeLists.txt
src/rspamadm/CMakeLists.txt

index ae77b8330d10d75b9a8eb59c3fcd39e20b3031f4..99c1f56c91eeb393d34fca3a501d67403e6561ee 100644 (file)
@@ -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)
index daa84f723c17ee6c824fb9ba840af2ebc4c21d60..b976b701c886f4571a9d8065de17678898058787 100644 (file)
 #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
index fc85428caf58e5c27a6e5804edd08cbc1eda1e06..385de9eb853d108a19127724c1c8a0e8bcc153c3 100644 (file)
@@ -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)
index c69bf0cbe179a6f636ccdb57528da5d25489f311..d57325f0e0ce7e8ee4cd2ff51ed18eebca055289 100644 (file)
@@ -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)