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/10/08 13:21:48 UTC

[celix] 02/02: #118: Reverts some packge name changes and adds the creation of Jansson target.

This is an automated email from the ASF dual-hosted git repository.

pnoltes pushed a commit to branch feature/#80_bundle_start_with_exception
in repository https://gitbox.apache.org/repos/asf/celix.git

commit c44e2c6db69074e9e8f7defaf7aa1178b69e293f
Author: Pepijn Noltes <pe...@gmail.com>
AuthorDate: Tue Oct 8 15:21:27 2019 +0200

    #118: Reverts some packge name changes and adds the creation of Jansson target.
    
    Recent version of Jansson build and installed with CMake will create a
    Jansson (imported) CMake target. If this target is not present
    UseCelix.cmake will create this.
---
 bundles/pubsub/examples/CMakeLists.txt             |  2 +-
 bundles/pubsub/keygen/CMakeLists.txt               |  2 +-
 bundles/pubsub/pubsub_discovery/CMakeLists.txt     |  2 +-
 .../pubsub/pubsub_serializer_json/CMakeLists.txt   |  2 +-
 bundles/pubsub/test/CMakeLists.txt                 | 12 +++----
 .../remote_services/discovery_etcd/CMakeLists.txt  |  2 +-
 .../remote_service_admin_dfi/CMakeLists.txt        |  2 +-
 .../topology_manager/tms_tst/CMakeLists.txt        |  2 +-
 cmake/Modules/FindJansson.cmake                    | 39 +++++++++++-----------
 cmake/Modules/FindNanoMsg.cmake                    | 26 +++++++--------
 cmake/Modules/FindOpenSSL.cmake                    | 32 +++++++++---------
 cmake/cmake_celix/UseCelix.cmake                   | 20 ++++++++---
 libs/dfi/CMakeLists.txt                            |  4 +--
 libs/etcdlib/CMakeLists.txt                        |  6 ++--
 14 files changed, 82 insertions(+), 71 deletions(-)

diff --git a/bundles/pubsub/examples/CMakeLists.txt b/bundles/pubsub/examples/CMakeLists.txt
index cab7eef..ec7e5a9 100644
--- a/bundles/pubsub/examples/CMakeLists.txt
+++ b/bundles/pubsub/examples/CMakeLists.txt
@@ -22,7 +22,7 @@ find_program(XTERM_CMD NAMES xterm)
 
 find_package(Jansson REQUIRED)
 
-set(PUBSUB_CONTAINER_LIBS Jansson::lib Celix::dfi)
+set(PUBSUB_CONTAINER_LIBS Jansson Celix::dfi)
 
 # UDP Multicast
 add_celix_container(pubsub_publisher_udp_mc
diff --git a/bundles/pubsub/keygen/CMakeLists.txt b/bundles/pubsub/keygen/CMakeLists.txt
index a4b1a63..65db872 100644
--- a/bundles/pubsub/keygen/CMakeLists.txt
+++ b/bundles/pubsub/keygen/CMakeLists.txt
@@ -25,6 +25,6 @@ if (BUILD_ZMQ_SECURITY)
     target_link_libraries(makecert CZMQ::lib)
     
     add_executable(ed_file ed_file.c)
-    target_link_libraries(ed_file PUBLIC ZMQ::lib CZMQ::lib ${OPENSSL_CRYPTO_LIBRARY})
+    target_link_libraries(ed_file PUBLIC ZMQ::lib CZMQ::lib OpenSSL::lib)
 
 endif()
diff --git a/bundles/pubsub/pubsub_discovery/CMakeLists.txt b/bundles/pubsub/pubsub_discovery/CMakeLists.txt
index 54896e4..5da7041 100644
--- a/bundles/pubsub/pubsub_discovery/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_discovery/CMakeLists.txt
@@ -30,7 +30,7 @@ target_include_directories(celix_pubsub_discovery_etcd PRIVATE src)
 target_link_libraries(celix_pubsub_discovery_etcd PRIVATE
         Celix::pubsub_spi Celix::framework Celix::etcdlib_static
         Celix::shell_api Celix::log_helper
-        CURL::libcurl Jansson::lib)
+        CURL::libcurl Jansson)
 
 install_celix_bundle(celix_pubsub_discovery_etcd EXPORT celix COMPONENT pubsub)
 
