Better way of finding libzmq (#235)

* new strategy for finding zmq based on cppzmq
This commit is contained in:
Erik Fröjdh
2021-03-15 15:03:45 +01:00
committed by GitHub
parent 435146ca9c
commit bdeb030fea
13 changed files with 111 additions and 137 deletions

View File

@ -12,8 +12,21 @@ include(CMakeFindDependencyMacro)
set(SLS_USE_HDF5 "@SLS_USE_HDF5@")
# Add optional dependencies here
find_package(ZeroMQ 4 QUIET)
# libzmq autotools install: fallback to pkg-config
if(NOT ZeroMQ_FOUND)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
find_package(ZeroMQ 4 REQUIRED)
endif()
if(NOT ZeroMQ_FOUND)
message(FATAL_ERROR "ZeroMQ was NOT found!")
endif()
find_dependency(Threads)
# Add optional dependencies here
if (SLS_USE_HDF5)
find_dependency(HDF5)
endif ()