Skip to content

Commit 3c14d37

Browse files
authored
Merge pull request #243 from sigiesec/fail-if-libzmq-not-found
Problem: cmake build succeeds even if libzmq not found
2 parents 1f14f9a + c69c1f9 commit 3c14d37

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ find_package(ZeroMQ QUIET)
1010

1111
# libzmq autotools install: fallback to pkg-config
1212
if(NOT ZeroMQ_FOUND)
13-
# try again with pkg-config (normal install of zeromq)
13+
message(STATUS "CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)")
1414
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
1515
find_package(ZeroMQ REQUIRED)
1616
endif()
1717

18+
# TODO "REQUIRED" above should already cause a fatal failure if not found, but this doesn't seem to work
19+
if(NOT ZeroMQ_FOUND)
20+
message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config")
21+
endif()
22+
1823
if (ZeroMQ_FOUND AND (NOT TARGET libzmq OR NOT TARGET libzmq-static))
1924
message(FATAL_ERROR "ZeroMQ version not supported!")
2025
endif()

0 commit comments

Comments
 (0)