[CMake] HOWTO declare component inter-dependencies in multi-component packages

Kyle Edwards kyle.edwards at kitware.com
Thu Oct 3 16:37:10 EDT 2019


On Thu, 2019-10-03 at 16:30 -0400, stefan wrote:
> Hi Kyle,
> thanks for the quick followup.
> On 2019-10-03 4:23 p.m., Kyle Edwards wrote:
> > Please take a look at cpack_add_component():
> > https://cmake.org/cmake/help/latest/module/CPackComponent.html
> I'm not sure what specifically I should be looking for.
> In general my setup is working fine, i.e. my build generates multiple
> packages as expected. They even contain dependencies to external
> packages, as I have set as per the available variables. What I
> haven't been able to express is the component inter-dependency. That
> is, I haven't found a way to make my "development" package depend on
> the "runtime" package (generated from the same build process).
> Sorry for being obtuse.

In particular, please look at the DEPENDS argument of
cpack_add_component():

"DEPENDS lists the components on which this component depends. If this
component is selected, then each of the components listed must also be
selected. The dependency information is encoded within the installer
itself, so that users cannot install inconsistent sets of components."

Kyle


More information about the CMake mailing list