Skip to content
Permalink
Browse files
Merge pull request #409 from apache/feature/rename_zmq_and_jansson_ta…
…rgets_to_align_with_conan

Feature/rename zmq and jansson targets to align with conan
  • Loading branch information
pnoltes committed Apr 6, 2022
2 parents 39dbc79 + fba37f8 commit 91fff325e328b3b2485940d128f5664cf60342a6
Showing 24 changed files with 78 additions and 76 deletions.
@@ -25,6 +25,7 @@ jobs:
BUILD_OPTIONS: |
-DENABLE_TESTING=ON
-DENABLE_ADDRESS_SANITIZER=ON
-DBUILD_CXX_REMOTE_SERVICE_ADMIN=ON
run: |
mkdir build install
cd build
@@ -55,6 +55,7 @@ jobs:
BUILD_OPTIONS: |
-DENABLE_TESTING=ON
-DBUILD_EXPERIMENTAL=ON
-DBUILD_CXX_REMOTE_SERVICE_ADMIN=ON
BUILD_OPTIONS_SANITIZER: |
-DENABLE_ADDRESS_SANITIZER=ON
BUILD_OPTIONS_V3_API: |
@@ -32,7 +32,7 @@ find_package(ZLIB REQUIRED) #framework
find_package(UUID REQUIRED) #framework
find_package(CURL REQUIRED) #framework, etcdlib
find_package(LIBZIP REQUIRED) #framework, etcdlib
find_package(Jansson REQUIRED) #etcdlib, dfi
find_package(jansson REQUIRED) #etcdlib, dfi
find_package(FFI REQUIRED) #dfi
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
@@ -58,7 +58,7 @@ if (NOT TARGET CURL::libcurl)
endif ()

if (NOT TARGET jansson::jansson)
message("Note jansson::jansson target not created by find_package(Jansson). Creating jansson::jansson Target.")
message("Note jansson::jansson target not created by find_package(jansson). Creating jansson::jansson Target.")
add_library(jansson::jansson SHARED IMPORTED)
set_target_properties(jansson::jansson PROPERTIES
IMPORTED_LOCATION "${JANSSON_LIBRARIES}"
@@ -17,8 +17,8 @@

celix_subproject(CXX_RSA_INTEGRATION "Option to build the C++17 Remote Service Admin Service integration" ON DEPS SHELL SHELL_TUI PUBSUB PROMISES PUSHSTREAMS PUBSUB_PSA_ZMQ PUBSUB_DISCOVERY_ETCD)
if (CXX_RSA_INTEGRATION)
find_package(ZMQ REQUIRED)
find_package(CZMQ REQUIRED)
find_package(ZeroMQ REQUIRED)
find_package(czmq REQUIRED)
add_celix_bundle(TestExportImportRemoteServiceFactory
SOURCES src/TestExportImportRemoteServiceFactory.cc
)
@@ -71,7 +71,7 @@ if (CXX_RSA_INTEGRATION)

CalculatorProvider
)
target_link_libraries(RemoteCalculatorProvider PRIVATE ZMQ::lib CZMQ::lib)
target_link_libraries(RemoteCalculatorProvider PRIVATE ZeroMQ::ZeroMQ czmq::czmq)

add_celix_container(RemoteCalculatorConsumer
GROUP rsa
@@ -95,5 +95,5 @@ if (CXX_RSA_INTEGRATION)

CalculatorConsumer
)
target_link_libraries(RemoteCalculatorConsumer PRIVATE ZMQ::lib CZMQ::lib)
endif()
target_link_libraries(RemoteCalculatorConsumer PRIVATE ZeroMQ::ZeroMQ czmq::czmq)
endif()
@@ -18,7 +18,7 @@
add_executable(test_cxx_remote_services_integration
src/RemoteServicesIntegrationTestSuite.cc
)
target_link_libraries(test_cxx_remote_services_integration PRIVATE Celix::framework Celix::Promises Celix::PushStreams Celix::shell_api ZMQ::lib CZMQ::lib GTest::gtest GTest::gtest_main)
target_link_libraries(test_cxx_remote_services_integration PRIVATE Celix::framework Celix::Promises Celix::PushStreams Celix::shell_api ZeroMQ::ZeroMQ czmq::czmq GTest::gtest GTest::gtest_main)
target_include_directories(test_cxx_remote_services_integration PRIVATE ../include) #Add ICalculator