diff --git a/bundles/pubsub/pubsub_serializer_json/CMakeLists.txt b/bundles/pubsub/pubsub_serializer_json/CMakeLists.txt
index 84c250f..163d8ff 100644
--- a/bundles/pubsub/pubsub_serializer_json/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_serializer_json/CMakeLists.txt
@@ -30,7 +30,7 @@ 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::pubsub_spi Celix::framework Celix::dfi Jansson::lib Celix::log_helper)
+target_link_libraries(celix_pubsub_serializer_json PRIVATE Celix::pubsub_spi Celix::framework Celix::dfi Jansson Celix::log_helper)
 
 install_celix_bundle(celix_pubsub_serializer_json EXPORT celix COMPONENT pubsub)
 
diff --git a/bundles/pubsub/test/CMakeLists.txt b/bundles/pubsub/test/CMakeLists.txt
index 36b4a8f..365f77f 100644
--- a/bundles/pubsub/test/CMakeLists.txt
+++ b/bundles/pubsub/test/CMakeLists.txt
@@ -120,7 +120,7 @@ add_celix_container(pubsub_udpmc_tests
             pubsub_sut
             pubsub_tst
 )
-target_link_libraries(pubsub_udpmc_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson::lib Celix::dfi)
+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")
 #add_test(NAME pubsub_udpmc_tests COMMAND pubsub_udpmc_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_udpmc_tests,CONTAINER_LOC>)
@@ -141,7 +141,7 @@ add_celix_container(pubsub_tcp_tests
         pubsub_sut
         pubsub_tst
         )
-target_link_libraries(pubsub_tcp_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson::lib Celix::dfi)
+target_link_libraries(pubsub_tcp_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson Celix::dfi)
 target_include_directories(pubsub_tcp_tests PRIVATE ${CPPUTEST_INCLUDE_DIR} test)
 add_test(NAME pubsub_tcp_tests COMMAND pubsub_tcp_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_tcp_tests,CONTAINER_LOC>)
 SETUP_TARGET_FOR_COVERAGE(pubsub_tcp_tests_cov pubsub_tcp_tests ${CMAKE_BINARY_DIR}/coverage/pubsub_tcp_tests/pubsub_tcp_tests ..)
@@ -163,7 +163,7 @@ add_celix_container(pubsub_tcp_endpoint_tests
         pubsub_endpoint_sut
         pubsub_endpoint_tst
         )
-target_link_libraries(pubsub_tcp_endpoint_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson::lib Celix::dfi)
+target_link_libraries(pubsub_tcp_endpoint_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson Celix::dfi)
 target_include_directories(pubsub_tcp_endpoint_tests PRIVATE ${CPPUTEST_INCLUDE_DIR} test)
 
 #TCP Endpoint test is disabled because the test is not stable when running on Travis
@@ -188,7 +188,7 @@ add_celix_container(pubsub_websocket_tests
             pubsub_sut
             pubsub_tst
 )
-target_link_libraries(pubsub_websocket_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson::lib Celix::dfi)
+target_link_libraries(pubsub_websocket_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson Celix::dfi)
 target_include_directories(pubsub_websocket_tests PRIVATE ${CPPUTEST_INCLUDE_DIR} test)
 add_test(NAME pubsub_websocket_tests COMMAND pubsub_websocket_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_websocket_tests,CONTAINER_LOC>)
 SETUP_TARGET_FOR_COVERAGE(pubsub_websocket_tests_cov pubsub_websocket_tests ${CMAKE_BINARY_DIR}/coverage/pubsub_websocket_tests/pubsub_websocket_tests ..)
@@ -208,7 +208,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
                 pubsub_tst
     )
 
-    target_link_libraries(pubsub_zmq_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson::lib Celix::dfi)
+    target_link_libraries(pubsub_zmq_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson Celix::dfi)
     target_include_directories(pubsub_zmq_tests PRIVATE ${CPPUTEST_INCLUDE_DIR} test)
     add_test(NAME pubsub_zmq_tests COMMAND pubsub_zmq_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_zmq_tests,CONTAINER_LOC>)
     SETUP_TARGET_FOR_COVERAGE(pubsub_zmq_tests_cov pubsub_zmq_tests ${CMAKE_BINARY_DIR}/coverage/pubsub_zmq_tests/pubsub_zmq_tests ..)
