celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rlenfer...@apache.org
Subject [celix] 02/02: Improved separate building of pubsub admins
Date Fri, 21 Jun 2019 16:57:15 GMT
This is an automated email from the ASF dual-hosted git repository.

rlenferink pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/celix.git

commit 031e469dc3533caa32990392e48456ad71218037
Author: Roy Lenferink <lenferinkroy@gmail.com>
AuthorDate: Fri Jun 21 13:28:41 2019 +0200

    Improved separate building of pubsub admins
---
 bundles/pubsub/examples/CMakeLists.txt             | 66 ++++++++++++----------
 .../pubsub_admin_udp_mc/src/pubsub_udpmc_admin.c   |  2 +-
 bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt     |  2 +-
 3 files changed, 37 insertions(+), 33 deletions(-)

diff --git a/bundles/pubsub/examples/CMakeLists.txt b/bundles/pubsub/examples/CMakeLists.txt
index bdbd9c2..3b96478 100644
--- a/bundles/pubsub/examples/CMakeLists.txt
+++ b/bundles/pubsub/examples/CMakeLists.txt
@@ -20,11 +20,9 @@ add_subdirectory(pubsub)
 find_program(ETCD_CMD NAMES etcd)
 find_program(XTERM_CMD NAMES xterm)
 
-find_package(ZMQ REQUIRED)
-find_package(CZMQ REQUIRED)
 find_package(Jansson REQUIRED)
 
-set(PUBSUB_CONTAINER_LIBS ${JANSSON_LIBRARY} ${ZMQ_LIBRARIES} ${CZMQ_LIBRARIES} ${NANOMSG_LIBRARIES}
${OPENSSL_CRYPTO_LIBRARY} Celix::dfi)
+set(PUBSUB_CONTAINER_LIBS ${JANSSON_LIBRARY} Celix::dfi)
 
 # UDP Multicast
 add_celix_container(pubsub_publisher_udp_mc
@@ -99,6 +97,10 @@ if (ETCD_CMD AND XTERM_CMD)
 endif ()
 
 if (BUILD_PUBSUB_PSA_ZMQ)
+    find_package(ZMQ REQUIRED)
+    find_package(CZMQ REQUIRED)
+
+    set(PUBSUB_CONTAINER_LIBS ${PUBSUB_CONTAINER_LIBS} ${ZMQ_LIBRARIES} ${CZMQ_LIBRARIES}
${OPENSSL_CRYPTO_LIBRARY})
 
     # Dynamic ZMQ / UDP admin
     add_celix_container(pubsub_publisher
@@ -117,8 +119,8 @@ if (BUILD_PUBSUB_PSA_ZMQ)
     target_link_libraries(pubsub_publisher PRIVATE ${PUBSUB_CONTAINER_LIBS})
 
     add_celix_container(pubsub_subscriber
-            GROUP "pubsub"
-            BUNDLES
+        GROUP "pubsub"
+        BUNDLES
             Celix::shell
             Celix::shell_tui
             Celix::pubsub_serializer_json
@@ -201,7 +203,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
     target_link_libraries(pubsub_subscriber2_zmq PRIVATE ${PUBSUB_CONTAINER_LIBS})
 
     if (ETCD_CMD AND XTERM_CMD)
-        #Runtime starting two bundles using both zmq and upd mc pubsub
+        # Runtime starting two bundles using both zmq and upd mc pubsub
         add_celix_runtime(pubsub_rt_zmq_udpmc_combi
             NAME combi
             GROUP pubsub
@@ -214,7 +216,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
             USE_TERM
         )
 
-        #Runtime starting a publish and 2 subscribers for zmq
+        # Runtime starting a publish and 2 subscribers for zmq
         add_celix_runtime(pubsub_rt_zmq
             NAME zmq
             GROUP pubsub
@@ -228,10 +230,13 @@ if (BUILD_PUBSUB_PSA_ZMQ)
         )
     endif ()
 endif()
+
 if (BUILD_PUBSUB_PSA_NANOMSG)
+    set(PUBSUB_CONTAINER_LIBS ${NANOMSG_LIBRARIES} ${PUBSUB_CONTAINER_LIBS})
+
     add_celix_container("pubsub_publisher1_nanomsg"
-            GROUP "pubsub"
-            BUNDLES
+        GROUP "pubsub"
+        BUNDLES
             Celix::shell
             Celix::shell_tui
             Celix::pubsub_serializer_json
@@ -239,16 +244,16 @@ if (BUILD_PUBSUB_PSA_NANOMSG)
             Celix::pubsub_topology_manager
             Celix::pubsub_admin_nanomsg
             celix_pubsub_poi_publisher
-            PROPERTIES
+        PROPERTIES
             PSA_NANOMSG_VERBOSE=true
             PUBSUB_ETCD_DISCOVERY_VERBOSE=true
             PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true
-            )
+    )
     target_link_libraries(pubsub_publisher1_nanomsg PRIVATE ${PUBSUB_CONTAINER_LIBS})
 
     add_celix_container("pubsub_publisher2_nanomsg"
-            GROUP "pubsub"
-            BUNDLES
+        GROUP "pubsub"
+        BUNDLES
             Celix::shell
             Celix::shell_tui
             Celix::pubsub_serializer_json
@@ -256,16 +261,16 @@ if (BUILD_PUBSUB_PSA_NANOMSG)
             Celix::pubsub_topology_manager
             Celix::pubsub_admin_nanomsg
             celix_pubsub_poi_publisher
-            PROPERTIES
+        PROPERTIES
             PSA_NANOMSG_VERBOSE=true
             PUBSUB_ETCD_DISCOVERY_VERBOSE=true
             PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true
-            )
+    )
     target_link_libraries(pubsub_publisher2_nanomsg PRIVATE ${PUBSUB_CONTAINER_LIBS})
 
     add_celix_container(pubsub_subscriber1_nanomsg
-            GROUP "pubsub"
-            BUNDLES
+        GROUP "pubsub"
+        BUNDLES
             Celix::shell
             Celix::shell_tui
             Celix::pubsub_serializer_json
@@ -273,16 +278,16 @@ if (BUILD_PUBSUB_PSA_NANOMSG)
             Celix::pubsub_topology_manager
             Celix::pubsub_admin_nanomsg
             celix_pubsub_poi_subscriber
-            PROPERTIES
+        PROPERTIES
             PSA_NANOMSG_VERBOSE=true
             PUBSUB_ETCD_DISCOVERY_VERBOSE=true
             PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true
-            )
+    )
     target_link_libraries(pubsub_subscriber1_nanomsg PRIVATE ${PUBSUB_CONTAINER_LIBS})
 
     add_celix_container(pubsub_subscriber2_nanomsg
-            GROUP "pubsub"
-            BUNDLES
+        GROUP "pubsub"
+        BUNDLES
             Celix::shell
             Celix::shell_tui
             Celix::pubsub_serializer_json
@@ -290,28 +295,27 @@ if (BUILD_PUBSUB_PSA_NANOMSG)
             Celix::pubsub_topology_manager
             Celix::pubsub_admin_nanomsg
             celix_pubsub_poi_subscriber
-            PROPERTIES
+        PROPERTIES
             PSA_NANOMSG_VERBOSE=true
             PUBSUB_ETCD_DISCOVERY_VERBOSE=true
             PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true
-            )
+    )
     target_link_libraries(pubsub_subscriber2_nanomsg PRIVATE ${PUBSUB_CONTAINER_LIBS})
 
