Working on modernizing a non-trivial monorepo with a significant amount of it’s own tooling (code gen, asset conversion, etc). As part of this I wanted to incorporate cmake tooling to build some of the tools and install them into their final locations in the monorepo.
For instance, we have a build target called “Pipeline” which builds all the tools, by depending on targets “CodeGen, Conversion, …, Distribution”. “CodeGen” has multiple sub-targets with multiple sub-targets…
Using install(...COMPONENT...)
is not nothing, but it introduces duplications and - to get a semblance of the granularity we want - means repeating things in aggregate, which tends to encourage falling back to old-school “everything in variables” pattern.
Is there any facility for building meta-components or anything like that? You can reference a single component from multiple install()s, but you don’t appear to be able to do, e.g:
INSTALL(TARGETS executable COMPONENT App COMPONENT JustExe ...)
INSTALL(TARGETS library COMPONENT App COMPONENT JustLib ...)
This results in components JustExe and JustLib but not App.