add_celix_bundle_dependencies(test_cxx_remote_services_integration
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)

add_celix_bundle(http_admin_sut
#"Vanilla" bundle which is under test
@@ -22,7 +22,7 @@ if (PUBSUB_EXAMPLES)
find_program(ETCD_CMD NAMES etcd)
find_program(XTERM_CMD NAMES xterm)

find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)

set(PUBSUB_CONTAINER_LIBS jansson::jansson Celix::dfi)

@@ -176,10 +176,10 @@ if (PUBSUB_EXAMPLES)
endif()

if (BUILD_PUBSUB_PSA_ZMQ)
find_package(ZMQ REQUIRED)
find_package(CZMQ REQUIRED)
find_package(ZeroMQ REQUIRED)
find_package(czmq REQUIRED)

set(PUBSUB_CONTAINER_LIBS ${PUBSUB_CONTAINER_LIBS} ZMQ::lib CZMQ::lib ${OPTIONAL_OPENSSL_LIB})
set(PUBSUB_CONTAINER_LIBS ${PUBSUB_CONTAINER_LIBS} ZeroMQ::ZeroMQ czmq::czmq ${OPTIONAL_OPENSSL_LIB})

if (BUILD_PUBSUB_PSA_TCP AND BUILD_PUBSUB_PSA_UDP_MC)
# Dynamic ZMQ / UDP / TCP admin
@@ -17,7 +17,7 @@

celix_subproject(PUBSUB_INTEGRATION "Option to build the pubsub integration" ON DEPS SHELL SHELL_TUI)
if (PUBSUB_INTEGRATION)
find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)

add_celix_bundle(pubsub_endpoint_sut
#"Vanilla" bundle which is under test
@@ -376,8 +376,8 @@ if (PUBSUB_INTEGRATION)
endif()

if (BUILD_PUBSUB_PSA_ZMQ)
find_package(ZMQ REQUIRED)
find_package(CZMQ REQUIRED)
find_package(ZeroMQ REQUIRED)
find_package(czmq REQUIRED)

add_celix_container(pubsub_zmq_v2_tests
USE_CONFIG #ensures that a config.properties will be created with the launch bundles.
@@ -396,7 +396,7 @@ if (PUBSUB_INTEGRATION)
pubsub_serializer
)

target_link_libraries(pubsub_zmq_v2_tests PRIVATE Celix::pubsub_api Celix::dfi ZMQ::lib CZMQ::lib GTest::gtest GTest::gtest_main)
target_link_libraries(pubsub_zmq_v2_tests PRIVATE Celix::pubsub_api Celix::dfi ZeroMQ::ZeroMQ czmq::czmq GTest::gtest GTest::gtest_main)
target_include_directories(pubsub_zmq_v2_tests SYSTEM PRIVATE gtest)
add_test(NAME pubsub_zmq_v2_tests COMMAND pubsub_zmq_v2_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_zmq_v2_tests,CONTAINER_LOC>)
setup_target_for_coverage(pubsub_zmq_v2_tests SCAN_DIR ..)
@@ -421,7 +421,7 @@ if (PUBSUB_INTEGRATION)
pubsub_serializer
)

target_link_libraries(pubsub_zmq_v2_zerocopy_tests PRIVATE Celix::pubsub_api Celix::dfi ZMQ::lib CZMQ::lib GTest::gtest GTest::gtest_main)
target_link_libraries(pubsub_zmq_v2_zerocopy_tests PRIVATE Celix::pubsub_api Celix::dfi ZeroMQ::ZeroMQ czmq::czmq GTest::gtest GTest::gtest_main)
target_include_directories(pubsub_zmq_v2_zerocopy_tests SYSTEM PRIVATE gtest)

