I want to implement a CMake-based build system for the following architecture:
As you can see: the
Model component has two interfaces: ModelRead and ModelEdit.What is the preferred way to implement this architecture?
- Implementing
ModelEditandModelReadas separate targets, e. g.STATIClibraries withtarget_include_directoriesset toPUBLIC? TheModelcomponent itself actually does not really exist as a dedicated target. - Implementing the
Modelcomponent as aSTATIClibrary withModelEditandModelReadbeingINTERFACElibraries thattarget_link_librariesto theModeltarget and havingINTERFACEinclude directories containing the public headers/functions? The directories containing the public headers/functions aretarget_include_directorieswith thePRIVATEkeyword to theModeltarget. - Or maybe something completely different?
To keep things simple, targets can all be static libraries which are finally linked into an executable.
Thanks for your thoughts and ideas, Rainer
