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/02 18:46:33 UTC

[celix] 02/02: gh-118: Updates all Find.cmake to created imported CMake targets. Also updates all link/include usage to use imported targets.

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 67342d2f0c56c800c116a2cf58a048368b4c4307
Author: Pepijn Noltes <pe...@gmail.com>
AuthorDate: Wed Oct 2 20:44:52 2019 +0200

    gh-118: Updates all Find<PKG>.cmake to created imported CMake targets. Also updates all link/include usage to use imported targets.
---
 CMakeLists.txt                                     |  2 +-
 bundles/deployment_admin/CMakeLists.txt            |  7 +--
 bundles/pubsub/examples/CMakeLists.txt             |  6 +--
 bundles/pubsub/keygen/CMakeLists.txt               | 10 ++--
 bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt     |  4 +-
 bundles/pubsub/pubsub_admin_udp_mc/CMakeLists.txt  |  1 -
 .../pubsub/pubsub_admin_websocket/CMakeLists.txt   |  8 ---
 bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt     | 12 +----
 bundles/pubsub/pubsub_discovery/CMakeLists.txt     |  6 +--
 .../pubsub/pubsub_serializer_json/CMakeLists.txt   |  3 +-
 bundles/pubsub/pubsub_spi/CMakeLists.txt           |  8 +--
 .../pubsub/pubsub_topology_manager/CMakeLists.txt  |  8 +--
 bundles/pubsub/test/CMakeLists.txt                 | 12 ++---
 .../discovery_configured/CMakeLists.txt            |  2 +-
 .../remote_services/discovery_etcd/CMakeLists.txt  |  3 +-
 .../remote_services/discovery_shm/CMakeLists.txt   |  2 +-
 .../remote_service_admin_dfi/CMakeLists.txt        | 11 ++--
 .../remote_service_admin_dfi/test/CMakeLists.txt   |  2 +-
 .../remote_service_admin_shm/CMakeLists.txt        |  3 +-
 .../private/test/CMakeLists.txt                    |  2 +-
 .../topology_manager/CMakeLists.txt                |  1 -
 .../topology_manager/tms_tst/CMakeLists.txt        |  2 +-
 bundles/shell/shell/CMakeLists.txt                 |  3 +-
 cmake/CelixConfig.cmake                            | 28 ++++++++++
 cmake/Modules/FindCZMQ.cmake                       | 11 +++-
 cmake/Modules/FindFFI.cmake                        | 61 ++++++++++------------
 cmake/Modules/FindJansson.cmake                    | 12 ++++-
 cmake/Modules/FindNanoMsg.cmake                    | 16 ++++--
 cmake/Modules/FindOpenSSL.cmake                    |  9 ++++
 cmake/Modules/FindSlp.cmake                        | 42 ---------------
 cmake/Modules/FindSyslog.cmake                     | 13 +++++
 cmake/Modules/FindUUID.cmake                       | 48 +++++++++++------
 cmake/Modules/FindZMQ.cmake                        |  9 ++++
 libs/dfi/CMakeLists.txt                            | 11 ++--
 libs/etcdlib/CMakeLists.txt                        | 14 ++---
 libs/framework/CMakeLists.txt                      | 15 ++----
 .../framework/include/celix/dm/DependencyManager.h | 11 +++-
 libs/framework/tst/CMakeLists.txt                  |  2 +-
 .../bundles/pubsub_admin_nanomsg/CMakeLists.txt    |  4 +-
 39 files changed, 206 insertions(+), 218 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ba7bfe7..8e2ccde 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,7 @@ IF (ANDROID)
     set(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall ${CMAKE_C_FLAGS}")
 ELSE ()
     set(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -fPIC ${CMAKE_C_FLAGS}")
-    set(CMAKE_CXX_FLAGS "-std=c++11 -fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-std=c++11 -fno-rtti ${CMAKE_CXX_FLAGS}")
     set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}")
     set(CMAKE_CXX_FLAGS "-Wall -Wextra -Weffc++ ${CMAKE_CXX_FLAGS}")
     set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG ${CMAKE_C_FLAGS}")
diff --git a/bundles/deployment_admin/CMakeLists.txt b/bundles/deployment_admin/CMakeLists.txt
index 08c7f0b..5bc52a9 100644
--- a/bundles/deployment_admin/CMakeLists.txt
+++ b/bundles/deployment_admin/CMakeLists.txt
@@ -23,10 +23,6 @@ if (DEPLOYMENT_ADMIN)
     find_package(UUID REQUIRED)
     find_package(ZLIB REQUIRED)
 
-    if (NOT UUID_LIBRARY)
-        set(UUID_LIBRARY "")
-    endif ()
-
     add_library(deployment_admin_api INTERFACE)
     target_include_directories(deployment_admin_api INTERFACE 
 	    $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/api>
@@ -51,8 +47,7 @@ if (DEPLOYMENT_ADMIN)
     )
 
     target_compile_definitions(deployment_admin PRIVATE -DUSE_FILE32API)
-    target_link_libraries(deployment_admin PRIVATE ${CURL_LIBRARY} ${UUID_LIBRARY} ${ZLIB_LIBRARIES} ${OPENSLL_LIBRARY} deployment_admin_api)
-    target_include_directories(deployment_admin PRIVATE ${CURL_INCLUDE_DIRS})
+    target_link_libraries(deployment_admin PRIVATE CURL::libcurl UUID::lib ZLIB::ZLIB deployment_admin_api)
 
     install(TARGETS deployment_admin_api EXPORT celix COMPONENT deployment_admin)
     install(DIRECTORY api/ DESTINATION include/celix/deployment_admin COMPONENT deployment_admin)
diff --git a/bundles/pubsub/examples/CMakeLists.txt b/bundles/pubsub/examples/CMakeLists.txt
index e6b8cad..dc71b77 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_LIBRARY} Celix::dfi)
+set(PUBSUB_CONTAINER_LIBS JANSSON::lib Celix::dfi)
 
 # UDP Multicast
 add_celix_container(pubsub_publisher_udp_mc
@@ -170,7 +170,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
     find_package(ZMQ REQUIRED)
     find_package(CZMQ REQUIRED)
 
-    set(PUBSUB_CONTAINER_LIBS ${PUBSUB_CONTAINER_LIBS} ${ZMQ_LIBRARIES} ${CZMQ_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARY})
+    set(PUBSUB_CONTAINER_LIBS ${PUBSUB_CONTAINER_LIBS} ZMQ::lib CZMQ::lib OPENSSL::lib)
 
     # Dynamic ZMQ / UDP / TCP admin
     add_celix_container(pubsub_publisher
@@ -304,7 +304,7 @@ if (BUILD_PUBSUB_PSA_ZMQ)
 endif()
 
 if (BUILD_PUBSUB_PSA_NANOMSG)
-    set(PUBSUB_CONTAINER_LIBS ${NANOMSG_LIBRARIES} ${PUBSUB_CONTAINER_LIBS})
+    set(PUBSUB_CONTAINER_LIBS NANOMSG::lib ${PUBSUB_CONTAINER_LIBS})
 
     add_celix_container(pubsub_publisher1_nanomsg
         GROUP "pubsub"
diff --git a/bundles/pubsub/keygen/CMakeLists.txt b/bundles/pubsub/keygen/CMakeLists.txt
index 991648e..a4b1a63 100644
--- a/bundles/pubsub/keygen/CMakeLists.txt
+++ b/bundles/pubsub/keygen/CMakeLists.txt
@@ -20,15 +20,11 @@ if (BUILD_ZMQ_SECURITY)
     find_package(ZMQ REQUIRED)
     find_package(CZMQ REQUIRED)
     find_package(OpenSSL 1.1.0 REQUIRED)
-    
-    include_directories("${ZMQ_INCLUDE_DIR}")
-    include_directories("${CZMQ_INCLUDE_DIR}")
-    include_directories("${OPENSSL_INCLUDE_DIR}")
-    
+
     add_executable(makecert makecert.c)
-    target_link_libraries(makecert ${CZMQ_LIBRARIES})
+    target_link_libraries(makecert CZMQ::lib)
     
     add_executable(ed_file ed_file.c)
-    target_link_libraries(ed_file ${ZMQ_LIBRARIES} ${CZMQ_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARY})
+    target_link_libraries(ed_file PUBLIC ZMQ::lib CZMQ::lib ${OPENSSL_CRYPTO_LIBRARY})
 
 endif()
diff --git a/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt b/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt
index 0fd4bbc..a2d4b3b 100644
--- a/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_admin_tcp/CMakeLists.txt
@@ -36,10 +36,10 @@ target_link_libraries(celix_pubsub_admin_tcp PRIVATE
         Celix::pubsub_spi
         Celix::framework Celix::dfi Celix::log_helper
 )
-target_include_directories(celix_pubsub_admin_tcp PRIVATE ${JANSSON_INCLUDE_DIR} src)
+target_include_directories(celix_pubsub_admin_tcp PRIVATE src)
 # cmake find package UUID set the wrong include dir for OSX
 if (NOT APPLE)
-    target_include_directories(celix_pubsub_admin_tcp SYSTEM PRIVATE ${UUID_INCLUDE_DIRS})
+    target_link_libraries(celix_pubsub_admin_tcp PRIVATE UUID::lib)
 endif()
 
 install_celix_bundle(celix_pubsub_admin_tcp EXPORT celix COMPONENT pubsub)
diff --git a/bundles/pubsub/pubsub_admin_udp_mc/CMakeLists.txt b/bundles/pubsub/pubsub_admin_udp_mc/CMakeLists.txt
index 8b87422..dd0a095 100644
--- a/bundles/pubsub/pubsub_admin_udp_mc/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_admin_udp_mc/CMakeLists.txt
@@ -31,7 +31,6 @@ add_celix_bundle(celix_pubsub_admin_udp_multicast
 )
 target_include_directories(celix_pubsub_admin_udp_multicast PRIVATE
         src
-        ${JANSSON_INCLUDE_DIR}
 )
 set_target_properties(celix_pubsub_admin_udp_multicast PROPERTIES INSTALL_RPATH "$ORIGIN")
 target_link_libraries(celix_pubsub_admin_udp_multicast PRIVATE Celix::pubsub_spi Celix::framework Celix::dfi Celix::log_helper Celix::utils)
diff --git a/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt b/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt
index c992d5e..a7f8835 100644
--- a/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_admin_websocket/CMakeLists.txt
@@ -18,12 +18,6 @@
 find_package(Jansson REQUIRED)
 find_package(UUID REQUIRED)
 
-if(NOT UUID_LIBRARY)
-    #i.e. not found for OSX
-    set(UUID_LIBRARY "")
-    set(UUID_INCLUDE_DIRS "")
-endif()
-
 add_celix_bundle(celix_pubsub_admin_websocket
     BUNDLE_SYMBOLICNAME "apache_celix_pubsub_admin_websocket"
     VERSION "1.0.0"
@@ -43,8 +37,6 @@ target_link_libraries(celix_pubsub_admin_websocket PRIVATE
         Celix::http_admin_api
 )
 target_include_directories(celix_pubsub_admin_websocket PRIVATE
-    ${JANSSON_INCLUDE_DIR}
-    ${UUID_INCLUDE_DIRS}
     src
 )
 
diff --git a/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt b/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt
index bcf6199..70a6048 100644
--- a/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_admin_zmq/CMakeLists.txt
@@ -22,12 +22,6 @@ if (BUILD_PUBSUB_PSA_ZMQ)
     find_package(Jansson REQUIRED)
     find_package(UUID REQUIRED)
 
-    if(NOT UUID_LIBRARY)
-        #i.e. not found for OSX
-        set(UUID_LIBRARY "")
-        set(UUID_INCLUDE_DIRS "")
-    endif()
-
     if (BUILD_ZMQ_SECURITY)
         add_definitions(-DBUILD_WITH_ZMQ_SECURITY=1)
 
@@ -54,13 +48,9 @@ if (BUILD_PUBSUB_PSA_ZMQ)
     target_link_libraries(celix_pubsub_admin_zmq PRIVATE
             Celix::pubsub_spi
             Celix::framework Celix::dfi Celix::log_helper Celix::utils
-            ${ZMQ_LIBRARIES} ${CZMQ_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARY}
+            ZMQ::lib CZMQ::lib OPENSSL::lib
     )
     target_include_directories(celix_pubsub_admin_zmq PRIVATE
-        ${ZMQ_INCLUDE_DIR}
-        ${CZMQ_INCLUDE_DIR}
-        ${JANSSON_INCLUDE_DIR}
-        ${UUID_INCLUDE_DIRS}
         src
     )
 
diff --git a/bundles/pubsub/pubsub_discovery/CMakeLists.txt b/bundles/pubsub/pubsub_discovery/CMakeLists.txt
index 0d48101..5d51ff1 100644
--- a/bundles/pubsub/pubsub_discovery/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_discovery/CMakeLists.txt
@@ -27,14 +27,10 @@ add_celix_bundle(celix_pubsub_discovery_etcd
         src/pubsub_discovery_impl.c
 )
 target_include_directories(celix_pubsub_discovery_etcd PRIVATE src)
-target_include_directories(celix_pubsub_discovery_etcd SYSTEM PRIVATE 
-    ${CURL_INCLUDE_DIR}
-    ${JANSSON_INCLUDE_DIR}
-)
 target_link_libraries(celix_pubsub_discovery_etcd PRIVATE
         Celix::pubsub_spi Celix::framework Celix::etcdlib_static
         Celix::shell_api Celix::log_helper
-        ${CURL_LIBRARY} ${JANSSON_LIBRARIES})
+        CURL::libcurl JANSSON::lib)
 
 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 0231d81..8764f6f 100644
--- a/bundles/pubsub/pubsub_serializer_json/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_serializer_json/CMakeLists.txt
@@ -28,10 +28,9 @@ add_celix_bundle(celix_pubsub_serializer_json
 )
 target_include_directories(celix_pubsub_serializer_json PRIVATE
     src
-    ${JANSSON_INCLUDE_DIR}
 )
 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_LIBRARIES} Celix::log_helper)
+target_link_libraries(celix_pubsub_serializer_json PRIVATE Celix::pubsub_spi Celix::framework Celix::dfi JANSSON::lib Celix::log_helper)
 
 install_celix_bundle(celix_pubsub_serializer_json EXPORT celix COMPONENT pubsub)
 
diff --git a/bundles/pubsub/pubsub_spi/CMakeLists.txt b/bundles/pubsub/pubsub_spi/CMakeLists.txt
index ffb9625..9ac6835 100644
--- a/bundles/pubsub/pubsub_spi/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_spi/CMakeLists.txt
@@ -17,19 +17,13 @@
 
 find_package(UUID REQUIRED)
 
-if(NOT UUID_LIBRARY)
-    #i.e. not found for OSX
-    set(UUID_LIBRARY "")
-    set(UUID_INCLUDE_DIRS "")
-endif()
-
 add_library(pubsub_spi STATIC
         src/pubsub_utils_match.c
         src/pubsub_endpoint.c
         src/pubsub_utils.c
         src/pubsub_admin_metrics.c
 )
-target_include_directories(pubsub_spi SYSTEM PRIVATE ${UUID_INCLUDE_DIRS})
+
 set_target_properties(pubsub_spi PROPERTIES OUTPUT_NAME "celix_pubsub_spi")
 target_include_directories(pubsub_spi PUBLIC
         $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
diff --git a/bundles/pubsub/pubsub_topology_manager/CMakeLists.txt b/bundles/pubsub/pubsub_topology_manager/CMakeLists.txt
index 1f2e1b9..5d9058e 100644
--- a/bundles/pubsub/pubsub_topology_manager/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_topology_manager/CMakeLists.txt
@@ -17,12 +17,6 @@
 
 find_package(UUID REQUIRED)
 
-if(NOT UUID_LIBRARY)
-    #i.e. not found for OSX
-    set(UUID_LIBRARY "")
-    set(UUID_INCLUDE_DIRS "")
-endif()
-
 add_celix_bundle(celix_pubsub_topology_manager
     BUNDLE_SYMBOLICNAME "apache_celix_pubsub_topology_manager"
     VERSION "1.0.0"
@@ -33,7 +27,7 @@ add_celix_bundle(celix_pubsub_topology_manager
         src/pubsub_topology_manager.h
 )
 target_link_libraries(celix_pubsub_topology_manager PRIVATE Celix::framework Celix::log_helper Celix::pubsub_spi Celix::shell_api)
-target_include_directories(celix_pubsub_topology_manager PRIVATE ${UUID_INCLUDE_DIRS})
+target_link_libraries(celix_pubsub_topology_manager PRIVATE UUID::lib)
 
 get_target_property(DESC Celix::pubsub_spi TOPIC_INFO_DESCRIPTOR)
 celix_bundle_files(celix_pubsub_topology_manager
diff --git a/bundles/pubsub/test/CMakeLists.txt b/bundles/pubsub/test/CMakeLists.txt
index 7820dfa..641f2ba 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_LIBRARIES} Celix::dfi)
+target_link_libraries(pubsub_udpmc_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} JANSSON::lib 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_LIBRARIES} Celix::dfi)
+target_link_libraries(pubsub_tcp_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} JANSSON::lib 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_LIBRARIES} Celix::dfi)
+target_link_libraries(pubsub_tcp_endpoint_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} JANSSON::lib 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_LIBRARIES} Celix::dfi)
+target_link_libraries(pubsub_websocket_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} JANSSON::lib 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_LIBRARIES} Celix::dfi)
+    target_link_libraries(pubsub_zmq_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} JANSSON::lib 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_LIBRARIES} Celix::dfi)
+    target_link_libraries(pubsub_zmq_zerocopy_tests PRIVATE Celix::pubsub_api ${CPPUTEST_LIBRARIES} JANSSON::lib 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_configured/CMakeLists.txt b/bundles/remote_services/discovery_configured/CMakeLists.txt
index 273fa2a..15bb1d4 100644
--- a/bundles/remote_services/discovery_configured/CMakeLists.txt
+++ b/bundles/remote_services/discovery_configured/CMakeLists.txt
@@ -34,7 +34,7 @@ if (RSA_DISCOVERY_CONFIGURED)
             $<TARGET_PROPERTY:Celix::rsa_discovery_common,INCLUDE_DIRECTORIES>
             $<TARGET_PROPERTY:Celix::civetweb,INCLUDE_DIRECTORIES>
     )
