FIND_PATH(LIBEV_INCLUDE_DIR ev.h /usr/local/include /opt/local/include /usr/include)
FIND_LIBRARY(LIBEV_LIBRARY NAMES libev.a PATH /usr/local/lib /opt/local/lib /usr/lib)

IF (LIBEV_INCLUDE_DIR AND LIBEV_LIBRARY)
    SET(LIBEV_FOUND TRUE)
ENDIF ()

IF (LIBEV_FOUND)
    IF (NOT Libev_FIND_QUIETLY)
        MESSAGE(STATUS "Found libev: ${LIBEV_LIBRARY}")
    ENDIF ()
ELSE()
    IF (Libev_FIND_REQUIRED)
        IF(NOT LIBEV_INCLUDE_DIR)
            MESSAGE(FATAL_ERROR "Could not find libev header file!")
        ENDIF()

        IF(NOT LIBEV_LIBRARY)
            MESSAGE(FATAL_ERROR "Could not find libev library file!")
        ENDIF()
    ENDIF ()
ENDIF ()
