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 19:47:41 UTC

[celix] branch feature/#80_bundle_start_with_exception updated: gh-118: Moves find_package and adding of imported targets to UseCelix.cmake instead of CelixConfig.cmake

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


The following commit(s) were added to refs/heads/feature/#80_bundle_start_with_exception by this push:
     new f0a56c0  gh-118: Moves find_package and adding of imported targets to UseCelix.cmake instead of CelixConfig.cmake
f0a56c0 is described below

commit f0a56c075f7a3c7fc37d0ca55a00d3fd2e731d01
Author: Pepijn Noltes <pe...@gmail.com>
AuthorDate: Wed Oct 2 21:47:00 2019 +0200

    gh-118: Moves find_package and adding of imported targets to UseCelix.cmake instead of CelixConfig.cmake
---
 cmake/CelixConfig.cmake          | 28 ----------------------------
 cmake/cmake_celix/UseCelix.cmake | 28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/cmake/CelixConfig.cmake b/cmake/CelixConfig.cmake
index c3d0d19..5dae9be 100644
--- a/cmake/CelixConfig.cmake
+++ b/cmake/CelixConfig.cmake
@@ -28,34 +28,6 @@ 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/cmake_celix/UseCelix.cmake b/cmake/cmake_celix/UseCelix.cmake
index a68cd9c..cda26c8 100644
--- a/cmake/cmake_celix/UseCelix.cmake
+++ b/cmake/cmake_celix/UseCelix.cmake
@@ -20,8 +20,36 @@ include(CMakeParseArguments)
 
 set(CELIX_CMAKE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CELIX_CMAKE_DIRECTORY}/../Modules)
+
+
+#Celix CMake function
 include(${CELIX_CMAKE_DIRECTORY}/BundlePackaging.cmake)
 include(${CELIX_CMAKE_DIRECTORY}/ContainerPackaging.cmake)
 include(${CELIX_CMAKE_DIRECTORY}/DockerPackaging.cmake)
 include(${CELIX_CMAKE_DIRECTORY}/Runtimes.cmake)
 include(${CELIX_CMAKE_DIRECTORY}/Generic.cmake)
+
+#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 ()
\ No newline at end of file