-    target_link_libraries(rsa_discovery_configured PRIVATE ${CURL_LIBRARY} ${LIBXML2_LIBRARIES} ${OPENSSL_LIBRARY} Celix::log_helper Celix::rsa_common)
+    target_link_libraries(rsa_discovery_configured PRIVATE CURL::libcurl ${LIBXML2_LIBRARIES} Celix::log_helper Celix::rsa_common)
 
     install_celix_bundle(rsa_discovery_configured 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 e8608d8..76117e7 100644
--- a/bundles/remote_services/discovery_etcd/CMakeLists.txt
+++ b/bundles/remote_services/discovery_etcd/CMakeLists.txt
@@ -41,10 +41,9 @@ if (RSA_DISCOVERY_ETCD)
 	)
         target_include_directories(rsa_discovery_etcd SYSTEM PRIVATE
 			${CURL_INCLUDE_DIR}
-			${JANSSON_INCLUDE_DIR}
 			${LIBXML2_INCLUDE_DIR}
 	)
-	target_link_libraries(rsa_discovery_etcd PRIVATE ${CURL_LIBRARY} ${LIBXML2_LIBRARIES} ${JANSSON_LIBRARIES} ${OPENSSL_LIBRARY})
+	target_link_libraries(rsa_discovery_etcd PRIVATE CURL::libcurl ${LIBXML2_LIBRARIES} JANSSON::lib)
 
 	install_celix_bundle(rsa_discovery_etcd EXPORT celix COMPONENT rsa)
 	#Setup target aliases to match external usage
