FIND_PACKAGE(XML2)

SET(XDMF_FOUND TRUE)
SET(XDMF_DIR /usr)
SET(XDMF_INCLUDE_DIRS ${XML2_INCLUDE_DIRS} ${XDMF_DIR}/include)
SET(XDMF_LIBRARY_DIRS /usr/lib/x86_64-linux-gnu/xdmf/serial/)
SET(XDMF_LIBRARIES  ${XDMF_LIBRARIES})

SET(XDMF_LIBRARIES_LIST
        Xdmf
        XdmfCore
        XdmfUtils
        )

FOREACH (LIB_ ${XDMF_LIBRARIES_LIST})
    find_library(${LIB_}_FILE NAMES ${LIB_} PATHS ${XDMF_LIBRARY_DIRS})
    IF (NOT ${LIB_}_FILE-NOTFOUND)
        LIST(APPEND XDMF_LIBRARIES ${${LIB_}_FILE})
    ENDIF (NOT ${LIB_}_FILE-NOTFOUND)
ENDFOREACH (LIB_ ${XDMF_LIBRARIES_LIST})

MESSAGE("-- XDMF include: ${XDMF_INCLUDE_DIRS}")