Module: kamailio Branch: master Commit: 97345507045bee739b006298a586dfaedc2b09e8 URL: https://github.com/kamailio/kamailio/commit/97345507045bee739b006298a586dfae...
Author: Xenofon Karamanos xk@gilawa.com Committer: Xenofon Karamanos xk@gilawa.com Date: 2025-07-24T13:11:45Z
cmake: Fix component group names for dbshema generation
- dbshema modules generated components that were not provided by user - if a module with dbschema is included in the include_modules list, it will now be in "user_specified_list" component instead of the actual KGROUP component that might be not included.
---
Modified: cmake/groups.cmake
---
Diff: https://github.com/kamailio/kamailio/commit/97345507045bee739b006298a586dfae... Patch: https://github.com/kamailio/kamailio/commit/97345507045bee739b006298a586dfae...
---
diff --git a/cmake/groups.cmake b/cmake/groups.cmake index c629ee49f93..353611f03be 100644 --- a/cmake/groups.cmake +++ b/cmake/groups.cmake @@ -754,7 +754,7 @@ set(MODULE_GROUP_PACKAGE_GROUPS
# Add group names to available group and provide "ALL_PACKAGED" as well # for easier packaging using components -list(APPEND AVAILABLE_GROUPS ALL_PACKAGED ${MODULE_GROUP_PACKAGE_GROUPS}) +list(APPEND AVAILABLE_GROUPS ALL_PACKAGED KMINI ${MODULE_GROUP_PACKAGE_GROUPS})
# Find the group name for the target by checking if the module is in the # list of modules to be built and if so, use the group name of that module @@ -764,28 +764,20 @@ function(find_group_name module) "" PARENT_SCOPE ) - # This was need due to the dbschema.cmake - # If one select one of these option as group - # we want the group name to match instead of the actual group it belongs to - if(MODULE_GROUP_NAME STREQUAL "ALL" - OR MODULE_GROUP_NAME STREQUAL "DEFAULT" - OR MODULE_GROUP_NAME STREQUAL "STANDARD" - OR MODULE_GROUP_NAME STREQUAL "COMMON" - ) - set(group_name - "${MODULE_GROUP_NAME}" - PARENT_SCOPE - ) - return() + separate_arguments(groups_to_search_in UNIX_COMMAND ${MODULE_GROUP_NAME}) + list(FIND groups_to_search_in "ALL_PACKAGED" group_index) + if(group_index GREATER -1) + # Remove it from the list and append the package groups + list(REMOVE_AT groups_to_search_in ${group_index}) + list(APPEND groups_to_search_in ${MODULE_GROUP_PACKAGE_GROUPS}) endif() - # message(WARNING "groups to search in" ${MODULE_GROUP_PACKAGE_GROUPS}) - # Get all variable names in the current CMake context - foreach(group IN LISTS MODULE_GROUP_PACKAGE_GROUPS) - # message(WARNING "Modules in group ${group}: ${MODULES_IN_GROUP}") - # message(WARNING "Checking group ${group} for db ${module}") + # message(WARNING "Groups provided by the user ${groups_to_search_in}") + # message(WARNING "Looking for group for db ${module}") + foreach(group IN LISTS groups_to_search_in) get_property(MODULES_IN_GROUP VARIABLE PROPERTY "MODULE_GROUP_${group}") + # message(WARNING "Modules in group ${group}: ${MODULES_IN_GROUP}") if("${module}" IN_LIST MODULES_IN_GROUP) - # message(WARNING "Found group ${group} for db ${module}") + # message(WARNING "Found group ${group} for db ${module}") set(group_name "${group}" PARENT_SCOPE @@ -793,5 +785,12 @@ function(find_group_name module) return() endif() endforeach() - message((STATUS "module ${module} not found in any group")) + message(STATUS "module ${module} not found in any group") + # if not found in any group, it's probably in include_modules list + # Use the group name "user_specified_list" associated with include_modules + # list, otherwise it will generate Unknown group component + set(group_name + "user_specified_list" + PARENT_SCOPE + ) endfunction()