File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,9 @@ find_package(ZeroMQ QUIET)
5
5
6
6
# libzmq autotools install: fallback to pkg-config
7
7
if (NOT ZeroMQ_FOUND )
8
- include (${CMAKE_CURRENT_LIST_DIR} /libzmqPkgConfigFallback.cmake )
9
- endif ()
10
-
11
- if (NOT ZeroMQ_FOUND )
12
- message (FATAL_ERROR "ZeroMQ was NOT found!" )
8
+ # try again with pkg-config (normal install of zeromq)
9
+ list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} /libzmq-pkg-config )
10
+ find_package (ZeroMQ REQUIRED )
13
11
endif ()
14
12
15
13
if (ZeroMQ_FOUND AND (NOT TARGET libzmq OR NOT TARGET libzmq-static ))
@@ -60,5 +58,7 @@ install(EXPORT ${PROJECT_NAME}-targets
60
58
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR} )
61
59
install (FILES ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME}Config.cmake
62
60
${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME}ConfigVersion.cmake
63
- ${CMAKE_SOURCE_DIR} /libzmqPkgConfigFallback .cmake
61
+ ${CMAKE_SOURCE_DIR} /libzmq-pkg-config/FindZeroMQ .cmake
64
62
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR} )
63
+ install (FILES ${CMAKE_SOURCE_DIR} /libzmq-pkg-config/FindZeroMQ.cmake
64
+ DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR} /libzmq-pkg-config )
Original file line number Diff line number Diff line change @@ -7,14 +7,19 @@ find_library(ZeroMQ_LIBRARY NAMES libzmq.so libzmq.dylib libzmq.dll
7
7
find_library (ZeroMQ_STATIC_LIBRARY NAMES libzmq.a libzmq.dll.a
8
8
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS} )
9
9
10
+ if (ZeroMQ_LIBRARY AND ZeroMQ_STATIC_LIBRARY )
11
+ set (ZeroMQ_FOUND ON )
12
+ endif ()
13
+
14
+ if (TARGET libzmq )
15
+ # avoid errors defining targets twice
16
+ return ()
17
+ endif ()
18
+
10
19
add_library (libzmq SHARED IMPORTED )
11
20
set_property (TARGET libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS} )
12
21
set_property (TARGET libzmq PROPERTY IMPORTED_LOCATION ${ZeroMQ_LIBRARY} )
13
22
14
23
add_library (libzmq-static STATIC IMPORTED ${PC_LIBZMQ_INCLUDE_DIRS} )
15
24
set_property (TARGET libzmq-static PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS} )
16
25
set_property (TARGET libzmq-static PROPERTY IMPORTED_LOCATION ${ZeroMQ_STATIC_LIBRARY} )
17
-
18
- if (ZeroMQ_LIBRARY AND ZeroMQ_STATIC_LIBRARY )
19
- set (ZeroMQ_FOUND ON )
20
- endif ()
You can’t perform that action at this time.
0 commit comments