diff --git a/bundles/remote_services/discovery_shm/CMakeLists.txt b/bundles/remote_services/discovery_shm/CMakeLists.txt
index 8ea0707..1c3b786 100644
--- a/bundles/remote_services/discovery_shm/CMakeLists.txt
+++ b/bundles/remote_services/discovery_shm/CMakeLists.txt
@@ -39,7 +39,7 @@ if (RSA_DISCOVERY_SHM)
 			$<TARGET_PROPERTY:Celix::rsa_discovery_common,INCLUDE_DIRECTORIES>
 			$<TARGET_PROPERTY:Celix::civetweb,INCLUDE_DIRECTORIES>
 	)
-	target_link_libraries(rsa_discovery_shm PRIVATE Celix::framework ${CURL_LIBRARY} ${LIBXML2_LIBRARIES})
+	target_link_libraries(rsa_discovery_shm PRIVATE Celix::framework CURL::libcurl ${LIBXML2_LIBRARIES})
 
 	install_celix_bundle(rsa_discovery_shm EXPORT celix COMPONENT rsa)
 
diff --git a/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt b/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt
index 5679611..a6d46ae 100644
--- a/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt
+++ b/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt
@@ -25,12 +25,6 @@ if (RSA_REMOTE_SERVICE_ADMIN_DFI)
     find_package(Jansson REQUIRED)
     find_package(UUID REQUIRED)
 
