2018-05-23 20:31:07 +02:00
|
|
|
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
|
2017-07-18 20:15:41 +02:00
|
|
|
find_package(PkgConfig)
|
|
|
|
pkg_check_modules(PC_LIBZMQ QUIET libzmq)
|
|
|
|
|
|
|
|
set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
|
|
|
|
|
2021-07-28 21:04:53 +02:00
|
|
|
find_path(ZeroMQ_INCLUDE_DIR zmq.h
|
|
|
|
PATHS ${ZeroMQ_DIR}/include
|
|
|
|
${PC_LIBZMQ_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
find_library(ZeroMQ_LIBRARY
|
|
|
|
NAMES zmq
|
|
|
|
PATHS ${ZeroMQ_DIR}/lib
|
|
|
|
${PC_LIBZMQ_LIBDIR}
|
|
|
|
${PC_LIBZMQ_LIBRARY_DIRS})
|
|
|
|
|
|
|
|
if(ZeroMQ_LIBRARY)
|
2018-01-13 23:13:38 +01:00
|
|
|
set(ZeroMQ_FOUND ON)
|
|
|
|
endif()
|
|
|
|
|
2021-07-28 21:04:53 +02:00
|
|
|
set ( ZeroMQ_LIBRARIES ${ZeroMQ_LIBRARY} )
|
|
|
|
set ( ZeroMQ_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIR} )
|
2018-01-13 23:13:38 +01:00
|
|
|
|
2021-07-28 21:04:53 +02:00
|
|
|
if(NOT TARGET libzmq)
|
|
|
|
add_library(libzmq UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(libzmq PROPERTIES
|
|
|
|
IMPORTED_LOCATION ${ZeroMQ_LIBRARIES}
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES ${ZeroMQ_INCLUDE_DIRS})
|
|
|
|
endif()
|
2017-07-18 20:15:41 +02:00
|
|
|
|
2021-07-28 21:04:53 +02:00
|
|
|
include ( FindPackageHandleStandardArgs )
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE
|
|
|
|
# if all listed variables are TRUE
|
|
|
|
find_package_handle_standard_args ( ZeroMQ DEFAULT_MSG ZeroMQ_LIBRARIES ZeroMQ_INCLUDE_DIRS )
|