@@ -228,7 +228,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
                 pubsub_sut
                 pubsub_tst
     )
-    target_link_libraries(pubsub_zmq_zerocopy_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson::lib Celix::dfi)
+    target_link_libraries(pubsub_zmq_zerocopy_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} Jansson Celix::dfi)
     target_include_directories(pubsub_zmq_zerocopy_tests PRIVATE ${CPPUTEST_INCLUDE_DIR} test)
     add_test(NAME pubsub_zmq_zerocopy_tests COMMAND pubsub_zmq_zerocopy_tests WORKING_DIRECTORY $<TARGET_PROPERTY:pubsub_zmq_zerocopy_tests,CONTAINER_LOC>)
     SETUP_TARGET_FOR_COVERAGE(pubsub_zmq_zerocopy_tests_cov pubsub_zmq_zerocopy_tests ${CMAKE_BINARY_DIR}/coverage/pubsub_zmq_tests/pubsub_zmq_zerocopy_tests ..)
diff --git a/bundles/remote_services/discovery_etcd/CMakeLists.txt b/bundles/remote_services/discovery_etcd/CMakeLists.txt
index a6fce5b..41e6f83 100644
--- a/bundles/remote_services/discovery_etcd/CMakeLists.txt
+++ b/bundles/remote_services/discovery_etcd/CMakeLists.txt
@@ -43,7 +43,7 @@ if (RSA_DISCOVERY_ETCD)
 			${CURL_INCLUDE_DIR}
 			${LIBXML2_INCLUDE_DIR}
 	)
-	target_link_libraries(rsa_discovery_etcd PRIVATE CURL::libcurl ${LIBXML2_LIBRARIES} Jansson::lib)
+	target_link_libraries(rsa_discovery_etcd PRIVATE CURL::libcurl ${LIBXML2_LIBRARIES} Jansson)
 
 	install_celix_bundle(rsa_discovery_etcd EXPORT celix COMPONENT rsa)
 	#Setup target aliases to match external usage
diff --git a/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt b/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt
index bffb937..eccf62c 100644
--- a/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt
+++ b/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt
@@ -45,7 +45,7 @@ if (RSA_REMOTE_SERVICE_ADMIN_DFI)
             Celix::log_helper
             Celix::rsa_common
             CURL::libcurl
-            Jansson::lib
+            Jansson
     )
 
     if (ENABLE_TESTING)
diff --git a/bundles/remote_services/topology_manager/tms_tst/CMakeLists.txt b/bundles/remote_services/topology_manager/tms_tst/CMakeLists.txt
index 22b4377..8339f7c 100644
--- a/bundles/remote_services/topology_manager/tms_tst/CMakeLists.txt
+++ b/bundles/remote_services/topology_manager/tms_tst/CMakeLists.txt
@@ -41,7 +41,7 @@ target_include_directories(test_tm_scoped PRIVATE ../src ../include)
 target_link_libraries(test_tm_scoped PRIVATE
         Celix::framework
         ${CPPUTEST_LIBRARY}
-        Jansson::lib
+        Jansson
         calculator_api
         Celix::rsa_common
 )
diff --git a/cmake/Modules/FindJansson.cmake b/cmake/Modules/FindJansson.cmake
index 1235da9..45ee311 100644
--- a/cmake/Modules/FindJansson.cmake
+++ b/cmake/Modules/FindJansson.cmake
@@ -18,41 +18,40 @@
 
 # - Try to find Jansson
 # Once done this will define
-#  Jansson - System has Jansson
-#  Jansson_INCLUDE_DIRS - The Jansson include directories
-#  Jansson_LIBRARIES - The libraries needed to use Jansson
-#  Jansson_DEFINITIONS - Compiler switches required for using Jansson
-#  Jansson::lib - Imported target for Jansson
+#  JANSSON_FOUND - System has Jansson
+#  JANSSON_INCLUDE_DIRS - The Jansson include directories
+#  JANSSON_LIBRARIES - The libraries needed to use Jansson
+#  Jansson - Imported target for Jansson
 
