ENDIF(LIBFETCH_LIBRARY)
ENDIF(ENABLE_URL_INCLUDE MATCHES "ON")
+# Find liblmdb
+FIND_LIBRARY(LIBLMDB_LIBRARY NAMES lmdb PATHS PATH_SUFFIXES lib64 lib
+ PATHS
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /usr/local
+ /usr
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ DOC "Path where the liblmdb library can be found")
+IF(LIBLMDB_LIBRARY)
+ FIND_PATH(LIBLMDB_INCLUDE lmdb.h PATHS /opt/include
+ /usr/include
+ /usr/local/include
+ DOC "Path where the lmdb header files can be found")
+
+ GET_FILENAME_COMPONENT(LIBLMDB_PATH "${LIBLMDB_LIBRARY}" PATH)
+ INCLUDE_DIRECTORIES("${LIBLMDB_INCLUDE}")
+ LINK_DIRECTORIES("${LIBLMDB_PATH}")
+ELSE(LIBLMDB_LIBRARY)
+ MESSAGE(FATAL "Liblmdb is required for rspamd")
+ENDIF(LIBLMDB_LIBRARY)
+
# Static build
IF(ENABLE_STATIC MATCHES "ON")