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 <[email protected]> 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>\"