-find_path(Jansson_INCLUDE_DIR jansson.h
+find_path(JANSSON_INCLUDE_DIR jansson.h
           /usr/include
           /usr/local/include )
 
-find_library(Jansson_LIBRARY NAMES jansson
+find_library(JANSSON_LIBRARY NAMES jansson
              PATHS /usr/lib /usr/local/lib )
 
-set(Jansson_LIBRARIES ${Jansson_LIBRARY} )
-set(Jansson_INCLUDE_DIRS ${Jansson_INCLUDE_DIR} )
+set(JANSSON_LIBRARIES ${JANSSON_LIBRARY} )
+set(JANSSON_INCLUDE_DIRS ${JANSSON_INCLUDE_DIR} )
 
 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set JANSSON_FOUND to TRUE
 # if all listed variables are TRUE
 find_package_handle_standard_args(Jansson  DEFAULT_MSG
-                                  Jansson_LIBRARY Jansson_INCLUDE_DIR)
+                                  JANSSON_LIBRARY JANSSON_INCLUDE_DIR)
 
-mark_as_advanced(Jansson_INCLUDE_DIR Jansson_LIBRARY)
+mark_as_advanced(JANSSON_INCLUDE_DIR JANSSON_LIBRARY)
 
-if (Jansson_FOUND AND NOT TARGET Jansson::lib)
-    add_library(Jansson::lib SHARED IMPORTED)
-    set_target_properties(Jansson::lib PROPERTIES
-            IMPORTED_LOCATION "${Jansson_LIBRARY}"
-            INTERFACE_INCLUDE_DIRECTORIES "${Jansson_INCLUDE_DIR}"
+if (JANSSON_FOUND AND NOT TARGET Jansson)
+    add_library(Jansson SHARED IMPORTED)
+    set_target_properties(Jansson PROPERTIES
+            IMPORTED_LOCATION "${JANSSON_LIBRARY}"
+            INTERFACE_INCLUDE_DIRECTORIES "${JANSSON_INCLUDE_DIR}"
     )
 
 endif ()
 
 #For backward compatability
-set(JANSSON_LIBRARY ${Jansson_LIBRARY})
-set(JANSSON_LIBRARIES ${Jansson_LIBRARY})
-set(JANSSON_INCLUDE_DIR ${Jansson_INCLUDE_DIR})
-set(JANSSON_INCLUDE_DIRS ${Jansson_INCLUDE_DIR})
+set(JANSSON_LIBRARY ${JANSSON_LIBRARY})
+set(JANSSON_LIBRARIES ${JANSSON_LIBRARY})
+set(JANSSON_INCLUDE_DIR ${JANSSON_INCLUDE_DIR})
+set(JANSSON_INCLUDE_DIRS ${JANSSON_INCLUDE_DIR})
diff --git a/cmake/Modules/FindNanoMsg.cmake b/cmake/Modules/FindNanoMsg.cmake
index a7578a7..9fdde2f 100644
--- a/cmake/Modules/FindNanoMsg.cmake
+++ b/cmake/Modules/FindNanoMsg.cmake
@@ -16,35 +16,35 @@
 # under the License.
 
 
-# - Try to find ZMQ
+# - Try to find NanoMsg
 # 	Once done this will define
-#  NanoMsg_FOUND - System has Nanomsg
-#  NanoMsg_INCLUDE_DIRS - The Nanomsg include directories
-#  NanoMsg_LIBRARIES - The libraries needed to use Nanomsg
+#  NANOMSG_FOUND - System has Nanomsg
+#  NANOMSG_INCLUDE_DIRS - The Nanomsg include directories
+#  NANOMSG_LIBRARIES - The libraries needed to use Nanomsg
 #  NanoMsg::lib - Imported target for Nanomsg
 
-find_path(NanoMsg_INCLUDE_DIR nanomsg/nn.h
+find_path(NANOMSG_INCLUDE_DIR nanomsg/nn.h
           /usr/include
           /usr/local/include )
 
-find_library(NanoMsg_LIBRARY NAMES nanomsg
+find_library(NANOMSG_LIBRARY NAMES nanomsg
              PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64 )
 
-set(NanoMsg_LIBRARIES ${NanoMsg_LIBRARY} )
-set(NanoMsg_INCLUDE_DIRS ${NanoMsg_INCLUDE_DIR} )
+set(NANOMSG_LIBRARIES ${NANOMSG_LIBRARY} )
+set(NANOMSG_INCLUDE_DIRS ${NANOMSG_INCLUDE_DIR} )
 
 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE
 # if all listed variables are TRUE
 find_package_handle_standard_args(NanoMsg  DEFAULT_MSG
-        NanoMsg_LIBRARY NanoMsg_INCLUDE_DIR)
+        NANOMSG_LIBRARY NANOMSG_INCLUDE_DIR)
 
-mark_as_advanced(NanoMsg_INCLUDE_DIR NanoMsg_LIBRARY )
+mark_as_advanced(NANOMSG_INCLUDE_DIR NANOMSG_LIBRARY )
 
-if (NanoMsg_FOUND AND NOT TARGET NanoMsg::lib)
+if (NANOMSG_FOUND AND NOT TARGET NanoMsg::lib)
     add_library(NanoMsg::lib SHARED IMPORTED)
     set_target_properties(NanoMsg::lib PROPERTIES
-            IMPORTED_LOCATION "${NanoMsg_LIBRARY}"
-            INTERFACE_INCLUDE_DIRECTORIES "${NanoMsg_INCLUDE_DIR}"
+            IMPORTED_LOCATION "${NANOMSG_LIBRARY}"
+            INTERFACE_INCLUDE_DIRECTORIES "${NANOMSG_INCLUDE_DIR}"
     )
 endif ()
\ No newline at end of file
diff --git a/cmake/Modules/FindOpenSSL.cmake b/cmake/Modules/FindOpenSSL.cmake
index 801546d..eefbfaf 100644
--- a/cmake/Modules/FindOpenSSL.cmake
+++ b/cmake/Modules/FindOpenSSL.cmake
@@ -18,38 +18,38 @@
 
 # - Try to find OpenSSL
 # Once done this will define
-#  OpenSSL_FOUND - System has OpenSSL
-#  OpenSSL_INCLUDE_DIRS - The OpenSSL include directories
-#  OpenSSL_LIBRARIES - The libraries needed to use OpenSSL
+#  OPENSSL_FOUND - System has OpenSSL
+#  OPENSSL_INCLUDE_DIRS - The OpenSSL include directories
+#  OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
 #  OpenSSL::lib - Imported target for OpenSSL
 
-find_path(OpenSSL_INCLUDE_DIR ssl.h crypto.h
+find_path(OPENSSL_INCLUDE_DIR ssl.h crypto.h
           /usr/include/openssl
           /usr/local/include/openssl 
           /usr/local/opt/openssl/include/openssl
-          ${OpenSSL_DIR}/include/openssl)
+          ${OPENSSL_DIR}/include/openssl)
 
-find_library(OpenSSL_LIBRARY NAMES ssl
-             PATHS /usr/lib /usr/local/lib  /usr/local/opt/openssl/lib ${OpenSSL_DIR}/lib)
+find_library(OPENSSL_LIBRARY NAMES ssl
+             PATHS /usr/lib /usr/local/lib  /usr/local/opt/openssl/lib ${OPENSSL_DIR}/lib)
 
-find_library(Crypto_LIBRARY NAMES crypto
-             PATHS /usr/lib /usr/local/lib  /usr/local/opt/openssl/lib ${OpenSSL_DIR}/lib)
+find_library(CRYPTO_LIBRARY NAMES crypto
+             PATHS /usr/lib /usr/local/lib  /usr/local/opt/openssl/lib ${OPENSSL_DIR}/lib)
 
-set(OPENSSL_LIBRARIES ${OpenSSL_LIBRARY} ${CRYPTO_LIBRARY})
-set(OPENSSL_INCLUDE_DIRS ${OpenSSL_INCLUDE_DIR})
+set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARY} ${CRYPTO_LIBRARY})
+set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
 
 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set OPENSSL_FOUND to TRUE
 # if all listed variables are TRUE
 find_package_handle_standard_args(OpenSSL  DEFAULT_MSG
-              OpenSSL_LIBRARY Crypto_LIBRARY OpenSSL_INCLUDE_DIR)
+              OPENSSL_LIBRARY CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
 
-mark_as_advanced(OpenSSL_INCLUDE_DIR OpenSSL_LIBRARY Crypto_LIBRARY)
+mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARY CRYPTO_LIBRARY)
 