-    if(NOT UUID_LIBRARY)
-        #i.e. not found for OSX
-        set(UUID_LIBRARY "")
-        set(UUID_INCLUDE_DIRS "")
-    endif()
-
     add_celix_bundle(rsa_dfi
             VERSION 0.9.0
             SYMBOLIC_NAME "apache_celix_remote_service_admin_dfi"
@@ -46,12 +40,13 @@ if (RSA_REMOTE_SERVICE_ADMIN_DFI)
     )
     celix_bundle_private_libs(rsa_dfi Celix::dfi)
     target_include_directories(rsa_dfi PRIVATE $<TARGET_PROPERTY:Celix::civetweb,INCLUDE_DIRECTORIES>)
-    target_include_directories(rsa_dfi SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} ${JANSSON_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS})
     target_link_libraries(rsa_dfi PRIVATE
             Celix::dfi
             Celix::log_helper
             Celix::rsa_common
-            ${CURL_LIBRARY} ${JANSSON_LIBRARIES} ${OPENSSL_LIBRARY})
+            CURL::libcurl
+            JANSSON::lib
+    )
 
     if (ENABLE_TESTING)
         add_subdirectory(test)
diff --git a/bundles/remote_services/remote_service_admin_dfi/test/CMakeLists.txt b/bundles/remote_services/remote_service_admin_dfi/test/CMakeLists.txt
index 9790181..20efa08 100644
--- a/bundles/remote_services/remote_service_admin_dfi/test/CMakeLists.txt
+++ b/bundles/remote_services/remote_service_admin_dfi/test/CMakeLists.txt
@@ -34,7 +34,7 @@ add_executable(test_rsa_dfi
     src/rsa_client_server_tests.cpp
 )
 target_include_directories(test_rsa_dfi PRIVATE src)
-target_link_libraries(test_rsa_dfi PRIVATE ${CURL_LIBRARY} ${CPPUTEST_LIBRARY}
+target_link_libraries(test_rsa_dfi PRIVATE CURL::libcurl ${CPPUTEST_LIBRARY}
         Celix::framework
         Celix::rsa_common
         calculator_api)
diff --git a/bundles/remote_services/remote_service_admin_shm/CMakeLists.txt b/bundles/remote_services/remote_service_admin_shm/CMakeLists.txt
index a5a708b..58d6a6f 100644
--- a/bundles/remote_services/remote_service_admin_shm/CMakeLists.txt
+++ b/bundles/remote_services/remote_service_admin_shm/CMakeLists.txt
@@ -32,7 +32,6 @@ if (RSA_REMOTE_SERVICE_ADMIN_SHM)
 	include_directories("${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin_shm/public/include")
 	include_directories("${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin_shm/private/include")
 	include_directories("${PROJECT_SOURCE_DIR}/remote_services/endpoint_listener/public/include")
-	include_directories(${UUID_INCLUDE_DIRS})
 
 	add_celix_bundle(remote_service_admin_shm
         VERSION 0.9.0
@@ -47,7 +46,7 @@ if (RSA_REMOTE_SERVICE_ADMIN_SHM)
         ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/import_registration_impl
         ${PROJECT_SOURCE_DIR}/log_service/public/src/log_helper.c
 	)
-	target_link_libraries(remote_service_admin_shm celix_framework)
+	target_link_libraries(remote_service_admin_shm Celix::framework)
 
        install_celix_bundle(remote_service_admin_shm EXPORT celix COMPONENT rsa)
        add_library(Celix::remote_service_admin_shm ALIAS remote_service_admin_shm)
diff --git a/bundles/remote_services/remote_service_admin_shm/private/test/CMakeLists.txt b/bundles/remote_services/remote_service_admin_shm/private/test/CMakeLists.txt
index e43cede..44bd290 100644
--- a/bundles/remote_services/remote_service_admin_shm/private/test/CMakeLists.txt
+++ b/bundles/remote_services/remote_service_admin_shm/private/test/CMakeLists.txt
@@ -35,7 +35,7 @@ add_executable(test_rsa_shm
 
     ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/endpoint_description.c
 )
-target_link_libraries(test_rsa_shm celix_framework celix_utils ${CURL_LIBRARY} ${CPPUTEST_LIBRARY})
+target_link_libraries(test_rsa_shm celix_framework celix_utils CURL::libcurl ${CPPUTEST_LIBRARY})
 
 get_property(rsa_bundle_file TARGET remote_service_admin_shm PROPERTY BUNDLE_FILE)
 get_property(calc_bundle_file TARGET calculator PROPERTY BUNDLE_FILE)
diff --git a/bundles/remote_services/topology_manager/CMakeLists.txt b/bundles/remote_services/topology_manager/CMakeLists.txt
index 8343d9f..8f56a13 100644
--- a/bundles/remote_services/topology_manager/CMakeLists.txt
+++ b/bundles/remote_services/topology_manager/CMakeLists.txt
@@ -36,7 +36,6 @@ if (RSA_TOPOLOGY_MANAGER)
         find_package(CppUTest REQUIRED)
 	    find_package(Jansson REQUIRED)
 
-        include_directories("${JANSSON_INCLUDE_DIR}")
         include_directories("${CPPUTEST_INCLUDE_DIR}")
         include_directories("${CPPUTEST_EXT_INCLUDE_DIR}")
         add_subdirectory(tms_tst)
diff --git a/bundles/remote_services/topology_manager/tms_tst/CMakeLists.txt b/bundles/remote_services/topology_manager/tms_tst/CMakeLists.txt
index fc0a016..f29b8ae 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_LIBRARY}
+        JANSSON::lib
         calculator_api
         Celix::rsa_common
 )
