SET(ASAPO_COMMON_FABRIC_LIBRARIES ${ASAPO_COMMON_IO_LIBRARIES})
IF(ENABLE_LIBFABRIC)
    find_package(LibFabric)
    if(NOT LIBFABRIC_LIBRARY)
        message(FATAL_ERROR "Did not find libfabric")
    endif()
    message(STATUS "LibFabric support enabled")
    message(STATUS "LIB_FABRIC: Path: ${LIBFABRIC_LIBRARY} Include: ${LIBFABRIC_INCLUDE_DIR}")
    add_definitions(-DLIBFABRIC_ENABLED)
    SET(ASAPO_COMMON_FABRIC_LIBRARIES ${ASAPO_COMMON_FABRIC_LIBRARIES} dl)
    IF(ENABLE_LIBFABRIC_LOCALHOST)
        message(STATUS "LIB_FABRIC: Enabled emulated RDMA when localhost is used. Should only be used for tests.")
        add_definitions(-DLIBFARBIC_ALLOW_LOCALHOST)
    ENDIF()
ENDIF()
SET_PROPERTY(GLOBAL PROPERTY ASAPO_COMMON_FABRIC_LIBRARIES ${ASAPO_COMMON_FABRIC_LIBRARIES})
