summaryrefslogtreecommitdiff
path: root/net-libs/cppzmq/files/cppzmq-disable-static.patch
blob: 12b1c2231205a3a146dac24c10a577fb1b1e263c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@
     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))
+if (ZeroMQ_FOUND AND NOT TARGET libzmq)
   message(FATAL_ERROR "ZeroMQ version not supported!")
 endif()
 
@@ -43,19 +43,20 @@
     zmq_addon.hpp
 )
 
-foreach (target cppzmq cppzmq-static)
+set (cppzmq_targets cppzmq cppzmq-static)
+
+foreach (target ${cppzmq_targets})
   add_library(${target} INTERFACE)
   target_include_directories(${target} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
                                                  $<INSTALL_INTERFACE:include>)
 endforeach()
 
 target_link_libraries(cppzmq INTERFACE libzmq)
-target_link_libraries(cppzmq-static INTERFACE libzmq-static)
 
 include(GNUInstallDirs)
 include(CMakePackageConfigHelpers)
 
-install(TARGETS cppzmq cppzmq-static
+install(TARGETS ${cppzmq_targets}
         EXPORT ${PROJECT_NAME}-targets)
 
 install(FILES ${CPPZMQ_HEADERS}