set(LIBEVENT_PATH CACHE PATH "The directory of libevent")
set(LIBEVENT_SEARCH_PATH /usr/local ${LIBEVENT_PATH})

FIND_PATH(LIBEVENT_INCLUDE_DIR
	NAMES event.h
	PATH_SUFFIXES include
	PATHS ${LIBEVENT_SEARCH_PATH})
	
FIND_LIBRARY(LIBEVENT_CORE
	NAMES event_core
	PATH_SUFFIXES lib
	PATHS ${LIBEVENT_SEARCH_PATH})
FIND_LIBRARY(LIBEVENT_EXTRA
	NAMES event_extra
	PATH_SUFFIXES lib
	PATHS ${LIBEVENT_SEARCH_PATH})

if (LIBEVENT_CORE)
	get_filename_component(LIBEVENT_BINARY_DIR ${LIBEVENT_CORE} DIRECTORY)
endif()
	
INCLUDE(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibeventBin DEFAULT_MSG
    LIBEVENT_INCLUDE_DIR
	LIBEVENT_BINARY_DIR)