MACRO(HAS_LIBRARY lib)
    find_library(IS_EXIST_${lib} ${lib})
    if (NOT "${ARGV1}" STREQUAL "")
        set (LIB ${ARGV1})
    else()
        string(TOUPPER ${lib} LIB)
    endif()
    IF (${IS_EXIST_${lib}} MATCHES ".*-NOTFOUND")
        SET(HAS_${LIB} 0)
    ELSE()
        SET(HAS_${LIB} 1)
    ENDIF()
ENDMACRO(HAS_LIBRARY)