# Find the LibExecinfo library - FreeBSD only

FIND_PATH(LIBEXECINFO_INCLUDE_DIR execinfo.h)
FIND_LIBRARY(LIBEXECINFO_LIBRARY NAMES execinfo)

IF(LIBEXECINFO_INCLUDE_DIR AND LIBEXECINFO_LIBRARY)
	SET(LIBEXECINFO_FOUND TRUE)
ENDIF()

IF(LIBEXECINFO_FOUND)
	IF(NOT LIBEXECINFO_FIND_QUIETLY)
		MESSAGE(STATUS "Found LibExecinfo: ${EXECINFO_LIBRARY}")
	ENDIF()
ELSE()
	IF(LIBEXECINFO_FIND_REQUIRED)
		MESSAGE(FATAL_ERROR "Could not find LibExecinfo")
	ENDIF()
ENDIF()