You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by ab...@apache.org on 2020/05/19 10:09:47 UTC

[celix] branch feature/fallback_build_types_targets created (now 01610c3)

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

abroekhuis pushed a change to branch feature/fallback_build_types_targets
in repository https://gitbox.apache.org/repos/asf/celix.git.


      at 01610c3  Added property for targets so that build type is set for bundles. Using this makes it possible to include all type configs and let cmake figure out which one to use.

This branch includes the following new commits:

     new 01610c3  Added property for targets so that build type is set for bundles. Using this makes it possible to include all type configs and let cmake figure out which one to use.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[celix] 01/01: Added property for targets so that build type is set for bundles. Using this makes it possible to include all type configs and let cmake figure out which one to use.

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

abroekhuis pushed a commit to branch feature/fallback_build_types_targets
in repository https://gitbox.apache.org/repos/asf/celix.git

commit 01610c353b91fad0ed353e071a7be53945789bf9
Author: Alexander Broekhuis <al...@luminis.eu>
AuthorDate: Tue May 19 12:09:36 2020 +0200

    Added property for targets so that build type is set for bundles. Using this makes it possible to include all type configs and let cmake figure out which one to use.
---
 cmake/CelixConfig.cmake                 | 7 ++++++-
 cmake/cmake_celix/BundlePackaging.cmake | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/cmake/CelixConfig.cmake b/cmake/CelixConfig.cmake
index 3f60854..f9cc1a4 100644
--- a/cmake/CelixConfig.cmake
+++ b/cmake/CelixConfig.cmake
@@ -30,7 +30,12 @@ get_filename_component(REL_INSTALL_DIR "${REL_INSTALL_DIR}" PATH)
 
 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_BUILD_TYPE}.cmake") #imports bundle targets (e.g. Celix::shell)
+
+# Load information for each installed configuration.
+file(GLOB CONFIG_FILES "${REL_INSTALL_DIR}/share/celix/cmake/CelixTargets-*.cmake")
+foreach(f ${CONFIG_FILES})
+  include(${f})
+endforeach()
 
 # The rest is added to ensure backwards compatiblity with project using the cmake lib/include var instead of targets.
 set(CELIX_CMAKE_MODULES_DIR ${REL_INSTALL_DIR}/share/celix/cmake/Modules)
diff --git a/cmake/cmake_celix/BundlePackaging.cmake b/cmake/cmake_celix/BundlePackaging.cmake
index 8c0ff2a..91db057 100644
--- a/cmake/cmake_celix/BundlePackaging.cmake
+++ b/cmake/cmake_celix/BundlePackaging.cmake
@@ -876,9 +876,11 @@ get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)
 
     foreach(BUNDLE_TARGET IN LISTS EXPORT_BUNDLES)
         set(TN "${EXPORT_NAMESPACE}${BUNDLE_TARGET}")
+        string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
         file(APPEND "${CONF_IN_FILE}" "
 if (NOT TARGET ${TN}) 
     add_library(${TN} SHARED IMPORTED)
+    set_property(TARGET ${TN} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${BUILD_TYPE})
     set_target_properties(${TN} PROPERTIES
         BUNDLE_IMPORTED TRUE
         BUNDLE_FILE \"\${_IMPORT_PREFIX}/share/${EXPORT_PROJECT_NAME}/bundles/$<TARGET_PROPERTY:${BUNDLE_TARGET},BUNDLE_FILENAME>\"