mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-04-01 09:24:53 +02:00
Merge pull request #243 from sigiesec/fail-if-libzmq-not-found
Problem: cmake build succeeds even if libzmq not found
This commit is contained in:
commit
3c14d37d8b
@ -10,11 +10,16 @@ find_package(ZeroMQ QUIET)
|
||||
|
||||
# libzmq autotools install: fallback to pkg-config
|
||||
if(NOT ZeroMQ_FOUND)
|
||||
# try again with pkg-config (normal install of zeromq)
|
||||
message(STATUS "CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)")
|
||||
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
|
||||
find_package(ZeroMQ REQUIRED)
|
||||
endif()
|
||||
|
||||
# TODO "REQUIRED" above should already cause a fatal failure if not found, but this doesn't seem to work
|
||||
if(NOT ZeroMQ_FOUND)
|
||||
message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config")
|
||||
endif()
|
||||
|
||||
if (ZeroMQ_FOUND AND (NOT TARGET libzmq OR NOT TARGET libzmq-static))
|
||||
message(FATAL_ERROR "ZeroMQ version not supported!")
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user