diff --git a/bundles/shell/shell/CMakeLists.txt b/bundles/shell/shell/CMakeLists.txt
index 963e4ad..6c0f22d 100644
--- a/bundles/shell/shell/CMakeLists.txt
+++ b/bundles/shell/shell/CMakeLists.txt
@@ -47,8 +47,7 @@ if (SHELL)
 		  src/dm_shell_list_command
 	)
 	target_include_directories(shell PRIVATE src)
-	target_include_directories(shell SYSTEM PRIVATE	${CURL_INCLUDE_DIRS})
-	target_link_libraries(shell PRIVATE Celix::shell_api ${CURL_LIBRARY} ${OPENSSL_LIBRARY} Celix::log_service_api Celix::log_helper)
+	target_link_libraries(shell PRIVATE Celix::shell_api CURL::libcurl Celix::log_service_api Celix::log_helper)
 
 	install_celix_bundle(shell EXPORT celix COMPONENT shell)
 
diff --git a/cmake/CelixConfig.cmake b/cmake/CelixConfig.cmake
index 5dae9be..c3d0d19 100644
--- a/cmake/CelixConfig.cmake
+++ b/cmake/CelixConfig.cmake
@@ -28,6 +28,34 @@ get_filename_component(REL_INSTALL_DIR "${REL_INSTALL_DIR}" PATH)
 get_filename_component(REL_INSTALL_DIR "${REL_INSTALL_DIR}" PATH)
 get_filename_component(REL_INSTALL_DIR "${REL_INSTALL_DIR}" PATH)
 
+set(CMAKE_PREFIX_PATH "${${REL_INSTALL_DIR}/share/celix/cmake/Modules}:${CMAKE_PREFIX_PATH}")
+
+#find required packages
+find_package(CURL REQUIRED) #framework, etcdlib
+find_package(ZLIB REQUIRED) #framework
+find_package(UUID REQUIRED) #framework
+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")
+  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")
+  add_library(CURL::libcurl SHARED IMPORTED)
+  set_target_properties(CURL::libcurl PROPERTIES
+          IMPORTED_LOCATION "${CURL_LIBRARIES}"
+          INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}"
+  )
+endif ()
+
+
 include("${REL_INSTALL_DIR}/share/celix/cmake/cmake_celix/UseCelix.cmake") #adds celix commands (e.g. add_celix_bundle)
 include("${REL_INSTALL_DIR}/share/celix/cmake/Targets.cmake") #imports lib and exe targets (e.g. Celix::framework)
 include("${REL_INSTALL_DIR}/share/celix/cmake/CelixTargets.cmake") #imports bundle targets (e.g. Celix::shell)
diff --git a/cmake/Modules/FindCZMQ.cmake b/cmake/Modules/FindCZMQ.cmake
index 4f4891c..30b1bb0 100644
--- a/cmake/Modules/FindCZMQ.cmake
+++ b/cmake/Modules/FindCZMQ.cmake
@@ -22,6 +22,7 @@
 #  CZMQ_INCLUDE_DIRS - The Zmq include directories
 #  CZMQ_LIBRARIES - The libraries needed to use Zmq
 #  CZMQ_DEFINITIONS - Compiler switches required for using Zmq
+#  CZMQ::lib - Imported CMake target for the library (include path + library)
 
 find_path(CZMQ_INCLUDE_DIR czmq.h
           /usr/include
@@ -39,4 +40,12 @@ include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Czmq  DEFAULT_MSG
                                   CZMQ_LIBRARY CZMQ_INCLUDE_DIR)
 
-mark_as_advanced(CZMQ_INCLUDE_DIR CZMQ_LIBRARY )
+mark_as_advanced(CZMQ_INCLUDE_DIR CZMQ_LIBRARY)
+
+if (CZMQ_FOUND AND NOT TARGET CZMQ::lib)
+    add_library(CZMQ::lib SHARED IMPORTED)
+    set_target_properties(CZMQ::lib PROPERTIES
+            IMPORTED_LOCATION "${CZMQ_LIBRARY}"
+            INTERFACE_INCLUDE_DIRECTORIES "${CZMQ_INCLUDE_DIR}"
+    )
+endif ()
diff --git a/cmake/Modules/FindFFI.cmake b/cmake/Modules/FindFFI.cmake
index 2da10d1..cb07ec4 100644
--- a/cmake/Modules/FindFFI.cmake
+++ b/cmake/Modules/FindFFI.cmake
@@ -19,7 +19,7 @@
 #
 # Once done this will define
 #  FFI_FOUND - System has libffi
-#  ffi::lib - Imported target for the libffi
+#  FFI::lib - Imported target for the libffi
 
 # try using pkg-config if available
 find_package(PkgConfig QUIET)
@@ -44,47 +44,40 @@ if (PkgConfig_FOUND)
     if (NOT FFI_ABS_LIB)
         message(WARNING "Cannot find abs path of libffi based on pkgconfig results. Tried to find libffi @ '${PC_LIBFFI_LIBRARY_DIRS}' and '${PC_LIBFFI_LIBDIR}'")
     else()    
-        set(LIBFFI_LIB_ADDED TRUE)
-        add_library(ffi::lib SHARED IMPORTED)
-        set_target_properties(ffi::lib PROPERTIES
-            IMPORTED_LOCATION "${FFI_ABS_LIB}"
-            INTERFACE_INCLUDE_DIRECTORIES "${PC_LIBFFI_INCLUDE_DIRS}"
-        )
+        unset(FFI_ABS_LIB)
     endif()
-
-    unset(FFI_ABS_LIB)
 endif()
 
-if (NOT LIBFFI_LIB_ADDED)
-    mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
+mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
 
-    find_library(FFI_LIBRARY NAMES ffi libffi
-        PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local
-        PATH_SUFFIXES lib lib64 x86_64-linux-gnu lib/x86_64-linux-gnu
-        HINTS ${PC_LIBFFI_LIBDIR} ${PC_LIBFFI_LIBRARY_DIRS}
-    )
+find_library(FFI_LIBRARY NAMES ffi libffi
+    PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local
+    PATH_SUFFIXES lib lib64 x86_64-linux-gnu lib/x86_64-linux-gnu
+    HINTS ${PC_LIBFFI_LIBDIR} ${PC_LIBFFI_LIBRARY_DIRS}
+)
 
