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})
|
2017-10-07 16:58:12 +02:00
|
|
|
find_library(ZeroMQ_LIBRARY NAMES libzmq.so libzmq.dylib libzmq.dll
|
2017-07-18 20:15:41 +02:00
|
|
|
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
|
2018-04-03 09:13:57 +02:00
|
|
|
find_library(ZeroMQ_STATIC_LIBRARY NAMES libzmq-static.a libzmq.a libzmq.dll.a
|
2017-07-18 20:15:41 +02:00
|
|
|
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
|
|
|
|
|
2018-01-13 23:13:38 +01:00
|
|
|
if(ZeroMQ_LIBRARY AND ZeroMQ_STATIC_LIBRARY)
|
|
|
|
set(ZeroMQ_FOUND ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (TARGET libzmq)
|
|
|
|
# avoid errors defining targets twice
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2017-07-18 20:15:41 +02:00
|
|
|
add_library(libzmq SHARED IMPORTED)
|
|
|
|
set_property(TARGET libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS})
|
|
|
|
set_property(TARGET libzmq PROPERTY IMPORTED_LOCATION ${ZeroMQ_LIBRARY})
|
|
|
|
|
|
|
|
add_library(libzmq-static STATIC IMPORTED ${PC_LIBZMQ_INCLUDE_DIRS})
|
|
|
|
set_property(TARGET libzmq-static PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS})
|
|
|
|
set_property(TARGET libzmq-static PROPERTY IMPORTED_LOCATION ${ZeroMQ_STATIC_LIBRARY})
|