-if (OpenSSL_FOUND AND NOT TARGET OpenSSL::lib)
+if (OPENSSL_FOUND AND NOT TARGET OpenSSL::lib)
     add_library(OpenSSL::lib SHARED IMPORTED)
     set_target_properties(OpenSSL::lib PROPERTIES
-            IMPORTED_LOCATION "${OpenSSL_LIBRARY};${Crypto_LIBRARY}"
-            INTERFACE_INCLUDE_DIRECTORIES "${OpenSSL_INCLUDE_DIR}"
+            IMPORTED_LOCATION "${OPENSSL_LIBRARY};${CRYPTO_LIBRARY}"
+            INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}"
     )
 endif ()
\ No newline at end of file
diff --git a/cmake/cmake_celix/UseCelix.cmake b/cmake/cmake_celix/UseCelix.cmake
index 84b2a2b..0e98b53 100644
--- a/cmake/cmake_celix/UseCelix.cmake
+++ b/cmake/cmake_celix/UseCelix.cmake
@@ -37,19 +37,31 @@ find_package(Jansson REQUIRED) #etcdlib, dfi
 find_package(FFI REQUIRED) #dfi
 
 if (NOT TARGET ZLIB::ZLIB)
-    message("Note ZLIB::ZLIB target not created by find_package(ZLIB). Creating one")
+    #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)
-    message("Note CURL::libcurl target not created by find_package(CURL). Creating one")
+    #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 ()
+
+if (NOT TARGET Jansson)
+    #Note if JanssonConfig is present on system this is not needed
+    message("Note Jansson target not created by find_package(Jansson). Creating Jansson Target.")
+    add_library(Jansson SHARED IMPORTED)
+    set_target_properties(Jansson PROPERTIES
+            IMPORTED_LOCATION "${JANSSON_LIBRARY}"
+            INTERFACE_INCLUDE_DIRECTORIES "${JANSSON_INCLUDE_DIR}"
+    )
 endif ()