-
     if (ETCD_CMD AND XTERM_CMD)
-        #Runtime starting a publish and 2 subscribers for zmq
+        # Runtime starting a publisher and 2 subscribers for nanomsg
         add_celix_runtime(pubsub_rt_nanomsg
-                NAME nanomsg
-                GROUP pubsub
-                CONTAINERS
+            NAME nanomsg
+            GROUP pubsub
+            CONTAINERS
                 pubsub_publisher1_nanomsg
                 pubsub_publisher2_nanomsg
                 pubsub_subscriber1_nanomsg
                 pubsub_subscriber2_nanomsg
-                COMMANDS
+            COMMANDS
                 etcd
-                USE_TERM
-                )
+            USE_TERM
+        )
     endif ()
 
 endif()
diff --git a/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_admin.c b/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_admin.c
index b7fc8bd..43602a4 100644
--- a/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_admin.c
+++ b/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_admin.c
@@ -500,7 +500,7 @@ static celix_status_t pubsub_udpmcAdmin_disconnectEndpointFromReceiver(pubsub_ud
     long sockPort = celix_properties_getAsLong(endpoint, PUBSUB_PSA_UDPMC_SOCKET_PORT_KEY,
-1L);
 
     if (type == NULL || sockAdress == NULL || sockPort < 0) {
-        fprintf(stderr, "[PSA UPDMC] Error got endpoint without udpmc socket address/port
or endpoint type");
+        fprintf(stderr, "[PSA UPDMC] Error got endpoint without udpmc socket address/port
or endpoint type\n");
         status = CELIX_BUNDLE_EXCEPTION;
     } else {
         if (eScope != NULL && eTopic != NULL && type != NULL &&
diff --git a/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt b/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt
index 6664c45..2ef2001 100644
--- a/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt
@@ -34,7 +34,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
 		find_package(OpenSSL 1.1.0 REQUIRED)
 		include_directories("${OPENSSL_INCLUDE_DIR}")
 
-		set (ZMQ_CRYPTO_C "private/src/zmq_crypto.c")
+		set (ZMQ_CRYPTO_C "src/zmq_crypto.c")
 	endif()
 
 	add_celix_bundle(celix_pubsub_admin_zmq


Mime
View raw message