add_test(NAME pubsub_zmq_v2_zerocopy_tests COMMAND pubsub_zmq_v2_zerocopy_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_zmq_v2_zerocopy_tests,CONTAINER_LOC>)
@@ -442,7 +442,7 @@ if (PUBSUB_INTEGRATION)
)

target_compile_definitions(pstm_deadlock_zmq_v2_test PRIVATE -DDEADLOCK_SUT_BUNDLE_FILE=\"${DEADLOCK_SUT_BUNDLE_FILE}\")
target_link_libraries(pstm_deadlock_zmq_v2_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main Celix::dfi ZMQ::lib CZMQ::lib)
target_link_libraries(pstm_deadlock_zmq_v2_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main Celix::dfi ZeroMQ::ZeroMQ czmq::czmq)
target_include_directories(pstm_deadlock_zmq_v2_test SYSTEM PRIVATE pstm_deadlock_zmq_v2_test)

#Note we do not link to bundles, as result (to ensure a bundle zip file is created) an dependency on the bundle is needed.
@@ -535,8 +535,8 @@ if (PUBSUB_INTEGRATION)
endif ()

#Linking against zmq if present
if (TARGET ZMQ::lib AND TARGET CZMQ::lib)
target_link_libraries(${TEST_TARGET_NAME} PRIVATE ZMQ::lib CZMQ::lib)
if (TARGET ZeroMQ::ZeroMQ AND TARGET czmq::czmq)
target_link_libraries(${TEST_TARGET_NAME} PRIVATE ZeroMQ::ZeroMQ czmq::czmq)
endif ()
endfunction()

@@ -17,14 +17,14 @@

if (BUILD_ZMQ_SECURITY)

find_package(ZMQ REQUIRED)
find_package(CZMQ REQUIRED)
find_package(ZeroMQ REQUIRED)
find_package(czmq REQUIRED)
find_package(OpenSSL 1.1.0 REQUIRED)

add_executable(makecert makecert.c)
target_link_libraries(makecert CZMQ::lib)
target_link_libraries(makecert czmq::czmq)

add_executable(ed_file ed_file.c)
target_link_libraries(ed_file PUBLIC ZMQ::lib CZMQ::lib OpenSSL::SSL)
target_link_libraries(ed_file PUBLIC ZeroMQ::ZeroMQ czmq::czmq OpenSSL::SSL)

endif()
@@ -17,7 +17,7 @@

celix_subproject(PUBSUB_PSA_UDP_MC "Build UDP MC PubSub Admin" ON)
if (PUBSUB_PSA_UDP_MC)
find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)

add_celix_bundle(celix_pubsub_admin_udp_multicast
BUNDLE_SYMBOLICNAME "apache_celix_pubsub_admin_udp_multicast"
@@ -17,7 +17,7 @@

celix_subproject(PUBSUB_PSA_WS "Build WebSocket PubSub Admin" ON DEPS HTTP_ADMIN)
if (PUBSUB_PSA_WS)
find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)
find_package(UUID REQUIRED)

add_celix_bundle(celix_pubsub_admin_websocket
@@ -17,8 +17,8 @@

celix_subproject(PUBSUB_PSA_ZMQ "Build ZeroMQ PubSub Admin (LGPL License)" ON)
if (PUBSUB_PSA_ZMQ)
find_package(ZMQ REQUIRED)
find_package(CZMQ REQUIRED)
find_package(ZeroMQ REQUIRED)
find_package(czmq REQUIRED)
find_package(UUID REQUIRED)

set(OPTIONAL_OPENSSL_LIB )
@@ -48,7 +48,7 @@ if (PUBSUB_PSA_ZMQ)

target_link_libraries(celix_pubsub_admin_zmq PRIVATE
Celix::framework Celix::dfi Celix::log_helper Celix::utils
ZMQ::lib CZMQ::lib ${OPTIONAL_OPENSSL_LIB})
ZeroMQ::ZeroMQ czmq::czmq ${OPTIONAL_OPENSSL_LIB})
target_link_libraries(celix_pubsub_admin_zmq PRIVATE Celix::shell_api)
target_link_libraries(celix_pubsub_admin_zmq PRIVATE Celix::pubsub_spi Celix::pubsub_utils)
target_include_directories(celix_pubsub_admin_zmq PRIVATE src)
@@ -18,7 +18,7 @@
celix_subproject(PUBSUB_DISCOVERY_ETCD "Option to enable building the PubSub Discovery (ETCD) bundle" ON DEPS CELIX_ETCDLIB)
if (PUBSUB_DISCOVERY_ETCD)
find_package(CURL REQUIRED)
find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)