-    find_path(FFI_INCLUDE_DIR ffi.h
-         PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local 
-         PATH_SUFFIXES include include/ffi include/x86_64-linux-gnu x86_64-linux-gnu
-         HINTS ${PC_LIBFFI_INCLUDEDIR} ${PC_LIBFFI_INCLUDE_DIRS}
-    )
+find_path(FFI_INCLUDE_DIR ffi.h
+     PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local
+     PATH_SUFFIXES include include/ffi include/x86_64-linux-gnu x86_64-linux-gnu
+     HINTS ${PC_LIBFFI_INCLUDEDIR} ${PC_LIBFFI_INCLUDE_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set FFI_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args(FFI DEFAULT_MSG
+                                  FFI_LIBRARY FFI_INCLUDE_DIR)
+mark_as_advanced(FFI_INCLUDE_DIR FFI_LIBRARY)
 
-    include(FindPackageHandleStandardArgs)
-    # handle the QUIETLY and REQUIRED arguments and set FFI_FOUND to TRUE
-    # if all listed variables are TRUE
-    find_package_handle_standard_args(FFI DEFAULT_MSG
-                                      FFI_LIBRARY FFI_INCLUDE_DIR)
-    mark_as_advanced(FFI_INCLUDE_DIR FFI_LIBRARY) 
+set(FFI_LIBRARIES ${FFI_LIBRARY})
+set(FFI_INCLUDE_DIRS ${FFI_INCLUDE_DIR})
 
-    if(FFI_FOUND)
-        set(FFI_LIBRARIES ${FFI_LIBRARY})
-        set(FFI_INCLUDE_DIRS ${FFI_INCLUDE_DIR})
 
-        add_library(ffi::lib SHARED IMPORTED)
-        set_target_properties(ffi::lib PROPERTIES
+if(FFI_FOUND AND NOT TARGET FFI::lib)
+    add_library(FFI::lib SHARED IMPORTED)
+    set_target_properties(FFI::lib PROPERTIES
             IMPORTED_LOCATION "${FFI_LIBRARY}"
             INTERFACE_INCLUDE_DIRECTORIES "${FFI_INCLUDE_DIR}"
-        )
-    endif()
+    )
+
 endif()
diff --git a/cmake/Modules/FindJansson.cmake b/cmake/Modules/FindJansson.cmake
index bedf8be..8584dba 100644
--- a/cmake/Modules/FindJansson.cmake
+++ b/cmake/Modules/FindJansson.cmake
@@ -22,6 +22,7 @@
 #  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
 
 find_path(JANSSON_INCLUDE_DIR jansson.h
           /usr/include
@@ -39,4 +40,13 @@ include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Jansson  DEFAULT_MSG
                                   JANSSON_LIBRARY JANSSON_INCLUDE_DIR)
 
-mark_as_advanced(JANSSON_INCLUDE_DIR JANSSON_LIBRARY )
\ No newline at end of file
+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}"
+    )
+
+endif ()
diff --git a/cmake/Modules/FindNanoMsg.cmake b/cmake/Modules/FindNanoMsg.cmake
index 79d68c5..8bac2e2 100644
--- a/cmake/Modules/FindNanoMsg.cmake
+++ b/cmake/Modules/FindNanoMsg.cmake
@@ -18,10 +18,10 @@
 
 # - Try to find ZMQ
 # 	Once done this will define
-#  ZMQ_FOUND - System has Zmq
-#  ZMQ_INCLUDE_DIRS - The Zmq include directories
-#  ZMQ_LIBRARIES - The libraries needed to use Zmq
-#  ZMQ_DEFINITIONS - Compiler switches required for using Zmq
+#  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
           /usr/include
@@ -40,3 +40,11 @@ find_package_handle_standard_args(NanoMsg  DEFAULT_MSG
                                   NANOMSG_LIBRARY NANOMSG_INCLUDE_DIR)
 
 mark_as_advanced(NANOMSG_INCLUDE_DIR NANOMSG_LIBRARY )
+
+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}"
+    )
+endif ()
\ No newline at end of file
diff --git a/cmake/Modules/FindOpenSSL.cmake b/cmake/Modules/FindOpenSSL.cmake
index 9b37bf4..fc14cb6 100644
--- a/cmake/Modules/FindOpenSSL.cmake
+++ b/cmake/Modules/FindOpenSSL.cmake
@@ -22,6 +22,7 @@
 #  OPENSSL_INCLUDE_DIRS - The OpenSSL include directories
 #  OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
 #  OPENSSL_DEFINITIONS - Compiler switches required for using OpenSSL
+#  OPENSSL::lib - Imported target for OpenSSL
 
 find_path(OPENSSL_INCLUDE_DIR ssl.h crypto.h
           /usr/include/openssl
@@ -45,3 +46,11 @@ find_package_handle_standard_args(OpenSSL  DEFAULT_MSG
              OPENSSL_LIBRARY CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
 
 mark_as_advanced(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARY CRYPTO_LIBRARY)
+
+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}"
+    )
+endif ()
\ No newline at end of file
diff --git a/cmake/Modules/FindSlp.cmake b/cmake/Modules/FindSlp.cmake
deleted file mode 100644
index 3461456..0000000
--- a/cmake/Modules/FindSlp.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-# 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 Slp
-# Once done this will define
-#  SLP_FOUND - System has Slp
-#  SLP_INCLUDE_DIRS - The Slp include directories
-#  SLP_LIBRARIES - The libraries needed to use Slp
-#  SLP_DEFINITIONS - Compiler switches required for using Slp
-
-find_path(SLP_INCLUDE_DIR slp.h
-          /usr/include
-          /usr/local/include )
-
-find_library(SLP_LIBRARY NAMES slp
-             PATHS /usr/lib /usr/local/lib )
-
-set(SLP_LIBRARIES ${SLP_LIBRARY} )
-set(SLP_INCLUDE_DIRS ${SLP_INCLUDE_DIR} )
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set SLP_FOUND to TRUE
-# if all listed variables are TRUE
-find_package_handle_standard_args(Slp  DEFAULT_MSG
-                                  SLP_LIBRARY SLP_INCLUDE_DIR)
-
-mark_as_advanced(SLP_INCLUDE_DIR SLP_LIBRARY )
\ No newline at end of file
diff --git a/cmake/Modules/FindSyslog.cmake b/cmake/Modules/FindSyslog.cmake
index 769b806..98002e5 100644
--- a/cmake/Modules/FindSyslog.cmake
+++ b/cmake/Modules/FindSyslog.cmake
@@ -15,6 +15,11 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# - Try to find Syslog
+# Once done this will define
+#  SYSLOG_FOUND - System has Syslog
+#  JANSSON_INCLUDE_DIRS - The Syslog include directories
+#  SYSLOG::lib - Imported target for Syslog
 
 find_path(SYSLOG_INCLUDE_DIR syslog.h /usr/include)
 
@@ -23,4 +28,12 @@ include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Syslog DEFAULT_MSG
                                   SYSLOG_INCLUDE_DIR)
 
+set(SYSLOG_INCLUDE_DIRS ${SYSLOG_INCLUDE_DIR})
 mark_as_advanced(SYSLOG_INCLUDE_DIR)
