# - Try to find libzmq
# Once done this will define
#  ZMQ_FOUND - System has libzmq
#  ZMQ_INCLUDE_DIRS - The libzmq include directories
#  ZMQ_LIBRARIES - The libraries needed to use libzmq

FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_ZMQ REQUIRED libzmq)

FIND_PATH(ZMQ_INCLUDE_DIR zmq.h
    HINTS ${PC_ZMQ_INCLUDEDIR} ${PC_ZMQ_INCLUDE_DIRS})

FIND_LIBRARY(ZMQ_LIBRARY NAMES zmq
    HINTS ${PC_ZMQ_LIBDIR} ${PC_ZMQ_LIBRARY_DIRS})

SET(ZMQ_LIBRARIES ${ZMQ_LIBRARY})
SET(ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR})

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZMQ DEFAULT_MSG ZMQ_LIBRARIES ZMQ_INCLUDE_DIRS)

MARK_AS_ADVANCED(ZMQ_INCLUDE_DIRS ZMQ_LIBRARIES)