<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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yann<br><br>macro( SOMA_ADD_COMPONENT_GROUP _group )<br>&nbsp; set( _readVariable )<br>&nbsp; set( _parentGroup )<br>&nbsp; foreach( _i ${ARGN} )<br>&nbsp;&nbsp;&nbsp; if( _readVariable )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set( ${_readVariable} &quot;${_i}&quot; )<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break()<br>&nbsp;&nbsp;&nbsp; else( _readVariable )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( &quot;${_i}&quot; STREQUAL PARENT_GROUP )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set( _readVariable _parentGroup )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endif( &quot;${_i}&quot; STREQUAL PARENT_GROUP )<br>&nbsp;&nbsp;&nbsp; endif( _readVariable )<br>
&nbsp; endforeach( _i ${ARGN} )<br><br>&nbsp; cpack_add_component_group( ${_group} ${ARGN} )<br>&nbsp; add_custom_target( install-${_group} )<br>&nbsp; if( _parentGroup )<br>&nbsp;&nbsp;&nbsp; add_dependencies( install-${_parentGroup} install-${_group} )<br>
&nbsp; endif( _parentGroup )<br>endmacro(( SOMA_ADD_COMPONENT_GROUP _group )<br><br><br>macro( SOMA_ADD_COMPONENT _component )<br>&nbsp; set( _readVariable )<br>&nbsp; set( _group )<br>&nbsp; foreach( _i ${ARGN} )<br>&nbsp;&nbsp;&nbsp; if( _readVariable )<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set( ${_readVariable} &quot;${_i}&quot; )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break()<br>&nbsp;&nbsp;&nbsp; else( _readVariable )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( &quot;${_i}&quot; STREQUAL GROUP )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set( _readVariable _group )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endif( &quot;${_i}&quot; STREQUAL GROUP )<br>
&nbsp;&nbsp;&nbsp; endif( _readVariable )<br>&nbsp; endforeach( _i ${ARGN} )<br><br>&nbsp; cpack_add_component( ${_component} ${ARGN} )<br>&nbsp; add_custom_target( install-${_component}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COMMAND ${CMAKE_COMMAND} -DCOMPONENT=${_component} -P &quot;${CMAKE_BINARY_DIR}/cmake_install.cmake&quot; )<br>
&nbsp; add_dependencies( install-${_group} install-${_component} )<br>endmacro( SOMA_ADD_COMPONENT _component _group )<br><br><br>
</div>