+
+if (SYSLOG_FOUND AND NOT TARGET SYSLOG::lib)
+    add_library(SYSLOG::lib SHARED IMPORTED)
+    set_target_properties(SYSLOG::lib PROPERTIES
+            INTERFACE_INCLUDE_DIRECTORIES "${SYSLOG_INCLUDE_DIR}"
+    )
+endif ()
\ No newline at end of file
diff --git a/cmake/Modules/FindUUID.cmake b/cmake/Modules/FindUUID.cmake
index 952be1c..4ce72b4 100644
--- a/cmake/Modules/FindUUID.cmake
+++ b/cmake/Modules/FindUUID.cmake
@@ -15,25 +15,43 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# - Try to find UUID
+# Once done this will define
+#  UUID_FOUND - System has UUID
+#  UUID_INCLUDE_DIRS - The UUID include directories
+#  UUID_LIBRARIES - The libraries needed to use UUID
+#  UUID::lib - Imported target for UUID
 
-find_path(UUID_INCLUDE_DIR uuid/uuid.h
-          /usr/include
-          /usr/local/include )
+if (APPLE)
+    set(UUID_INCLUDE_DIRS )
+    set(UUID_LIBRARIES )
 
-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)
+    find_package_handle_standard_args(UUID DEFAULT_MSG)
 
-include(FindPackageHandleStandardArgs)
-if (APPLE)
-find_package_handle_standard_args(UUID  DEFAULT_MSG
-                                  UUID_INCLUDE_DIR)
+    if (NOT TARGET UUID::lib)
+        add_library(UUID::lib INTERFACE IMPORTED)
+    endif ()
 else ()
-find_package_handle_standard_args(UUID  DEFAULT_MSG
-                                  UUID_LIBRARY UUID_INCLUDE_DIR)
-endif ()
 
+    find_path(UUID_INCLUDE_DIR uuid/uuid.h
+              /usr/include
+              /usr/local/include )
+
+    find_library(UUID_LIBRARY NAMES uuid
+                 PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64 /lib/i386-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu)
 
-mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY)
-set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR})
-set(UUID_LIBRARIES ${UUID_LIBRARY})
+    include(FindPackageHandleStandardArgs)
+    find_package_handle_standard_args(UUID DEFAULT_MSG
+                                      UUID_LIBRARY UUID_INCLUDE_DIR)
 
+    mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY)
+    set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR})
+    set(UUID_LIBRARIES ${UUID_LIBRARY})
+    if (UUID_FOUND AND NOT TARGET UUID::lib)
+        add_library(UUID::lib SHARED IMPORTED)
+        set_target_properties(UUID::lib PROPERTIES
+                IMPORTED_LOCATION "${UUID_LIBRARY}"
+                INTERFACE_INCLUDE_DIRECTORIES "${UUID_INCLUDE_DIR}"
+        )
+    endif ()
+endif ()
\ No newline at end of file
diff --git a/cmake/Modules/FindZMQ.cmake b/cmake/Modules/FindZMQ.cmake
index b2c2663..0a7c33c 100644
--- a/cmake/Modules/FindZMQ.cmake
+++ b/cmake/Modules/FindZMQ.cmake
@@ -22,6 +22,7 @@
 #  ZMQ_INCLUDE_DIRS - The Zmq include directories
 #  ZMQ_LIBRARIES - The libraries needed to use Zmq
 #  ZMQ_DEFINITIONS - Compiler switches required for using Zmq
+#  ZMQ::lib - Imported target for UUID
 
 find_path(ZMQ_INCLUDE_DIR zmq.h zmq_utils.h
           /usr/include
@@ -40,3 +41,11 @@ find_package_handle_standard_args(Zmq  DEFAULT_MSG
                                   ZMQ_LIBRARY ZMQ_INCLUDE_DIR)
 
 mark_as_advanced(ZMQ_INCLUDE_DIR ZMQ_LIBRARY )
+
+if (ZMQ_FOUND AND NOT TARGET ZMQ::lib)
+    add_library(ZMQ::lib SHARED IMPORTED)
+    set_target_properties(ZMQ::lib PROPERTIES
+            IMPORTED_LOCATION "${ZMQ_LIBRARY}"
+            INTERFACE_INCLUDE_DIRECTORIES "${ZMQ_INCLUDE_DIR}"
+    )
+endif ()
\ No newline at end of file
diff --git a/libs/dfi/CMakeLists.txt b/libs/dfi/CMakeLists.txt
index 6b32a54..cd76e86 100644
--- a/libs/dfi/CMakeLists.txt
+++ b/libs/dfi/CMakeLists.txt
@@ -39,12 +39,8 @@ target_include_directories(dfi PUBLIC
 	$<INSTALL_INTERFACE:include/celix/dfi>
 )
 
-target_include_directories(dfi SYSTEM PRIVATE
-		${JANSSON_INCLUDE_DIRS}
-)
-target_link_libraries(dfi PRIVATE ffi::lib)
-target_include_directories(dfi SYSTEM PRIVATE)
-target_link_libraries(dfi PRIVATE ${JANSSON_LIBRARY})
+target_link_libraries(dfi PRIVATE FFI::lib)
+target_link_libraries(dfi PUBLIC JANSSON::lib)
 target_link_libraries(dfi PRIVATE Celix::utils)
 set_target_properties(dfi PROPERTIES "SOVERSION" 1)
 
@@ -72,8 +68,7 @@ if (ENABLE_TESTING)
 		test/run_tests.cpp
 	)
 
