Annotation of embedaddon/lighttpd/cmake/FindLibEV.cmake, revision 1.1

1.1     ! misho       1: 
        !             2: set(LIBEV_PATH "" CACHE PATH "Base path for include/ev.h and lib/libev*")
        !             3: set(LIBEV_INCLUDE_PATH "" CACHE PATH "Include path for ev.h")
        !             4: set(LIBEV_LIBDIR "" CACHE PATH "Path containing libev")
        !             5: 
        !             6: if(LIBEV_PATH)
        !             7:        set(LIBEV_INCLUDE_PATH "${LIBEV_PATH}/include" CACHE PATH "Include path for ev.h" FORCE)
        !             8:        set(LIBEV_LIBDIR "${LIBEV_PATH}/lib" CACHE PATH "Path containing libev" FORCE)
        !             9: endif()
        !            10: 
        !            11: if(LIBEV_INCLUDE_PATH)
        !            12:        include_directories(${LIBEV_INCLUDE_PATH})
        !            13: endif()
        !            14: 
        !            15: # Use cached result
        !            16: if(NOT LIBEV_FOUND)
        !            17:        unset(HAVE_EV_H)
        !            18:        unset(HAVE_LIBEV)
        !            19:        unset(HAVE_EV_H CACHE)
        !            20:        unset(HAVE_LIBEV CACHE)
        !            21:        unset(LIBEV_CFLAGS)
        !            22:        unset(LIBEV_LDFLAGS)
        !            23: 
        !            24:        if(LIBEV_INCLUDE_PATH OR LIBEV_LIBDIR)
        !            25:                set(CMAKE_REQUIRED_INCLUDES ${LIBEV_INCLUDE_PATH})
        !            26: #              message(STATUS "Looking for ev.h in ${CMAKE_REQUIRED_INCLUDES}")
        !            27:                check_include_files(ev.h HAVE_EV_H)
        !            28:                if(HAVE_EV_H)
        !            29: #                      message(STATUS "Looking for lib ev in ${LIBEV_LIBDIR}")
        !            30:                        check_library_exists(ev ev_time "${LIBEV_LIBDIR}" HAVE_LIBEV)
        !            31:                        if(HAVE_LIBEV)
        !            32:                                set(LIBEV_CFLAGS "" CACHE INTERNAL "")
        !            33:                                set(LIBEV_LDFLAGS "-L${LIBEV_LIBDIR} -lev" CACHE INTERNAL "")
        !            34:                                set(LIBEV_FOUND TRUE CACHE INTERNAL "Found libev")
        !            35:                        else()
        !            36:                                message(STATUS "Couldn't find lib ev in ${LIBEV_LIBDIR}")
        !            37:                        endif()
        !            38:                else()
        !            39:                        message(STATUS "Couldn't find <ev.h> in ${LIBEV_INCLUDE_PATH}")
        !            40:                endif()
        !            41:        else()
        !            42:                pkg_check_modules(LIBEV libev)
        !            43:                if(NOT LIBEV_FOUND)
        !            44: #                      message(STATUS "Looking for ev.h in ${CMAKE_REQUIRED_INCLUDES}")
        !            45:                        check_include_files(ev.h HAVE_EV_H)
        !            46:                        if(HAVE_EV_H)
        !            47: #                              message(STATUS "Looking for lib ev")
        !            48:                                check_library_exists(ev ev_time "" HAVE_LIBEV)
        !            49:                                if(HAVE_LIBEV)
        !            50:                                        set(LIBEV_CFLAGS "" CACHE INTERNAL "")
        !            51:                                        set(LIBEV_LDFLAGS "-lev" CACHE INTERNAL "")
        !            52:                                        set(LIBEV_FOUND TRUE CACHE INTERNAL "Found libev")
        !            53:                                else()
        !            54:                                        message(STATUS "Couldn't find lib ev")
        !            55:                                endif()
        !            56:                        else()
        !            57:                                message(STATUS "Couldn't find <ev.h>")
        !            58:                        endif()
        !            59:                endif()
        !            60:        endif()
        !            61: 
        !            62: endif()
        !            63: 
        !            64: if(NOT LIBEV_FOUND)
        !            65:        if(LibEV_FIND_REQUIRED)
        !            66:                message(FATAL_ERROR "Could not find libev")
        !            67:        endif()
        !            68: endif()
        !            69: 
        !            70: mark_as_advanced(LIBEV_PATH LIBEV_INCLUDE_PATH LIBEV_LIBDIR)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>