diff --git a/libs/dfi/CMakeLists.txt b/libs/dfi/CMakeLists.txt
index 4f7aeac..3a18c1b 100644
--- a/libs/dfi/CMakeLists.txt
+++ b/libs/dfi/CMakeLists.txt
@@ -40,7 +40,7 @@ target_include_directories(dfi PUBLIC
 )
 
 target_link_libraries(dfi PRIVATE FFI::lib)
-target_link_libraries(dfi PUBLIC Jansson::lib)
+target_link_libraries(dfi PUBLIC Jansson)
 target_link_libraries(dfi PRIVATE Celix::utils)
 set_target_properties(dfi PROPERTIES "SOVERSION" 1)
 
@@ -68,7 +68,7 @@ if (ENABLE_TESTING)
 		test/run_tests.cpp
 	)
 
-    target_link_libraries(test_dfi PRIVATE Celix::dfi Celix::utils FFI::lib Jansson::lib ${CPPUTEST_LIBRARIES})
+    target_link_libraries(test_dfi PRIVATE Celix::dfi Celix::utils FFI::lib Jansson ${CPPUTEST_LIBRARIES})
 
     file(COPY ${CMAKE_CURRENT_LIST_DIR}/test/schemas DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
     file(COPY ${CMAKE_CURRENT_LIST_DIR}/test/descriptors DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/libs/etcdlib/CMakeLists.txt b/libs/etcdlib/CMakeLists.txt
index 98227f6..42ede14 100644
--- a/libs/etcdlib/CMakeLists.txt
+++ b/libs/etcdlib/CMakeLists.txt
@@ -53,7 +53,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::lib)
+target_link_libraries(etcdlib PUBLIC CURL::libcurl Jansson)
 
 add_library(etcdlib_static STATIC
     src/etcd.c
@@ -64,10 +64,10 @@ 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::lib)
+target_link_libraries(etcdlib_static PUBLIC CURL::libcurl Jansson)
 
 add_executable(etcdlib_test ${CMAKE_CURRENT_SOURCE_DIR}/test/etcdlib_test.c)
-target_link_libraries(etcdlib_test PRIVATE etcdlib_static CURL::libcurl Jansson::lib)
+target_link_libraries(etcdlib_test PRIVATE etcdlib_static CURL::libcurl Jansson)
 
 #TODO install etcdlib_static. For now left out, because the imported target leaks library paths
 install(DIRECTORY api/ DESTINATION include/etcdlib COMPONENT ${ETCDLIB_CMP})