diff --git a/.github/workflows/conan_create.yml b/.github/workflows/conan_create.yml new file mode 100644 index 000000000..655a5fc85 --- /dev/null +++ b/.github/workflows/conan_create.yml @@ -0,0 +1,71 @@ +name: Conan Create + +on: + push: + pull_request: + schedule: + - cron: '0 0 * * *' + +jobs: + + ubuntu-build: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + compiler: [ [gcc,g++], [clang,clang++] ] + type: [ Debug ] + timeout-minutes: 120 + steps: + - name: Checkout source code + uses: actions/checkout@v3.3.0 + - name: Install build dependencies + run: | + sudo pip install -U conan==1.59.0 + sudo apt-get install -yq --no-install-recommends ninja-build + - name: Setup Conan Profile + env: + CC: ${{ matrix.compiler[0] }} + CXX: ${{ matrix.compiler[1] }} + run: | + # build profile + conan profile new release --detect + conan profile update settings.build_type=Release release + #Note no backwards compatiblity for gcc5 needed, setting libcxx to c++11. + conan profile update settings.compiler.libcxx=libstdc++11 release + conan profile show release + # host profile + conan profile new default --detect + conan profile update settings.build_type=${{ matrix.type }} default + #Note no backwards compatiblity for gcc5 needed, setting libcxx to c++11. + conan profile update settings.compiler.libcxx=libstdc++11 default + conan profile show default + - name: Create Celix + env: + CC: ${{ matrix.compiler[0] }} + CXX: ${{ matrix.compiler[1] }} + CONAN_CMAKE_GENERATOR: Ninja + run: | + conan inspect . -a options | awk 'BEGIN { FS="[\t:]+" } /build/ && !/build_all/ { print $1}' | while read option; do conan create . -b missing -o celix:${option}=True -pr:b release -pr:h default -tf examples/conan_test_package -tbf test-build -o celix:celix_cxx17=True -o celix:celix_install_deprecated_api=True --require-override=libcurl/7.64.1 --require-override=openssl/1.1.1s --require-override=zlib/1.2.13 || exit 1; done + + mac-build: + runs-on: macOS-11 + timeout-minutes: 120 + steps: + - name: Checkout source code + uses: actions/checkout@v3.3.0 + - name: Install build dependencies + run: | + brew install python ninja + pip3 install -U conan==1.59.0 + - name: Setup Conan Profile + run: | + conan profile new default --detect + conan profile update settings.build_type=Release default + - name: Create Celix + env: + CC: ${{ matrix.compiler[0] }} + CXX: ${{ matrix.compiler[1] }} + CONAN_CMAKE_GENERATOR: Ninja + run: | + conan inspect . -a options | awk 'BEGIN { FS="[\t:]+" } /build/ && !/build_all/ { print $1}' | while read option; do conan create . -b missing -o celix:${option}=True -pr:b default -pr:h default -tf examples/conan_test_package -tbf test-build -o celix:celix_cxx17=True -o celix:celix_install_deprecated_api=True --require-override=libcurl/7.64.1 --require-override=openssl/1.1.1s --require-override=zlib/1.2.13 || exit 1; done diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b43de2f22..965408d21 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -44,12 +44,9 @@ jobs: source activate_run.sh ctest --output-on-failure source deactivate_run.sh - - name: Test Installed Celix - run: | - conan create -pr:b default -pr:h default -tf examples/conan_test_package -tbf test-build -o celix:celix_cxx17=True -o celix:celix_install_deprecated_api=True --require-override=libcurl/7.64.1 --require-override=openssl/1.1.1s . build-brew: - runs-on: macOS-latest + runs-on: macOS-11 timeout-minutes: 120 steps: - name: Checkout source code diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index f5098ae28..6d70598e5 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -19,9 +19,10 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v3.3.0 - - name: Install conan + - name: Install build dependencies run: | sudo pip install -U conan==1.59.0 + sudo apt-get install -yq --no-install-recommends ninja-build - name: Setup Conan Profile env: CC: ${{ matrix.compiler[0] }} @@ -51,7 +52,6 @@ jobs: -o celix:enable_testing_dependency_manager_for_cxx11=True run: | #force require libcurl 7.64.1, due to a sha256 verify issue in libcurl/7.87.0 - sudo apt-get install -yq --no-install-recommends ninja-build conan install . celix/ci -pr:b release -pr:h default -if build ${CONAN_BUILD_OPTIONS} -b missing -b cpputest --require-override=libcurl/7.64.1 --require-override=openssl/1.1.1s - name: Build env: @@ -67,13 +67,6 @@ jobs: source activate_run.sh ctest --output-on-failure source deactivate_run.sh - - name: Test Installed Celix - env: - CC: ${{ matrix.compiler[0] }} - CXX: ${{ matrix.compiler[1] }} - CONAN_CMAKE_GENERATOR: Ninja - run: | - conan create -pr:b release -pr:h default -tf examples/conan_test_package -tbf test-build -o celix:celix_cxx17=True -o celix:celix_install_deprecated_api=True --require-override=libcurl/7.64.1 --require-override=openssl/1.1.1s . build-apt: runs-on: ubuntu-22.04 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6654e4ee4..1c00d4857 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)." ) @@ -70,7 +46,7 @@ if (ENABLE_TESTING) endif () # Set C specific flags -set(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=c99 -fPIC ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -fPIC ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS "-Wall -Werror -Wformat -Wno-error=deprecated-declarations ${CMAKE_C_FLAGS}") # Set C++ specific flags @@ -196,6 +172,12 @@ include(CheckLinkerFlag) check_linker_flag(CXX LINKER:--wrap,celix_nonexistent_symbol LINKER_WRAP_SUPPORTED) cmake_pop_check_state() +# avoid unknown export "celix" error when building nothing +add_library(celix INTERFACE) +add_library(Celix::celix ALIAS celix) +install(TARGETS celix EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix) + #Add generate_export_header to cmake include(GenerateExportHeader) diff --git a/bundles/cxx_remote_services/integration/CMakeLists.txt b/bundles/cxx_remote_services/integration/CMakeLists.txt index de8fcf716..63df4e1e8 100644 --- a/bundles/cxx_remote_services/integration/CMakeLists.txt +++ b/bundles/cxx_remote_services/integration/CMakeLists.txt @@ -15,10 +15,8 @@ # specific language governing permissions and limitations # under the License. -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) +celix_subproject(CXX_RSA_INTEGRATION "Option to build the C++17 Remote Service Admin Service integration" ON) 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 2d49d6274..25572ed58 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 c56dc6bae..5eb0dfaec 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 $ ) +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 762439fd1..049206792 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 d8d407d46..41f3b9d8b 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=\"$\") diff --git a/bundles/logging/log_helper/CMakeLists.txt b/bundles/logging/log_helper/CMakeLists.txt index c180014cb..ddec3e494 100644 --- a/bundles/logging/log_helper/CMakeLists.txt +++ b/bundles/logging/log_helper/CMakeLists.txt @@ -15,36 +15,42 @@ # specific language governing permissions and limitations # under the License. -if (CELIX_INSTALL_DEPRECATED_API) - set(SOURCES src/celix_log_helper.c src/log_helper.c) -else () - set(SOURCES src/celix_log_helper.c) -endif () +celix_subproject(LOG_HELPER "Option to enable building the log helper library" ON) +if (LOG_HELPER) + if (CELIX_INSTALL_DEPRECATED_API) + set(SOURCES src/celix_log_helper.c src/log_helper.c) + else () + set(SOURCES src/celix_log_helper.c) + endif () -add_library(log_helper STATIC ${SOURCES}) -set_target_properties(log_helper PROPERTIES OUTPUT_NAME "celix_log_utils") -target_include_directories(log_helper PUBLIC - $ -) -target_link_libraries(log_helper PUBLIC Celix::log_service_api Celix::framework PRIVATE Celix::utils) + add_library(log_helper STATIC ${SOURCES}) + set_target_properties(log_helper PROPERTIES OUTPUT_NAME "celix_log_utils") + target_include_directories(log_helper PUBLIC + $ + ) + target_link_libraries(log_helper PUBLIC Celix::log_service_api Celix::framework PRIVATE Celix::utils) -if (CELIX_INSTALL_DEPRECATED_API) - target_include_directories(log_helper PUBLIC - $ - ) - install(DIRECTORY include_v1/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_helper) -endif () + if (CELIX_INSTALL_DEPRECATED_API) + target_include_directories(log_helper PUBLIC + $ + ) + install(DIRECTORY include_v1/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_helper) + endif () -install(TARGETS log_helper EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT logging - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_helper) -install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_helper COMPONENT logging) + install(TARGETS log_helper EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT logging + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_helper) + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_helper COMPONENT logging) -celix_target_hide_symbols(log_helper) -celix_deprecated_utils_headers(log_helper) -celix_deprecated_framework_headers(log_helper) + celix_target_hide_symbols(log_helper) + celix_deprecated_utils_headers(log_helper) + celix_deprecated_framework_headers(log_helper) -add_library(Celix::log_helper ALIAS log_helper) + add_library(Celix::log_helper ALIAS log_helper) -if (ENABLE_TESTING) - add_subdirectory(gtest) -endif() + if (ENABLE_TESTING) + if (LINKER_WRAP_SUPPORTED) + add_subdirectory(error_injector) + endif () + add_subdirectory(gtest) + endif () +endif () diff --git a/libs/error_injector/celix_log_helper/CMakeLists.txt b/bundles/logging/log_helper/error_injector/CMakeLists.txt similarity index 93% rename from libs/error_injector/celix_log_helper/CMakeLists.txt rename to bundles/logging/log_helper/error_injector/CMakeLists.txt index 4c4d00cc5..448b8759d 100644 --- a/libs/error_injector/celix_log_helper/CMakeLists.txt +++ b/bundles/logging/log_helper/error_injector/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(log_helper_ei STATIC src/celix_log_helper_ei.cc) -target_include_directories(log_helper_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(log_helper_ei PUBLIC include) target_link_libraries(log_helper_ei PUBLIC Celix::error_injector Celix::log_helper) # It plays nicely with address sanitizer this way. target_link_options(log_helper_ei INTERFACE LINKER:--wrap,celix_logHelper_create) diff --git a/libs/error_injector/celix_log_helper/include/celix_log_helper_ei.h b/bundles/logging/log_helper/error_injector/include/celix_log_helper_ei.h similarity index 100% rename from libs/error_injector/celix_log_helper/include/celix_log_helper_ei.h rename to bundles/logging/log_helper/error_injector/include/celix_log_helper_ei.h diff --git a/libs/error_injector/celix_log_helper/src/celix_log_helper_ei.cc b/bundles/logging/log_helper/error_injector/src/celix_log_helper_ei.cc similarity index 100% rename from libs/error_injector/celix_log_helper/src/celix_log_helper_ei.cc rename to bundles/logging/log_helper/error_injector/src/celix_log_helper_ei.cc diff --git a/bundles/logging/log_service_api/CMakeLists.txt b/bundles/logging/log_service_api/CMakeLists.txt index c1828ef63..afd92dc7e 100644 --- a/bundles/logging/log_service_api/CMakeLists.txt +++ b/bundles/logging/log_service_api/CMakeLists.txt @@ -15,21 +15,25 @@ # specific language governing permissions and limitations # under the License. -add_library(log_service_api INTERFACE) -target_include_directories(log_service_api INTERFACE - $ -) -target_link_libraries(log_service_api INTERFACE Celix::utils Celix::framework) +celix_subproject(LOG_SERVICE_API "Option to enable building the log service API" ON) +if (LOG_SERVICE_API) + add_library(log_service_api INTERFACE) + target_include_directories(log_service_api INTERFACE + $ + ) + target_link_libraries(log_service_api INTERFACE Celix::utils) -if (CELIX_INSTALL_DEPRECATED_API) - target_include_directories(log_service_api INTERFACE - $ - ) - install(DIRECTORY include_v2/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_service) -endif () + if (CELIX_INSTALL_DEPRECATED_API) + target_link_libraries(log_service_api INTERFACE Celix::framework) + target_include_directories(log_service_api INTERFACE + $ + ) + install(DIRECTORY include_v2/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_service) + endif () -install(TARGETS log_service_api EXPORT celix - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_service) -install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_service) + install(TARGETS log_service_api EXPORT celix + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_service) + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/log_service) -add_library(Celix::log_service_api ALIAS log_service_api) + add_library(Celix::log_service_api ALIAS log_service_api) +endif () diff --git a/bundles/logging/log_service_api/include/celix_log_control.h b/bundles/logging/log_service_api/include/celix_log_control.h index b42a2f0fd..5f3d82f34 100644 --- a/bundles/logging/log_service_api/include/celix_log_control.h +++ b/bundles/logging/log_service_api/include/celix_log_control.h @@ -21,6 +21,7 @@ #define CELIX_LOG_CONTROL_H #include +#include #include "celix_log_level.h" #include "celix_array_list.h" diff --git a/bundles/logging/log_writers/syslog_writer/CMakeLists.txt b/bundles/logging/log_writers/syslog_writer/CMakeLists.txt index 63e117490..dd6934f77 100644 --- a/bundles/logging/log_writers/syslog_writer/CMakeLists.txt +++ b/bundles/logging/log_writers/syslog_writer/CMakeLists.txt @@ -24,7 +24,7 @@ add_celix_bundle(syslog_writer SOURCES src/celix_syslog_writer_activator.c ) -target_link_libraries(syslog_writer PRIVATE Celix::log_helper Celix::log_service_api) +target_link_libraries(syslog_writer PRIVATE Celix::log_service_api) install_celix_bundle(syslog_writer EXPORT celix COMPONENT logging) #Setup target aliases to match external usage diff --git a/bundles/logging/log_writers/syslog_writer/gtest/CMakeLists.txt b/bundles/logging/log_writers/syslog_writer/gtest/CMakeLists.txt index f9df777e6..87b4228e7 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 Celix::log_service_api 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_compile_definitions(test_syslog_writer PRIVATE -DSYSLOG_WRITER_BUNDLE=\"$\") diff --git a/bundles/pubsub/CMakeLists.txt b/bundles/pubsub/CMakeLists.txt index b4985be60..bf8fe5f60 100644 --- a/bundles/pubsub/CMakeLists.txt +++ b/bundles/pubsub/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -celix_subproject(PUBSUB "Option to build the pubsub bundles" ON DEPS CELIX_DFI) +celix_subproject(PUBSUB "Option to build the pubsub bundles" ON) if (PUBSUB) add_subdirectory(pubsub_api) add_subdirectory(pubsub_utils) diff --git a/bundles/pubsub/examples/CMakeLists.txt b/bundles/pubsub/examples/CMakeLists.txt index 94dc90f01..893d50f68 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 1bf920be5..0be810a39 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 250f64bd8..b55d90777 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 cf96a101b..60392538e 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 8bf542471..b51ce1367 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 1ab0cf7a1..363833f26 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 59aebe272..c57c1dfb3 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 $) 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 $) 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 $) 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 $) 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 $) 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 $) @@ -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 8bd326a13..6427cae31 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 6092f2b77..f859a9664 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 180437e5c..752004ca4 100644 --- a/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt +++ b/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -celix_subproject(PUBSUB_PSA_WS "Build WebSocket PubSub Admin" ON DEPS HTTP_ADMIN) +celix_subproject(PUBSUB_PSA_WS "Build WebSocket PubSub Admin" ON) if (PUBSUB_PSA_WS) find_package(jansson REQUIRED) find_package(libuuid REQUIRED) @@ -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 58f2500a6..1d6119512 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 3269e25ec..14facae8f 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 $ ) +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 daab5b9e3..ca73cae8a 100644 --- a/bundles/pubsub/pubsub_discovery/CMakeLists.txt +++ b/bundles/pubsub/pubsub_discovery/CMakeLists.txt @@ -15,9 +15,8 @@ # specific language governing permissions and limitations # under the License. -celix_subproject(PUBSUB_DISCOVERY_ETCD "Option to enable building the PubSub Discovery (ETCD) bundle" ON DEPS CELIX_ETCDLIB) +celix_subproject(PUBSUB_DISCOVERY_ETCD "Option to enable building the PubSub Discovery (ETCD) bundle" ON) 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 4050e7f4b..5a5a2636e 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 450aa6548..a4a0f7ee3 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 fd04b2c11..e287bf7cf 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 3738c00d4..ff039a9cd 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 b10863c10..212b575b7 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 + typedef struct pubsub_utils_url { char *url; char *protocol; diff --git a/bundles/remote_services/CMakeLists.txt b/bundles/remote_services/CMakeLists.txt index c62a388de..18f6c4342 100644 --- a/bundles/remote_services/CMakeLists.txt +++ b/bundles/remote_services/CMakeLists.txt @@ -15,10 +15,8 @@ # specific language governing permissions and limitations # under the License. -celix_subproject(REMOTE_SERVICE_ADMIN "Option to enable building the Remote Service Admin Service bundles" ON DEPS CELIX_DFI) +celix_subproject(REMOTE_SERVICE_ADMIN "Option to enable building the Remote Service Admin Service bundles" ON) if (REMOTE_SERVICE_ADMIN) - - add_subdirectory(thpool) add_subdirectory(remote_services_api) add_subdirectory(rsa_spi) add_subdirectory(rsa_common) diff --git a/bundles/remote_services/discovery_common/CMakeLists.txt b/bundles/remote_services/discovery_common/CMakeLists.txt index eacd835aa..aa94f2fb0 100644 --- a/bundles/remote_services/discovery_common/CMakeLists.txt +++ b/bundles/remote_services/discovery_common/CMakeLists.txt @@ -15,30 +15,29 @@ # specific language governing permissions and limitations # under the License. +celix_subproject(RSA_DISCOVERY_COMMON "Option to enable building the RSA discovery common library" ON) +if (RSA_DISCOVERY_COMMON) + find_package(CURL REQUIRED) + find_package(LibXml2 REQUIRED) + find_package(civetweb REQUIRED) -find_package(CURL REQUIRED) -find_package(LibXml2 REQUIRED) -find_package(civetweb REQUIRED) + add_library(rsa_discovery_common OBJECT + src/discovery.c + src/discovery_activator.c + src/endpoint_descriptor_reader.c + src/endpoint_descriptor_writer.c + src/endpoint_discovery_poller.c + src/endpoint_discovery_server.c + ) + target_include_directories(rsa_discovery_common PUBLIC include + PRIVATE src ${LIBXML2_INCLUDE_DIR}) + celix_target_hide_symbols(rsa_discovery_common) + celix_deprecated_utils_headers(rsa_discovery_common) + celix_deprecated_framework_headers(rsa_discovery_common) + target_link_libraries(rsa_discovery_common + PUBLIC Celix::framework Celix::utils Celix::c_rsa_spi Celix::log_helper + PRIVATE CURL::libcurl civetweb::civetweb ${LIBXML2_LIBRARIES}) -add_library(rsa_discovery_common OBJECT - src/discovery.c - src/discovery_activator.c - src/endpoint_descriptor_reader.c - src/endpoint_descriptor_writer.c - src/endpoint_discovery_poller.c - src/endpoint_discovery_server.c -) -target_include_directories(rsa_discovery_common PUBLIC - include src - $ - $ - $ - $ - ${CURL_INCLUDE_DIRS} - ${LIBXML2_INCLUDE_DIR}) -celix_deprecated_utils_headers(rsa_discovery_common) -celix_deprecated_framework_headers(rsa_discovery_common) -target_link_libraries(rsa_discovery_common PUBLIC civetweb::civetweb) - -#Setup target aliases to match external usage -add_library(Celix::rsa_discovery_common ALIAS rsa_discovery_common) + #Setup target aliases to match external usage + add_library(Celix::rsa_discovery_common ALIAS rsa_discovery_common) +endif () \ No newline at end of file diff --git a/bundles/remote_services/discovery_common/include/endpoint_descriptor_common.h b/bundles/remote_services/discovery_common/src/endpoint_descriptor_common.h similarity index 100% rename from bundles/remote_services/discovery_common/include/endpoint_descriptor_common.h rename to bundles/remote_services/discovery_common/src/endpoint_descriptor_common.h diff --git a/bundles/remote_services/discovery_configured/CMakeLists.txt b/bundles/remote_services/discovery_configured/CMakeLists.txt index 9ff90a220..176cb680b 100644 --- a/bundles/remote_services/discovery_configured/CMakeLists.txt +++ b/bundles/remote_services/discovery_configured/CMakeLists.txt @@ -17,23 +17,17 @@ celix_subproject(RSA_DISCOVERY_CONFIGURED "Option to enable building the Discovery (Configured) bundle" ON) if (RSA_DISCOVERY_CONFIGURED) - find_package(CURL REQUIRED) - find_package(LibXml2 REQUIRED) - find_package(civetweb REQUIRED) - add_celix_bundle(rsa_discovery VERSION 0.9.0 SYMBOLIC_NAME "apache_celix_rsa_discovery" NAME "Apache Celix RSA Configured Discovery" SOURCES src/discovery_impl.c - $ - ) - target_include_directories(rsa_discovery PRIVATE - src - $ ) - target_link_libraries(rsa_discovery PRIVATE CURL::libcurl ${LIBXML2_LIBRARIES} Celix::log_helper Celix::rsa_common civetweb::civetweb) + target_include_directories(rsa_discovery PRIVATE src ) + target_link_libraries(rsa_discovery PRIVATE Celix::rsa_discovery_common Celix::log_helper Celix::rsa_common) + celix_deprecated_framework_headers(rsa_discovery) + celix_deprecated_utils_headers(rsa_discovery) install_celix_bundle(rsa_discovery EXPORT celix COMPONENT rsa) #Setup target aliases to match external usage diff --git a/bundles/remote_services/discovery_etcd/CMakeLists.txt b/bundles/remote_services/discovery_etcd/CMakeLists.txt index 4a479cf67..67de75131 100644 --- a/bundles/remote_services/discovery_etcd/CMakeLists.txt +++ b/bundles/remote_services/discovery_etcd/CMakeLists.txt @@ -15,13 +15,8 @@ # specific language governing permissions and limitations # under the License. -celix_subproject(RSA_DISCOVERY_ETCD "Option to enable building the Discovery (ETCD) bundle" ON DEPS CELIX_ETCDLIB) +celix_subproject(RSA_DISCOVERY_ETCD "Option to enable building the Discovery (ETCD) bundle" ON) if (RSA_DISCOVERY_ETCD) - find_package(CURL REQUIRED) - find_package(LibXml2 REQUIRED) - find_package(jansson REQUIRED) - find_package(civetweb REQUIRED) - add_celix_bundle(rsa_discovery_etcd VERSION 0.9.0 SYMBOLIC_NAME "apache_celix_rsa_discovery_etcd" @@ -30,18 +25,11 @@ if (RSA_DISCOVERY_ETCD) SOURCES src/discovery_impl.c src/etcd_watcher.c - $ ) - target_link_libraries(rsa_discovery_etcd PRIVATE Celix::log_helper Celix::etcdlib_static Celix::rsa_common civetweb::civetweb) + target_link_libraries(rsa_discovery_etcd PRIVATE Celix::rsa_discovery_common Celix::log_helper Celix::etcdlib_static Celix::rsa_common) target_include_directories(rsa_discovery_etcd PRIVATE src) - target_include_directories(rsa_discovery_etcd PRIVATE - $ - ) - target_include_directories(rsa_discovery_etcd SYSTEM PRIVATE - ${CURL_INCLUDE_DIR} - ${LIBXML2_INCLUDE_DIR} - ) - target_link_libraries(rsa_discovery_etcd PRIVATE CURL::libcurl ${LIBXML2_LIBRARIES} jansson::jansson) + celix_deprecated_framework_headers(rsa_discovery_etcd) + celix_deprecated_utils_headers(rsa_discovery_etcd) install_celix_bundle(rsa_discovery_etcd EXPORT celix COMPONENT rsa) #Setup target aliases to match external usage diff --git a/bundles/remote_services/discovery_etcd/src/etcd_watcher.c b/bundles/remote_services/discovery_etcd/src/etcd_watcher.c index b3d6c70cf..7341698f2 100644 --- a/bundles/remote_services/discovery_etcd/src/etcd_watcher.c +++ b/bundles/remote_services/discovery_etcd/src/etcd_watcher.c @@ -28,7 +28,6 @@ #include "discovery.h" #include "discovery_impl.h" -#include #include "etcd.h" #include "etcd_watcher.h" @@ -301,7 +300,7 @@ celix_status_t etcdWatcher_create(discovery_t *discovery, celix_bundle_context_t const char* etcd_server = celix_bundleContext_getProperty(context, CFG_ETCD_SERVER_IP, DEFAULT_ETCD_SERVER_IP); long etcd_port = celix_bundleContext_getPropertyAsLong(context, CFG_ETCD_SERVER_PORT, DEFAULT_ETCD_SERVER_PORT); - (*watcher)->etcdlib = etcdlib_create(etcd_server, (int)etcd_port, CURL_GLOBAL_DEFAULT); + (*watcher)->etcdlib = etcdlib_create(etcd_server, (int)etcd_port, ETCDLIB_NO_CURL_INITIALIZATION); celix_status_t status = CELIX_SUCCESS; if ((*watcher)->etcdlib == NULL) { status = CELIX_BUNDLE_EXCEPTION; diff --git a/bundles/remote_services/discovery_shm/CMakeLists.txt b/bundles/remote_services/discovery_shm/CMakeLists.txt index 1f6bb4078..1f860cb71 100644 --- a/bundles/remote_services/discovery_shm/CMakeLists.txt +++ b/bundles/remote_services/discovery_shm/CMakeLists.txt @@ -28,17 +28,17 @@ add_celix_bundle(rsa_discovery_shm src/discovery_shm.c src/discovery_shmWatcher.c src/discovery_impl.c - $ ) target_include_directories(rsa_discovery_shm PRIVATE src ${LIBXML2_INCLUDE_DIR} ${CURL_INCLUDE_DIR} - $ ) target_link_libraries(rsa_discovery_shm PRIVATE - Celix::framework CURL::libcurl ${LIBXML2_LIBRARIES} Celix::log_helper + Celix::rsa_discovery_common Celix::framework CURL::libcurl ${LIBXML2_LIBRARIES} Celix::log_helper rsa_common civetweb::civetweb) +celix_deprecated_framework_headers(rsa_discovery_shm) +celix_deprecated_utils_headers(rsa_discovery_shm) install_celix_bundle(rsa_discovery_shm EXPORT celix COMPONENT rsa) diff --git a/bundles/remote_services/examples/CMakeLists.txt b/bundles/remote_services/examples/CMakeLists.txt index d2c8e5178..65fea929b 100644 --- a/bundles/remote_services/examples/CMakeLists.txt +++ b/bundles/remote_services/examples/CMakeLists.txt @@ -18,7 +18,10 @@ add_subdirectory(calculator_api) add_subdirectory(calculator_service) -add_subdirectory(calculator_shell) + +if (BUILD_SHELL) + add_subdirectory(calculator_shell) +endif () add_subdirectory(remote_example_api) add_subdirectory(remote_example_service) diff --git a/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt b/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt index 4de2a276f..4c194dc58 100644 --- a/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt +++ b/bundles/remote_services/remote_service_admin_dfi/gtest/CMakeLists.txt @@ -53,7 +53,6 @@ target_link_libraries(test_rsa_dfi PRIVATE get_property(rsa_bundle_file TARGET rsa_dfi PROPERTY BUNDLE_FILE) get_property(calc_bundle_file TARGET calculator PROPERTY BUNDLE_FILE) -get_property(calculator_shell_bundle_file TARGET calculator_shell PROPERTY BUNDLE_FILE) get_property(discovery_bundle_file TARGET rsa_discovery PROPERTY BUNDLE_FILE) get_property(topology_manager_bundle_file TARGET Celix::rsa_topology_manager PROPERTY BUNDLE_FILE) get_property(tst_bundle_file TARGET rsa_dfi_tst_bundle PROPERTY BUNDLE_FILE) @@ -69,7 +68,6 @@ add_celix_bundle_dependencies(test_rsa_dfi rsa_dfi #note depend on the target creating the bundle zip not the lib target calculator remote_example_service - calculator_shell rsa_discovery Celix::rsa_topology_manager rsa_dfi_tst_bundle diff --git a/bundles/remote_services/remote_service_admin_dfi/gtest/client.properties.in b/bundles/remote_services/remote_service_admin_dfi/gtest/client.properties.in index 564111041..7c8ed7eed 100644 --- a/bundles/remote_services/remote_service_admin_dfi/gtest/client.properties.in +++ b/bundles/remote_services/remote_service_admin_dfi/gtest/client.properties.in @@ -1,4 +1,4 @@ -cosgi.auto.start.1=@rsa_bundle_file@ @calculator_shell_bundle_file@ @discovery_bundle_file@ @topology_manager_bundle_file@ @tst_bundle_file@ +cosgi.auto.start.1=@rsa_bundle_file@ @discovery_bundle_file@ @topology_manager_bundle_file@ @tst_bundle_file@ LOGHELPER_ENABLE_STDOUT_FALLBACK=true org.osgi.framework.storage.clean=onFirstInit org.osgi.framework.storage=.cacheClient diff --git a/bundles/remote_services/remote_service_admin_shm_v2/CMakeLists.txt b/bundles/remote_services/remote_service_admin_shm_v2/CMakeLists.txt index c475f3c4d..e9ce5fe2f 100644 --- a/bundles/remote_services/remote_service_admin_shm_v2/CMakeLists.txt +++ b/bundles/remote_services/remote_service_admin_shm_v2/CMakeLists.txt @@ -22,6 +22,7 @@ endif () celix_subproject(RSA_REMOTE_SERVICE_ADMIN_SHM_V2 "Option to enable building the Remote Service Admin Service SHM V2 bundle" RSA_REMOTE_SERVICE_ADMIN_SHM_V2_DEFAULT) if (RSA_REMOTE_SERVICE_ADMIN_SHM_V2) + add_subdirectory(thpool) add_subdirectory(shm_pool) add_subdirectory(rsa_shm) diff --git a/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/CMakeLists.txt b/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/CMakeLists.txt index 836140218..b7189afcd 100644 --- a/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/CMakeLists.txt +++ b/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/CMakeLists.txt @@ -57,6 +57,7 @@ add_library(Celix::rsa_shm ALIAS rsa_shm) if (ENABLE_TESTING) add_library(rsa_shm_cut STATIC ${RSA_SHM_SRC}) celix_deprecated_utils_headers(rsa_shm_cut) + celix_deprecated_framework_headers(rsa_shm_cut) target_include_directories(rsa_shm_cut PUBLIC src) target_link_libraries(rsa_shm_cut PUBLIC ${RSA_SHM_DEPS}) add_subdirectory(gtest) diff --git a/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/gtest/CMakeLists.txt b/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/gtest/CMakeLists.txt index dddf7d17b..030832ae4 100644 --- a/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/gtest/CMakeLists.txt +++ b/bundles/remote_services/remote_service_admin_shm_v2/rsa_shm/gtest/CMakeLists.txt @@ -39,7 +39,7 @@ add_celix_bundle_dependencies(integration_test_rsa_shm Celix::rsa_shm) add_test(NAME run_integration_test_rsa_shm COMMAND integration_test_rsa_shm) setup_target_for_coverage(integration_test_rsa_shm SCAN_DIR ..) -if (LINKER_WRAP_SUPPORTED) +if (LINKER_WRAP_SUPPORTED AND BUILD_RSA_JSON_RPC) ####unit test add_executable(unit_test_rsa_shm src/RsaShmImplUnitTestSuite.cc @@ -82,6 +82,7 @@ if (LINKER_WRAP_SUPPORTED) add_celix_bundle_dependencies(unit_test_rsa_shm Celix::rsa_json_rpc) celix_deprecated_utils_headers(unit_test_rsa_shm) + celix_deprecated_framework_headers(unit_test_rsa_shm) add_test(NAME run_unit_test_rsa_shm COMMAND unit_test_rsa_shm) setup_target_for_coverage(unit_test_rsa_shm SCAN_DIR ..) diff --git a/bundles/remote_services/thpool/CMakeLists.txt b/bundles/remote_services/remote_service_admin_shm_v2/thpool/CMakeLists.txt similarity index 100% rename from bundles/remote_services/thpool/CMakeLists.txt rename to bundles/remote_services/remote_service_admin_shm_v2/thpool/CMakeLists.txt diff --git a/bundles/remote_services/thpool/LICENSE b/bundles/remote_services/remote_service_admin_shm_v2/thpool/LICENSE similarity index 100% rename from bundles/remote_services/thpool/LICENSE rename to bundles/remote_services/remote_service_admin_shm_v2/thpool/LICENSE diff --git a/bundles/remote_services/thpool/README.md b/bundles/remote_services/remote_service_admin_shm_v2/thpool/README.md similarity index 100% rename from bundles/remote_services/thpool/README.md rename to bundles/remote_services/remote_service_admin_shm_v2/thpool/README.md diff --git a/bundles/remote_services/thpool/include/thpool.h b/bundles/remote_services/remote_service_admin_shm_v2/thpool/include/thpool.h similarity index 100% rename from bundles/remote_services/thpool/include/thpool.h rename to bundles/remote_services/remote_service_admin_shm_v2/thpool/include/thpool.h diff --git a/bundles/remote_services/thpool/src/thpool.c b/bundles/remote_services/remote_service_admin_shm_v2/thpool/src/thpool.c similarity index 100% rename from bundles/remote_services/thpool/src/thpool.c rename to bundles/remote_services/remote_service_admin_shm_v2/thpool/src/thpool.c diff --git a/bundles/remote_services/rsa_spi/CMakeLists.txt b/bundles/remote_services/rsa_spi/CMakeLists.txt index 8836c6c4d..6b60f7b4f 100644 --- a/bundles/remote_services/rsa_spi/CMakeLists.txt +++ b/bundles/remote_services/rsa_spi/CMakeLists.txt @@ -17,12 +17,9 @@ add_library(c_rsa_spi INTERFACE) -get_target_property(FRAMEWORK_SOURCE_DIR Celix::framework "SOURCE_DIR") target_include_directories(c_rsa_spi INTERFACE $ - $##TODO remove when deprecated header service_reference.h is removed ) -set_property(TARGET celix-deprecated APPEND PROPERTY "FRAMEWORK_TARGETS" c_rsa_spi) target_link_libraries(c_rsa_spi INTERFACE Celix::framework) install(TARGETS c_rsa_spi EXPORT celix COMPONENT rsa diff --git a/bundles/remote_services/topology_manager/CMakeLists.txt b/bundles/remote_services/topology_manager/CMakeLists.txt index 8541c0508..1ed7420be 100644 --- a/bundles/remote_services/topology_manager/CMakeLists.txt +++ b/bundles/remote_services/topology_manager/CMakeLists.txt @@ -35,7 +35,7 @@ install_celix_bundle(rsa_topology_manager EXPORT celix COMPONENT rsa) #Setup target aliases to match external usage add_library(Celix::rsa_topology_manager ALIAS rsa_topology_manager) -if (ENABLE_TESTING AND BUILD_RSA_REMOTE_SERVICE_ADMIN_DFI) +if (ENABLE_TESTING AND BUILD_RSA_REMOTE_SERVICE_ADMIN_DFI AND BUILD_RSA_DISCOVERY_COMMON) find_package(jansson REQUIRED) add_subdirectory(tms_tst) endif () diff --git a/bundles/remote_services/topology_manager/tms_tst/disc_mock/CMakeLists.txt b/bundles/remote_services/topology_manager/tms_tst/disc_mock/CMakeLists.txt index e7f9c4176..537497ecc 100644 --- a/bundles/remote_services/topology_manager/tms_tst/disc_mock/CMakeLists.txt +++ b/bundles/remote_services/topology_manager/tms_tst/disc_mock/CMakeLists.txt @@ -23,5 +23,7 @@ add_celix_bundle(topology_manager_disc_mock_bundle ) target_include_directories(topology_manager_disc_mock_bundle PRIVATE $ -) + ) target_link_libraries(topology_manager_disc_mock_bundle PRIVATE Celix::framework) +celix_deprecated_framework_headers(topology_manager_disc_mock_bundle) +celix_deprecated_utils_headers(topology_manager_disc_mock_bundle) diff --git a/bundles/shell/remote_shell/CMakeLists.txt b/bundles/shell/remote_shell/CMakeLists.txt index 99627c973..51bc5e9ed 100644 --- a/bundles/shell/remote_shell/CMakeLists.txt +++ b/bundles/shell/remote_shell/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(REMOTE_SHELL "Option to enable building the Remote Shell bundles" ON DEPS SHELL) +celix_subproject(REMOTE_SHELL "Option to enable building the Remote Shell bundles" ON) if (REMOTE_SHELL) add_celix_bundle(remote_shell diff --git a/bundles/shell/shell/CMakeLists.txt b/bundles/shell/shell/CMakeLists.txt index 34914da88..140f4ea4f 100644 --- a/bundles/shell/shell/CMakeLists.txt +++ b/bundles/shell/shell/CMakeLists.txt @@ -15,82 +15,86 @@ # specific language governing permissions and limitations # under the License. -add_library(shell_api INTERFACE) -target_include_directories(shell_api INTERFACE - $ - ) +celix_subproject(SHELL_API "Option to enable building the Shell API" ON) +if (SHELL_API) + add_library(shell_api INTERFACE) + target_include_directories(shell_api INTERFACE + $ + ) + target_link_libraries(shell_api INTERFACE Celix::utils) -if (CELIX_INSTALL_DEPRECATED_API) - target_include_directories(shell_api INTERFACE $) - install(DIRECTORY deprecated_api/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/shell COMPONENT shell) -endif () + target_include_directories(shell_api INTERFACE $) + if (CELIX_INSTALL_DEPRECATED_API) + install(DIRECTORY deprecated_api/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/shell COMPONENT shell) + endif () -install(TARGETS shell_api EXPORT celix COMPONENT shell - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/shell) -install(DIRECTORY api/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/shell COMPONENT shell) + install(TARGETS shell_api EXPORT celix COMPONENT shell + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/shell) + install(DIRECTORY api/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/shell COMPONENT shell) -add_library(Celix::shell_api ALIAS shell_api) + add_library(Celix::shell_api ALIAS shell_api) +endif () celix_subproject(SHELL "Option to enable building the Shell bundles" ON) if (SHELL) - add_library(shell_commands STATIC - src/lb_command.c - src/start_command.c - src/stop_command.c - src/install_command.c - src/update_command.c - src/uninstall_command.c - src/unload_command.c - src/help_command.c - src/dm_shell_list_command.c - src/query_command.c - src/quit_command.c - src/std_commands.c - src/bundle_command.c) - target_include_directories(shell_commands PRIVATE src) - target_link_libraries(shell_commands PRIVATE Celix::shell_api Celix::log_helper) - celix_deprecated_utils_headers(shell_commands) + add_library(shell_commands STATIC + src/lb_command.c + src/start_command.c + src/stop_command.c + src/install_command.c + src/update_command.c + src/uninstall_command.c + src/unload_command.c + src/help_command.c + src/dm_shell_list_command.c + src/query_command.c + src/quit_command.c + src/std_commands.c + src/bundle_command.c) + target_include_directories(shell_commands PRIVATE src) + target_link_libraries(shell_commands PRIVATE Celix::shell_api Celix::log_helper) + celix_deprecated_utils_headers(shell_commands) add_celix_bundle(shell - SYMBOLIC_NAME "apache_celix_c_shell" - VERSION "2.1.0" - NAME "Apache Celix C Shell" - FILENAME celix_shell - GROUP "Celix/Shell" - SOURCES - src/c_shell_activator.c - src/c_shell.c - ) - target_include_directories(shell PRIVATE src) - target_link_libraries(shell PRIVATE shell_commands Celix::shell_api Celix::log_helper) - target_compile_options(shell PRIVATE -Wno-deprecated-declarations) - celix_deprecated_utils_headers(shell) - if (CELIX_INSTALL_DEPRECATED_API) - target_compile_definitions(shell PRIVATE CELIX_INSTALL_DEPRECATED_API) - endif () - install_celix_bundle(shell EXPORT celix COMPONENT shell) + SYMBOLIC_NAME "apache_celix_c_shell" + VERSION "2.1.0" + NAME "Apache Celix C Shell" + FILENAME celix_shell + GROUP "Celix/Shell" + SOURCES + src/c_shell_activator.c + src/c_shell.c + ) + target_include_directories(shell PRIVATE src) + target_link_libraries(shell PRIVATE shell_commands Celix::shell_api Celix::log_helper) + target_compile_options(shell PRIVATE -Wno-deprecated-declarations) + celix_deprecated_utils_headers(shell) + if (CELIX_INSTALL_DEPRECATED_API) + target_compile_definitions(shell PRIVATE CELIX_INSTALL_DEPRECATED_API) + endif () + install_celix_bundle(shell EXPORT celix COMPONENT shell) - #Setup target aliases to match external usage - add_library(Celix::shell ALIAS shell) + #Setup target aliases to match external usage + add_library(Celix::shell ALIAS shell) - if (CELIX_CXX14) - add_celix_bundle(ShellCxx - SYMBOLIC_NAME "Apache_Celix_CxxShell" - VERSION "2.1.0" - NAME "Apache Celix CXX Shell" - FILENAME celix_ShellCxx - GROUP "Celix/Shell" - SOURCES - src/Shell.cc - ) - target_include_directories(ShellCxx PRIVATE src) - target_link_libraries(ShellCxx PRIVATE shell_commands Celix::shell_api Celix::log_service_api Celix::log_helper) - install_celix_bundle(ShellCxx EXPORT celix COMPONENT shell) - add_library(Celix::ShellCxx ALIAS ShellCxx) - endif () + if (CELIX_CXX14) + add_celix_bundle(ShellCxx + SYMBOLIC_NAME "Apache_Celix_CxxShell" + VERSION "2.1.0" + NAME "Apache Celix CXX Shell" + FILENAME celix_ShellCxx + GROUP "Celix/Shell" + SOURCES + src/Shell.cc + ) + target_include_directories(ShellCxx PRIVATE src) + target_link_libraries(ShellCxx PRIVATE shell_commands Celix::shell_api Celix::log_service_api Celix::log_helper) + install_celix_bundle(ShellCxx EXPORT celix COMPONENT shell) + add_library(Celix::ShellCxx ALIAS ShellCxx) + endif () - if (ENABLE_TESTING) - add_subdirectory(gtest) - endif() + if (ENABLE_TESTING) + add_subdirectory(gtest) + endif () endif (SHELL) diff --git a/bundles/shell/shell_bonjour/CMakeLists.txt b/bundles/shell/shell_bonjour/CMakeLists.txt index b492a14df..929c1b7f2 100644 --- a/bundles/shell/shell_bonjour/CMakeLists.txt +++ b/bundles/shell/shell_bonjour/CMakeLists.txt @@ -15,14 +15,11 @@ # specific language governing permissions and limitations # under the License. -celix_subproject(SHELL_BONJOUR "Option to enable building the Bonjour Shell (shell access by chat clients)" OFF DEPS SHELL) +celix_subproject(SHELL_BONJOUR "Option to enable building the Bonjour Shell (shell access by chat clients)" OFF) 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") @@ -38,16 +35,15 @@ if (SHELL_BONJOUR) ) celix_deprecated_utils_headers(bonjour_shell) celix_deprecated_framework_headers(bonjour_shell) - add_library(Celix::bonjour_shell ALIAS bonjour_shell) - 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) + install_celix_bundle(bonjour_shell EXPORT celix COMPONENT bonjour_shell) + add_library(Celix::bonjour_shell ALIAS bonjour_shell) 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 34bed2335..d51f36b9f 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 f89cc3122..2f20bda69 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 50f837870..3cef039b4 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 a3ab69700..c4c097550 100644 --- a/cmake/CelixDeps.cmake.in +++ b/cmake/CelixDeps.cmake.in @@ -1,13 +1,21 @@ +$<$>:find_dependency(libuuid)> +$<$>:find_dependency(libuuid)> +$<$>:find_dependency(libuuid)> +$<$>:find_dependency(libzip)> +$<$>:find_dependency(ZLIB)> $<$>:find_dependency(libffi)> $<$>:find_dependency(jansson)> $<$>:find_dependency(jansson)> +$<$>:find_dependency(CURL)> +$<$>:find_dependency(CURL)> $<$>:find_dependency(RapidJSON)> -$<$>:find_dependency(LibXml2)> +$<$>:find_dependency(LibXml2)> $<$>:find_dependency(LibXml2)> $<$>:find_dependency(ZeroMQ)> -$<$>:find_dependency(ZeroMQ)> $<$>:find_dependency(czmq)> -$<$>:find_dependency(czmq)> $<$>:find_dependency(NanoMsg)> $<$>:find_dependency(civetweb)> +$<$>:find_dependency(civetweb)> +$<$>:find_dependency(civetweb)> $<$>:find_dependency(DNSSD)> +$<$>:find_dependency(DNSSD)> diff --git a/cmake/Modules/FindDNSSD.cmake b/cmake/Modules/FindDNSSD.cmake new file mode 100644 index 000000000..6c7320e40 --- /dev/null +++ b/cmake/Modules/FindDNSSD.cmake @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# - Try to find DNSSD +# +# Once done this will define +# DNSSD_FOUND - System has dns_sd +# DNSSD::DNSSD target (if found) + +find_library(DNS_SD_LIBRARY NAMES dns_sd dns_services + PATHS $ENV{DNS_SD_DIR} ${DNS_SD_DIR} /usr /usr/local /opt/local + PATH_SUFFIXES lib lib64 x86_64-linux-gnu lib/x86_64-linux-gnu + ) + +find_path(DNS_SD_INCLUDE_DIR dns_sd.h + PATHS $ENV{DNS_SD_DIR} ${DNS_SD_DIR} /usr /usr/local /opt/local + PATH_SUFFIXES include include/ffi include/x86_64-linux-gnu x86_64-linux-gnu + ) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set libzip_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(DNSSD DEFAULT_MSG + DNS_SD_LIBRARY DNS_SD_INCLUDE_DIR) + +if(DNSSD_FOUND AND NOT TARGET DNSSD::DNSSD) + add_library(DNSSD::DNSSD SHARED IMPORTED) + set_target_properties(DNSSD::DNSSD PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${DNS_SD_INCLUDE_DIR}" + IMPORTED_LOCATION "${DNS_SD_LIBRARY}" + ) +endif() + +unset(DNS_SD_LIBRARY) +unset(DNS_SD_INCLUDE_DIR) diff --git a/cmake/Modules/Findlibuuid.cmake b/cmake/Modules/Findlibuuid.cmake index cc6e34445..47412d608 100644 --- a/cmake/Modules/Findlibuuid.cmake +++ b/cmake/Modules/Findlibuuid.cmake @@ -25,33 +25,31 @@ 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 ) - + /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) + 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) + 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 () -endif () \ No newline at end of file +endif () + diff --git a/cmake/celix_project/CodeCoverage.cmake b/cmake/celix_project/CodeCoverage.cmake index d05262f91..aa33308e9 100644 --- a/cmake/celix_project/CodeCoverage.cmake +++ b/cmake/celix_project/CodeCoverage.cmake @@ -135,7 +135,7 @@ function (setup_target_for_coverage) # Capturing lcov counters and generating report COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/coverage COMMAND ${LCOV_PATH} --directory ${COVERAGE_SCAN_DIR} --capture --output-file ${OUTPUT_FILE} - COMMAND ${LCOV_PATH} --remove ${OUTPUT_FILE} '**/mock/*' '**/.conan/*' '**/test/*' '**/gtest/*' '**/tst/*' '**/celix/gen/*' '**/googletest_project/*' '**/glog/*' '/usr/*' --output-file ${OUTPUT_FILE}.cleaned + COMMAND ${LCOV_PATH} --remove ${OUTPUT_FILE} '**/error_injector/*' '**/mock/*' '**/.conan/*' '**/test/*' '**/gtest/*' '**/tst/*' '**/celix/gen/*' '**/googletest_project/*' '**/glog/*' '/usr/*' --output-file ${OUTPUT_FILE}.cleaned #test dependencies, so that test is runned DEPENDENCIES ${TEST_TARGET_NAME} diff --git a/conanfile.py b/conanfile.py index 604fafd46..b65f25f2f 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], @@ -62,12 +68,14 @@ class CelixConan(ConanFile): "build_cxx_rsa_integration": [True, False], "build_remote_service_admin": [True, False], "build_rsa_remote_service_admin_dfi": [True, False], + "build_rsa_discovery_common": [True, False], "build_rsa_discovery_configured": [True, False], "build_rsa_discovery_etcd": [True, False], "build_rsa_remote_service_admin_shm_v2": [True, False], "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], @@ -79,6 +87,11 @@ class CelixConan(ConanFile): "build_pushstreams": [True, False], "build_experimental": [True, False], "build_celix_dfi": [True, False], + "build_dependency_manager": [True, False], + "build_dependency_manager_cxx": [True, False], + "build_framework": [True, False], + "build_rcm": [True, False], + "build_utils": [True, False], "celix_cxx14": [True, False], "celix_cxx17": [True, False], "celix_install_deprecated_api": [True, False], @@ -95,27 +108,35 @@ class CelixConan(ConanFile): "enable_testing_for_cxx14": False, "build_all": False, "build_deployment_admin": False, - "build_http_admin": True, - "build_log_service": True, - "build_syslog_writer": True, - "build_pubsub": True, + "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, "build_pubsub_psa_tcp": False, "build_pubsub_psa_udp_mc": False, - "build_pubsub_psa_ws": True, + "build_pubsub_psa_ws": False, "build_pubsub_discovery_etcd": False, - "build_cxx_remote_service_admin": True, + "build_cxx_remote_service_admin": False, "build_cxx_rsa_integration": False, - "build_remote_service_admin": True, - "build_rsa_remote_service_admin_dfi": True, - "build_rsa_discovery_configured": True, + "build_remote_service_admin": False, + "build_rsa_remote_service_admin_dfi": False, + "build_rsa_discovery_common": False, + "build_rsa_discovery_configured": False, "build_rsa_discovery_etcd": False, "build_rsa_remote_service_admin_shm_v2": False, "build_rsa_json_rpc": False, "build_rsa_discovery_zeroconf": False, - "build_shell": True, + "build_shell": False, + "build_shell_api": False, "build_remote_shell": False, "build_shell_bonjour": False, "build_shell_tui": False, @@ -126,7 +147,12 @@ class CelixConan(ConanFile): "build_promises": False, "build_pushstreams": False, "build_experimental": False, - "build_celix_dfi": True, + "build_celix_dfi": False, + "build_dependency_manager": False, + "build_dependency_manager_cxx": False, + "build_framework": False, + "build_rcm": False, + "build_utils": False, "celix_cxx14": True, "celix_cxx17": True, "celix_install_deprecated_api": False, @@ -145,6 +171,9 @@ def validate(self): if self.options.build_rsa_discovery_zeroconf and self.settings.os != "Linux": raise ConanInvalidConfiguration("Celix build_rsa_discovery_zeroconf is only supported for Linux") + if self.options.build_shell_bonjour and self.settings.os != "Linux": + raise ConanInvalidConfiguration("Celix build_shell_bonjour is only supported for Linux") + try: val = int(self.options.celix_err_buffer_size) if val <= 0: @@ -173,76 +202,201 @@ def configure(self): for opt, val in self.options.values.items(): if opt.startswith('build_'): setattr(self.options, opt, True) - if self.settings.os != "Linux": - self.options.build_rsa_remote_service_admin_shm_v2 = False - self.options.build_rsa_discovery_zeroconf = False - - if not self.options.celix_cxx14: - self.options.celix_cxx17 = False - if not self.options.celix_cxx17: - self.options.build_cxx_remote_service_admin = False - self.options.build_promises = False - self.options.build_pushstreams = False - if not self.options.build_cxx_remote_service_admin: - self.options.build_cxx_rsa_integration = False - 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 - self.options.build_rsa_discovery_etcd = False - self.options.build_rsa_json_rpc = False + + if self.settings.os != "Linux": 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 not self.options.enable_testing: + self.options.build_pubsub_integration = False + self.options.enable_code_coverage = False + + if self.options.build_examples: + self.options.build_shell_tui = True + self.options.build_shell_wui = True + self.options.build_log_service = True + self.options.build_syslog_writer = True + + if self.options.build_shell_bonjour: + self.options.build_shell = True + + if self.options.build_deployment_admin: + self.options.build_framework = True + + if self.options.build_cxx_rsa_integration: + self.options.build_cxx_remote_service_admin = 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.options.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_rsa_discovery_etcd: + self.options.build_celix_etcdlib = True + self.options.build_rsa_discovery_common = True + + if self.options.build_rsa_discovery_configured: + self.options.build_rsa_discovery_common = True + + if self.options.build_rsa_discovery_common or self.options.build_rsa_discovery_zeroconf \ + or self.options.build_rsa_remote_service_admin_dfi or self.options.build_rsa_json_rpc \ + or self.options.build_rsa_remote_service_admin_shm_v2: + self.options.build_remote_service_admin = True + + if self.options.build_remote_service_admin: + self.options.build_framework = True + self.options.build_log_helper = True + self.options.build_celix_dfi = True + self.options.celix_install_deprecated_api = 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_http_admin: + 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 + self.options.build_log_helper = 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_rcm: + self.options.build_utils = True + + if self.options.build_launcher or self.options.build_dependency_manager: + self.options.build_framework = True + + if self.options.build_dependency_manager_cxx: + self.options.build_framework = True + self.options.celix_cxx14 = True + + if self.options.build_celix_dfi: + self.options.build_utils = True + + if self.options.build_framework: + self.options.build_utils = True + + if self.options.build_pushstreams: + self.options.build_promises = True + + if self.options.build_promises: + self.options.celix_cxx17 = True + + if self.options.celix_cxx17: + 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: + if self.options.build_rsa_discovery_common 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 self.requires("czmq/4.2.0") self.options['czmq'].shared = True - if self.options.build_http_admin or self.options.build_remote_service_admin: + if self.options.build_http_admin or self.options.build_rsa_discovery_common \ + or self.options.build_rsa_remote_service_admin_dfi: self.requires("civetweb/1.15") self.options['civetweb'].shared = True if self.options.build_celix_dfi: @@ -251,7 +405,7 @@ def requirements(self): if self.options.build_celix_dfi or self.options.build_celix_etcdlib: 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 self.requires("mdnsresponder/1310.140.1") @@ -297,4 +451,5 @@ def package_info(self): # check https://docs.conan.io/en/latest/reference/conanfile/methods.html#imports self.cpp_info.bindirs = ["bin", os.path.join("share", self.name, "bundles")] self.cpp_info.build_modules["cmake"].append(os.path.join("lib", "cmake", "Celix", "CelixConfig.cmake")) - self.cpp_info.build_modules["cmake_find_package"].append(os.path.join("lib", "cmake", "Celix", "CelixConfig.cmake")) + self.cpp_info.build_modules["cmake_find_package"].append(os.path.join("lib", "cmake", + "Celix", "CelixConfig.cmake")) diff --git a/documents/building/dev_celix_with_clion.md b/documents/building/dev_celix_with_clion.md index a2e3d49f2..d6c1b926f 100644 --- a/documents/building/dev_celix_with_clion.md +++ b/documents/building/dev_celix_with_clion.md @@ -67,6 +67,6 @@ then update the "Google Test" template so that the `active_run.sh` Conan generat "Environment variables" entry. If the Apache Celix CMake build directory is `home/joe/workspace/celix/cmake-build-debug` then the value for -"Environment variables" should be: `source /home/joe/workspace/celix/cmake-build-debug/activate_run.sh` +"Environment variables" should be: `source /home/joe/workspace/celix/cmake-build-debug/environment_run.sh.env` ![Configure CLion](media/clion_run_configuration_template.png) diff --git a/examples/celix-examples/CMakeLists.txt b/examples/celix-examples/CMakeLists.txt index c05966ec0..c4a6d983d 100644 --- a/examples/celix-examples/CMakeLists.txt +++ b/examples/celix-examples/CMakeLists.txt @@ -16,7 +16,7 @@ # under the License. if (COMMAND celix_subproject) - celix_subproject(EXAMPLES "Option to enable building the Examples" ON DEPS SHELL SHELL_TUI LOG_SERVICE) + celix_subproject(EXAMPLES "Option to enable building the Examples" ON) else () set(EXAMPLES true) #celix_subproject is only available in the celix project -> using examples dir in other project is also supported option(CELIX_CXX14 "Build C++14 libraries and bundles." ON) diff --git a/examples/celix-examples/dm_example/CMakeLists.txt b/examples/celix-examples/dm_example/CMakeLists.txt index 278e32f2f..27334c116 100644 --- a/examples/celix-examples/dm_example/CMakeLists.txt +++ b/examples/celix-examples/dm_example/CMakeLists.txt @@ -28,7 +28,6 @@ add_celix_container(dm_example BUNDLES Celix::shell Celix::shell_tui - Celix::dm_shell dm_example_phase1 dm_example_phase2a diff --git a/examples/conan_test_package/CMakeLists.txt b/examples/conan_test_package/CMakeLists.txt index 051dbbb41..2de423d48 100644 --- a/examples/conan_test_package/CMakeLists.txt +++ b/examples/conan_test_package/CMakeLists.txt @@ -21,14 +21,16 @@ set(CMAKE_CXX_STANDARD 17) find_package(Celix REQUIRED) -add_celix_bundle(hello VERSION 1.0.0 SOURCES hello_bundle.c) -target_link_libraries(hello PRIVATE Celix::log_helper) -celix_get_bundle_file(hello HELLO_TEST_BUNDLE) +option(TEST_FRAMEWORK "Test Celix framework" OFF) +if (TEST_FRAMEWORK) + add_celix_bundle(hello VERSION 1.0.0 SOURCES hello_bundle.c) + celix_get_bundle_file(hello HELLO_TEST_BUNDLE) -add_executable(use_framework test_framework.c) -target_link_libraries(use_framework Celix::framework) -add_celix_bundle_dependencies(use_framework hello) -target_compile_definitions(use_framework PRIVATE HELLO_TEST_BUNDLE_LOCATION="${HELLO_TEST_BUNDLE}") + add_executable(use_framework test_framework.c) + target_link_libraries(use_framework Celix::framework) + add_celix_bundle_dependencies(use_framework hello) + target_compile_definitions(use_framework PRIVATE HELLO_TEST_BUNDLE_LOCATION="${HELLO_TEST_BUNDLE}") +endif () option(TEST_HTTP_ADMIN "Test http_admin" OFF) if (TEST_HTTP_ADMIN) @@ -52,7 +54,7 @@ if (TEST_LOG_SERVICE) my_log_writer_activator.c VERSION 1.0.0 ) - target_link_libraries(my_log_writer PRIVATE Celix::log_helper Celix::log_service_api) + target_link_libraries(my_log_writer PRIVATE Celix::log_service_api) add_celix_container(use_log_writer COPY) celix_container_bundles(use_log_writer LEVEL 0 Celix::log_admin) celix_container_bundles(use_log_writer LEVEL 1 my_log_writer) @@ -77,8 +79,6 @@ if (TEST_PUBSUB) target_link_libraries(my_pubsub_admin PRIVATE Celix::pubsub_spi Celix::pubsub_utils ) add_celix_container(use_my_psa BUNDLES - Celix::celix_pubsub_serializer_json - Celix::celix_pubsub_serializer_avrobin Celix::celix_pubsub_topology_manager my_pubsub_admin hello @@ -91,8 +91,6 @@ option(TEST_PSA_ZMQ "Test ZeroMQ PubSub Admin" OFF) if (TEST_PSA_ZMQ) add_celix_container(use_psa_zmq BUNDLES - Celix::celix_pubsub_serializer_json - Celix::celix_pubsub_serializer_avrobin Celix::celix_pubsub_topology_manager Celix::celix_pubsub_admin_zmq hello @@ -105,7 +103,6 @@ option(TEST_PSA_TCP "Test TCP PubSub Admin" OFF) if (TEST_PSA_TCP) add_celix_container(use_psa_tcp BUNDLES - Celix::celix_pubsub_serializer_json Celix::celix_pubsub_topology_manager Celix::celix_pubsub_admin_tcp hello @@ -119,7 +116,6 @@ option(TEST_PSA_UDP_MC "Test UDP MC PubSub Admin" OFF) if (TEST_PSA_UDP_MC) add_celix_container(use_psa_udp_mc BUNDLES - Celix::celix_pubsub_serializer_json Celix::celix_pubsub_topology_manager Celix::celix_pubsub_admin_udp_multicast hello @@ -134,7 +130,6 @@ if (TEST_PSA_WS) add_celix_container(use_psa_ws BUNDLES Celix::http_admin - Celix::celix_pubsub_serializer_json Celix::celix_pubsub_topology_manager Celix::celix_pubsub_admin_websocket hello @@ -147,7 +142,6 @@ option(TEST_PSA_DISCOVERY_ETCD "Test the PubSub Discovery (ETCD) bundle" OFF) if (TEST_PSA_DISCOVERY_ETCD) add_celix_container(use_psa_discovery_etcd BUNDLES - Celix::celix_pubsub_serializer_json Celix::celix_pubsub_topology_manager Celix::celix_pubsub_discovery_etcd my_pubsub_admin @@ -303,3 +297,69 @@ if (TEST_PUSHSTREAMS) target_link_libraries(use_pushstreams PRIVATE Celix::PushStreams) endif () +option(TEST_DEPLOYMENT_ADMIN "Test deployment admin" OFF) +if (TEST_DEPLOYMENT_ADMIN) + add_celix_container("use_deployment_admin" BUNDLES Celix::deployment_admin hello) +endif () + +option(TEST_LOG_HELPER "Test log helper" OFF) +if (TEST_LOG_HELPER) + add_executable(use_log_helper test_log_helper.c) + target_link_libraries(use_log_helper PRIVATE Celix::log_helper) +endif () + +option(TEST_LOG_SERVICE_API "Test log service api" OFF) +if (TEST_LOG_SERVICE_API) + add_executable(use_log_service_api test_log_service_api.c) + target_link_libraries(use_log_service_api PRIVATE Celix::log_service_api) +endif () + +option(TEST_PUBSUB_WIRE_PROTOCOL_V1 "Test pubsub wire protocol v1" OFF) +if (TEST_PUBSUB_WIRE_PROTOCOL_V1) + add_celix_container("use_pubsub_wire_protocol_v1" BUNDLES Celix::celix_pubsub_protocol_wire_v1 hello) +endif () + +option(TEST_PUBSUB_WIRE_PROTOCOL_V2 "Test pubsub wire protocol v2" OFF) +if (TEST_PUBSUB_WIRE_PROTOCOL_V2) + add_celix_container("use_pubsub_wire_protocol_v2" BUNDLES Celix::celix_pubsub_protocol_wire_v2 hello) +endif () + +option(TEST_PUBSUB_JSON_SERIALIZER "Test pubsub json serializer" OFF) +if (TEST_PUBSUB_JSON_SERIALIZER) + add_celix_container("use_pubsub_json_serializer" BUNDLES Celix::celix_pubsub_serializer_json hello) +endif () + +option(TEST_PUBSUB_AVROBIN_SERIALIZER "Test pubsub avrobin serializer" OFF) +if (TEST_PUBSUB_AVROBIN_SERIALIZER) + add_celix_container("use_pubsub_avrobin_serializer" BUNDLES Celix::celix_pubsub_serializer_avrobin hello) +endif () + +option(TEST_CXX_REMOTE_SERVICE_ADMIN "Test C++ remote service admin" OFF) +if (TEST_CXX_REMOTE_SERVICE_ADMIN) + add_celix_container("use_cxx_remote_service_admin" BUNDLES Celix::RemoteServiceAdmin hello) + add_executable(use_rsa_spi test_rsa_spi.cc) + target_link_libraries(use_rsa_spi PRIVATE Celix::rsa_spi) +endif () + +option(TEST_SHELL_API "Test shell api" OFF) +if (TEST_SHELL_API) + add_executable(use_shell_api test_shell_api.c) + target_link_libraries(use_shell_api PRIVATE Celix::shell_api) +endif () + +option(TEST_SHELL_BONJOUR "Test shell bonjour" OFF) +if (TEST_SHELL_BONJOUR) + add_celix_container("use_shell_bonjour" INSTALL_BUNDLES Celix::bonjour_shell BUNDLES hello) +endif () + +option(TEST_CELIX_DFI "Test Celix DFI" OFF) +if (TEST_CELIX_DFI) + add_executable(use_celix_dfi test_celix_dfi.c) + target_link_libraries(use_celix_dfi PRIVATE Celix::dfi) +endif () + +option(TEST_UTILS "Test utils" OFF) +if (TEST_UTILS) + add_executable(use_utils test_utils.c) + target_link_libraries(use_utils PRIVATE Celix::utils) +endif () \ No newline at end of file diff --git a/examples/conan_test_package/conanfile.py b/examples/conan_test_package/conanfile.py index 327a61a74..88c58a8e2 100644 --- a/examples/conan_test_package/conanfile.py +++ b/examples/conan_test_package/conanfile.py @@ -22,9 +22,11 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" generators = "cmake_paths", "cmake_find_package" + # requires = "celix/2.3.0@docker/test" def build(self): cmake = CMake(self) + cmake.definitions["TEST_FRAMEWORK"] = self.options["celix"].build_framework cmake.definitions["TEST_HTTP_ADMIN"] = self.options["celix"].build_http_admin cmake.definitions["TEST_LOG_SERVICE"] = self.options["celix"].build_log_service cmake.definitions["TEST_SYSLOG_WRITER"] = self.options["celix"].build_syslog_writer @@ -51,6 +53,18 @@ def build(self): cmake.definitions["TEST_LAUNCHER"] = self.options["celix"].build_launcher cmake.definitions["TEST_PROMISES"] = self.options["celix"].build_promises cmake.definitions["TEST_PUSHSTREAMS"] = self.options["celix"].build_pushstreams + cmake.definitions["TEST_DEPLOYMENT_ADMIN"] = self.options["celix"].build_deployment_admin + cmake.definitions["TEST_LOG_HELPER"] = self.options["celix"].build_log_helper + cmake.definitions["TEST_LOG_SERVICE_API"] = self.options["celix"].build_log_service_api + cmake.definitions["TEST_PUBSUB_WIRE_PROTOCOL_V1"] = self.options["celix"].build_pubsub_wire_protocol_v1 + cmake.definitions["TEST_PUBSUB_WIRE_PROTOCOL_V2"] = self.options["celix"].build_pubsub_wire_protocol_v2 + cmake.definitions["TEST_PUBSUB_JSON_SERIALIZER"] = self.options["celix"].build_pubsub_json_serializer + cmake.definitions["TEST_PUBSUB_AVROBIN_SERIALIZER"] = self.options["celix"].build_pubsub_avrobin_serializer + cmake.definitions["TEST_CXX_REMOTE_SERVICE_ADMIN"] = self.options["celix"].build_cxx_remote_service_admin + cmake.definitions["TEST_SHELL_API"] = self.options["celix"].build_shell_api + cmake.definitions["TEST_SHELL_BONJOUR"] = self.options["celix"].build_shell_bonjour + cmake.definitions["TEST_CELIX_DFI"] = self.options["celix"].build_celix_dfi + cmake.definitions["TEST_UTILS"] = self.options["celix"].build_utils cmake.definitions["CMAKE_PROJECT_test_package_INCLUDE"] = os.path.join(self.build_folder, "conan_paths.cmake") # the following is workaround https://github.com/conan-io/conan/issues/7192 if self.settings.os == "Linux": @@ -62,7 +76,8 @@ def build(self): def test(self): if not tools.cross_building(self, skip_x64_x86=True): - self.run("./use_framework", run_environment=True) + if self.options["celix"].build_framework: + self.run("./use_framework", run_environment=True) if self.options["celix"].build_http_admin: self.run("./use_http_admin", cwd=os.path.join("deploy", "use_http_admin"), run_environment=True) if self.options["celix"].build_log_service: @@ -80,7 +95,8 @@ def test(self): if self.options["celix"].build_pubsub_psa_ws: self.run("./use_psa_ws", cwd=os.path.join("deploy", "use_psa_ws"), run_environment=True) if self.options["celix"].build_pubsub_discovery_etcd: - self.run("./use_psa_discovery_etcd", cwd=os.path.join("deploy", "use_psa_discovery_etcd"), run_environment=True) + self.run("./use_psa_discovery_etcd", + cwd=os.path.join("deploy", "use_psa_discovery_etcd"), run_environment=True) if self.options["celix"].build_remote_service_admin: self.run("./use_my_rsa", cwd=os.path.join("deploy", "use_my_rsa"), run_environment=True) self.run("./use_c_rsa_spi", run_environment=True) @@ -95,7 +111,8 @@ def test(self): if self.options["celix"].build_rsa_discovery_etcd: self.run("./use_rsa_etcd", cwd=os.path.join("deploy", "use_rsa_etcd"), run_environment=True) if self.options["celix"].build_rsa_discovery_zeroconf: - self.run("./use_rsa_discovery_zeroconf", cwd=os.path.join("deploy", "use_rsa_discovery_zeroconf"), run_environment=True) + self.run("./use_rsa_discovery_zeroconf", + cwd=os.path.join("deploy", "use_rsa_discovery_zeroconf"), run_environment=True) if self.options["celix"].build_shell: self.run("./use_shell", run_environment=True) if self.options["celix"].celix_cxx17 or self.options["celix"].celix_cxx14: @@ -114,3 +131,35 @@ def test(self): self.run("./use_promises", run_environment=True) if self.options["celix"].build_pushstreams: self.run("./use_pushstreams", run_environment=True) + if self.options["celix"].build_deployment_admin: + self.run("./use_deployment_admin", + cwd=os.path.join("deploy", "use_deployment_admin"), run_environment=True) + if self.options["celix"].build_log_helper: + self.run("./use_log_helper", run_environment=True) + if self.options["celix"].build_log_service_api: + self.run("./use_log_service_api", run_environment=True) + if self.options["celix"].build_pubsub_wire_protocol_v1: + self.run("./use_pubsub_wire_protocol_v1", + cwd=os.path.join("deploy", "use_pubsub_wire_protocol_v1"), run_environment=True) + if self.options["celix"].build_pubsub_wire_protocol_v2: + self.run("./use_pubsub_wire_protocol_v2", + cwd=os.path.join("deploy", "use_pubsub_wire_protocol_v2"), run_environment=True) + if self.options["celix"].build_pubsub_json_serializer: + self.run("./use_pubsub_json_serializer", + cwd=os.path.join("deploy", "use_pubsub_json_serializer"), run_environment=True) + if self.options["celix"].build_pubsub_avrobin_serializer: + self.run("./use_pubsub_avrobin_serializer", + cwd=os.path.join("deploy", "use_pubsub_avrobin_serializer"), run_environment=True) + if self.options["celix"].build_cxx_remote_service_admin: + self.run("./use_cxx_remote_service_admin", + cwd=os.path.join("deploy", "use_cxx_remote_service_admin"), run_environment=True) + self.run("./use_rsa_spi", run_environment=True) + if self.options["celix"].build_shell_api: + self.run("./use_shell_api", run_environment=True) + if self.options["celix"].build_shell_bonjour: + self.run("./use_shell_bonjour", + cwd=os.path.join("deploy", "use_shell_bonjour"), run_environment=True) + if self.options["celix"].build_celix_dfi: + self.run("./use_celix_dfi", run_environment=True) + if self.options["celix"].build_utils: + self.run("./use_utils", run_environment=True) diff --git a/examples/conan_test_package/hello_bundle.c b/examples/conan_test_package/hello_bundle.c index 6e2afe674..d8452b727 100644 --- a/examples/conan_test_package/hello_bundle.c +++ b/examples/conan_test_package/hello_bundle.c @@ -16,18 +16,18 @@ * specific language governing permissions and limitations * under the License. */ -#include -#include +#include +#include +#include #include typedef struct activator_data { - celix_log_helper_t *logger; + void* data; } activator_data_t; static celix_status_t activator_start(activator_data_t *data, celix_bundle_context_t *ctx) { const char *key = NULL; - data->logger = celix_logHelper_create(ctx, "test"); printf("\nHello world from C bundle with id %li\n", celix_bundle_getId(celix_bundleContext_getBundle(ctx))); celix_array_list_t *bundles = celix_bundleContext_listInstalledBundles(ctx); for (int i = 0; i < celix_arrayList_size(bundles); i++) { @@ -40,8 +40,7 @@ static celix_status_t activator_start(activator_data_t *data, celix_bundle_conte } static celix_status_t activator_stop(activator_data_t *data, celix_bundle_context_t *ctx) { - celix_logHelper_info(data->logger, "Goodbye world from C bundle with id %li\n", celix_bundle_getId(celix_bundleContext_getBundle(ctx))); - celix_logHelper_destroy(data->logger); + printf("Goodbye world from C bundle with id %li\n", celix_bundle_getId(celix_bundleContext_getBundle(ctx))); return CELIX_SUCCESS; } diff --git a/examples/conan_test_package/my_log_writer_activator.c b/examples/conan_test_package/my_log_writer_activator.c index 4d11f35e5..8bf40a728 100644 --- a/examples/conan_test_package/my_log_writer_activator.c +++ b/examples/conan_test_package/my_log_writer_activator.c @@ -18,9 +18,9 @@ */ #define _GNU_SOURCE -#include -#include +#include #include +#include typedef struct my_log_writer_activator { celix_log_sink_t logSinkSvc; @@ -42,7 +42,10 @@ static void myLogWriter_sinkLog(void *handle __attribute__((unused)), celix_log_ va_end(argCopy); if (needed > 1024) { char *allocatedBuffer = NULL; - vasprintf(&allocatedBuffer, format, formatArgs); + if(vasprintf(&allocatedBuffer, format, formatArgs) == -1) { + fprintf(stderr, "Error allocating memory for log message\n"); + return; + } printf("my [%s]: %s", logServiceName, allocatedBuffer); free(allocatedBuffer); } else { diff --git a/examples/conan_test_package/my_psa_activator.c b/examples/conan_test_package/my_psa_activator.c index 32a3b536c..6c32125d6 100644 --- a/examples/conan_test_package/my_psa_activator.c +++ b/examples/conan_test_package/my_psa_activator.c @@ -17,12 +17,12 @@ under the License. */ -#include -#include +#include +#include #include #include #include -#include +#include #include typedef struct my_psa_activator { diff --git a/examples/conan_test_package/my_rsa_activator.c b/examples/conan_test_package/my_rsa_activator.c index 24e6188d2..e8f817141 100644 --- a/examples/conan_test_package/my_rsa_activator.c +++ b/examples/conan_test_package/my_rsa_activator.c @@ -17,10 +17,10 @@ under the License. */ -#include +#include +#include #include #include -#include struct remote_service_admin { diff --git a/examples/conan_test_package/test_celix_dfi.c b/examples/conan_test_package/test_celix_dfi.c new file mode 100644 index 000000000..a592acbe8 --- /dev/null +++ b/examples/conan_test_package/test_celix_dfi.c @@ -0,0 +1,25 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// + +#include +#include + +int main() { + printf("sizeof(struct method_entry) = %zu\n", sizeof(struct method_entry)); + return 0; +} \ No newline at end of file diff --git a/examples/conan_test_package/test_cxx_shell.cpp b/examples/conan_test_package/test_cxx_shell.cpp index e5f269088..da028ffa8 100644 --- a/examples/conan_test_package/test_cxx_shell.cpp +++ b/examples/conan_test_package/test_cxx_shell.cpp @@ -19,8 +19,10 @@ #include #include +#include +#include #include -#include +#include #include #include #include @@ -39,13 +41,13 @@ int main() { celix_bundle_context_t *ctx = NULL; celix_properties_t *properties = NULL; - properties = properties_create(); - properties_set(properties, "LOGHELPER_ENABLE_STDOUT_FALLBACK", "true"); - properties_set(properties, "org.osgi.framework.storage.clean", "onFirstInit"); - properties_set(properties, "org.osgi.framework.storage", ".cacheBundleContextTestFramework"); + properties = celix_properties_create(); + celix_properties_setBool(properties, "LOGHELPER_ENABLE_STDOUT_FALLBACK", true); + celix_properties_setBool(properties, "org.osgi.framework.storage.clean", true); + celix_properties_set(properties, "org.osgi.framework.storage", ".cacheBundleContextTestFramework"); fw = celix_frameworkFactory_createFramework(properties); - ctx = framework_getContext(fw); + ctx = celix_framework_getFrameworkContext(fw); long bndId = celix_bundleContext_installBundle(ctx, CXX_SHELL_BUNDLE_LOCATION, true); assert(bndId >= 0); diff --git a/examples/conan_test_package/test_framework.c b/examples/conan_test_package/test_framework.c index 416a046a7..ae9531ed2 100644 --- a/examples/conan_test_package/test_framework.c +++ b/examples/conan_test_package/test_framework.c @@ -16,8 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -#include #include +#include +#include +#include +#include #include int main() { @@ -25,13 +28,13 @@ int main() { celix_bundle_context_t *ctx = NULL; celix_properties_t *properties = NULL; - properties = properties_create(); - properties_set(properties, "LOGHELPER_ENABLE_STDOUT_FALLBACK", "true"); - properties_set(properties, "org.osgi.framework.storage.clean", "onFirstInit"); - properties_set(properties, "org.osgi.framework.storage", ".cacheBundleContextTestFramework"); + properties = celix_properties_create(); + celix_properties_setBool(properties, "LOGHELPER_ENABLE_STDOUT_FALLBACK", true); + celix_properties_setBool(properties, "org.osgi.framework.storage.clean", true); + celix_properties_set(properties, "org.osgi.framework.storage", ".cacheBundleContextTestFramework"); fw = celix_frameworkFactory_createFramework(properties); - ctx = framework_getContext(fw); + ctx = celix_framework_getFrameworkContext(fw); long bndId = celix_bundleContext_installBundle(ctx, HELLO_TEST_BUNDLE_LOCATION, true); assert(bndId >= 0); celix_framework_waitForStop(fw); diff --git a/examples/conan_test_package/test_http_admin_activator.c b/examples/conan_test_package/test_http_admin_activator.c index 73a74d846..14931da3c 100644 --- a/examples/conan_test_package/test_http_admin_activator.c +++ b/examples/conan_test_package/test_http_admin_activator.c @@ -16,13 +16,12 @@ * specific language governing permissions and limitations * under the License. */ +#include +#include +#include +#include #include -#include "celix_api.h" -#include "http_admin/api.h" - -#include "civetweb.h" - struct activator { celix_http_service_t httpSvc; celix_http_service_t httpSvc2; @@ -37,6 +36,7 @@ struct activator { //Local function prototypes int alias_test_put(void *handle, struct mg_connection *connection, const char *path, const char *data, size_t length); + int websocket_data_echo(struct mg_connection *connection, int op_code, char *data, size_t length, void *handle); celix_status_t bnd_start(struct activator *act, celix_bundle_context_t *ctx) { @@ -61,7 +61,8 @@ celix_status_t bnd_start(struct activator *act, celix_bundle_context_t *ctx) { act->sockSvc.handle = act; act->sockSvc.data = websocket_data_echo; act->sockSvcId = celix_bundleContext_registerService(ctx, &act->sockSvc, WEBSOCKET_ADMIN_SERVICE_NAME, props4); - celix_framework_stopBundleAsync(celix_bundleContext_getFramework(ctx), CELIX_FRAMEWORK_BUNDLE_ID); // make to container quit immediately + celix_framework_stopBundleAsync(celix_bundleContext_getFramework(ctx), + CELIX_FRAMEWORK_BUNDLE_ID); // make to container quit immediately return CELIX_SUCCESS; } @@ -76,9 +77,10 @@ celix_status_t bnd_stop(struct activator *act, celix_bundle_context_t *ctx) { CELIX_GEN_BUNDLE_ACTIVATOR(struct activator, bnd_start, bnd_stop); -int alias_test_put(void *handle __attribute__((unused)), struct mg_connection *connection, const char *path __attribute__((unused)), const char *data, size_t length) { +int alias_test_put(void *handle __attribute__((unused)), struct mg_connection *connection, + const char *path __attribute__((unused)), const char *data, size_t length) { //If data received, echo the data for the test case - if(length > 0 && data != NULL) { + if (length > 0 && data != NULL) { const char *mime_type = mg_get_header(connection, "Content-Type"); mg_printf(connection, "HTTP/1.1 200 OK\r\nContent-Type: %s\r\nConnection: close\r\n\r\n%s", mime_type, data); @@ -88,7 +90,9 @@ int alias_test_put(void *handle __attribute__((unused)), struct mg_connection *c return 200; } -int websocket_data_echo(struct mg_connection *connection, int op_code __attribute__((unused)), char *data, size_t length, void *handle __attribute__((unused))) { +int +websocket_data_echo(struct mg_connection *connection, int op_code __attribute__((unused)), char *data, size_t length, + void *handle __attribute__((unused))) { mg_websocket_write(connection, MG_WEBSOCKET_OPCODE_PONG, data, length); return 0; //Close socket after echoing. diff --git a/examples/conan_test_package/test_log_helper.c b/examples/conan_test_package/test_log_helper.c new file mode 100644 index 000000000..49a9371c6 --- /dev/null +++ b/examples/conan_test_package/test_log_helper.c @@ -0,0 +1,43 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// + +#include +#include +#include + +int main() { + celix_properties_t *properties = NULL; + properties = celix_properties_create(); + celix_properties_setBool(properties, "LOGHELPER_ENABLE_STDOUT_FALLBACK", true); + celix_properties_setBool(properties, "org.osgi.framework.storage.clean", true); + celix_properties_set(properties, "org.osgi.framework.storage", ".cacheBundleContextTestFramework"); + celix_framework_t *fw = celix_frameworkFactory_createFramework(properties); + celix_bundle_context_t *ctx = celix_framework_getFrameworkContext(fw); + celix_log_helper_t *logHelper = celix_logHelper_create(ctx, "example_log_helper"); + + celix_logHelper_trace(logHelper, "Hello from log helper"); + celix_logHelper_debug(logHelper, "Hello from log helper"); + celix_logHelper_info(logHelper, "Hello from log helper"); + celix_logHelper_warning(logHelper, "Hello from log helper"); + celix_logHelper_error(logHelper, "Hello from log helper"); + celix_logHelper_fatal(logHelper, "Hello from log helper"); + + celix_logHelper_destroy(logHelper); + celix_frameworkFactory_destroyFramework(fw); + return 0; +} \ No newline at end of file diff --git a/examples/conan_test_package/test_log_service_api.c b/examples/conan_test_package/test_log_service_api.c new file mode 100644 index 000000000..d0bc75fb8 --- /dev/null +++ b/examples/conan_test_package/test_log_service_api.c @@ -0,0 +1,25 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// + +#include +#include + +int main() { + printf("sizeof(celix_log_service_t) = %zu\n", sizeof(celix_log_service_t)); + return 0; +} diff --git a/examples/conan_test_package/test_rsa_spi.cc b/examples/conan_test_package/test_rsa_spi.cc new file mode 100644 index 000000000..5ed78fe1d --- /dev/null +++ b/examples/conan_test_package/test_rsa_spi.cc @@ -0,0 +1,25 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// + +#include +#include + +int main() { + printf("sizeof(celix::rsa::EndpointDescription) = %zu\n", sizeof(celix::rsa::EndpointDescription)); + return 0; +} \ No newline at end of file diff --git a/examples/conan_test_package/test_shell.c b/examples/conan_test_package/test_shell.c index e4c3421fc..db693732a 100644 --- a/examples/conan_test_package/test_shell.c +++ b/examples/conan_test_package/test_shell.c @@ -16,10 +16,14 @@ * specific language governing permissions and limitations * under the License. */ +#include +#include +#include +#include +#include #include #include -#include -#include +#include static void use(void *handle, void *svc) { celix_shell_t *shell = svc; @@ -39,13 +43,13 @@ int main() { celix_bundle_context_t *ctx = NULL; celix_properties_t *properties = NULL; - properties = properties_create(); - properties_set(properties, "LOGHELPER_ENABLE_STDOUT_FALLBACK", "true"); - properties_set(properties, "org.osgi.framework.storage.clean", "onFirstInit"); - properties_set(properties, "org.osgi.framework.storage", ".cacheBundleContextTestFramework"); + properties = celix_properties_create(); + celix_properties_setBool(properties, "LOGHELPER_ENABLE_STDOUT_FALLBACK", true); + celix_properties_setBool(properties, "org.osgi.framework.storage.clean", true); + celix_properties_set(properties, "org.osgi.framework.storage", ".cacheBundleContextTestFramework"); fw = celix_frameworkFactory_createFramework(properties); - ctx = framework_getContext(fw); + ctx = celix_framework_getFrameworkContext(fw); long bndId = celix_bundleContext_installBundle(ctx, SHELL_BUNDLE_LOCATION, true); assert(bndId >= 0); diff --git a/examples/conan_test_package/test_shell_api.c b/examples/conan_test_package/test_shell_api.c new file mode 100644 index 000000000..b4d34206b --- /dev/null +++ b/examples/conan_test_package/test_shell_api.c @@ -0,0 +1,26 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// + +#include +#include + +int main() { + printf("sizeof(celix_shell_t) = %zu\n", sizeof(celix_shell_t)); + return 0; +} + diff --git a/examples/conan_test_package/test_utils.c b/examples/conan_test_package/test_utils.c new file mode 100644 index 000000000..645a12598 --- /dev/null +++ b/examples/conan_test_package/test_utils.c @@ -0,0 +1,28 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// + +#include +#include +#include + +int main() { + char *dup = celix_utils_strdup("Hello World"); + printf("dup = %s\n", dup); + free(dup); + return 0; +} \ No newline at end of file diff --git a/libs/dependency_manager/CMakeLists.txt b/libs/dependency_manager/CMakeLists.txt index 8dbc604be..2c1f759bb 100644 --- a/libs/dependency_manager/CMakeLists.txt +++ b/libs/dependency_manager/CMakeLists.txt @@ -16,40 +16,43 @@ # under the License. #dummy libaries to ensure backward compatability with projects using the dependency manager libs/shell -add_library(dependency_manager_static STATIC src/dm_activator.c) -celix_deprecated_framework_headers(dependency_manager_static) -target_include_directories(dependency_manager_static PUBLIC - $ -) -if (APPLE) - target_link_libraries(dependency_manager_static Celix::framework "-undefined dynamic_lookup") -else() - target_link_libraries(dependency_manager_static Celix::framework) -endif() +celix_subproject(DEPENDENCY_MANAGER "Option to enable building the legacy Dependency Manager" ON) +if (DEPENDENCY_MANAGER) + add_library(dependency_manager_static STATIC src/dm_activator.c) + celix_deprecated_framework_headers(dependency_manager_static) + target_include_directories(dependency_manager_static PUBLIC + $ + ) + if (APPLE) + target_link_libraries(dependency_manager_static Celix::framework "-undefined dynamic_lookup") + else() + target_link_libraries(dependency_manager_static Celix::framework) + endif() -add_library(dependency_manager_so SHARED src/dm_activator.c) -celix_deprecated_framework_headers(dependency_manager_so) -target_include_directories(dependency_manager_so PUBLIC - $ -) -if (APPLE) - target_link_libraries(dependency_manager_so Celix::framework "-undefined dynamic_lookup") -else() - target_link_libraries(dependency_manager_so Celix::framework) -endif() + add_library(dependency_manager_so SHARED src/dm_activator.c) + celix_deprecated_framework_headers(dependency_manager_so) + target_include_directories(dependency_manager_so PUBLIC + $ + ) + if (APPLE) + target_link_libraries(dependency_manager_so Celix::framework "-undefined dynamic_lookup") + else() + target_link_libraries(dependency_manager_so Celix::framework) + endif() -#now part of the the shell bundle -add_library(dm_shell INTERFACE) + #now part of the the shell bundle + add_library(dm_shell INTERFACE) -celix_deprecated_utils_headers(dependency_manager_static) -celix_deprecated_utils_headers(dependency_manager_so) + celix_deprecated_utils_headers(dependency_manager_static) + celix_deprecated_utils_headers(dependency_manager_so) -#Setup target aliases to match external usage -add_library(Celix::dm_shell ALIAS dm_shell) -add_library(Celix::dependency_manager_static ALIAS dependency_manager_static) -add_library(Celix::dependency_manager_so ALIAS dependency_manager_so) + #Setup target aliases to match external usage + add_library(Celix::dm_shell ALIAS dm_shell) + add_library(Celix::dependency_manager_static ALIAS dependency_manager_static) + add_library(Celix::dependency_manager_so ALIAS dependency_manager_so) -#install dummy libs -install(TARGETS dependency_manager_static dependency_manager_so dm_shell EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix) + #install dummy libs + install(TARGETS dependency_manager_static dependency_manager_so dm_shell EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix) +endif () diff --git a/libs/dependency_manager_cxx/CMakeLists.txt b/libs/dependency_manager_cxx/CMakeLists.txt index 15fc29dfb..e28880d0d 100644 --- a/libs/dependency_manager_cxx/CMakeLists.txt +++ b/libs/dependency_manager_cxx/CMakeLists.txt @@ -14,23 +14,25 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +celix_subproject(DEPENDENCY_MANAGER_CXX "Option to enable building the legacy C++ Dependency Manager" ON) +if (DEPENDENCY_MANAGER_CXX) + add_library(dependency_manager_cxx_static STATIC + src/dm_activator.cc + ) + celix_deprecated_framework_headers(dependency_manager_cxx_static) + set_target_properties(dependency_manager_cxx_static PROPERTIES OUTPUT_NAME "celix_dependency_manager_cxx_static") + target_compile_options(dependency_manager_cxx_static PRIVATE -fPIC) + target_compile_options(dependency_manager_cxx_static PRIVATE -Wno-deprecated-declarations) + if (APPLE) + target_link_libraries(dependency_manager_cxx_static Celix::framework "-undefined dynamic_lookup") + else() + target_link_libraries(dependency_manager_cxx_static Celix::framework) + endif() -add_library(dependency_manager_cxx_static STATIC - src/dm_activator.cc -) -celix_deprecated_framework_headers(dependency_manager_cxx_static) -set_target_properties(dependency_manager_cxx_static PROPERTIES OUTPUT_NAME "celix_dependency_manager_cxx_static") -target_compile_options(dependency_manager_cxx_static PRIVATE -fPIC) -target_compile_options(dependency_manager_cxx_static PRIVATE -Wno-deprecated-declarations) -if (APPLE) - target_link_libraries(dependency_manager_cxx_static Celix::framework "-undefined dynamic_lookup") -else() - target_link_libraries(dependency_manager_cxx_static Celix::framework) -endif() + install(TARGETS dependency_manager_cxx_static EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework) -install(TARGETS dependency_manager_cxx_static EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework) + celix_deprecated_utils_headers(dependency_manager_cxx_static) -celix_deprecated_utils_headers(dependency_manager_cxx_static) - -#Setup target aliases to match external usage -add_library(Celix::dependency_manager_cxx_static ALIAS dependency_manager_cxx_static) + #Setup target aliases to match external usage + add_library(Celix::dependency_manager_cxx_static ALIAS dependency_manager_cxx_static) +endif () diff --git a/libs/dfi/CMakeLists.txt b/libs/dfi/CMakeLists.txt index bcf2521d8..affed988e 100644 --- a/libs/dfi/CMakeLists.txt +++ b/libs/dfi/CMakeLists.txt @@ -60,6 +60,9 @@ if (CELIX_DFI) #Alias setup to match external usage add_library(Celix::dfi ALIAS dfi) + if (ENABLE_TESTING AND LINKER_WRAP_SUPPORTED) + add_subdirectory(error_injector) + endif () if (ENABLE_TESTING) add_subdirectory(gtest) endif(ENABLE_TESTING) diff --git a/libs/dfi/error_injector/CMakeLists.txt b/libs/dfi/error_injector/CMakeLists.txt new file mode 100644 index 000000000..f6d2a84c9 --- /dev/null +++ b/libs/dfi/error_injector/CMakeLists.txt @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +add_subdirectory(dfi) \ No newline at end of file diff --git a/libs/error_injector/dfi/CMakeLists.txt b/libs/dfi/error_injector/dfi/CMakeLists.txt similarity index 93% rename from libs/error_injector/dfi/CMakeLists.txt rename to libs/dfi/error_injector/dfi/CMakeLists.txt index 5aac1af9b..23608c884 100644 --- a/libs/error_injector/dfi/CMakeLists.txt +++ b/libs/dfi/error_injector/dfi/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(dfi_ei STATIC src/dfi_ei.cc) -target_include_directories(dfi_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(dfi_ei PUBLIC include) target_link_libraries(dfi_ei PUBLIC Celix::error_injector Celix::dfi) # It plays nicely with address sanitizer this way. target_link_options(dfi_ei INTERFACE diff --git a/libs/error_injector/dfi/include/dfi_ei.h b/libs/dfi/error_injector/dfi/include/dfi_ei.h similarity index 100% rename from libs/error_injector/dfi/include/dfi_ei.h rename to libs/dfi/error_injector/dfi/include/dfi_ei.h diff --git a/libs/error_injector/dfi/src/dfi_ei.cc b/libs/dfi/error_injector/dfi/src/dfi_ei.cc similarity index 100% rename from libs/error_injector/dfi/src/dfi_ei.cc rename to libs/dfi/error_injector/dfi/src/dfi_ei.cc diff --git a/libs/error_injector/CMakeLists.txt b/libs/error_injector/CMakeLists.txt index 7c508927a..bd149b460 100644 --- a/libs/error_injector/CMakeLists.txt +++ b/libs/error_injector/CMakeLists.txt @@ -25,32 +25,17 @@ 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_CELIX_DFI) - add_subdirectory(dfi) -endif () celix_subproject(ERROR_INJECTOR_MDNSRESPONDER "Option to enable building the mdnsresponder error injector" OFF) if (ERROR_INJECTOR_MDNSRESPONDER) add_subdirectory(mdnsresponder) diff --git a/libs/etcdlib/CMakeLists.txt b/libs/etcdlib/CMakeLists.txt index c640450ff..16a30a6e9 100644 --- a/libs/etcdlib/CMakeLists.txt +++ b/libs/etcdlib/CMakeLists.txt @@ -21,7 +21,7 @@ if (NOT COMMAND celix_subproject) #act as a top level project. Making the etcdlib useable #stand-alone - cmake_minimum_required (VERSION 3.2) + cmake_minimum_required (VERSION 3.18) project(ETCDLIB VERSION 1.1.0 LANGUAGES C CXX @@ -36,24 +36,14 @@ if (NOT COMMAND celix_subproject) set(CMAKE_EXE_LINKER_FLAGS "-pthread ${CMAKE_EXE_LINKER_FLAGS}") set(ETCDLIB_CMP ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) - find_package(CURL REQUIRED) - 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(ETCDLIB_STANDALONE ON) else() set(ETCDLIB_CMP framework) celix_subproject(CELIX_ETCDLIB "Option to build the ETCD library" ON) - find_package(CURL REQUIRED) endif () if (CELIX_ETCDLIB OR ETCDLIB_STANDALONE) + find_package(CURL REQUIRED) find_package(jansson REQUIRED) add_library(etcdlib SHARED src/etcd.c) @@ -65,7 +55,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 +71,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 3cde38606..d45c2acc8 100644 --- a/libs/framework/CMakeLists.txt +++ b/libs/framework/CMakeLists.txt @@ -15,74 +15,81 @@ # specific language governing permissions and limitations # under the License. -find_package(ZLIB REQUIRED) -find_package(libuuid REQUIRED) -find_package(CURL REQUIRED) +celix_subproject(FRAMEWORK "Option to build the Celix Framework" ON) +if (FRAMEWORK) + find_package(libuuid REQUIRED) + find_package(CURL REQUIRED) -set(FRAMEWORK_SRC - src/attribute.c src/bundle.c src/bundle_archive.c src/celix_bundle_cache.c - src/bundle_context.c src/bundle_revision.c - src/framework.c src/manifest.c - src/manifest_parser.c src/module.c - src/requirement.c src/capability.c src/resolver.c src/wire.c - src/service_reference.c src/service_registration.c - src/service_registry.c src/service_tracker.c src/service_tracker_customizer.c - src/celix_log.c src/celix_launcher.c - src/celix_framework_factory.c - src/dm_dependency_manager_impl.c src/dm_component_impl.c - src/dm_service_dependency.c src/celix_libloader.c - src/framework_bundle_lifecycle_handler.c - src/celix_bundle_state.c - src/celix_framework_utils.c - src/celix_scheduled_event.c -) -set(FRAMEWORK_DEPS libuuid::libuuid CURL::libcurl ZLIB::ZLIB ${CMAKE_DL_LIBS}) + set(FRAMEWORK_SRC + src/attribute.c src/bundle.c src/bundle_archive.c src/celix_bundle_cache.c + src/bundle_context.c src/bundle_revision.c + src/framework.c src/manifest.c + src/manifest_parser.c src/module.c + src/requirement.c src/capability.c src/resolver.c src/wire.c + src/service_reference.c src/service_registration.c + src/service_registry.c src/service_tracker.c src/service_tracker_customizer.c + src/celix_log.c src/celix_launcher.c + src/celix_framework_factory.c + src/dm_dependency_manager_impl.c src/dm_component_impl.c + src/dm_service_dependency.c src/celix_libloader.c + src/framework_bundle_lifecycle_handler.c + src/celix_bundle_state.c + src/celix_framework_utils.c + src/celix_scheduled_event.c + ) + set(FRAMEWORK_DEPS libuuid::libuuid CURL::libcurl ${CMAKE_DL_LIBS}) -add_library(framework SHARED ${FRAMEWORK_SRC}) + add_library(framework SHARED ${FRAMEWORK_SRC}) -set_target_properties(framework - PROPERTIES - C_VISIBILITY_PRESET hidden - "VERSION" "${CELIX_MAJOR}.${CELIX_MINOR}.${CELIX_MICRO}" - "SOVERSION" ${CELIX_MAJOR} - OUTPUT_NAME "celix_framework") -target_include_directories(framework PUBLIC - $ -) -target_include_directories(framework PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include_deprecated) -target_compile_options(framework PRIVATE -DUSE_FILE32API) -target_compile_options(framework PRIVATE -Wno-deprecated-declarations) #note part of the api is deprecated, ignore this warning on own api -target_link_libraries(framework PUBLIC Celix::utils ${CELIX_OPTIONAL_EXTRA_LIBS}) -target_link_libraries(framework PRIVATE ${FRAMEWORK_DEPS}) + set_target_properties(framework + PROPERTIES + C_VISIBILITY_PRESET hidden + "VERSION" "${CELIX_MAJOR}.${CELIX_MINOR}.${CELIX_MICRO}" + "SOVERSION" ${CELIX_MAJOR} + OUTPUT_NAME "celix_framework") + target_include_directories(framework PUBLIC + $ + ) + target_include_directories(framework PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include_deprecated) + target_compile_options(framework PRIVATE -DUSE_FILE32API) + target_compile_options(framework PRIVATE -Wno-deprecated-declarations) #note part of the api is deprecated, ignore this warning on own api + target_link_libraries(framework PUBLIC Celix::utils ${CELIX_OPTIONAL_EXTRA_LIBS}) + target_link_libraries(framework PRIVATE ${FRAMEWORK_DEPS}) -generate_export_header(framework - BASE_NAME "CELIX_FRAMEWORK" - EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/celix/gen/includes/framework/celix_framework_export.h") -target_include_directories(framework PUBLIC $) -celix_deprecated_utils_headers(framework) + generate_export_header(framework + BASE_NAME "CELIX_FRAMEWORK" + EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/celix/gen/includes/framework/celix_framework_export.h") + target_include_directories(framework PUBLIC $) + celix_deprecated_utils_headers(framework) -install(TARGETS framework EXPORT celix LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/framework) -install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/framework COMPONENT framework) -install(DIRECTORY include_deprecated/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/framework COMPONENT framework) -install(DIRECTORY ${CMAKE_BINARY_DIR}/celix/gen/includes/framework/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/framework COMPONENT framework) + install(TARGETS framework EXPORT celix LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/framework) + install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/framework COMPONENT framework) + if (CELIX_INSTALL_DEPRECATED_API) + install(DIRECTORY include_deprecated/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/framework COMPONENT framework) + endif () + install(DIRECTORY ${CMAKE_BINARY_DIR}/celix/gen/includes/framework/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/framework COMPONENT framework) -#Alias setup to match external usage -add_library(Celix::framework ALIAS framework) + #Alias setup to match external usage + add_library(Celix::framework ALIAS framework) -if (ENABLE_TESTING AND CELIX_CXX17) #framework tests are C++17 - add_library(framework_cut STATIC ${FRAMEWORK_SRC}) - target_include_directories(framework_cut PUBLIC - ${CMAKE_CURRENT_LIST_DIR}/src - ${CMAKE_CURRENT_LIST_DIR}/include - ${CMAKE_BINARY_DIR}/celix/gen/includes/framework - ${CMAKE_CURRENT_LIST_DIR}/include_deprecated - ) - target_compile_options(framework_cut PRIVATE -DUSE_FILE32API) - target_compile_options(framework_cut PRIVATE -Wno-deprecated-declarations) #note part of the api is deprecated, ignore this warning on own api - target_link_libraries(framework_cut PUBLIC Celix::utils ${CELIX_OPTIONAL_EXTRA_LIBS} ${FRAMEWORK_DEPS}) - celix_deprecated_utils_headers(framework_cut) - add_subdirectory(gtest) -endif() + if (ENABLE_TESTING AND LINKER_WRAP_SUPPORTED) + add_subdirectory(error_injector) + endif () + if (ENABLE_TESTING AND CELIX_CXX17) #framework tests are C++17 + add_library(framework_cut STATIC ${FRAMEWORK_SRC}) + target_include_directories(framework_cut PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/src + ${CMAKE_CURRENT_LIST_DIR}/include + ${CMAKE_BINARY_DIR}/celix/gen/includes/framework + ${CMAKE_CURRENT_LIST_DIR}/include_deprecated + ) + target_compile_options(framework_cut PRIVATE -DUSE_FILE32API) + target_compile_options(framework_cut PRIVATE -Wno-deprecated-declarations) #note part of the api is deprecated, ignore this warning on own api + target_link_libraries(framework_cut PUBLIC Celix::utils ${CELIX_OPTIONAL_EXTRA_LIBS} ${FRAMEWORK_DEPS}) + celix_deprecated_utils_headers(framework_cut) + add_subdirectory(gtest) + endif() -add_subdirectory(benchmark) + add_subdirectory(benchmark) +endif () diff --git a/libs/framework/error_injector/CMakeLists.txt b/libs/framework/error_injector/CMakeLists.txt new file mode 100644 index 000000000..636a68539 --- /dev/null +++ b/libs/framework/error_injector/CMakeLists.txt @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +add_subdirectory(celix_bundle_ctx) +add_subdirectory(celix_bundle) \ No newline at end of file diff --git a/libs/error_injector/celix_bundle/CMakeLists.txt b/libs/framework/error_injector/celix_bundle/CMakeLists.txt similarity index 93% rename from libs/error_injector/celix_bundle/CMakeLists.txt rename to libs/framework/error_injector/celix_bundle/CMakeLists.txt index 1c0a7d810..97eb8e2cb 100644 --- a/libs/error_injector/celix_bundle/CMakeLists.txt +++ b/libs/framework/error_injector/celix_bundle/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(bundle_ei STATIC src/celix_bundle_ei.cc) -target_include_directories(bundle_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(bundle_ei PUBLIC include) target_link_libraries(bundle_ei PUBLIC Celix::error_injector) target_link_libraries(bundle_ei PRIVATE Celix::framework) diff --git a/libs/error_injector/celix_bundle/include/celix_bundle_ei.h b/libs/framework/error_injector/celix_bundle/include/celix_bundle_ei.h similarity index 100% rename from libs/error_injector/celix_bundle/include/celix_bundle_ei.h rename to libs/framework/error_injector/celix_bundle/include/celix_bundle_ei.h diff --git a/libs/error_injector/celix_bundle/src/celix_bundle_ei.cc b/libs/framework/error_injector/celix_bundle/src/celix_bundle_ei.cc similarity index 100% rename from libs/error_injector/celix_bundle/src/celix_bundle_ei.cc rename to libs/framework/error_injector/celix_bundle/src/celix_bundle_ei.cc diff --git a/libs/error_injector/celix_bundle_ctx/CMakeLists.txt b/libs/framework/error_injector/celix_bundle_ctx/CMakeLists.txt similarity index 95% rename from libs/error_injector/celix_bundle_ctx/CMakeLists.txt rename to libs/framework/error_injector/celix_bundle_ctx/CMakeLists.txt index fed75fbee..cab4abc23 100644 --- a/libs/error_injector/celix_bundle_ctx/CMakeLists.txt +++ b/libs/framework/error_injector/celix_bundle_ctx/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(bundle_ctx_ei STATIC src/celix_bundle_context_ei.cc) -target_include_directories(bundle_ctx_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(bundle_ctx_ei PUBLIC include) target_link_libraries(bundle_ctx_ei PUBLIC Celix::error_injector) target_link_libraries(bundle_ctx_ei PRIVATE Celix::framework) diff --git a/libs/error_injector/celix_bundle_ctx/include/celix_bundle_context_ei.h b/libs/framework/error_injector/celix_bundle_ctx/include/celix_bundle_context_ei.h similarity index 100% rename from libs/error_injector/celix_bundle_ctx/include/celix_bundle_context_ei.h rename to libs/framework/error_injector/celix_bundle_ctx/include/celix_bundle_context_ei.h diff --git a/libs/error_injector/celix_bundle_ctx/src/celix_bundle_context_ei.cc b/libs/framework/error_injector/celix_bundle_ctx/src/celix_bundle_context_ei.cc similarity index 100% rename from libs/error_injector/celix_bundle_ctx/src/celix_bundle_context_ei.cc rename to libs/framework/error_injector/celix_bundle_ctx/src/celix_bundle_context_ei.cc diff --git a/libs/framework/src/celix_launcher.c b/libs/framework/src/celix_launcher.c index 7ce3a2932..82abb92e9 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 2db3c4df2..76a9ac74b 100644 --- a/libs/pushstreams/CMakeLists.txt +++ b/libs/pushstreams/CMakeLists.txt @@ -16,10 +16,11 @@ # under the License. set(PUSHSTREAMS_DEFAULT_ON ${CELIX_CXX17}) -celix_subproject(PUSHSTREAMS "Option to build the PushStreams library" ${PUSHSTREAMS_DEFAULT_ON} DEPS PROMISES) +celix_subproject(PUSHSTREAMS "Option to build the PushStreams library" ${PUSHSTREAMS_DEFAULT_ON}) 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/rcm/CMakeLists.txt b/libs/rcm/CMakeLists.txt index 23e422661..86ce6e16c 100644 --- a/libs/rcm/CMakeLists.txt +++ b/libs/rcm/CMakeLists.txt @@ -15,24 +15,27 @@ # specific language governing permissions and limitations # under the License. -set(RCM_SOURCES src/celix_resource.c src/celix_capability.c src/celix_requirement.c) -set(RCM_PUBLIC_LIBS Celix::utils) -SET(RCM_PRIVATE_LIBS ) +celix_subproject(RCM "Option to enable building the Requirement-Capability-Model library" ON) +if (RCM) + set(RCM_SOURCES src/celix_resource.c src/celix_capability.c src/celix_requirement.c) + set(RCM_PUBLIC_LIBS Celix::utils) + SET(RCM_PRIVATE_LIBS ) -add_library(rcm STATIC ${RCM_SOURCES}) -set_target_properties(rcm PROPERTIES - OUTPUT_NAME "celix_rcm" - VERSION 0.0.1 - SOVERSION 0) -target_link_libraries(rcm PUBLIC ${RCM_PUBLIC_LIBS} PRIVATE ${RCM_PRIVATE_LIBS}) -target_include_directories(rcm PRIVATE src PUBLIC include) -celix_target_hide_symbols(rcm) -add_library(Celix::rcm ALIAS rcm) + add_library(rcm STATIC ${RCM_SOURCES}) + set_target_properties(rcm PROPERTIES + OUTPUT_NAME "celix_rcm" + VERSION 0.0.1 + SOVERSION 0) + target_link_libraries(rcm PUBLIC ${RCM_PUBLIC_LIBS} PRIVATE ${RCM_PRIVATE_LIBS}) + target_include_directories(rcm PRIVATE src PUBLIC include) + celix_target_hide_symbols(rcm) + add_library(Celix::rcm ALIAS rcm) -if (ENABLE_TESTING) - add_library(rcm_cut STATIC ${RCM_SOURCES}) - target_link_libraries(rcm_cut PUBLIC ${RCM_PUBLIC_LIBS} PRIVATE ${RCM_PRIVATE_LIBS}) - target_include_directories(rcm_cut PRIVATE src PUBLIC include) + if (ENABLE_TESTING) + add_library(rcm_cut STATIC ${RCM_SOURCES}) + target_link_libraries(rcm_cut PUBLIC ${RCM_PUBLIC_LIBS} PRIVATE ${RCM_PRIVATE_LIBS}) + target_include_directories(rcm_cut PRIVATE src PUBLIC include) - add_subdirectory(gtest) + add_subdirectory(gtest) + endif () endif () diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt index e9362dc04..025266768 100644 --- a/libs/utils/CMakeLists.txt +++ b/libs/utils/CMakeLists.txt @@ -15,174 +15,179 @@ # specific language governing permissions and limitations # under the License. -find_package(libzip REQUIRED) - -set(MEMSTREAM_SOURCES ) -set(MEMSTREAM_INCLUDES ) -include(CheckFunctionExists) -#check_function_exists(fmemopen FMEMOPEN_EXISTS) -check_function_exists(open_memstream OPEN_MEMSTREAM_EXISTS) -if (NOT OPEN_MEMSTREAM_EXISTS) - set(MEMSTREAM_SOURCES src/memstream/open_memstream.c src/memstream/fmemopen.c ${MEMSTREAM_SOURCES}) - set(MEMSTREAM_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/include/memstream ${MEMSTREAM_INCLUDE_DIR}) - install(DIRECTORY include/memstream/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/memstream COMPONENT framework) -endif() - -set(UTILS_SRC - src/array_list.c - src/hash_map.c - src/linked_list.c - src/linked_list_iterator.c - src/celix_threads.c - src/version.c - src/version_range.c - src/properties.c - src/utils.c - src/ip_utils.c - src/filter.c - src/celix_log_level.c - src/celix_log_utils.c - src/celix_hash_map.c - src/celix_file_utils.c - src/celix_convert_utils.c - src/celix_errno.c - src/celix_err.c - ${MEMSTREAM_SOURCES} - ) -set(UTILS_PRIVATE_DEPS libzip::libzip) -set(UTILS_PUBLIC_DEPS) - -add_library(utils SHARED ${UTILS_SRC} src/celix_log_level.c) - -target_link_libraries(utils PRIVATE libzip::libzip) -set_target_properties(utils - PROPERTIES - C_VISIBILITY_PRESET hidden - SOVERSION ${CELIX_MAJOR} - OUTPUT_NAME "celix_utils") - -if (NOT OPEN_MEMSTREAM_EXISTS) - target_compile_definitions(utils PUBLIC -DCELIX_UTILS_NO_MEMSTREAM_AVAILABLE) -endif () - -if (ANDROID) - target_compile_definitions(utils PRIVATE -DUSE_FILE32API) -endif () - -if (NOT APPLE) - set(UTILS_PUBLIC_DEPS ${UTILS_PUBLIC_DEPS} rt) -endif () - -target_include_directories(utils PUBLIC - $ - $ - ) -target_include_directories(utils PRIVATE src include_deprecated) -IF(UNIX AND NOT ANDROID) - set(UTILS_PRIVATE_DEPS ${UTILS_PRIVATE_DEPS} m pthread) -ELSEIF(ANDROID) - set(UTILS_PRIVATE_DEPS ${UTILS_PRIVATE_DEPS} m) -ENDIF() - -target_link_libraries(utils PUBLIC ${UTILS_PUBLIC_DEPS} PRIVATE ${UTILS_PRIVATE_DEPS}) -generate_export_header(utils - BASE_NAME "CELIX_UTILS" - EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/celix/gen/includes/utils/celix_utils_export.h") -target_include_directories(utils PUBLIC $) - -#Configure celix_err_constant header file -set(CELIX_ERR_BUFFER_SIZE 512 CACHE STRING "The size of the thread-specific buffer used for library error messages") -configure_file("${CMAKE_CURRENT_LIST_DIR}/src/celix_err_constants.h.in" "${CMAKE_BINARY_DIR}/celix/gen/includes/utils/celix_err_constants.h" @ONLY) - -install(TARGETS utils EXPORT celix LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/utils) -install(DIRECTORY include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/utils/ - COMPONENT framework PATTERN memstream* EXCLUDE) -install(DIRECTORY ${CMAKE_BINARY_DIR}/celix/gen/includes/utils/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/utils/ - COMPONENT framework) - -if (CELIX_INSTALL_DEPRECATED_API) - install(DIRECTORY include_deprecated/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/utils COMPONENT framework) -endif () - -#Alias setup to match external usage -add_library(Celix::utils ALIAS utils) - - -if (ENABLE_TESTING) - add_library(utils_cut STATIC ${UTILS_SRC}) - target_include_directories(utils_cut PUBLIC - ${CMAKE_CURRENT_LIST_DIR}/include - ${MEMSTREAM_INCLUDE_DIR} - ${CMAKE_BINARY_DIR}/celix/gen/includes/utils - src include_deprecated - ) - target_link_libraries(utils_cut PUBLIC ${UTILS_PUBLIC_DEPS} ${UTILS_PRIVATE_DEPS}) - - if (CELIX_CXX17) #utils tests are C++17 - add_subdirectory(gtest) +celix_subproject(UTILS "Option to enable building the Utilities library" ON) +if (UTILS) + find_package(libzip REQUIRED) + + set(MEMSTREAM_SOURCES ) + set(MEMSTREAM_INCLUDES ) + include(CheckFunctionExists) + #check_function_exists(fmemopen FMEMOPEN_EXISTS) + check_function_exists(open_memstream OPEN_MEMSTREAM_EXISTS) + if (NOT OPEN_MEMSTREAM_EXISTS) + set(MEMSTREAM_SOURCES src/memstream/open_memstream.c src/memstream/fmemopen.c ${MEMSTREAM_SOURCES}) + set(MEMSTREAM_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/include/memstream ${MEMSTREAM_INCLUDE_DIR}) + install(DIRECTORY include/memstream/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/memstream COMPONENT framework) endif() - find_package(CppUTest) - - if (CppUTest_FOUND) - include_directories(SYSTEM PRIVATE ${CppUTest_INCLUDE_DIR}) - include_directories(include) - include_directories(src) - - add_executable(hash_map_test private/test/hash_map_test.cpp) - target_include_directories(hash_map_test PRIVATE include_deprecated) - target_link_libraries(hash_map_test utils_cut CppUTest::CppUTest pthread) - - add_executable(array_list_test private/test/array_list_test.cpp) - target_include_directories(array_list_test PRIVATE include_deprecated) - target_link_libraries(array_list_test utils_cut CppUTest::CppUTest pthread) - - add_executable(linked_list_test private/test/linked_list_test.cpp) - target_include_directories(linked_list_test PRIVATE include_deprecated) - target_link_libraries(linked_list_test utils_cut CppUTest::CppUTest pthread) - - add_executable(properties_test private/test/properties_test.cpp) - target_include_directories(properties_test PRIVATE include_deprecated) - target_link_libraries(properties_test CppUTest::CppUTest CppUTest::CppUTestExt utils_cut pthread) - - add_executable(ip_utils_test private/test/ip_utils_test.cpp) - target_include_directories(ip_utils_test PRIVATE include_deprecated) - target_link_libraries(ip_utils_test CppUTest::CppUTest utils_cut pthread) - - add_executable(version_test private/test/version_test.cpp) - target_include_directories(version_test PRIVATE include_deprecated) - target_link_libraries(version_test CppUTest::CppUTest utils_cut pthread) + set(UTILS_SRC + src/array_list.c + src/hash_map.c + src/linked_list.c + src/linked_list_iterator.c + src/celix_threads.c + src/version.c + src/version_range.c + src/properties.c + src/utils.c + src/ip_utils.c + src/filter.c + src/celix_log_level.c + src/celix_log_utils.c + src/celix_hash_map.c + src/celix_file_utils.c + src/celix_convert_utils.c + src/celix_errno.c + src/celix_err.c + ${MEMSTREAM_SOURCES} + ) + set(UTILS_PRIVATE_DEPS libzip::libzip) + set(UTILS_PUBLIC_DEPS) + add_library(utils SHARED ${UTILS_SRC}) - if (LINKER_WRAP_SUPPORTED) - add_executable(version_ei_test private/test/version_ei_test.cc) - target_include_directories(version_ei_test PRIVATE include_deprecated) - target_link_libraries(version_ei_test CppUTest::CppUTest utils_cut Celix::malloc_ei Celix::utils_ei pthread) - add_test(NAME version_ei_test COMMAND version_ei_test) - endif () + set_target_properties(utils + PROPERTIES + C_VISIBILITY_PRESET hidden + SOVERSION ${CELIX_MAJOR} + OUTPUT_NAME "celix_utils") - configure_file(private/resources-test/properties.txt ${CMAKE_CURRENT_BINARY_DIR}/resources-test/properties.txt COPYONLY) + if (NOT OPEN_MEMSTREAM_EXISTS) + target_compile_definitions(utils PUBLIC -DCELIX_UTILS_NO_MEMSTREAM_AVAILABLE) + endif () - add_test(NAME run_array_list_test COMMAND array_list_test) - add_test(NAME run_hash_map_test COMMAND hash_map_test) - add_test(NAME run_linked_list_test COMMAND linked_list_test) - add_test(NAME run_properties_test COMMAND properties_test) - add_test(NAME run_ip_utils_test COMMAND ip_utils_test) - add_test(NAME version_test COMMAND version_test) + if (ANDROID) + target_compile_definitions(utils PRIVATE -DUSE_FILE32API) + endif () - setup_target_for_coverage(array_list_test) - setup_target_for_coverage(hash_map_test) - setup_target_for_coverage(linked_list_test) - setup_target_for_coverage(properties_test) - setup_target_for_coverage(ip_utils_test) - setup_target_for_coverage(version_test) - else () - message(WARNING "Cannot find CppUTest, deprecated cpputest-based unit test will not be added") - endif () #end CppUTest_FOUND + if (NOT APPLE) + set(UTILS_PUBLIC_DEPS ${UTILS_PUBLIC_DEPS} rt) + endif () + target_include_directories(utils PUBLIC + $ + $ + ) + target_include_directories(utils PRIVATE src include_deprecated) + IF(UNIX AND NOT ANDROID) + set(UTILS_PRIVATE_DEPS ${UTILS_PRIVATE_DEPS} m pthread) + ELSEIF(ANDROID) + set(UTILS_PRIVATE_DEPS ${UTILS_PRIVATE_DEPS} m) + ENDIF() + + target_link_libraries(utils PUBLIC ${UTILS_PUBLIC_DEPS} PRIVATE ${UTILS_PRIVATE_DEPS}) + generate_export_header(utils + BASE_NAME "CELIX_UTILS" + EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/celix/gen/includes/utils/celix_utils_export.h") + target_include_directories(utils PUBLIC $) + + #Configure celix_err_constant header file + set(CELIX_ERR_BUFFER_SIZE 512 CACHE STRING "The size of the thread-specific buffer used for library error messages") + configure_file("${CMAKE_CURRENT_LIST_DIR}/src/celix_err_constants.h.in" "${CMAKE_BINARY_DIR}/celix/gen/includes/utils/celix_err_constants.h" @ONLY) + + install(TARGETS utils EXPORT celix LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/utils) + install(DIRECTORY include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/utils/ + COMPONENT framework PATTERN memstream* EXCLUDE) + install(DIRECTORY ${CMAKE_BINARY_DIR}/celix/gen/includes/utils/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/utils/ + COMPONENT framework) + + if (CELIX_INSTALL_DEPRECATED_API) + install(DIRECTORY include_deprecated/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix/utils COMPONENT framework) + endif () + + #Alias setup to match external usage + add_library(Celix::utils ALIAS utils) + + if (ENABLE_TESTING AND LINKER_WRAP_SUPPORTED) + add_subdirectory(error_injector) + endif () + + if (ENABLE_TESTING) + add_library(utils_cut STATIC ${UTILS_SRC}) + target_include_directories(utils_cut PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/include + ${MEMSTREAM_INCLUDE_DIR} + ${CMAKE_BINARY_DIR}/celix/gen/includes/utils + src include_deprecated + ) + target_link_libraries(utils_cut PUBLIC ${UTILS_PUBLIC_DEPS} ${UTILS_PRIVATE_DEPS}) + + if (CELIX_CXX17) #utils tests are C++17 + add_subdirectory(gtest) + endif() + + find_package(CppUTest) + + if (CppUTest_FOUND) + include_directories(SYSTEM PRIVATE ${CppUTest_INCLUDE_DIR}) + include_directories(include) + include_directories(src) + + add_executable(hash_map_test private/test/hash_map_test.cpp) + target_include_directories(hash_map_test PRIVATE include_deprecated) + target_link_libraries(hash_map_test utils_cut CppUTest::CppUTest pthread) + + add_executable(array_list_test private/test/array_list_test.cpp) + target_include_directories(array_list_test PRIVATE include_deprecated) + target_link_libraries(array_list_test utils_cut CppUTest::CppUTest pthread) + + add_executable(linked_list_test private/test/linked_list_test.cpp) + target_include_directories(linked_list_test PRIVATE include_deprecated) + target_link_libraries(linked_list_test utils_cut CppUTest::CppUTest pthread) + + add_executable(properties_test private/test/properties_test.cpp) + target_include_directories(properties_test PRIVATE include_deprecated) + target_link_libraries(properties_test CppUTest::CppUTest CppUTest::CppUTestExt utils_cut pthread) + + add_executable(ip_utils_test private/test/ip_utils_test.cpp) + target_include_directories(ip_utils_test PRIVATE include_deprecated) + target_link_libraries(ip_utils_test CppUTest::CppUTest utils_cut pthread) + + add_executable(version_test private/test/version_test.cpp) + target_include_directories(version_test PRIVATE include_deprecated) + target_link_libraries(version_test CppUTest::CppUTest utils_cut pthread) + + + if (LINKER_WRAP_SUPPORTED) + add_executable(version_ei_test private/test/version_ei_test.cc) + target_include_directories(version_ei_test PRIVATE include_deprecated) + target_link_libraries(version_ei_test CppUTest::CppUTest utils_cut Celix::malloc_ei Celix::utils_ei pthread) + add_test(NAME version_ei_test COMMAND version_ei_test) + endif () + + configure_file(private/resources-test/properties.txt ${CMAKE_CURRENT_BINARY_DIR}/resources-test/properties.txt COPYONLY) + + add_test(NAME run_array_list_test COMMAND array_list_test) + add_test(NAME run_hash_map_test COMMAND hash_map_test) + add_test(NAME run_linked_list_test COMMAND linked_list_test) + add_test(NAME run_properties_test COMMAND properties_test) + add_test(NAME run_ip_utils_test COMMAND ip_utils_test) + add_test(NAME version_test COMMAND version_test) + + setup_target_for_coverage(array_list_test) + setup_target_for_coverage(hash_map_test) + setup_target_for_coverage(linked_list_test) + setup_target_for_coverage(properties_test) + setup_target_for_coverage(ip_utils_test) + setup_target_for_coverage(version_test) + else () + message(WARNING "Cannot find CppUTest, deprecated cpputest-based unit test will not be added") + endif () #end CppUTest_FOUND + + endif () + + add_subdirectory(benchmark) endif () - -add_subdirectory(benchmark) diff --git a/libs/utils/error_injector/CMakeLists.txt b/libs/utils/error_injector/CMakeLists.txt new file mode 100644 index 000000000..e055e028c --- /dev/null +++ b/libs/utils/error_injector/CMakeLists.txt @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +add_subdirectory(celix_array_list) +add_subdirectory(celix_hash_map) +add_subdirectory(celix_long_hash_map) +add_subdirectory(celix_properties) +add_subdirectory(celix_threads) +add_subdirectory(celix_utils) +add_subdirectory(celix_version) +add_subdirectory(zip) \ No newline at end of file diff --git a/libs/error_injector/celix_array_list/CMakeLists.txt b/libs/utils/error_injector/celix_array_list/CMakeLists.txt similarity index 94% rename from libs/error_injector/celix_array_list/CMakeLists.txt rename to libs/utils/error_injector/celix_array_list/CMakeLists.txt index 9954bf005..24fb126df 100644 --- a/libs/error_injector/celix_array_list/CMakeLists.txt +++ b/libs/utils/error_injector/celix_array_list/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(array_list_ei STATIC src/celix_array_list_ei.cc) -target_include_directories(array_list_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(array_list_ei PUBLIC include) target_link_libraries(array_list_ei PUBLIC Celix::error_injector Celix::utils) target_link_options(array_list_ei INTERFACE LINKER:--wrap,celix_arrayList_create diff --git a/libs/error_injector/celix_array_list/include/celix_array_list_ei.h b/libs/utils/error_injector/celix_array_list/include/celix_array_list_ei.h similarity index 100% rename from libs/error_injector/celix_array_list/include/celix_array_list_ei.h rename to libs/utils/error_injector/celix_array_list/include/celix_array_list_ei.h diff --git a/libs/error_injector/celix_array_list/src/celix_array_list_ei.cc b/libs/utils/error_injector/celix_array_list/src/celix_array_list_ei.cc similarity index 100% rename from libs/error_injector/celix_array_list/src/celix_array_list_ei.cc rename to libs/utils/error_injector/celix_array_list/src/celix_array_list_ei.cc diff --git a/libs/error_injector/celix_hash_map/CMakeLists.txt b/libs/utils/error_injector/celix_hash_map/CMakeLists.txt similarity index 92% rename from libs/error_injector/celix_hash_map/CMakeLists.txt rename to libs/utils/error_injector/celix_hash_map/CMakeLists.txt index dbef2bb6d..25f87d49e 100644 --- a/libs/error_injector/celix_hash_map/CMakeLists.txt +++ b/libs/utils/error_injector/celix_hash_map/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(hash_map_ei STATIC src/celix_hash_map_ei.cc) -target_include_directories(hash_map_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(hash_map_ei PUBLIC include) target_link_libraries(hash_map_ei PUBLIC Celix::error_injector Celix::utils) target_link_options(hash_map_ei INTERFACE LINKER:--wrap,celix_stringHashMap_create diff --git a/libs/error_injector/celix_hash_map/include/celix_hash_map_ei.h b/libs/utils/error_injector/celix_hash_map/include/celix_hash_map_ei.h similarity index 100% rename from libs/error_injector/celix_hash_map/include/celix_hash_map_ei.h rename to libs/utils/error_injector/celix_hash_map/include/celix_hash_map_ei.h diff --git a/libs/error_injector/celix_hash_map/src/celix_hash_map_ei.cc b/libs/utils/error_injector/celix_hash_map/src/celix_hash_map_ei.cc similarity index 100% rename from libs/error_injector/celix_hash_map/src/celix_hash_map_ei.cc rename to libs/utils/error_injector/celix_hash_map/src/celix_hash_map_ei.cc diff --git a/libs/error_injector/celix_long_hash_map/CMakeLists.txt b/libs/utils/error_injector/celix_long_hash_map/CMakeLists.txt similarity index 92% rename from libs/error_injector/celix_long_hash_map/CMakeLists.txt rename to libs/utils/error_injector/celix_long_hash_map/CMakeLists.txt index 004eb71c5..ad3cb09c3 100644 --- a/libs/error_injector/celix_long_hash_map/CMakeLists.txt +++ b/libs/utils/error_injector/celix_long_hash_map/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(long_hash_map_ei STATIC src/celix_long_hash_map_ei.cc) -target_include_directories(long_hash_map_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(long_hash_map_ei PUBLIC include) target_link_libraries(long_hash_map_ei PUBLIC Celix::error_injector Celix::utils) target_link_options(long_hash_map_ei INTERFACE diff --git a/libs/error_injector/celix_long_hash_map/include/celix_long_hash_map_ei.h b/libs/utils/error_injector/celix_long_hash_map/include/celix_long_hash_map_ei.h similarity index 100% rename from libs/error_injector/celix_long_hash_map/include/celix_long_hash_map_ei.h rename to libs/utils/error_injector/celix_long_hash_map/include/celix_long_hash_map_ei.h diff --git a/libs/error_injector/celix_long_hash_map/src/celix_long_hash_map_ei.cc b/libs/utils/error_injector/celix_long_hash_map/src/celix_long_hash_map_ei.cc similarity index 100% rename from libs/error_injector/celix_long_hash_map/src/celix_long_hash_map_ei.cc rename to libs/utils/error_injector/celix_long_hash_map/src/celix_long_hash_map_ei.cc diff --git a/libs/error_injector/celix_properties/CMakeLists.txt b/libs/utils/error_injector/celix_properties/CMakeLists.txt similarity index 93% rename from libs/error_injector/celix_properties/CMakeLists.txt rename to libs/utils/error_injector/celix_properties/CMakeLists.txt index 3a8a7bfac..2ddcf2fd0 100644 --- a/libs/error_injector/celix_properties/CMakeLists.txt +++ b/libs/utils/error_injector/celix_properties/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(properties_ei STATIC src/celix_properties_ei.cc) -target_include_directories(properties_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(properties_ei PUBLIC include) target_link_libraries(properties_ei PUBLIC Celix::error_injector Celix::utils) # It plays nicely with address sanitizer this way. target_link_options(properties_ei INTERFACE diff --git a/libs/error_injector/celix_properties/include/celix_properties_ei.h b/libs/utils/error_injector/celix_properties/include/celix_properties_ei.h similarity index 100% rename from libs/error_injector/celix_properties/include/celix_properties_ei.h rename to libs/utils/error_injector/celix_properties/include/celix_properties_ei.h diff --git a/libs/error_injector/celix_properties/src/celix_properties_ei.cc b/libs/utils/error_injector/celix_properties/src/celix_properties_ei.cc similarity index 100% rename from libs/error_injector/celix_properties/src/celix_properties_ei.cc rename to libs/utils/error_injector/celix_properties/src/celix_properties_ei.cc diff --git a/libs/error_injector/celix_threads/CMakeLists.txt b/libs/utils/error_injector/celix_threads/CMakeLists.txt similarity index 94% rename from libs/error_injector/celix_threads/CMakeLists.txt rename to libs/utils/error_injector/celix_threads/CMakeLists.txt index 80327143e..ed97d3a58 100644 --- a/libs/error_injector/celix_threads/CMakeLists.txt +++ b/libs/utils/error_injector/celix_threads/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(threads_ei STATIC src/celix_threads_ei.cc) -target_include_directories(threads_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(threads_ei PUBLIC include) target_link_libraries(threads_ei PUBLIC Celix::error_injector Celix::utils) target_link_options(threads_ei INTERFACE diff --git a/libs/error_injector/celix_threads/include/celix_threads_ei.h b/libs/utils/error_injector/celix_threads/include/celix_threads_ei.h similarity index 100% rename from libs/error_injector/celix_threads/include/celix_threads_ei.h rename to libs/utils/error_injector/celix_threads/include/celix_threads_ei.h diff --git a/libs/error_injector/celix_threads/src/celix_threads_ei.cc b/libs/utils/error_injector/celix_threads/src/celix_threads_ei.cc similarity index 100% rename from libs/error_injector/celix_threads/src/celix_threads_ei.cc rename to libs/utils/error_injector/celix_threads/src/celix_threads_ei.cc diff --git a/libs/error_injector/celix_utils/CMakeLists.txt b/libs/utils/error_injector/celix_utils/CMakeLists.txt similarity index 94% rename from libs/error_injector/celix_utils/CMakeLists.txt rename to libs/utils/error_injector/celix_utils/CMakeLists.txt index f8873d5f9..651dab0af 100644 --- a/libs/error_injector/celix_utils/CMakeLists.txt +++ b/libs/utils/error_injector/celix_utils/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(utils_ei STATIC src/celix_utils_ei.cc) -target_include_directories(utils_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(utils_ei PUBLIC include) target_link_libraries(utils_ei PUBLIC Celix::error_injector Celix::utils) # It plays nicely with address sanitizer this way. target_link_options(utils_ei INTERFACE diff --git a/libs/error_injector/celix_utils/include/celix_utils_ei.h b/libs/utils/error_injector/celix_utils/include/celix_utils_ei.h similarity index 100% rename from libs/error_injector/celix_utils/include/celix_utils_ei.h rename to libs/utils/error_injector/celix_utils/include/celix_utils_ei.h diff --git a/libs/error_injector/celix_utils/src/celix_utils_ei.cc b/libs/utils/error_injector/celix_utils/src/celix_utils_ei.cc similarity index 100% rename from libs/error_injector/celix_utils/src/celix_utils_ei.cc rename to libs/utils/error_injector/celix_utils/src/celix_utils_ei.cc diff --git a/libs/error_injector/celix_version/CMakeLists.txt b/libs/utils/error_injector/celix_version/CMakeLists.txt similarity index 93% rename from libs/error_injector/celix_version/CMakeLists.txt rename to libs/utils/error_injector/celix_version/CMakeLists.txt index 45abfb400..a89f7d9d5 100644 --- a/libs/error_injector/celix_version/CMakeLists.txt +++ b/libs/utils/error_injector/celix_version/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(version_ei STATIC src/celix_version_ei.cc) -target_include_directories(version_ei PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +target_include_directories(version_ei PUBLIC include) target_link_libraries(version_ei PUBLIC Celix::error_injector Celix::utils) # It plays nicely with address sanitizer this way. target_link_options(version_ei INTERFACE diff --git a/libs/error_injector/celix_version/include/celix_version_ei.h b/libs/utils/error_injector/celix_version/include/celix_version_ei.h similarity index 100% rename from libs/error_injector/celix_version/include/celix_version_ei.h rename to libs/utils/error_injector/celix_version/include/celix_version_ei.h diff --git a/libs/error_injector/celix_version/src/celix_version_ei.cc b/libs/utils/error_injector/celix_version/src/celix_version_ei.cc similarity index 100% rename from libs/error_injector/celix_version/src/celix_version_ei.cc rename to libs/utils/error_injector/celix_version/src/celix_version_ei.cc diff --git a/libs/error_injector/zip/CMakeLists.txt b/libs/utils/error_injector/zip/CMakeLists.txt similarity index 93% rename from libs/error_injector/zip/CMakeLists.txt rename to libs/utils/error_injector/zip/CMakeLists.txt index d9689907a..858737564 100644 --- a/libs/error_injector/zip/CMakeLists.txt +++ b/libs/utils/error_injector/zip/CMakeLists.txt @@ -15,9 +15,10 @@ # 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) +target_include_directories(zip_ei PUBLIC include) target_link_libraries(zip_ei PUBLIC Celix::error_injector libzip::libzip) # It plays nicely with address sanitizer this way. diff --git a/libs/error_injector/zip/include/zip_ei.h b/libs/utils/error_injector/zip/include/zip_ei.h similarity index 100% rename from libs/error_injector/zip/include/zip_ei.h rename to libs/utils/error_injector/zip/include/zip_ei.h diff --git a/libs/error_injector/zip/src/zip_ei.cc b/libs/utils/error_injector/zip/src/zip_ei.cc similarity index 100% rename from libs/error_injector/zip/src/zip_ei.cc rename to libs/utils/error_injector/zip/src/zip_ei.cc diff --git a/misc/experimental/bundles/event_admin/CMakeLists.txt b/misc/experimental/bundles/event_admin/CMakeLists.txt index 288206995..89df1ed47 100644 --- a/misc/experimental/bundles/event_admin/CMakeLists.txt +++ b/misc/experimental/bundles/event_admin/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -celix_subproject(EVENT_ADMIN "Option to enable building the Event Admin Service bundles" OFF DEPS LAUNCHER LOG_SERVICE SHELL shell_tui) +celix_subproject(EVENT_ADMIN "Option to enable building the Event Admin Service bundles" OFF) if(EVENT_ADMIN) #add_subdirectory(utils) diff --git a/misc/experimental/bundles/pubsub_admin_nanomsg/CMakeLists.txt b/misc/experimental/bundles/pubsub_admin_nanomsg/CMakeLists.txt index 425a96939..27e808304 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