<div dir="ltr">Thank you for your answers. I have been able to create macros (see below) to replace cpack_add_component_group and cpack_add_component. These macros call the corresponding cpack macro and create install-${group-component} and install-${group} targets with appropriate dependencies.<br>
<br> Yann<br><br>macro( SOMA_ADD_COMPONENT_GROUP _group )<br> set( _readVariable )<br> set( _parentGroup )<br> foreach( _i ${ARGN} )<br> if( _readVariable )<br> set( ${_readVariable} "${_i}" )<br>
break()<br> else( _readVariable )<br> if( "${_i}" STREQUAL PARENT_GROUP )<br> set( _readVariable _parentGroup )<br> endif( "${_i}" STREQUAL PARENT_GROUP )<br> endif( _readVariable )<br>
endforeach( _i ${ARGN} )<br><br> cpack_add_component_group( ${_group} ${ARGN} )<br> add_custom_target( install-${_group} )<br> if( _parentGroup )<br> add_dependencies( install-${_parentGroup} install-${_group} )<br>
endif( _parentGroup )<br>endmacro(( SOMA_ADD_COMPONENT_GROUP _group )<br><br><br>macro( SOMA_ADD_COMPONENT _component )<br> set( _readVariable )<br> set( _group )<br> foreach( _i ${ARGN} )<br> if( _readVariable )<br>
set( ${_readVariable} "${_i}" )<br> break()<br> else( _readVariable )<br> if( "${_i}" STREQUAL GROUP )<br> set( _readVariable _group )<br> endif( "${_i}" STREQUAL GROUP )<br>
endif( _readVariable )<br> endforeach( _i ${ARGN} )<br><br> cpack_add_component( ${_component} ${ARGN} )<br> add_custom_target( install-${_component}<br> COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${_component} -P "${CMAKE_BINARY_DIR}/cmake_install.cmake" )<br>
add_dependencies( install-${_group} install-${_component} )<br>endmacro( SOMA_ADD_COMPONENT _component _group )<br><br><br>
</div>