This is an automated email from the ASF dual-hosted git repository. pengzheng pushed a commit to branch feature/579-automatic-dependency-deduction in repository https://gitbox.apache.org/repos/asf/celix.git
commit e21fcae97e007a05368a615253be2e29febbfeb5 Author: PengZheng <[email protected]> AuthorDate: Tue Jul 11 09:22:37 2023 +0800 Add automatic dependency deduction to shell/log/pubsub and improve cmake dependency specification. --- CMakeLists.txt | 24 --- .../cxx_remote_services/integration/CMakeLists.txt | 4 - .../integration/gtest/CMakeLists.txt | 2 +- bundles/cxx_remote_services/rsa_spi/CMakeLists.txt | 1 + bundles/logging/log_admin/CMakeLists.txt | 2 +- bundles/logging/log_admin/gtest/CMakeLists.txt | 2 +- .../log_writers/syslog_writer/gtest/CMakeLists.txt | 2 +- bundles/pubsub/examples/CMakeLists.txt | 28 +--- .../examples/pubsub/interceptors/CMakeLists.txt | 2 +- .../examples/pubsub/publisher/CMakeLists.txt | 2 +- .../examples/pubsub/publisher2/CMakeLists.txt | 2 +- .../pubsub/pubsub_websocket/CMakeLists.txt | 5 +- .../examples/pubsub/subscriber/CMakeLists.txt | 2 +- bundles/pubsub/integration/CMakeLists.txt | 41 ++---- bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt | 7 +- bundles/pubsub/pubsub_admin_udp_mc/CMakeLists.txt | 5 +- .../pubsub/pubsub_admin_websocket/CMakeLists.txt | 7 +- bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt | 3 +- bundles/pubsub/pubsub_api/CMakeLists.txt | 1 + bundles/pubsub/pubsub_discovery/CMakeLists.txt | 5 +- .../pubsub_protocol_wire_v1/CMakeLists.txt | 51 ++++--- .../pubsub_protocol_wire_v2/CMakeLists.txt | 45 +++--- .../pubsub_serializer_avrobin/CMakeLists.txt | 50 ++++--- .../pubsub/pubsub_serializer_json/CMakeLists.txt | 48 +++--- .../pubsub/pubsub_utils/include/pubsub_utils_url.h | 2 + bundles/shell/shell_bonjour/CMakeLists.txt | 8 +- bundles/shell/shell_tui/CMakeLists.txt | 2 +- bundles/shell/shell_wui/CMakeLists.txt | 2 +- cmake/CelixConfig.cmake | 33 +---- cmake/CelixDeps.cmake.in | 13 +- cmake/Modules/Findlibuuid.cmake | 52 +++---- conanfile.py | 164 +++++++++++++++------ libs/error_injector/CMakeLists.txt | 29 ++-- libs/error_injector/zip/CMakeLists.txt | 1 + libs/etcdlib/CMakeLists.txt | 4 +- libs/framework/CMakeLists.txt | 3 +- libs/framework/src/celix_launcher.c | 2 +- libs/pushstreams/CMakeLists.txt | 1 + libs/utils/CMakeLists.txt | 1 - .../bundles/pubsub_admin_nanomsg/CMakeLists.txt | 1 - 40 files changed, 325 insertions(+), 334 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6654e4ee..1b050b7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,33 +28,9 @@ include(cmake/cmake_celix/UseCelix.cmake) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") #find required packages -find_package(ZLIB REQUIRED) #framework -find_package(libuuid REQUIRED) #framework -find_package(CURL REQUIRED) #framework, etcdlib -find_package(libzip REQUIRED) #framework, etcdlib set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -if (NOT TARGET ZLIB::ZLIB) - #Note more recent zlib will create ZLIB::ZLIB target - message("Note ZLIB::ZLIB target not created by find_package(ZLIB). Creating ZLIB::ZLIB Target.") - add_library(ZLIB::ZLIB SHARED IMPORTED) - set_target_properties(ZLIB::ZLIB PROPERTIES - IMPORTED_LOCATION "${ZLIB_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}" - ) -endif () - -if (NOT TARGET CURL::libcurl) - #Note more recent curl will create CURL::libcurl target - message("Note CURL::libcurl target not created by find_package(CURL). Creating CURL::libcurl Target.") - add_library(CURL::libcurl SHARED IMPORTED) - set_target_properties(CURL::libcurl PROPERTIES - IMPORTED_LOCATION "${CURL_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}" - ) -endif () - # see https://public.kitware.com/Bug/view.php?id=15696 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} EQUAL 3.3 AND ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles") message( FATAL_ERROR "Building Celix using CMake 3.3 and makefiles is not supported due to a bug in the Makefile Generator (see Bug 15696). Please change the used CMake version - both, CMake 3.2 and CMake 3.4 are working fine. Or use a different generator (e.g. Ninja)." ) diff --git a/bundles/cxx_remote_services/integration/CMakeLists.txt b/bundles/cxx_remote_services/integration/CMakeLists.txt index de8fcf71..c7b4a73d 100644 --- a/bundles/cxx_remote_services/integration/CMakeLists.txt +++ b/bundles/cxx_remote_services/integration/CMakeLists.txt @@ -17,8 +17,6 @@ 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(ZeroMQ REQUIRED) - find_package(czmq REQUIRED) add_celix_bundle(TestExportImportRemoteServiceFactory SOURCES src/TestExportImportRemoteServiceFactory.cc ) @@ -71,7 +69,6 @@ if (CXX_RSA_INTEGRATION) CalculatorProvider ) - target_link_libraries(RemoteCalculatorProvider PRIVATE ZeroMQ::ZeroMQ czmq::czmq) add_celix_container(RemoteCalculatorConsumer GROUP rsa @@ -95,5 +92,4 @@ if (CXX_RSA_INTEGRATION) CalculatorConsumer ) - target_link_libraries(RemoteCalculatorConsumer PRIVATE ZeroMQ::ZeroMQ czmq::czmq) endif() diff --git a/bundles/cxx_remote_services/integration/gtest/CMakeLists.txt b/bundles/cxx_remote_services/integration/gtest/CMakeLists.txt index 2d49d627..25572ed5 100644 --- a/bundles/cxx_remote_services/integration/gtest/CMakeLists.txt +++ b/bundles/cxx_remote_services/integration/gtest/CMakeLists.txt @@ -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::dfi Celix::Promises Celix::PushStreams Celix::shell_api ZeroMQ::ZeroMQ czmq::czmq GTest::gtest GTest::gtest_main) +target_link_libraries(test_cxx_remote_services_integration PRIVATE Celix::framework Celix::Promises Celix::PushStreams Celix::shell_api 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 diff --git a/bundles/cxx_remote_services/rsa_spi/CMakeLists.txt b/bundles/cxx_remote_services/rsa_spi/CMakeLists.txt index c56dc6ba..5eb0dfae 100644 --- a/bundles/cxx_remote_services/rsa_spi/CMakeLists.txt +++ b/bundles/cxx_remote_services/rsa_spi/CMakeLists.txt @@ -19,6 +19,7 @@ add_library(rsa_spi INTERFACE) target_include_directories(rsa_spi INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> ) +target_link_libraries(rsa_spi INTERFACE Celix::framework Celix::utils) install(TARGETS rsa_spi EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT rsa INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/rsa) diff --git a/bundles/logging/log_admin/CMakeLists.txt b/bundles/logging/log_admin/CMakeLists.txt index 762439fd..04920679 100644 --- a/bundles/logging/log_admin/CMakeLists.txt +++ b/bundles/logging/log_admin/CMakeLists.txt @@ -25,7 +25,7 @@ add_celix_bundle(log_admin src/celix_log_admin_activator.c FILENAME celix_log_admin ) -target_link_libraries(log_admin PRIVATE Celix::log_helper Celix::shell_api) +target_link_libraries(log_admin PRIVATE Celix::log_service_api Celix::shell_api) target_include_directories(log_admin PRIVATE src) celix_deprecated_utils_headers(log_admin) install_celix_bundle(log_admin EXPORT celix COMPONENT logging) diff --git a/bundles/logging/log_admin/gtest/CMakeLists.txt b/bundles/logging/log_admin/gtest/CMakeLists.txt index d8d407d4..41f3b9d8 100644 --- a/bundles/logging/log_admin/gtest/CMakeLists.txt +++ b/bundles/logging/log_admin/gtest/CMakeLists.txt @@ -19,7 +19,7 @@ add_executable(test_log_admin src/LogAdminTestSuite.cc ) -target_link_libraries(test_log_admin PRIVATE Celix::log_service_api Celix::shell_api GTest::gtest GTest::gtest_main) +target_link_libraries(test_log_admin PRIVATE Celix::framework Celix::log_service_api Celix::shell_api GTest::gtest GTest::gtest_main) add_celix_bundle_dependencies(test_log_admin Celix::log_admin) target_compile_definitions(test_log_admin PRIVATE -DLOG_ADMIN_BUNDLE=\"$<TARGET_PROPERTY:log_admin,BUNDLE_FILE>\") diff --git a/bundles/logging/log_writers/syslog_writer/gtest/CMakeLists.txt b/bundles/logging/log_writers/syslog_writer/gtest/CMakeLists.txt index f9df777e..81d04aec 100644 --- a/bundles/logging/log_writers/syslog_writer/gtest/CMakeLists.txt +++ b/bundles/logging/log_writers/syslog_writer/gtest/CMakeLists.txt @@ -19,7 +19,7 @@ add_executable(test_syslog_writer src/SyslogWriterTestSuite.cc ) -target_link_libraries(test_syslog_writer PRIVATE Celix::log_helper GTest::gtest GTest::gtest_main) +target_link_libraries(test_syslog_writer PRIVATE GTest::gtest GTest::gtest_main) add_celix_bundle_dependencies(test_syslog_writer Celix::log_admin Celix::syslog_writer) target_compile_definitions(test_syslog_writer PRIVATE -DLOG_ADMIN_BUNDLE=\"$<TARGET_PROPERTY:log_admin,BUNDLE_FILE>\") target_compile_definitions(test_syslog_writer PRIVATE -DSYSLOG_WRITER_BUNDLE=\"$<TARGET_PROPERTY:syslog_writer,BUNDLE_FILE>\") diff --git a/bundles/pubsub/examples/CMakeLists.txt b/bundles/pubsub/examples/CMakeLists.txt index 94dc90f0..893d50f6 100644 --- a/bundles/pubsub/examples/CMakeLists.txt +++ b/bundles/pubsub/examples/CMakeLists.txt @@ -15,17 +15,13 @@ # specific language governing permissions and limitations # under the License. -celix_subproject(PUBSUB_EXAMPLES "Option to build the pubsub examples" ON DEPS LOG_SERVICE SHELL SHELL_TUI PUBSUB_DISCOVERY_ETCD) +celix_subproject(PUBSUB_EXAMPLES "Option to build the pubsub examples" ON) if (PUBSUB_EXAMPLES) add_subdirectory(pubsub) find_program(ETCD_CMD NAMES etcd) find_program(XTERM_CMD NAMES xterm) - find_package(jansson REQUIRED) - - set(PUBSUB_CONTAINER_LIBS jansson::jansson Celix::dfi) - # UDP Multicast if (BUILD_PUBSUB_PSA_UDP_MC) add_celix_container(pubsub_publisher_udp_mc @@ -45,7 +41,6 @@ if (PUBSUB_EXAMPLES) PUBSUB_ETCD_DISCOVERY_VERBOSE=true PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true ) - target_link_libraries(pubsub_publisher_udp_mc PRIVATE ${PUBSUB_CONTAINER_LIBS}) add_celix_container(pubsub_subscriber_udp_mc GROUP pubsub @@ -63,7 +58,6 @@ if (PUBSUB_EXAMPLES) PUBSUB_ETCD_DISCOVERY_VERBOSE=true PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true ) - target_link_libraries(pubsub_subscriber_udp_mc PRIVATE ${PUBSUB_CONTAINER_LIBS}) add_celix_container(pubsub_subscriber2_udp_mc GROUP pubsub @@ -81,7 +75,6 @@ if (PUBSUB_EXAMPLES) PUBSUB_ETCD_DISCOVERY_VERBOSE=true PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true ) - target_link_libraries(pubsub_subscriber2_udp_mc PRIVATE ${PUBSUB_CONTAINER_LIBS}) if (ETCD_CMD AND XTERM_CMD) # Runtime starting a publish and subscriber for udp mc @@ -119,7 +112,6 @@ if (PUBSUB_EXAMPLES) PUBSUB_ETCD_DISCOVERY_VERBOSE=true PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true ) - target_link_libraries(pubsub_publisher_tcp PRIVATE ${PUBSUB_CONTAINER_LIBS}) add_celix_container(pubsub_subscriber_tcp GROUP pubsub @@ -138,7 +130,6 @@ if (PUBSUB_EXAMPLES) PUBSUB_ETCD_DISCOVERY_VERBOSE=true PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true ) - target_link_libraries(pubsub_subscriber_tcp PRIVATE ${PUBSUB_CONTAINER_LIBS}) add_celix_container(pubsub_subscriber2_tcp GROUP pubsub @@ -157,7 +148,6 @@ if (PUBSUB_EXAMPLES) PUBSUB_ETCD_DISCOVERY_VERBOSE=true PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true ) - target_link_libraries(pubsub_subscriber2_tcp PRIVATE ${PUBSUB_CONTAINER_LIBS}) if (ETCD_CMD AND XTERM_CMD) # Runtime starting a publish and subscriber for tcp @@ -176,10 +166,6 @@ if (PUBSUB_EXAMPLES) endif() if (BUILD_PUBSUB_PSA_ZMQ) - find_package(ZeroMQ REQUIRED) - find_package(czmq REQUIRED) - - 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 @@ -198,7 +184,6 @@ if (PUBSUB_EXAMPLES) celix_pubsub_poi_publisher celix_pubsub_poi_publisher2 ) - target_link_libraries(pubsub_publisher PRIVATE ${PUBSUB_CONTAINER_LIBS}) add_celix_container(pubsub_subscriber GROUP "pubsub" @@ -214,7 +199,6 @@ if (PUBSUB_EXAMPLES) Celix::celix_pubsub_protocol_wire_v1 celix_pubsub_poi_subscriber ) - target_link_libraries(pubsub_subscriber PRIVATE ${PUBSUB_CONTAINER_LIBS}) endif() # ZMQ @@ -232,7 +216,6 @@ if (PUBSUB_EXAMPLES) PROPERTIES PSA_ZMQ_ZEROCOPY_ENABLED=true ) - target_link_libraries(pubsub_zmq PRIVATE ${PUBSUB_CONTAINER_LIBS}) add_celix_container(pubsub_publisher_zmq GROUP "pubsub" @@ -253,7 +236,6 @@ if (PUBSUB_EXAMPLES) PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true PSA_ZMQ_ZEROCOPY_ENABLED=false ) - target_link_libraries(pubsub_publisher_zmq PRIVATE ${PUBSUB_CONTAINER_LIBS}) add_celix_container(pubsub_subscriber_zmq GROUP "pubsub" @@ -272,7 +254,6 @@ if (PUBSUB_EXAMPLES) PUBSUB_ETCD_DISCOVERY_VERBOSE=true PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true ) - target_link_libraries(pubsub_subscriber_zmq PRIVATE ${PUBSUB_CONTAINER_LIBS}) add_celix_container(pubsub_subscriber2_zmq GROUP "pubsub" @@ -289,7 +270,6 @@ if (PUBSUB_EXAMPLES) PUBSUB_ETCD_DISCOVERY_VERBOSE=true PUBSUB_TOPOLOGY_MANAGER_VERBOSE=true ) - 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 @@ -321,7 +301,6 @@ if (PUBSUB_EXAMPLES) endif() if (BUILD_PUBSUB_PSA_NANOMSG) - set(PUBSUB_CONTAINER_LIBS NANOMSG::lib ${PUBSUB_CONTAINER_LIBS}) add_celix_container(pubsub_publisher1_nanomsg GROUP "pubsub" @@ -338,7 +317,6 @@ if (PUBSUB_EXAMPLES) 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" @@ -355,7 +333,6 @@ if (PUBSUB_EXAMPLES) 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" @@ -372,7 +349,6 @@ if (PUBSUB_EXAMPLES) 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" @@ -389,7 +365,6 @@ if (PUBSUB_EXAMPLES) 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 publisher and 2 subscribers for nanomsg @@ -428,6 +403,5 @@ if (PUBSUB_EXAMPLES) CELIX_HTTP_ADMIN_LISTENING_PORTS=7660 CELIX_HTTP_ADMIN_NUM_THREADS=5 ) - target_link_libraries(pubsub_websocket_example PRIVATE ${PUBSUB_CONTAINER_LIBS}) endif() endif () diff --git a/bundles/pubsub/examples/pubsub/interceptors/CMakeLists.txt b/bundles/pubsub/examples/pubsub/interceptors/CMakeLists.txt index 1bf920be..0be810a3 100644 --- a/bundles/pubsub/examples/pubsub/interceptors/CMakeLists.txt +++ b/bundles/pubsub/examples/pubsub/interceptors/CMakeLists.txt @@ -24,5 +24,5 @@ add_celix_bundle(celix_pubsub_interceptors_example src/second_interceptor.c ) -target_link_libraries(celix_pubsub_interceptors_example PRIVATE Celix::framework Celix::pubsub_spi) +target_link_libraries(celix_pubsub_interceptors_example PRIVATE Celix::pubsub_spi) target_include_directories(celix_pubsub_interceptors_example PRIVATE include) \ No newline at end of file diff --git a/bundles/pubsub/examples/pubsub/publisher/CMakeLists.txt b/bundles/pubsub/examples/pubsub/publisher/CMakeLists.txt index 250f64bd..b55d9077 100644 --- a/bundles/pubsub/examples/pubsub/publisher/CMakeLists.txt +++ b/bundles/pubsub/examples/pubsub/publisher/CMakeLists.txt @@ -23,7 +23,7 @@ add_celix_bundle(celix_pubsub_poi_publisher private/src/pubsub_publisher.c ) -target_link_libraries(celix_pubsub_poi_publisher PRIVATE Celix::framework Celix::pubsub_api) +target_link_libraries(celix_pubsub_poi_publisher PRIVATE Celix::pubsub_api) target_include_directories(celix_pubsub_poi_publisher PRIVATE private/include) celix_deprecated_utils_headers(celix_pubsub_poi_publisher) celix_deprecated_framework_headers(celix_pubsub_poi_publisher) diff --git a/bundles/pubsub/examples/pubsub/publisher2/CMakeLists.txt b/bundles/pubsub/examples/pubsub/publisher2/CMakeLists.txt index cf96a101..60392538 100644 --- a/bundles/pubsub/examples/pubsub/publisher2/CMakeLists.txt +++ b/bundles/pubsub/examples/pubsub/publisher2/CMakeLists.txt @@ -22,7 +22,7 @@ add_celix_bundle(celix_pubsub_poi_publisher2 ../publisher/private/src/ps_pub_activator.c ../publisher/private/src/pubsub_publisher.c ) -target_link_libraries(celix_pubsub_poi_publisher2 PRIVATE Celix::framework Celix::pubsub_api) +target_link_libraries(celix_pubsub_poi_publisher2 PRIVATE Celix::pubsub_api) target_include_directories(celix_pubsub_poi_publisher2 PRIVATE ../publisher/private/include) celix_deprecated_utils_headers(celix_pubsub_poi_publisher2) diff --git a/bundles/pubsub/examples/pubsub/pubsub_websocket/CMakeLists.txt b/bundles/pubsub/examples/pubsub/pubsub_websocket/CMakeLists.txt index 8bf54247..b51ce136 100644 --- a/bundles/pubsub/examples/pubsub/pubsub_websocket/CMakeLists.txt +++ b/bundles/pubsub/examples/pubsub/pubsub_websocket/CMakeLists.txt @@ -16,9 +16,6 @@ # under the License. -find_package(CURL REQUIRED) - - add_celix_bundle(celix_pubsub_websocket_example SYMBOLIC_NAME "apache_celix_pubsub_websocket_example" VERSION "1.0.0" @@ -26,7 +23,7 @@ add_celix_bundle(celix_pubsub_websocket_example private/src/ps_websocket_activator.c private/src/pubsub_websocket_example.c ) -target_link_libraries(celix_pubsub_websocket_example PRIVATE Celix::framework Celix::pubsub_api ${CURL_LIBRARIES}) +target_link_libraries(celix_pubsub_websocket_example PRIVATE Celix::pubsub_api) target_include_directories(celix_pubsub_websocket_example PRIVATE private/include) celix_deprecated_utils_headers(celix_pubsub_websocket_example) celix_deprecated_framework_headers(celix_pubsub_websocket_example) diff --git a/bundles/pubsub/examples/pubsub/subscriber/CMakeLists.txt b/bundles/pubsub/examples/pubsub/subscriber/CMakeLists.txt index 1ab0cf7a..363833f2 100644 --- a/bundles/pubsub/examples/pubsub/subscriber/CMakeLists.txt +++ b/bundles/pubsub/examples/pubsub/subscriber/CMakeLists.txt @@ -23,7 +23,7 @@ add_celix_bundle(celix_pubsub_poi_subscriber private/src/pubsub_subscriber.c ) -target_link_libraries(celix_pubsub_poi_subscriber PRIVATE Celix::framework Celix::pubsub_api) +target_link_libraries(celix_pubsub_poi_subscriber PRIVATE Celix::pubsub_api) target_include_directories(celix_pubsub_poi_subscriber PRIVATE private/include) celix_deprecated_utils_headers(celix_pubsub_poi_subscriber) celix_deprecated_framework_headers(celix_pubsub_poi_subscriber) diff --git a/bundles/pubsub/integration/CMakeLists.txt b/bundles/pubsub/integration/CMakeLists.txt index 59aebe27..c57c1dfb 100644 --- a/bundles/pubsub/integration/CMakeLists.txt +++ b/bundles/pubsub/integration/CMakeLists.txt @@ -15,11 +15,8 @@ # specific language governing permissions and limitations # under the License. -celix_subproject(PUBSUB_INTEGRATION "Option to build the pubsub integration" ON DEPS SHELL SHELL_TUI) +celix_subproject(PUBSUB_INTEGRATION "Option to build the pubsub integration" ON) if (PUBSUB_INTEGRATION) - find_package(jansson REQUIRED) - find_package(civetweb REQUIRED) - add_celix_bundle(pubsub_endpoint_sut #"Vanilla" bundle which is under test SOURCES @@ -44,7 +41,7 @@ if (PUBSUB_INTEGRATION) gtest/tst_endpoint_activator.c VERSION 1.0.0 ) - target_link_libraries(pubsub_endpoint_tst PRIVATE Celix::framework Celix::pubsub_api) + target_link_libraries(pubsub_endpoint_tst PRIVATE Celix::pubsub_api) celix_deprecated_utils_headers(pubsub_endpoint_tst) celix_bundle_files(pubsub_endpoint_tst meta_data/msg.descriptor @@ -103,7 +100,7 @@ if (PUBSUB_INTEGRATION) VERSION 1.0.0 ) celix_deprecated_utils_headers(pubsub_tst) - target_link_libraries(pubsub_tst PRIVATE Celix::framework Celix::pubsub_api) + target_link_libraries(pubsub_tst PRIVATE Celix::pubsub_api) celix_bundle_files(pubsub_tst meta_data/msg.descriptor DESTINATION "META-INF/descriptors" @@ -161,7 +158,7 @@ if (PUBSUB_INTEGRATION) pubsub_sut pubsub_tst ) - target_link_libraries(pubsub_udpmc_tests PRIVATE Celix::pubsub_api jansson::jansson Celix::dfi GTest::gtest GTest::gtest_main) + target_link_libraries(pubsub_udpmc_tests PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main) target_include_directories(pubsub_udpmc_tests SYSTEM PRIVATE gtest) add_celix_container(pstm_deadlock_udpmc_test @@ -180,7 +177,7 @@ if (PUBSUB_INTEGRATION) Celix::shell_tui ) target_compile_definitions(pstm_deadlock_udpmc_test PRIVATE -DDEADLOCK_SUT_BUNDLE_FILE=\"${DEADLOCK_SUT_BUNDLE_FILE}\") - target_link_libraries(pstm_deadlock_udpmc_test PRIVATE Celix::pubsub_api jansson::jansson Celix::dfi GTest::gtest GTest::gtest_main) + target_link_libraries(pstm_deadlock_udpmc_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main) target_include_directories(pstm_deadlock_udpmc_test SYSTEM PRIVATE pstm_deadlock_udpmc_test) add_celix_bundle_dependencies(pstm_deadlock_udpmc_test pubsub_deadlock_sut) @@ -218,7 +215,7 @@ if (PUBSUB_INTEGRATION) pubsub_tst pubsub_serializer ) - target_link_libraries(pubsub_tcp_v2_wire_v1_tests PRIVATE Celix::pubsub_api Celix::dfi GTest::gtest GTest::gtest_main) + target_link_libraries(pubsub_tcp_v2_wire_v1_tests PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main) target_include_directories(pubsub_tcp_v2_wire_v1_tests SYSTEM PRIVATE gtest) add_test(NAME pubsub_tcp_v2_wire_v1_tests COMMAND pubsub_tcp_v2_wire_v1_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_tcp_v2_wire_v1_tests,CONTAINER_LOC>) setup_target_for_coverage(pubsub_tcp_v2_wire_v1_tests SCAN_DIR ..) @@ -241,7 +238,7 @@ if (PUBSUB_INTEGRATION) pubsub_tst pubsub_serializer ) - target_link_libraries(pubsub_tcp_v2_wire_v2_tests PRIVATE Celix::pubsub_api Celix::dfi GTest::gtest GTest::gtest_main) + target_link_libraries(pubsub_tcp_v2_wire_v2_tests PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main) target_include_directories(pubsub_tcp_v2_wire_v2_tests SYSTEM PRIVATE gtest) add_test(NAME pubsub_tcp_v2_wire_v2_tests COMMAND pubsub_tcp_v2_wire_v2_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_tcp_v2_wire_v2_tests,CONTAINER_LOC>) setup_target_for_coverage(pubsub_tcp_v2_wire_v2_tests SCAN_DIR ..) @@ -265,7 +262,7 @@ if (PUBSUB_INTEGRATION) pubsub_tst pubsub_serializer ) - target_link_libraries(pubsub_tcp_v2_wire_v2_with_no_scope_tests PRIVATE Celix::pubsub_api Celix::dfi GTest::gtest GTest::gtest_main) + target_link_libraries(pubsub_tcp_v2_wire_v2_with_no_scope_tests PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main) target_include_directories(pubsub_tcp_v2_wire_v2_with_no_scope_tests SYSTEM PRIVATE gtest) add_test(NAME pubsub_tcp_v2_wire_v2_with_no_scope_tests COMMAND pubsub_tcp_v2_wire_v2_with_no_scope_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_tcp_v2_wire_v2_with_no_scope_tests,CONTAINER_LOC>) setup_target_for_coverage(pubsub_tcp_v2_wire_v2_with_no_scope_tests SCAN_DIR ..) @@ -289,7 +286,7 @@ if (PUBSUB_INTEGRATION) pubsub_loopback pubsub_serializer ) - target_link_libraries(pubsub_tcp_v2_endpoint_tests PRIVATE Celix::pubsub_api Celix::dfi GTest::gtest GTest::gtest_main) + target_link_libraries(pubsub_tcp_v2_endpoint_tests PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main) target_include_directories(pubsub_tcp_v2_endpoint_tests SYSTEM PRIVATE gtest) add_celix_container(pstm_deadlock_tcp_v2_test @@ -309,7 +306,7 @@ if (PUBSUB_INTEGRATION) pubsub_serializer ) target_compile_definitions(pstm_deadlock_tcp_v2_test PRIVATE -DDEADLOCK_SUT_BUNDLE_FILE=\"${DEADLOCK_SUT_BUNDLE_FILE}\") - target_link_libraries(pstm_deadlock_tcp_v2_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main Celix::dfi) + target_link_libraries(pstm_deadlock_tcp_v2_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main) target_include_directories(pstm_deadlock_tcp_v2_test SYSTEM PRIVATE pstm_deadlock_tcp_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. @@ -347,7 +344,7 @@ if (PUBSUB_INTEGRATION) pubsub_tst pubsub_serializer ) - target_link_libraries(pubsub_websocket_v2_tests PRIVATE Celix::pubsub_api Celix::dfi jansson::jansson GTest::gtest GTest::gtest_main civetweb::civetweb) + target_link_libraries(pubsub_websocket_v2_tests PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main) target_include_directories(pubsub_websocket_v2_tests SYSTEM PRIVATE gtest) add_test(NAME pubsub_websocket_v2_tests COMMAND pubsub_websocket_v2_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_websocket_v2_tests,CONTAINER_LOC>) setup_target_for_coverage(pubsub_websocket_v2_tests SCAN_DIR ..) @@ -369,7 +366,7 @@ if (PUBSUB_INTEGRATION) pubsub_serializer ) target_compile_definitions(pstm_deadlock_websocket_v2_test PRIVATE -DDEADLOCK_SUT_BUNDLE_FILE=\"${DEADLOCK_SUT_BUNDLE_FILE}\") - target_link_libraries(pstm_deadlock_websocket_v2_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main jansson::jansson Celix::dfi civetweb::civetweb) + target_link_libraries(pstm_deadlock_websocket_v2_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main) target_include_directories(pstm_deadlock_websocket_v2_test SYSTEM PRIVATE pstm_deadlock_websocket_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. @@ -384,9 +381,6 @@ if (PUBSUB_INTEGRATION) endif() if (BUILD_PUBSUB_PSA_ZMQ) - 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. LAUNCHER_SRC ${CMAKE_CURRENT_LIST_DIR}/gtest/PubSubIntegrationTestSuite.cc @@ -404,7 +398,7 @@ if (PUBSUB_INTEGRATION) pubsub_serializer ) - target_link_libraries(pubsub_zmq_v2_tests PRIVATE Celix::pubsub_api Celix::dfi ZeroMQ::ZeroMQ czmq::czmq GTest::gtest GTest::gtest_main) + target_link_libraries(pubsub_zmq_v2_tests PRIVATE Celix::pubsub_api 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 ..) @@ -429,7 +423,7 @@ if (PUBSUB_INTEGRATION) pubsub_serializer ) - target_link_libraries(pubsub_zmq_v2_zerocopy_tests PRIVATE Celix::pubsub_api Celix::dfi ZeroMQ::ZeroMQ czmq::czmq GTest::gtest GTest::gtest_main) + target_link_libraries(pubsub_zmq_v2_zerocopy_tests PRIVATE Celix::pubsub_api 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>) @@ -450,7 +444,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 ZeroMQ::ZeroMQ czmq::czmq) + target_link_libraries(pstm_deadlock_zmq_v2_test PRIVATE Celix::pubsub_api GTest::gtest GTest::gtest_main) 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. @@ -541,11 +535,6 @@ if (PUBSUB_INTEGRATION) add_celix_bundle_dependencies(${TEST_TARGET_NAME} Celix::http_admin) target_compile_definitions(${TEST_TARGET_NAME} PRIVATE HTTP_ADMIN_BUNDLE_FILE="${HTTP_ADMIN_BUNDLE_FILE}") endif () - - #Linking against zmq if present - if (TARGET ZeroMQ::ZeroMQ AND TARGET czmq::czmq) - target_link_libraries(${TEST_TARGET_NAME} PRIVATE ZeroMQ::ZeroMQ czmq::czmq) - endif () endfunction() diff --git a/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt b/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt index 8bd326a1..6427cae3 100644 --- a/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt +++ b/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt @@ -33,13 +33,10 @@ if (PUBSUB_PSA_TCP) ) target_link_libraries(celix_pubsub_admin_tcp PRIVATE Celix::pubsub_spi Celix::pubsub_utils) - target_link_libraries(celix_pubsub_admin_tcp PRIVATE Celix::framework Celix::log_helper) + target_link_libraries(celix_pubsub_admin_tcp PRIVATE Celix::log_helper) target_link_libraries(celix_pubsub_admin_tcp PRIVATE Celix::shell_api) target_include_directories(celix_pubsub_admin_tcp PRIVATE src) - # cmake find package UUID set the wrong include dir for OSX, does Conan solve this? - if (NOT APPLE) - target_link_libraries(celix_pubsub_admin_tcp PRIVATE libuuid::libuuid) - endif() + target_link_libraries(celix_pubsub_admin_tcp PRIVATE libuuid::libuuid) celix_deprecated_utils_headers(celix_pubsub_admin_tcp) celix_deprecated_framework_headers(celix_pubsub_admin_tcp) diff --git a/bundles/pubsub/pubsub_admin_udp_mc/CMakeLists.txt b/bundles/pubsub/pubsub_admin_udp_mc/CMakeLists.txt index 6092f2b7..f859a966 100644 --- a/bundles/pubsub/pubsub_admin_udp_mc/CMakeLists.txt +++ b/bundles/pubsub/pubsub_admin_udp_mc/CMakeLists.txt @@ -17,8 +17,6 @@ celix_subproject(PUBSUB_PSA_UDP_MC "Build UDP MC PubSub Admin" ON) if (PUBSUB_PSA_UDP_MC) - find_package(jansson REQUIRED) - add_celix_bundle(celix_pubsub_admin_udp_multicast BUNDLE_SYMBOLICNAME "apache_celix_pubsub_admin_udp_multicast" VERSION "1.0.0" @@ -34,8 +32,7 @@ if (PUBSUB_PSA_UDP_MC) target_include_directories(celix_pubsub_admin_udp_multicast PRIVATE src ) - set_target_properties(celix_pubsub_admin_udp_multicast PROPERTIES INSTALL_RPATH "$ORIGIN") - target_link_libraries(celix_pubsub_admin_udp_multicast PRIVATE Celix::framework Celix::dfi Celix::log_helper Celix::utils Celix::shell_api) + target_link_libraries(celix_pubsub_admin_udp_multicast PRIVATE Celix::log_helper Celix::shell_api) target_link_libraries(celix_pubsub_admin_udp_multicast PRIVATE Celix::pubsub_spi Celix::pubsub_utils ) celix_deprecated_utils_headers(celix_pubsub_admin_udp_multicast) celix_deprecated_framework_headers(celix_pubsub_admin_udp_multicast) diff --git a/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt b/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt index 180437e5..7e32182f 100644 --- a/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt +++ b/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt @@ -32,12 +32,9 @@ if (PUBSUB_PSA_WS) src/pubsub_websocket_common.c ) - target_link_libraries(celix_pubsub_admin_websocket PRIVATE - Celix::framework Celix::log_helper Celix::utils - Celix::http_admin_api - ) + target_link_libraries(celix_pubsub_admin_websocket PRIVATE Celix::log_helper Celix::http_admin_api) target_link_libraries(celix_pubsub_admin_websocket PRIVATE Celix::pubsub_spi Celix::pubsub_utils) - target_link_libraries(celix_pubsub_admin_websocket PRIVATE Celix::shell_api) + target_link_libraries(celix_pubsub_admin_websocket PRIVATE Celix::shell_api libuuid::libuuid jansson::jansson) target_include_directories(celix_pubsub_admin_websocket PRIVATE src) celix_deprecated_utils_headers(celix_pubsub_admin_websocket) celix_deprecated_framework_headers(celix_pubsub_admin_websocket) diff --git a/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt b/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt index 58f2500a..1d611951 100644 --- a/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt +++ b/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt @@ -47,8 +47,7 @@ if (PUBSUB_PSA_ZMQ) ) target_link_libraries(celix_pubsub_admin_zmq PRIVATE - Celix::framework Celix::dfi Celix::log_helper Celix::utils - ZeroMQ::ZeroMQ czmq::czmq ${OPTIONAL_OPENSSL_LIB}) + Celix::log_helper ZeroMQ::ZeroMQ czmq::czmq libuuid::libuuid ${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) diff --git a/bundles/pubsub/pubsub_api/CMakeLists.txt b/bundles/pubsub/pubsub_api/CMakeLists.txt index 3269e25e..14facae8 100644 --- a/bundles/pubsub/pubsub_api/CMakeLists.txt +++ b/bundles/pubsub/pubsub_api/CMakeLists.txt @@ -21,6 +21,7 @@ add_library(pubsub_api INTERFACE) target_include_directories(pubsub_api INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> ) +target_link_libraries(pubsub_api INTERFACE Celix::utils) #install api install(TARGETS pubsub_api EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT pubsub diff --git a/bundles/pubsub/pubsub_discovery/CMakeLists.txt b/bundles/pubsub/pubsub_discovery/CMakeLists.txt index daab5b9e..bf752b08 100644 --- a/bundles/pubsub/pubsub_discovery/CMakeLists.txt +++ b/bundles/pubsub/pubsub_discovery/CMakeLists.txt @@ -17,7 +17,6 @@ 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) add_celix_bundle(celix_pubsub_discovery_etcd @@ -30,9 +29,9 @@ if (PUBSUB_DISCOVERY_ETCD) ) target_include_directories(celix_pubsub_discovery_etcd PRIVATE src) target_link_libraries(celix_pubsub_discovery_etcd PRIVATE - Celix::framework Celix::etcdlib_static + Celix::etcdlib_static Celix::shell_api Celix::log_helper - CURL::libcurl jansson::jansson + jansson::jansson ) target_link_libraries(celix_pubsub_discovery_etcd PRIVATE Celix::pubsub_spi Celix::pubsub_utils) celix_deprecated_utils_headers(celix_pubsub_discovery_etcd) diff --git a/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v1/CMakeLists.txt b/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v1/CMakeLists.txt index 4050e7f4..5a5a2636 100644 --- a/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v1/CMakeLists.txt +++ b/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v1/CMakeLists.txt @@ -15,31 +15,34 @@ # specific language governing permissions and limitations # under the License. -add_library(celix_wire_protocol_v1_impl STATIC - src/pubsub_wire_protocol_impl.c -) -target_include_directories(celix_wire_protocol_v1_impl PRIVATE src) -target_link_libraries(celix_wire_protocol_v1_impl PUBLIC Celix::pubsub_spi) -target_link_libraries(celix_wire_protocol_v1_impl PUBLIC celix_pubsub_protocol_lib) -celix_deprecated_utils_headers(celix_wire_protocol_v1_impl) +celix_subproject(PUBSUB_WIRE_PROTOCOL_V1 "Option to enable building the PubSub Wire Protocol v1 bundle" ON) +if (PUBSUB_WIRE_PROTOCOL_V1) + add_library(celix_wire_protocol_v1_impl STATIC + src/pubsub_wire_protocol_impl.c + ) + target_include_directories(celix_wire_protocol_v1_impl PRIVATE src) + target_link_libraries(celix_wire_protocol_v1_impl PUBLIC Celix::pubsub_spi) + target_link_libraries(celix_wire_protocol_v1_impl PUBLIC celix_pubsub_protocol_lib) + celix_deprecated_utils_headers(celix_wire_protocol_v1_impl) -add_celix_bundle(celix_pubsub_protocol_wire_v1 - BUNDLE_SYMBOLICNAME "apache_celix_pubsub_protocol_wire_v1" - VERSION "1.0.0" - GROUP "Celix/PubSub" - SOURCES - src/ps_wire_protocol_activator.c -) -target_include_directories(celix_pubsub_protocol_wire_v1 PRIVATE src) -target_link_libraries(celix_pubsub_protocol_wire_v1 PRIVATE Celix::pubsub_spi Celix::pubsub_utils) -target_link_libraries(celix_pubsub_protocol_wire_v1 PRIVATE celix_wire_protocol_v1_impl) -celix_deprecated_utils_headers(celix_pubsub_protocol_wire_v1) -celix_deprecated_framework_headers(celix_pubsub_protocol_wire_v1) + add_celix_bundle(celix_pubsub_protocol_wire_v1 + BUNDLE_SYMBOLICNAME "apache_celix_pubsub_protocol_wire_v1" + VERSION "1.0.0" + GROUP "Celix/PubSub" + SOURCES + src/ps_wire_protocol_activator.c + ) + target_include_directories(celix_pubsub_protocol_wire_v1 PRIVATE src) + target_link_libraries(celix_pubsub_protocol_wire_v1 PRIVATE Celix::pubsub_spi Celix::pubsub_utils) + target_link_libraries(celix_pubsub_protocol_wire_v1 PRIVATE celix_wire_protocol_v1_impl) + celix_deprecated_utils_headers(celix_pubsub_protocol_wire_v1) + celix_deprecated_framework_headers(celix_pubsub_protocol_wire_v1) -install_celix_bundle(celix_pubsub_protocol_wire_v1 EXPORT celix COMPONENT pubsub) + install_celix_bundle(celix_pubsub_protocol_wire_v1 EXPORT celix COMPONENT pubsub) -add_library(Celix::celix_pubsub_protocol_wire_v1 ALIAS celix_pubsub_protocol_wire_v1) + add_library(Celix::celix_pubsub_protocol_wire_v1 ALIAS celix_pubsub_protocol_wire_v1) -if (ENABLE_TESTING) - add_subdirectory(gtest) -endif() \ No newline at end of file + if (ENABLE_TESTING) + add_subdirectory(gtest) + endif() +endif () \ No newline at end of file diff --git a/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v2/CMakeLists.txt b/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v2/CMakeLists.txt index 450aa654..a4a0f7ee 100644 --- a/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v2/CMakeLists.txt +++ b/bundles/pubsub/pubsub_protocol/pubsub_protocol_wire_v2/CMakeLists.txt @@ -15,28 +15,31 @@ # specific language governing permissions and limitations # under the License. -add_library(celix_wire_protocol_v2_impl STATIC - src/pubsub_wire_v2_protocol_impl.c -) -target_include_directories(celix_wire_protocol_v2_impl PRIVATE src) -target_link_libraries(celix_wire_protocol_v2_impl PUBLIC Celix::pubsub_spi) -target_link_libraries(celix_wire_protocol_v2_impl PUBLIC celix_pubsub_protocol_lib) +celix_subproject(PUBSUB_WIRE_PROTOCOL_V2 "Option to enable building the PubSub Wire Protocol v2 bundle" ON) +if (PUBSUB_WIRE_PROTOCOL_V2) + add_library(celix_wire_protocol_v2_impl STATIC + src/pubsub_wire_v2_protocol_impl.c + ) + target_include_directories(celix_wire_protocol_v2_impl PRIVATE src) + target_link_libraries(celix_wire_protocol_v2_impl PUBLIC Celix::pubsub_spi) + target_link_libraries(celix_wire_protocol_v2_impl PUBLIC celix_pubsub_protocol_lib) -add_celix_bundle(celix_pubsub_protocol_wire_v2 - BUNDLE_SYMBOLICNAME "apache_celix_pubsub_protocol_wire_v2" - VERSION "1.0.0" - GROUP "Celix/PubSub" - SOURCES - src/ps_wire_v2_protocol_activator.c -) -target_include_directories(celix_pubsub_protocol_wire_v2 PRIVATE src) -target_link_libraries(celix_pubsub_protocol_wire_v2 PRIVATE Celix::pubsub_spi Celix::pubsub_utils) -target_link_libraries(celix_pubsub_protocol_wire_v2 PRIVATE celix_wire_protocol_v2_impl) + add_celix_bundle(celix_pubsub_protocol_wire_v2 + BUNDLE_SYMBOLICNAME "apache_celix_pubsub_protocol_wire_v2" + VERSION "1.0.0" + GROUP "Celix/PubSub" + SOURCES + src/ps_wire_v2_protocol_activator.c + ) + target_include_directories(celix_pubsub_protocol_wire_v2 PRIVATE src) + target_link_libraries(celix_pubsub_protocol_wire_v2 PRIVATE Celix::pubsub_utils) + target_link_libraries(celix_pubsub_protocol_wire_v2 PRIVATE celix_wire_protocol_v2_impl) -install_celix_bundle(celix_pubsub_protocol_wire_v2 EXPORT celix COMPONENT pubsub) + install_celix_bundle(celix_pubsub_protocol_wire_v2 EXPORT celix COMPONENT pubsub) -add_library(Celix::celix_pubsub_protocol_wire_v2 ALIAS celix_pubsub_protocol_wire_v2) + add_library(Celix::celix_pubsub_protocol_wire_v2 ALIAS celix_pubsub_protocol_wire_v2) -if (ENABLE_TESTING) - add_subdirectory(gtest) -endif() \ No newline at end of file + if (ENABLE_TESTING) + add_subdirectory(gtest) + endif() +endif () \ No newline at end of file diff --git a/bundles/pubsub/pubsub_serializer_avrobin/CMakeLists.txt b/bundles/pubsub/pubsub_serializer_avrobin/CMakeLists.txt index fd04b2c1..e287bf7c 100644 --- a/bundles/pubsub/pubsub_serializer_avrobin/CMakeLists.txt +++ b/bundles/pubsub/pubsub_serializer_avrobin/CMakeLists.txt @@ -15,31 +15,33 @@ # specific language governing permissions and limitations # under the License. -find_package(jansson REQUIRED) +celix_subproject(PUBSUB_AVROBIN_SERIALIZER "Option to enable building the Avro binary serializer bundle" ON) +if (PUBSUB_AVROBIN_SERIALIZER) + find_package(jansson REQUIRED) -add_celix_bundle(celix_pubsub_serializer_avrobin - BUNDLE_SYMBOLICNAME "apache_celix_pubsub_serializer_avrobin" - VERSION "1.1.0" - GROUP "Celix/PubSub" - SOURCES - src/ps_avrobin_serializer_activator.c - src/pubsub_avrobin_serializer_impl.c - src/pubsub_avrobin_serialization_provider.c -) -target_include_directories(celix_pubsub_serializer_avrobin PRIVATE - src - ${JANSSON_INCLUDE_DIR} -) -set_target_properties(celix_pubsub_serializer_avrobin PROPERTIES INSTALL_RPATH "$ORIGIN") -target_link_libraries(celix_pubsub_serializer_avrobin PRIVATE Celix::framework Celix::dfi ${JANSSON_LIBRARIES} Celix::log_helper) -target_link_libraries(celix_pubsub_serializer_avrobin PRIVATE Celix::pubsub_spi Celix::pubsub_utils ) -celix_deprecated_utils_headers(celix_pubsub_serializer_avrobin) -celix_deprecated_framework_headers(celix_pubsub_serializer_avrobin) + add_celix_bundle(celix_pubsub_serializer_avrobin + BUNDLE_SYMBOLICNAME "apache_celix_pubsub_serializer_avrobin" + VERSION "1.1.0" + GROUP "Celix/PubSub" + SOURCES + src/ps_avrobin_serializer_activator.c + src/pubsub_avrobin_serializer_impl.c + src/pubsub_avrobin_serialization_provider.c + ) + target_include_directories(celix_pubsub_serializer_avrobin PRIVATE + src + ${JANSSON_INCLUDE_DIR} + ) + target_link_libraries(celix_pubsub_serializer_avrobin PRIVATE Celix::dfi jansson::jansson Celix::log_helper) + target_link_libraries(celix_pubsub_serializer_avrobin PRIVATE Celix::pubsub_spi Celix::pubsub_utils ) + celix_deprecated_utils_headers(celix_pubsub_serializer_avrobin) + celix_deprecated_framework_headers(celix_pubsub_serializer_avrobin) -install_celix_bundle(celix_pubsub_serializer_avrobin EXPORT celix COMPONENT pubsub) + install_celix_bundle(celix_pubsub_serializer_avrobin EXPORT celix COMPONENT pubsub) -add_library(Celix::celix_pubsub_serializer_avrobin ALIAS celix_pubsub_serializer_avrobin) + add_library(Celix::celix_pubsub_serializer_avrobin ALIAS celix_pubsub_serializer_avrobin) -if (ENABLE_TESTING) - add_subdirectory(gtest) -endif(ENABLE_TESTING) + if (ENABLE_TESTING) + add_subdirectory(gtest) + endif(ENABLE_TESTING) +endif () \ No newline at end of file diff --git a/bundles/pubsub/pubsub_serializer_json/CMakeLists.txt b/bundles/pubsub/pubsub_serializer_json/CMakeLists.txt index 3738c00d..ff039a9c 100644 --- a/bundles/pubsub/pubsub_serializer_json/CMakeLists.txt +++ b/bundles/pubsub/pubsub_serializer_json/CMakeLists.txt @@ -15,32 +15,34 @@ # specific language governing permissions and limitations # under the License. -find_package(jansson REQUIRED) +celix_subproject(PUBSUB_JSON_SERIALIZER "Option to enable building the PubSub JSON serializer bundle" ON) +if (PUBSUB_JSON_SERIALIZER) + find_package(jansson REQUIRED) -add_celix_bundle(celix_pubsub_serializer_json - BUNDLE_SYMBOLICNAME "apache_celix_pubsub_serializer_json" - VERSION "1.1.0" - GROUP "Celix/PubSub" - SOURCES - src/ps_json_serializer_activator.c - src/pubsub_serializer_impl.c - src/pubsub_json_serialization_provider.c -) -target_include_directories(celix_pubsub_serializer_json PRIVATE - src -) -set_target_properties(celix_pubsub_serializer_json PROPERTIES INSTALL_RPATH "$ORIGIN") -target_link_libraries(celix_pubsub_serializer_json PRIVATE Celix::framework Celix::dfi jansson::jansson Celix::log_helper) -target_link_libraries(celix_pubsub_serializer_json PRIVATE Celix::pubsub_spi Celix::pubsub_utils) -celix_deprecated_utils_headers(celix_pubsub_serializer_json) -celix_deprecated_framework_headers(celix_pubsub_serializer_json) + add_celix_bundle(celix_pubsub_serializer_json + BUNDLE_SYMBOLICNAME "apache_celix_pubsub_serializer_json" + VERSION "1.1.0" + GROUP "Celix/PubSub" + SOURCES + src/ps_json_serializer_activator.c + src/pubsub_serializer_impl.c + src/pubsub_json_serialization_provider.c + ) + target_include_directories(celix_pubsub_serializer_json PRIVATE + src + ) + target_link_libraries(celix_pubsub_serializer_json PRIVATE Celix::dfi jansson::jansson Celix::log_helper) + target_link_libraries(celix_pubsub_serializer_json PRIVATE Celix::pubsub_spi Celix::pubsub_utils) + celix_deprecated_utils_headers(celix_pubsub_serializer_json) + celix_deprecated_framework_headers(celix_pubsub_serializer_json) -install_celix_bundle(celix_pubsub_serializer_json EXPORT celix COMPONENT pubsub) + install_celix_bundle(celix_pubsub_serializer_json EXPORT celix COMPONENT pubsub) -add_library(Celix::celix_pubsub_serializer_json ALIAS celix_pubsub_serializer_json) + add_library(Celix::celix_pubsub_serializer_json ALIAS celix_pubsub_serializer_json) -if (ENABLE_TESTING) - add_subdirectory(gtest) -endif(ENABLE_TESTING) + if (ENABLE_TESTING) + add_subdirectory(gtest) + endif(ENABLE_TESTING) +endif () \ No newline at end of file diff --git a/bundles/pubsub/pubsub_utils/include/pubsub_utils_url.h b/bundles/pubsub/pubsub_utils/include/pubsub_utils_url.h index b10863c1..212b575b 100644 --- a/bundles/pubsub/pubsub_utils/include/pubsub_utils_url.h +++ b/bundles/pubsub/pubsub_utils/include/pubsub_utils_url.h @@ -24,6 +24,8 @@ extern "C" { #endif +#include <netinet/in.h> + typedef struct pubsub_utils_url { char *url; char *protocol; diff --git a/bundles/shell/shell_bonjour/CMakeLists.txt b/bundles/shell/shell_bonjour/CMakeLists.txt index b492a14d..898f1d3d 100644 --- a/bundles/shell/shell_bonjour/CMakeLists.txt +++ b/bundles/shell/shell_bonjour/CMakeLists.txt @@ -19,10 +19,7 @@ celix_subproject(SHELL_BONJOUR "Option to enable building the Bonjour Shell (she if (SHELL_BONJOUR) message(WARNING "Celix::bonjour_shell is considered unstable, because develop of this bundle has been dormant for a while") find_package(LibXml2 REQUIRED) - - #TODO create/add FindDNS_SD.cmake and use it (with required) - find_library(DNS_SD_LIB NAMES dns_sd dns_services) - find_path(DNS_SD_INCLUDE_DIR dns_sd.h) + find_package(DNSSD REQUIRED) set(BUNDLE_SYMBOLICNAME "bonjour_shell") set(BUNDLE_VERSION "0.1.0") @@ -44,10 +41,9 @@ if (SHELL_BONJOUR) target_include_directories(bonjour_shell PRIVATE "${PROJECT_SOURCE_DIR}/utils/public/include" "${LIBXML2_INCLUDE_DIR}" - "${DNS_SD_INCLUDE_DIR}" private/include ) - target_link_libraries(bonjour_shell PRIVATE ${LIBXML2_LIBRARIES} ${DNS_SD_LIB} Celix::shell_api) + target_link_libraries(bonjour_shell PRIVATE ${LIBXML2_LIBRARIES} DNSSD::DNSSD Celix::shell_api) add_celix_container("bonjour_shell_deploy" BUNDLES Celix::shell diff --git a/bundles/shell/shell_tui/CMakeLists.txt b/bundles/shell/shell_tui/CMakeLists.txt index 34bed233..d51f36b9 100644 --- a/bundles/shell/shell_tui/CMakeLists.txt +++ b/bundles/shell/shell_tui/CMakeLists.txt @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -celix_subproject(SHELL_TUI "Option to enable building the Shell Textual User Interface bundles" ON DEPS SHELL) +celix_subproject(SHELL_TUI "Option to enable building the Shell Textual User Interface bundles" ON) if (SHELL_TUI) add_celix_bundle(shell_tui diff --git a/bundles/shell/shell_wui/CMakeLists.txt b/bundles/shell/shell_wui/CMakeLists.txt index f89cc312..2f20bda6 100644 --- a/bundles/shell/shell_wui/CMakeLists.txt +++ b/bundles/shell/shell_wui/CMakeLists.txt @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -celix_subproject(SHELL_WUI "Option to enable building the Shell Web User Interface bundles" ON DEPS SHELL HTTP_ADMIN) +celix_subproject(SHELL_WUI "Option to enable building the Shell Web User Interface bundles" ON) if (SHELL_WUI) add_celix_bundle(shell_wui diff --git a/cmake/CelixConfig.cmake b/cmake/CelixConfig.cmake index 50f83787..3cef039b 100644 --- a/cmake/CelixConfig.cmake +++ b/cmake/CelixConfig.cmake @@ -32,17 +32,14 @@ include("${REL_INSTALL_DIR}/share/celix/cmake/cmake_celix/UseCelix.cmake") #adds include(CMakeFindDependencyMacro) -find_dependency(ZLIB) #Needed by framework -find_dependency(libuuid) #Needed by framework -find_dependency(CURL) #Needed by framework (used for curl initialization), etcdlib -find_dependency(libzip) #Needed by utils set(THREADS_PREFER_PTHREAD_FLAG ON) find_dependency(Threads) -include("${REL_INSTALL_DIR}/share/celix/cmake/CelixDeps.cmake") #adds celix optional dependencies - -include("${REL_INSTALL_DIR}/share/celix/cmake/Targets.cmake") #imports lib and exe targets (e.g. Celix::framework) +#adds celix optional dependencies +include("${REL_INSTALL_DIR}/share/celix/cmake/CelixDeps.cmake") +#imports lib and exe targets (e.g. Celix::framework) +include("${REL_INSTALL_DIR}/share/celix/cmake/Targets.cmake") include("${REL_INSTALL_DIR}/share/celix/cmake/CelixTargets.cmake") # The rest is added to ensure backwards compatiblity with project using the cmake lib/include var instead of targets. @@ -84,24 +81,4 @@ endif () set(CELIX_BUNDLES_DIR ${REL_INSTALL_DIR}/share/celix/bundles) set(CELIX_SHELL_BUNDLE ${CELIX_BUNDLES_DIR}/shell.zip) -set(CELIX_SHELL_TUI_BUNDLE ${CELIX_BUNDLES_DIR}/shell_tui.zip) - -if (NOT TARGET ZLIB::ZLIB) - #Note more recent zlib will create ZLIB::ZLIB target - message("Note ZLIB::ZLIB target not created by find_package(ZLIB). Creating ZLIB::ZLIB Target.") - add_library(ZLIB::ZLIB SHARED IMPORTED) - set_target_properties(ZLIB::ZLIB PROPERTIES - IMPORTED_LOCATION "${ZLIB_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}" - ) -endif () - -if (NOT TARGET CURL::libcurl) - #Note more recent curl will create CURL::libcurl target - message("Note CURL::libcurl target not created by find_package(CURL). Creating CURL::libcurl Target.") - add_library(CURL::libcurl SHARED IMPORTED) - set_target_properties(CURL::libcurl PROPERTIES - IMPORTED_LOCATION "${CURL_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}" - ) -endif () +set(CELIX_SHELL_TUI_BUNDLE ${CELIX_BUNDLES_DIR}/shell_tui.zip) \ No newline at end of file diff --git a/cmake/CelixDeps.cmake.in b/cmake/CelixDeps.cmake.in index a3ab6970..66d819d9 100644 --- a/cmake/CelixDeps.cmake.in +++ b/cmake/CelixDeps.cmake.in @@ -1,13 +1,22 @@ +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::framework>>:find_dependency(libuuid)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::deployment_admin>>:find_dependency(libuuid)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::pubsub_spi>>:find_dependency(libuuid)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::utils>>:find_dependency(libzip)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::deployment_admin>>:find_dependency(ZLIB)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::dfi>>:find_dependency(libffi)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::dfi>>:find_dependency(jansson)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::etcdlib>>:find_dependency(jansson)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_serializer_json>>:find_dependency(jansson)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_serializer_avrobin>>:find_dependency(jansson)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_discovery_etcd>>:find_dependency(jansson)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_admin_websocket>>:find_dependency(jansson)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::framework>>:find_dependency(CURL)> +$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::etcdlib>>:find_dependency(CURL)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::RsaConfiguredDiscovery>>:find_dependency(RapidJSON)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::rsa_discovery_common>>:find_dependency(LibXml2)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::bonjour_shell>>:find_dependency(LibXml2)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_admin_zmq>>:find_dependency(ZeroMQ)> -$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_admin_zmq_v2>>:find_dependency(ZeroMQ)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_admin_zmq>>:find_dependency(czmq)> -$<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::celix_pubsub_admin_zmq_v2>>:find_dependency(czmq)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::pubsub_admin_nanomsg>>:find_dependency(NanoMsg)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::http_admin_api>>:find_dependency(civetweb)> $<$<BOOL:$<TARGET_NAME_IF_EXISTS:Celix::rsa_discovery_zeroconf>>:find_dependency(DNSSD)> diff --git a/cmake/Modules/Findlibuuid.cmake b/cmake/Modules/Findlibuuid.cmake index cc6e3444..de2adb17 100644 --- a/cmake/Modules/Findlibuuid.cmake +++ b/cmake/Modules/Findlibuuid.cmake @@ -22,36 +22,24 @@ # UUID_LIBRARIES - The libraries needed to use UUID # libuuid::libuuid - Imported target for UUID -if (APPLE) - set(UUID_INCLUDE_DIRS ) - set(UUID_LIBRARIES ) - - find_package_handle_standard_args(libuuid DEFAULT_MSG) - - if (NOT TARGET libuuid::libuuid) - add_library(libuuid::libuuid INTERFACE IMPORTED) - endif () -else () - - find_path(UUID_INCLUDE_DIR uuid/uuid.h - /usr/include - /usr/local/include ) - - find_library(UUID_LIBRARY NAMES uuid - PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64 /lib/i386-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(libuuid DEFAULT_MSG - UUID_LIBRARY UUID_INCLUDE_DIR) - - mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY) - set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR}) - set(UUID_LIBRARIES ${UUID_LIBRARY}) - if (libuuid_FOUND AND NOT TARGET libuuid::libuuid) - add_library(libuuid::libuuid SHARED IMPORTED) - set_target_properties(libuuid::libuuid PROPERTIES - IMPORTED_LOCATION "${UUID_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${UUID_INCLUDE_DIR}" - ) - endif () +find_path(UUID_INCLUDE_DIR uuid/uuid.h + /usr/include + /usr/local/include ) + +find_library(UUID_LIBRARY NAMES uuid + PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64 /lib/i386-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(libuuid DEFAULT_MSG + UUID_LIBRARY UUID_INCLUDE_DIR) + +mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY) +set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR}) +set(UUID_LIBRARIES ${UUID_LIBRARY}) +if (libuuid_FOUND AND NOT TARGET libuuid::libuuid) + add_library(libuuid::libuuid SHARED IMPORTED) + set_target_properties(libuuid::libuuid PROPERTIES + IMPORTED_LOCATION "${UUID_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${UUID_INCLUDE_DIR}" + ) endif () \ No newline at end of file diff --git a/conanfile.py b/conanfile.py index 36fd65fa..d796f2c9 100644 --- a/conanfile.py +++ b/conanfile.py @@ -49,8 +49,14 @@ class CelixConan(ConanFile): "build_deployment_admin": [True, False], "build_http_admin": [True, False], "build_log_service": [True, False], + "build_log_helper": [True, False], + "build_log_service_api": [True, False], "build_syslog_writer": [True, False], "build_pubsub": [True, False], + "build_pubsub_wire_protocol_v1": [True, False], + "build_pubsub_wire_protocol_v2": [True, False], + "build_pubsub_json_serializer": [True, False], + "build_pubsub_avrobin_serializer": [True, False], "build_pubsub_psa_zmq": [True, False], "build_pubsub_examples": [True, False], "build_pubsub_integration": [True, False], @@ -68,6 +74,7 @@ class CelixConan(ConanFile): "build_rsa_json_rpc": [True, False], "build_rsa_discovery_zeroconf": [True, False], "build_shell": [True, False], + "build_shell_api": [True, False], "build_remote_shell": [True, False], "build_shell_bonjour": [True, False], "build_shell_tui": [True, False], @@ -84,9 +91,6 @@ class CelixConan(ConanFile): "build_framework": [True, False], "build_rcm": [True, False], "build_utils": [True, False], - "build_log_helper": [True, False], - "build_log_service_api": [True, False], - "build_shell_api": [True, False], "celix_cxx14": [True, False], "celix_cxx17": [True, False], "celix_install_deprecated_api": [True, False], @@ -105,8 +109,14 @@ class CelixConan(ConanFile): "build_deployment_admin": False, "build_http_admin": False, "build_log_service": False, + "build_log_helper": False, + "build_log_service_api": False, "build_syslog_writer": False, "build_pubsub": False, + "build_pubsub_wire_protocol_v1": False, + "build_pubsub_wire_protocol_v2": False, + "build_pubsub_json_serializer": False, + "build_pubsub_avrobin_serializer": False, "build_pubsub_psa_zmq": False, "build_pubsub_examples": False, "build_pubsub_integration": False, @@ -124,6 +134,7 @@ class CelixConan(ConanFile): "build_rsa_json_rpc": False, "build_rsa_discovery_zeroconf": False, "build_shell": False, + "build_shell_api": False, "build_remote_shell": False, "build_shell_bonjour": False, "build_shell_tui": False, @@ -140,9 +151,6 @@ class CelixConan(ConanFile): "build_framework": False, "build_rcm": False, "build_utils": False, - "build_log_helper": False, - "build_log_service_api": False, - "build_shell_api": False, "celix_cxx14": True, "celix_cxx17": True, "celix_install_deprecated_api": False, @@ -200,16 +208,6 @@ class CelixConan(ConanFile): if not self.options.enable_testing: self.options.build_pubsub_integration = False self.options.enable_code_coverage = False - if not self.options.build_log_service: - self.options.build_syslog_writer = False - if not self.options.build_pubsub: - self.options.build_pubsub_psa_zmq = False - self.options.build_pubsub_examples = False - self.options.build_pubsub_integration = False - self.options.build_pubsub_psa_tcp = False - self.options.build_pubsub_psa_udp_mc = False - self.options.build_pubsub_psa_ws = False - self.options.build_pubsub_discovery_etcd = False if not self.options.build_remote_service_admin: self.options.build_rsa_remote_service_admin_dfi = False self.options.build_rsa_discovery_configured = False @@ -217,30 +215,111 @@ class CelixConan(ConanFile): self.options.build_rsa_json_rpc = False self.options.build_rsa_remote_service_admin_shm_v2 = False self.options.build_rsa_discovery_zeroconf = False - if not self.options.build_shell: - self.options.build_remote_shell = False - self.options.build_shell_bonjour = False - self.options.build_shell_tui = False - self.options.build_shell_wui = False - if not self.options.celix_install_deprecated_api: - self.options.build_shell_bonjour = False + + if self.options.build_shell_bonjour: + self.options.build_shell = True + self.options.celix_install_deprecated_api = True if self.options.build_cxx_rsa_integration: self.options.build_cxx_remote_service_admin = True - self.options.build_pubsub = True self.options.build_pushstreams = True self.options.build_promises = True self.options.build_log_helper = True self.options.build_shell = True self.options.build_shell_tui = True self.options.build_shell_api = True + self.options.build_pubsub = True + self.options.build_pubsub_wire_protocol_v2 = True + self.options.build_pubsub_json_serializer = True self.options.build_pubsub_psa_zmq = True self.options.build_pubsub_discovery_etcd = True + if self.options.build_pubsub_integration: + self.options.build_pubsub = True + self.options.build_shell_tui = True + self.options.build_pubsub_json_serializer = True + self.options.build_pubsub_wire_protocol_v2 = True + self.options.build_pubsub_wire_protocol_v1 = True + + if self.options.build_pubsub_examples: + self.options.build_log_service = True + self.options.build_shell_tui = True + self.options.build_pubsub_json_serializer = True + self.options.build_pubsub_discovery_etcd = True + self.options.build_pubsub_wire_protocol_v2 = True + self.options.build_pubsub_wire_protocol_v1 = True + + if self.options.build_pubsub_discovery_etcd: + self.options.build_pubsub = True + self.options.build_celix_etcdlib = True + + if self.options.build_pubsub_psa_ws: + self.options.build_http_admin = True + self.options.build_pubsub = True + + if self.options.build_pubsub_psa_zmq or self.options.build_pubsub_psa_tcp \ + or self.options.build_pubsub_psa_udp_mc: + self.options.build_pubsub = True + + if self.options.build_pubsub_wire_protocol_v1: + self.options.build_pubsub = True + + if self.options.build_pubsub_wire_protocol_v2: + self.options.build_pubsub = True + + if self.options.build_pubsub_json_serializer or self.build_pubsub_avrobin_serializer: + self.options.build_pubsub = True + + if self.options.build_pubsub: + self.options.build_framework = True + self.options.build_celix_dfi = True + self.options.build_shell_api = True + self.options.build_log_helper = True + self.options.celix_install_deprecated_api = True + if self.options.build_cxx_remote_service_admin: self.options.build_framework = True + self.options.build_log_helper = True self.options.celix_cxx17 = True + if self.options.build_remote_shell: + self.options.build_shell = True + + if self.options.build_shell_wui: + self.options.build_shell = True + self.options.build_http_admin = True + + if self.options.build_shell_tui: + self.options.build_shell = True + + if self.options.build_shell: + self.options.build_shell_api = True + self.options.build_log_helper = True + self.options.build_framework = True + + if self.options.build_syslog_writer: + self.options.build_log_service = True + + if self.options.build_log_service: + self.options.build_log_service_api = True + self.options.build_shell_api = True + self.options.build_framework = True + + if self.options.build_shell_api: + self.options.build_utils = True + + if self.options.build_log_helper: + self.options.build_log_service_api = True + self.options.build_framework = True + + if self.options.build_log_service_api: + self.options.build_utils = True + if self.options.celix_install_deprecated_api: + self.options.build_framework = True + + if self.options.build_framework: + self.options.build_utils = True + if self.options.build_pushstreams: self.options.build_promises = True @@ -251,29 +330,27 @@ class CelixConan(ConanFile): self.options.celix_cxx14 = True def requirements(self): - self.requires("libcurl/[>=7.64.1 <8.0.0]") - self.options['libcurl'].shared = True - self.requires("zlib/[>=1.2.8 <2.0.0]") - self.options['zlib'].shared = True - self.requires("libuuid/1.0.3") - self.options['libuuid'].shared = True - self.requires("libzip/[>=1.7.3 <2.0.0]") - self.options['libzip'].shared = True - self.options['openssl'].shared = True - self.options['libxml2'].shared = True + if self.options.build_utils: + self.requires("libzip/[>=1.7.3 <2.0.0]") + self.options['libzip'].shared = True + if self.options.build_framework or self.options.build_pubsub: + self.requires("libuuid/1.0.3") + self.options['libuuid'].shared = True + if self.options.build_framework or self.options.build_celix_etcdlib: + self.requires("libcurl/[>=7.64.1 <8.0.0]") + self.options['libcurl'].shared = True + if self.options.build_deployment_admin: + self.requires("zlib/[>=1.2.8 <2.0.0]") + self.options['zlib'].shared = True if self.options.enable_testing: self.options['gtest'].shared = True if self.options.enable_address_sanitizer: self.options["cpputest"].with_leak_detection = False if self.options.build_remote_service_admin or self.options.build_shell_bonjour: self.requires("libxml2/[>=2.9.9 <3.0.0]") + self.options['libxml2'].shared = True if self.options.build_cxx_remote_service_admin: self.requires("rapidjson/[>=1.1.0 <2.0.0]") - if self.options.build_shell_bonjour: - # TODO: CC=cc is fixed in the official mdnsresponder Makefile, patching is needed to make cross-compile work - # https://github.com/conan-io/conan-center-index/issues/9711 - # Another issue is in conan infrastructure: https://github.com/conan-io/conan-center-index/issues/9709 - self.requires("mdnsresponder/1310.140.1") if self.options.build_pubsub_psa_zmq: self.requires("zeromq/4.3.4") self.options['zeromq'].shared = True @@ -285,12 +362,17 @@ class CelixConan(ConanFile): if self.options.build_celix_dfi: self.requires("libffi/[>=3.2.1 <4.0.0]") self.options['libffi'].shared = True - if self.options.build_celix_dfi or self.options.build_celix_etcdlib: + if self.options.build_celix_dfi or self.options.build_celix_etcdlib \ + or self.options.build_pubsub_json_serializer or self.options.build_pubsub_avrobin_serializer \ + or self.options.build_pubsub_discovery_etcd or self.options.build_pubsub_psa_ws: self.requires("jansson/[>=2.12 <3.0.0]") self.options['jansson'].shared = True - if self.options.build_rsa_discovery_zeroconf: + if self.options.build_rsa_discovery_zeroconf or self.options.build_shell_bonjour: # TODO: To be replaced with mdnsresponder/1790.80.10, resolve some problems of mdnsresponder # https://github.com/conan-io/conan-center-index/pull/16254 + # TODO: CC=cc is fixed in the official mdnsresponder Makefile, patching is needed to make cross-compile work + # https://github.com/conan-io/conan-center-index/issues/9711 + # Another issue is in conan infrastructure: https://github.com/conan-io/conan-center-index/issues/9709 self.requires("mdnsresponder/1310.140.1") self.validate() diff --git a/libs/error_injector/CMakeLists.txt b/libs/error_injector/CMakeLists.txt index 7c508927..13737f14 100644 --- a/libs/error_injector/CMakeLists.txt +++ b/libs/error_injector/CMakeLists.txt @@ -25,29 +25,34 @@ add_library(Celix::error_injector ALIAS error_injector) add_subdirectory(malloc) add_subdirectory(asprintf) -add_subdirectory(celix_properties) -add_subdirectory(celix_utils) -add_subdirectory(zip) add_subdirectory(stdio) add_subdirectory(stdlib) -add_subdirectory(celix_threads) add_subdirectory(eventfd) -add_subdirectory(celix_bundle_ctx) add_subdirectory(stat) add_subdirectory(fts) add_subdirectory(dlfcn) add_subdirectory(ifaddrs) -add_subdirectory(celix_array_list) add_subdirectory(sys_shm) add_subdirectory(socket) add_subdirectory(pthread) -add_subdirectory(celix_log_helper) -add_subdirectory(celix_bundle) -add_subdirectory(celix_version) -add_subdirectory(celix_hash_map) -add_subdirectory(celix_long_hash_map) add_subdirectory(unistd) - +if (BUILD_UTILS) + add_subdirectory(celix_properties) + add_subdirectory(celix_utils) + add_subdirectory(celix_threads) + add_subdirectory(celix_array_list) + add_subdirectory(celix_version) + add_subdirectory(celix_hash_map) + add_subdirectory(celix_long_hash_map) + add_subdirectory(zip) +endif () +if (BUILD_FRAMEWORK) + add_subdirectory(celix_bundle_ctx) + add_subdirectory(celix_bundle) +endif () +if (BUILD_LOG_HELPER) + add_subdirectory(celix_log_helper) +endif () if (BUILD_CELIX_DFI) add_subdirectory(dfi) endif () diff --git a/libs/error_injector/zip/CMakeLists.txt b/libs/error_injector/zip/CMakeLists.txt index d9689907..9646397f 100644 --- a/libs/error_injector/zip/CMakeLists.txt +++ b/libs/error_injector/zip/CMakeLists.txt @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. +find_package(libzip REQUIRED) add_library(zip_ei STATIC src/zip_ei.cc) target_include_directories(zip_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) diff --git a/libs/etcdlib/CMakeLists.txt b/libs/etcdlib/CMakeLists.txt index c640450f..bc351136 100644 --- a/libs/etcdlib/CMakeLists.txt +++ b/libs/etcdlib/CMakeLists.txt @@ -65,7 +65,7 @@ if (CELIX_ETCDLIB OR ETCDLIB_STANDALONE) SOVERSION 1 C_VISIBILITY_PRESET hidden ) - target_link_libraries(etcdlib PUBLIC CURL::libcurl jansson::jansson ${CELIX_OPTIONAL_EXTRA_LIBS}) + target_link_libraries(etcdlib PRIVATE CURL::libcurl jansson::jansson ${CELIX_OPTIONAL_EXTRA_LIBS}) generate_export_header(etcdlib BASE_NAME "ETCDLIB" @@ -81,7 +81,7 @@ if (CELIX_ETCDLIB OR ETCDLIB_STANDALONE) PROPERTIES OUTPUT_NAME "celix_etcdlib_static") target_compile_definitions(etcdlib_static PRIVATE ETCDLIB_STATIC_DEFINE) - target_link_libraries(etcdlib_static PUBLIC CURL::libcurl jansson::jansson ${CELIX_OPTIONAL_EXTRA_LIBS}) + target_link_libraries(etcdlib_static PRIVATE CURL::libcurl jansson::jansson ${CELIX_OPTIONAL_EXTRA_LIBS}) add_executable(etcdlib_test ${CMAKE_CURRENT_SOURCE_DIR}/test/etcdlib_test.c) target_link_libraries(etcdlib_test PRIVATE etcdlib_static CURL::libcurl jansson::jansson) diff --git a/libs/framework/CMakeLists.txt b/libs/framework/CMakeLists.txt index 0bd6852c..103ab406 100644 --- a/libs/framework/CMakeLists.txt +++ b/libs/framework/CMakeLists.txt @@ -17,7 +17,6 @@ celix_subproject(FRAMEWORK "Option to build the Celix Framework" ON) if (FRAMEWORK) - find_package(ZLIB REQUIRED) find_package(libuuid REQUIRED) find_package(CURL REQUIRED) @@ -37,7 +36,7 @@ if (FRAMEWORK) src/celix_bundle_state.c src/celix_framework_utils.c src/celix_module_private.h) - set(FRAMEWORK_DEPS libuuid::libuuid CURL::libcurl ZLIB::ZLIB ${CMAKE_DL_LIBS}) + set(FRAMEWORK_DEPS libuuid::libuuid CURL::libcurl ${CMAKE_DL_LIBS}) add_library(framework SHARED ${FRAMEWORK_SRC}) diff --git a/libs/framework/src/celix_launcher.c b/libs/framework/src/celix_launcher.c index 7ce3a293..82abb92e 100644 --- a/libs/framework/src/celix_launcher.c +++ b/libs/framework/src/celix_launcher.c @@ -163,7 +163,7 @@ static int celixLauncher_launchWithConfigAndProps(const char *configFile, celix_ int celixLauncher_launchWithProperties(celix_properties_t* config, celix_framework_t** framework) { #ifndef CELIX_NO_CURLINIT // Before doing anything else, let's setup Curl - curl_global_init(CURL_GLOBAL_NOTHING); + curl_global_init(CURL_GLOBAL_ALL); #endif *framework = celix_frameworkFactory_createFramework(config); return *framework != NULL ? CELIX_LAUNCHER_OK_EXIT_CODE : CELIX_LAUNCHER_ERROR_EXIT_CODE; diff --git a/libs/pushstreams/CMakeLists.txt b/libs/pushstreams/CMakeLists.txt index 2db3c4df..d63e11b1 100644 --- a/libs/pushstreams/CMakeLists.txt +++ b/libs/pushstreams/CMakeLists.txt @@ -20,6 +20,7 @@ celix_subproject(PUSHSTREAMS "Option to build the PushStreams library" ${PUSHSTR if (PUSHSTREAMS) set(CMAKE_CXX_STANDARD 17) + set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads) add_library(PushStreams INTERFACE) target_include_directories(PushStreams INTERFACE diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt index 6b418aa8..e7fbcd37 100644 --- a/libs/utils/CMakeLists.txt +++ b/libs/utils/CMakeLists.txt @@ -55,7 +55,6 @@ if (UTILS) add_library(utils SHARED ${UTILS_SRC}) - target_link_libraries(utils PRIVATE libzip::libzip) set_target_properties(utils PROPERTIES C_VISIBILITY_PRESET hidden diff --git a/misc/experimental/bundles/pubsub_admin_nanomsg/CMakeLists.txt b/misc/experimental/bundles/pubsub_admin_nanomsg/CMakeLists.txt index 425a9693..27e80830 100644 --- a/misc/experimental/bundles/pubsub_admin_nanomsg/CMakeLists.txt +++ b/misc/experimental/bundles/pubsub_admin_nanomsg/CMakeLists.txt @@ -31,7 +31,6 @@ if (BUILD_PUBSUB_PSA_NANOMSG) src/pubsub_nanomsg_common.cc ) - set_target_properties(celix_pubsub_admin_nanomsg PROPERTIES INSTALL_RPATH "$ORIGIN") target_link_libraries(celix_pubsub_admin_nanomsg PRIVATE Celix::pubsub_spi Celix::framework Celix::dfi Celix::log_helper