add_celix_bundle(celix_pubsub_discovery_etcd
BUNDLE_SYMBOLICNAME "apache_celix_pubsub_discovery_etcd"
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)

add_celix_bundle(celix_pubsub_serializer_avrobin
BUNDLE_SYMBOLICNAME "apache_celix_pubsub_serializer_avrobin"
@@ -40,4 +40,4 @@ add_library(Celix::celix_pubsub_serializer_avrobin ALIAS celix_pubsub_serializer

if (ENABLE_TESTING)
add_subdirectory(gtest)
endif(ENABLE_TESTING)
endif(ENABLE_TESTING)
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)


add_celix_bundle(celix_pubsub_serializer_json
@@ -19,7 +19,7 @@ celix_subproject(RSA_DISCOVERY_ETCD "Option to enable building the Discovery (ET
if (RSA_DISCOVERY_ETCD)
find_package(CURL REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)

add_celix_bundle(rsa_discovery_etcd
VERSION 0.9.0
@@ -18,7 +18,7 @@
celix_subproject(RSA_REMOTE_SERVICE_ADMIN_DFI "Option to enable building the Remote Service Admin Service DFI" ON)
if (RSA_REMOTE_SERVICE_ADMIN_DFI)
find_package(CURL REQUIRED)
find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)
find_package(UUID REQUIRED)

add_celix_bundle(rsa_dfi
@@ -34,7 +34,7 @@ install_celix_bundle(rsa_topology_manager EXPORT celix COMPONENT rsa)
add_library(Celix::rsa_topology_manager ALIAS rsa_topology_manager)

if (ENABLE_TESTING AND BUILD_RSA_REMOTE_SERVICE_ADMIN_DFI)
find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)
add_subdirectory(tms_tst)
endif ()

@@ -18,34 +18,34 @@

# - Try to find ZMQ
# Once done this will define
# ZMQ_FOUND - System has Zmq
# ZMQ_INCLUDE_DIRS - The Zmq include directories
# ZMQ_LIBRARIES - The libraries needed to use Zmq
# ZMQ_DEFINITIONS - Compiler switches required for using Zmq
# ZMQ::lib - Imported target for UUID
# ZEROMQ_FOUND - System has Zmq
# ZEROMQ_INCLUDE_DIRS - The Zmq include directories
# ZEROMQ_LIBRARIES - The libraries needed to use Zmq
# ZEROMQ_DEFINITIONS - Compiler switches required for using Zmq
# ZeroMQ::ZeroMQ - Imported target for UUID

find_path(ZMQ_INCLUDE_DIR zmq.h zmq_utils.h
find_path(ZEROMQ_INCLUDE_DIR zmq.h zmq_utils.h
/usr/include
/usr/local/include )

find_library(ZMQ_LIBRARY NAMES zmq
find_library(ZEROMQ_LIBRARY NAMES zmq
PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64 )

set(ZMQ_LIBRARIES ${ZMQ_LIBRARY} )
set(ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR} )
set(ZEROMQ_LIBRARIES ${ZEROMQ_LIBRARY} )
set(ZEROMQ_INCLUDE_DIRS ${ZEROMQ_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE
# handle the QUIETLY and REQUIRED arguments and set ZEROMQ_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(ZMQ DEFAULT_MSG
ZMQ_LIBRARY ZMQ_INCLUDE_DIR)
find_package_handle_standard_args(ZeroMQ DEFAULT_MSG
ZEROMQ_LIBRARY ZEROMQ_INCLUDE_DIR)

mark_as_advanced(ZMQ_INCLUDE_DIR ZMQ_LIBRARY )
mark_as_advanced(ZEROMQ_INCLUDE_DIR ZEROMQ_LIBRARY )

if (ZMQ_FOUND AND NOT TARGET ZMQ::lib)
add_library(ZMQ::lib SHARED IMPORTED)
set_target_properties(ZMQ::lib PROPERTIES
IMPORTED_LOCATION "${ZMQ_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${ZMQ_INCLUDE_DIR}"
if (ZEROMQ_FOUND AND NOT TARGET ZeroMQ::ZeroMQ)
add_library(ZeroMQ::ZeroMQ SHARED IMPORTED)
set_target_properties(ZeroMQ::ZeroMQ PROPERTIES
IMPORTED_LOCATION "${ZEROMQ_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${ZEROMQ_INCLUDE_DIR}"
)
endif ()
endif ()
@@ -18,11 +18,11 @@

# - Try to find CZMQ
# Once done this will define
# CZMQ_FOUND - System has Zmq
# CZMQ_INCLUDE_DIRS - The Zmq include directories
# CZMQ_LIBRARIES - The libraries needed to use Zmq
# CZMQ_DEFINITIONS - Compiler switches required for using Zmq
# CZMQ::lib - Imported CMake target for the library (include path + library)
# CZMQ_FOUND - System has czmq
# CZMQ_INCLUDE_DIRS - The czmq include directories
# CZMQ_LIBRARIES - The libraries needed to use czmq
# CZMQ_DEFINITIONS - Compiler switches required for using czmq
# czmq::czmq - Imported CMake target for the library (include path + library)

find_path(CZMQ_INCLUDE_DIR czmq.h
/usr/include
@@ -37,14 +37,14 @@ set(CZMQ_INCLUDE_DIRS ${CZMQ_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set CZMQ_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(CZMQ DEFAULT_MSG
find_package_handle_standard_args(czmq DEFAULT_MSG
CZMQ_LIBRARY CZMQ_INCLUDE_DIR)

mark_as_advanced(CZMQ_INCLUDE_DIR CZMQ_LIBRARY)

if (CZMQ_FOUND AND NOT TARGET CZMQ::lib)
add_library(CZMQ::lib SHARED IMPORTED)
set_target_properties(CZMQ::lib PROPERTIES
if (CZMQ_FOUND AND NOT TARGET czmq::czmq)
add_library(czmq::czmq SHARED IMPORTED)
set_target_properties(czmq::czmq PROPERTIES
IMPORTED_LOCATION "${CZMQ_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${CZMQ_INCLUDE_DIR}"
)
@@ -21,7 +21,7 @@
# JANSSON_FOUND - System has Jansson
# JANSSON_INCLUDE_DIRS - The Jansson include directories
# JANSSON_LIBRARIES - The libraries needed to use Jansson
# Jansson - Imported target for Jansson
# jansson::jansson - Imported target for Jansson

find_path(JANSSON_INCLUDE_DIR jansson.h
/usr/include
@@ -36,7 +36,7 @@ set(JANSSON_INCLUDE_DIRS ${JANSSON_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set JANSSON_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Jansson DEFAULT_MSG
find_package_handle_standard_args(jansson DEFAULT_MSG
JANSSON_LIBRARY JANSSON_INCLUDE_DIR)

mark_as_advanced(JANSSON_INCLUDE_DIR JANSSON_LIBRARY)
@@ -16,7 +16,7 @@
# under the License.

find_package(FFI REQUIRED)
find_package(Jansson REQUIRED)
find_package(jansson REQUIRED)

set(SOURCES
src/dyn_common.c

0 comments on commit 91fff32

Please sign in to comment.