PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS}
DOC "Path where the libutil library can be found")
IF(LIBUTIL_LIBRARY)
- FIND_FILE(HAVE_LIBUTIL_H
+ FIND_FILE(_LIBUTIL_H
HINTS "${RSPAMD_SEARCH_PATH}"
NAMES libutil.h PATH ${RSPAMD_DEFAULT_INCLUDE_PATHS}
PATH_SUFFIXES include
DOC "Path to libutil header")
- IF(HAVE_LIBUTIL_H)
+ IF(_LIBUTIL_H)
+ SET(HAVE_LIBUTIL_H 1)
+ INCLUDE_DIRECTORIES(${_LIBUTIL_H})
+ LIST(APPEND CMAKE_REQUIRED_INCLUDES ${_LIBUTIL_H})
+ SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} -L${LIBUTIL_LIBRARY};-lutil")
LIST(APPEND RSPAMD_REQUIRED_LIBRARIES util)
CHECK_FUNCTION_EXISTS(pidfile_open HAVE_PIDFILE)
CHECK_FUNCTION_EXISTS(pidfile_fileno HAVE_PIDFILE_FILENO)
- ENDIF(HAVE_LIBUTIL_H)
+ ENDIF(_LIBUTIL_H)
ENDIF(LIBUTIL_LIBRARY)
# Find libfetch (for FreeBSD)