You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2019/12/09 19:56:45 UTC
[celix] 02/02: #128: updates openssl dependency handling.
This is an automated email from the ASF dual-hosted git repository.
pnoltes pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/celix.git
commit 6c0fcf277cbedf695ca8f33979715105b965e2cc
Author: Pepijn Noltes <pe...@gmail.com>
AuthorDate: Mon Dec 9 20:52:36 2019 +0100
#128: updates openssl dependency handling.
---
CMakeLists.txt | 7 +++++++
bundles/pubsub/test/CMakeLists.txt | 3 ++-
bundles/shell/shell/CMakeLists.txt | 1 -
libs/etcdlib/CMakeLists.txt | 5 ++---
libs/framework/CMakeLists.txt | 3 ++-
5 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e2ccde..5d96f25 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -99,6 +99,13 @@ endif()
# Default bundle version
set(DEFAULT_VERSION 1.0.0)
+option(CELIX_ADD_OPENSSL_DEP "Enabled building Celix framework & etcdlib with OpenSSL library dependency. This can help in some libcurl resolving issues" OFF)
+set(CELIX_OPTIONAL_EXTRA_LIBS "")
+if (CELIX_ADD_OPENSSL_DEP)
+ find_package(OpenSSL REQUIRED)
+ set(CELIX_OPTIONAL_EXTRA_LIBS "OpenSSL::lib")
+endif ()
+
#Libraries and Launcher
add_subdirectory(libs)
diff --git a/bundles/pubsub/test/CMakeLists.txt b/bundles/pubsub/test/CMakeLists.txt
index 365f77f..bad0441 100644
--- a/bundles/pubsub/test/CMakeLists.txt
+++ b/bundles/pubsub/test/CMakeLists.txt
@@ -122,7 +122,8 @@ add_celix_container(pubsub_udpmc_tests
)
target_link_libraries(pubsub_udpmc_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson Celix::dfi)
target_include_directories(pubsub_udpmc_tests PRIVATE ${CPPUTEST_INCLUDE_DIR} test)
-message(WARNING "TODO fix issues with UDPMC and reanble test again")
+
+#TODO fix issues with UDPMC and reanble test again
#add_test(NAME pubsub_udpmc_tests COMMAND pubsub_udpmc_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_udpmc_tests,CONTAINER_LOC>)
#SETUP_TARGET_FOR_COVERAGE(pubsub_udpmc_tests_cov pubsub_udpmc_tests ${CMAKE_BINARY_DIR}/coverage/pubsub_udpmc_tests/pubsub_udpmc_tests ..)
diff --git a/bundles/shell/shell/CMakeLists.txt b/bundles/shell/shell/CMakeLists.txt
index 6c0f22d..4d59345 100644
--- a/bundles/shell/shell/CMakeLists.txt
+++ b/bundles/shell/shell/CMakeLists.txt
@@ -17,7 +17,6 @@
celix_subproject(SHELL "Option to enable building the Shell bundles" ON DEPS LAUNCHER LOG_SERVICE)
if (SHELL)
find_package(CURL REQUIRED)
- find_package(OpenSSL REQUIRED)
add_library(shell_api INTERFACE)
target_include_directories(shell_api INTERFACE
diff --git a/libs/etcdlib/CMakeLists.txt b/libs/etcdlib/CMakeLists.txt
index 42ede14..7090630 100644
--- a/libs/etcdlib/CMakeLists.txt
+++ b/libs/etcdlib/CMakeLists.txt
@@ -40,7 +40,6 @@ endif ()
find_package(CURL REQUIRED)
find_package(Jansson REQUIRED)
-find_package(OpenSSL REQUIRED)
add_library(etcdlib SHARED
src/etcd.c
@@ -53,7 +52,7 @@ target_include_directories(etcdlib PRIVATE src)
set_target_properties(etcdlib PROPERTIES SOVERSION 1)
set_target_properties(etcdlib PROPERTIES VERSION 1.0.0)
-target_link_libraries(etcdlib PUBLIC CURL::libcurl Jansson)
+target_link_libraries(etcdlib PUBLIC CURL::libcurl Jansson ${CELIX_OPTIONAL_EXTRA_LIBS})
add_library(etcdlib_static STATIC
src/etcd.c
@@ -64,7 +63,7 @@ target_include_directories(etcdlib_static PUBLIC
)
target_include_directories(etcdlib_static PRIVATE src)
set_target_properties(etcdlib_static PROPERTIES "SOVERSION" 1)
-target_link_libraries(etcdlib_static PUBLIC CURL::libcurl Jansson)
+target_link_libraries(etcdlib_static PUBLIC CURL::libcurl 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)
diff --git a/libs/framework/CMakeLists.txt b/libs/framework/CMakeLists.txt
index d7da72e..88a8d08 100644
--- a/libs/framework/CMakeLists.txt
+++ b/libs/framework/CMakeLists.txt
@@ -41,7 +41,8 @@ target_include_directories(framework PUBLIC
)
target_compile_options(framework PRIVATE -DUSE_FILE32API)
set_target_properties(framework PROPERTIES "SOVERSION" 2)
-target_link_libraries(framework PUBLIC Celix::utils)
+
+target_link_libraries(framework PUBLIC Celix::utils ${CELIX_OPTIONAL_EXTRA_LIBS})
target_link_libraries(framework PUBLIC UUID::lib CURL::libcurl ZLIB::ZLIB)
install(TARGETS framework EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework)