471a472,552
> # Add inter-component dependencies
> if(CPACK_RPM_PACKAGE_COMPONENT) # it means that we package components, either per component or per group
>     # Define whether we are packaging per group or per component
>     if(CPACK_COMPONENTS_GROUPING STREQUAL "ONE_PER_GROUP" OR NOT DEFINED CPACK_COMPONENTS_GROUPING)
>         set(PER_GROUP 1)
>     endif()
>     # Variable CURRENT_PKG defines either the component or the group depending on the mode
>     set(CURRENT_PKG ${CPACK_RPM_PACKAGE_COMPONENT})
>     string(TOUPPER ${CURRENT_PKG} UPPER_CURRENT_PKG)
>     # necessary because later it checks whether it exists or not
>     SET(CPACK_RPM_${CURRENT_PKG}_PACKAGE_REQUIRES "") 
>     unset(_DEPENDENCIES)
>     
>     # add the package requirements to the list of component's requirements
>     if(DEFINED CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES) # add coma if non empty
>         SET(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES},") 
>     endif()
>     SET(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES} ${CPACK_RPM_PACKAGE_REQUIRES}")
>     
>                 
>     # get dependencies of this component or group of components
>     if (NOT PER_GROUP)
>         if(DEFINED CPACK_COMPONENT_${UPPER_CURRENT_PKG}_DEPENDS)
>             SET(_DEPENDENCIES ${CPACK_COMPONENT_${UPPER_CURRENT_PKG}_DEPENDS})
>         endif()
>     else()
>         # get all dependencies of all components of this group
>         foreach(_COMPNAME ${CPACK_COMPONENTS_ALL})
>             # first determine the component's group
>             string(TOUPPER ${_COMPNAME} _UPPER_COMPNAME)
>             if(NOT DEFINED CPACK_COMPONENT_${_UPPER_COMPNAME}_GROUP)  # case when a component has no group
>                 set(COMPGROUP ${_UPPER_COMPNAME})
>             else()
>                 SET(COMPGROUP ${CPACK_COMPONENT_${_UPPER_COMPNAME}_GROUP})
>             endif()
>             string(TOUPPER ${COMPGROUP} UPPER_COMPGROUP)
>             # second, if it is in the group we are producing a package for, gets its dependencies
>             if(${UPPER_COMPGROUP} STREQUAL ${UPPER_CURRENT_PKG})
>                 if(DEFINED CPACK_COMPONENT_${_UPPER_COMPNAME}_DEPENDS)
>                     SET(_DEPENDENCIES ${CPACK_COMPONENT_${_UPPER_COMPNAME}_DEPENDS})
>                 endif()
>             endif()
>         endforeach()
>     endif()
>     
>     # Compute library name and assign it to the list of dependencies
>     if(DEFINED _DEPENDENCIES)
>         if(CPACK_RPM_PACKAGE_DEBUG)
>             message("CPackRPM:Debug: Inter-component dependency for component ${UPPER_CURRENT_PKG} defined : ${CPACK_COMPONENT_${UPPER_CURRENT_PKG}_DEPENDS}")
>         endif()
>         
>         # Add the inter-component dependencies to the list of component's requirements
>         foreach(_DEPENDS ${_DEPENDENCIES})
>             if (NOT PER_GROUP)
>                 # Prepare the library name (<project>-<component>) and add it to the requirements
>                 SET(_PACKAGE_NAME "${CPACK_RPM_PACKAGE_NAME}-${_DEPENDS}")
>                 SET(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES}, ${_PACKAGE_NAME}")
>             else()
>                 # Prepare the library name (<project>-<group>) 
>                 string(TOUPPER ${_DEPENDS} _UPPER_DEPENDS) 
>                 if(NOT DEFINED CPACK_COMPONENT_${_UPPER_DEPENDS}_GROUP) # case when a component has no group
>                     SET(_DEPENDENCY_GROUP "${_DEPENDS}")
>                 else()
>                     SET(_DEPENDENCY_GROUP "${CPACK_COMPONENT_${_UPPER_DEPENDS}_GROUP}")
>                 endif()
>                 string(TOUPPER ${_DEPENDENCY_GROUP} _UPPER_DEPENDENCY_GROUP)
>                 SET(_PACKAGE_NAME "${CPACK_RPM_PACKAGE_NAME}-${_DEPENDENCY_GROUP}")
>                 # add dependency to the requirements
>                 if(NOT ${_UPPER_DEPENDENCY_GROUP} STREQUAL ${UPPER_CURRENT_PKG}) # Do not consider dependency on itself
>                     SET(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES}, ${_PACKAGE_NAME}")
>                 endif()
>             endif()
>         endforeach()
>     endif()
>    
>     if(CPACK_RPM_PACKAGE_DEBUG)
>         message("CPackRPM:Debug: List of requirements after inter-component dependencies have been applied CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES : ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_REQUIRES}")
>     endif()
> endif()
> 
> 
524a606,607
> 
>  
