Skip to content

Commit 38e4d2d

Browse files
committed
Do not look for ZeroMQ directly as it is a dependency of cppzmq
Also only look for cppzmq if BTCPP_GROOT_INTERFACE
1 parent 0bafb1b commit 38e4d2d

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

3rdparty/cppzmq/CMakeLists.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
find_package(ZeroMQ REQUIRED)
22

33
add_library(cppzmq INTERFACE)
4-
if(TARGET libzmq-static)
5-
target_link_libraries(cppzmq INTERFACE libzmq-static)
6-
elseif(TARGET libzmq)
7-
target_link_libraries(cppzmq INTERFACE libzmq)
8-
else()
9-
message(FATAL_ERROR "Failed to find libzmq")
10-
endif()
114

125
# This library doesn't use modern targets unfortunately.
136
#add_library(cppzmq::cppzmq ALIAS cppzmq)
@@ -16,3 +9,11 @@ target_include_directories(cppzmq
169
INTERFACE
1710
${CMAKE_CURRENT_SOURCE_DIR}
1811
)
12+
13+
if(TARGET libzmq-static)
14+
target_link_libraries(cppzmq INTERFACE libzmq-static)
15+
elseif(TARGET libzmq)
16+
target_link_libraries(cppzmq INTERFACE libzmq)
17+
else()
18+
message(FATAL_ERROR "Unknown zeromq target name")
19+
endif()

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ endif()
104104
find_package(Threads REQUIRED)
105105

106106
if(BTCPP_GROOT_INTERFACE)
107-
find_package(ZeroMQ REQUIRED)
107+
if(USE_VENDORED_CPPZMQ)
108+
add_subdirectory(3rdparty/cppzmq)
109+
else()
110+
find_package(cppzmq REQUIRED)
111+
endif()
108112
endif()
109113

110114
if(BTCPP_SQLITE_LOGGING)
@@ -115,11 +119,7 @@ if(BTCPP_SQLITE_LOGGING)
115119
endif()
116120
endif()
117121

118-
if(USE_VENDORED_CPPZMQ)
119-
add_subdirectory(3rdparty/cppzmq)
120-
else()
121-
find_package(cppzmq REQUIRED)
122-
endif()
122+
123123

124124
if(USE_VENDORED_FLATBUFFERS)
125125
add_subdirectory(3rdparty/flatbuffers)

0 commit comments

Comments
 (0)