-    target_link_libraries(test_dfi PRIVATE Celix::dfi Celix::utils ffi::lib ${JANSSON_LIBRARY} ${CPPUTEST_LIBRARIES})
-    target_include_directories(test_dfi PRIVATE ${JANSSON_INCLUDE_DIRS})
+    target_link_libraries(test_dfi PRIVATE Celix::dfi Celix::utils FFI::lib JANSSON::lib ${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 9fff290..faf8129 100644
--- a/libs/etcdlib/CMakeLists.txt
+++ b/libs/etcdlib/CMakeLists.txt
@@ -50,14 +50,10 @@ target_include_directories(etcdlib PUBLIC
     $<INSTALL_INTERFACE:include/etcdlib>
 )
 target_include_directories(etcdlib PRIVATE src)
-target_include_directories(etcdlib SYSTEM PRIVATE 
-    ${CURL_INCLUDE_DIRS}
-    ${JANSSON_INCLUDE_DIRS}
-)
 
 set_target_properties(etcdlib PROPERTIES SOVERSION 1)
 set_target_properties(etcdlib PROPERTIES VERSION 1.0.0)
-target_link_libraries(etcdlib PRIVATE ${CURL_LIBRARY} ${JANSSON_LIBRARIES} ${OPENSSL_LIBRARY})
+target_link_libraries(etcdlib PUBLIC CURL::libcurl JANSSON::lib)
 
 add_library(etcdlib_static STATIC
     src/etcd.c
@@ -67,15 +63,11 @@ target_include_directories(etcdlib_static PUBLIC
     $<INSTALL_INTERFACE:include/etcdlib>
 )
 target_include_directories(etcdlib_static PRIVATE src)
-target_include_directories(etcdlib_static SYSTEM PRIVATE 
-    ${CURL_INCLUDE_DIRS}
-    ${JANSSON_INCLUDE_DIRS}
-)
 set_target_properties(etcdlib_static PROPERTIES "SOVERSION" 1)
-target_link_libraries(etcdlib_static PRIVATE ${CURL_LIBRARY} ${JANSSON_LIBRARY})
+target_link_libraries(etcdlib_static PUBLIC CURL::libcurl JANSSON::lib)
 
 add_executable(etcdlib_test ${CMAKE_CURRENT_SOURCE_DIR}/test/etcdlib_test.c)
-target_link_libraries(etcdlib_test PRIVATE etcdlib_static ${CURL_LIBRARY} ${JANSSON_LIBRARY} ${OPENSSL_LIBRARY})
+target_link_libraries(etcdlib_test PRIVATE etcdlib_static CURL::libcurl JANSSON::lib)
 
 #TODO install etcdlib_static. For now left out, because the imported target leaks library paths
 install(DIRECTORY api/ DESTINATION include/etcdlib COMPONENT ${ETCDLIB_CMP})
diff --git a/libs/framework/CMakeLists.txt b/libs/framework/CMakeLists.txt
index b804a8d..d7da72e 100644
--- a/libs/framework/CMakeLists.txt
+++ b/libs/framework/CMakeLists.txt
@@ -20,12 +20,6 @@ find_package(UUID REQUIRED)
 find_package(CURL REQUIRED)
 find_package(OpenSSL REQUIRED)
 
-if(NOT UUID_LIBRARY)
-    #i.e. not found for OSX
-    set(UUID_LIBRARY "")
-    set(UUID_INCLUDE_DIRS "")
-endif()
-
 set(SOURCES
         src/attribute.c src/bundle.c src/bundle_archive.c src/bundle_cache.c
         src/bundle_context.c src/bundle_revision.c src/capability.c src/celix_errorcodes.c
@@ -41,15 +35,14 @@ set(SOURCES
 )
 add_library(framework SHARED ${SOURCES})
 set_target_properties(framework PROPERTIES OUTPUT_NAME "celix_framework")
-target_include_directories(framework PUBLIC 
+target_include_directories(framework PUBLIC
         $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
         $<INSTALL_INTERFACE:include/celix>
 )
 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 PRIVATE ${UUID_LIBRARY} ${ZLIB_LIBRARY} ${CURL_LIBRARY} ${OPENSSL_LIBRARIES})
-target_include_directories(framework PRIVATE ${CURL_INCLUDE_DIR} ${UUID_INCLUDE_DIRS})
+target_link_libraries(framework PUBLIC UUID::lib CURL::libcurl ZLIB::ZLIB)
 
 install(TARGETS framework EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework)
 install(DIRECTORY include/ DESTINATION include/celix COMPONENT framework)
@@ -128,7 +121,7 @@ if (ENABLE_TESTING AND FRAMEWORK_TESTS)
         src/bundle_revision.c
         src/celix_errorcodes.c
         private/mock/celix_log_mock.c)
-    target_link_libraries(bundle_revision_test ${ZLIB_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+    target_link_libraries(bundle_revision_test ZLIB::ZLIB ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
 
     add_executable(bundle_test
         private/test/bundle_test.cpp
@@ -178,7 +171,7 @@ if (ENABLE_TESTING AND FRAMEWORK_TESTS)
         private/mock/celix_log_mock.c
         src/framework.c
         src/celix_library_loader.c)
-    target_link_libraries(framework_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} ${UUID_LIBRARY} Celix::utils pthread dl)
+    target_link_libraries(framework_test PRIVATE ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} UUID::lib Celix::utils pthread dl)
 
     add_executable(manifest_parser_test
         private/test/manifest_parser_test.cpp
diff --git a/libs/framework/include/celix/dm/DependencyManager.h b/libs/framework/include/celix/dm/DependencyManager.h
index e9136c9..3e8b6c1 100644
--- a/libs/framework/include/celix/dm/DependencyManager.h
+++ b/libs/framework/include/celix/dm/DependencyManager.h
@@ -52,7 +52,16 @@ namespace celix { namespace dm {
                 this->cDepMan = nullptr;
                 this->context = nullptr;
         }
-        DependencyManager& operator=(DependencyManager&&) = default;
+        DependencyManager& operator=(DependencyManager&& rhs) {
+            std::lock_guard<std::recursive_mutex> lock(rhs.componentsMutex);
+            context = rhs.context;
+            queuedComponents = std::move(rhs.queuedComponents);
+            startedComponents = std::move(rhs.startedComponents);
+            cDepMan = rhs.cDepMan;
+            rhs.cDepMan = nullptr;
+            rhs.context = nullptr;
+            return *this;
+        };
 
         DependencyManager(const DependencyManager&) = delete;
         DependencyManager& operator=(const DependencyManager&) = delete;
diff --git a/libs/framework/tst/CMakeLists.txt b/libs/framework/tst/CMakeLists.txt
index 7ef1ceb..4466761 100644
--- a/libs/framework/tst/CMakeLists.txt
+++ b/libs/framework/tst/CMakeLists.txt
@@ -30,7 +30,7 @@ add_executable(test_framework
     dm_tests.cpp
 )
 
-target_link_libraries(test_framework Celix::framework ${CURL_LIBRARIES} ${CPPUTEST_LIBRARY})
+target_link_libraries(test_framework Celix::framework CURL::libcurl ${CPPUTEST_LIBRARY})
 add_dependencies(test_framework simple_test_bundle1_bundle simple_test_bundle2_bundle simple_test_bundle3_bundle simple_test_bundle4_bundle simple_test_bundle5_bundle bundle_with_exception)
 target_include_directories(test_framework PRIVATE ../src)
 
diff --git a/misc/experimental/bundles/pubsub_admin_nanomsg/CMakeLists.txt b/misc/experimental/bundles/pubsub_admin_nanomsg/CMakeLists.txt
index b9344f3..02a71cd 100644
--- a/misc/experimental/bundles/pubsub_admin_nanomsg/CMakeLists.txt
+++ b/misc/experimental/bundles/pubsub_admin_nanomsg/CMakeLists.txt
@@ -36,11 +36,9 @@ if (BUILD_PUBSUB_PSA_NANOMSG)
     target_link_libraries(celix_pubsub_admin_nanomsg PRIVATE
             Celix::pubsub_spi
             Celix::framework Celix::dfi Celix::log_helper
-            ${NANOMSG_LIBRARIES}
+            NANOMSG::lib
     )
     target_include_directories(celix_pubsub_admin_nanomsg PRIVATE
-        ${NANOMSG_INCLUDE_DIR}
-        ${JANSSON_INCLUDE_DIR}
         src
     )