ores.cmake.component
Table of Contents
This page is the node for the ores.cmake.component facet of the codegen
template library, part of the ores.cmake technical space. Each archetype
below is documented, and holds its mustache source, in its own
linked page — this page is the facet-level summary and the routing
table to them.
Summary
Six templates generate the CMake build files for a component: the
component root dispatcher, four src variants for the plain / api /
core / service component flavours, the Catch2 test wiring, and the
PlantUML diagram target.
The ores.cmake.component facet
Projects a component onto its CMake build files: which targets
exist, what they link, and how tests and diagrams are wired into the
global run_all_tests / make_all_diagrams aggregation targets. The
facet's shape follows the api/core/service component split described
in component architecture: every component gets the same root, tests,
and modeling files, while src/CMakeLists.txt varies by component
flavour — that is why there are four *_src variants but only one of
each of the others.
Mustache incantations
{{#component}}…{{/component}}- section. Renders its body
with the component object pushed onto the context stack, so bare
names inside resolve against the component first; it also guards —
a missing
componentrenders empty rather than fails. {{full_name}}- escaped interpolation, resolved against the enclosing component. HTML-escaping is a no-op for the identifiers that appear here.
{{{cmake_license}}}- triple-stache (unescaped interpolation) — see the group doc's shared conventions.
{{! … }}- comment, removed with its line — what makes the GENERATED FILE header output-neutral.
Archetypes
| Archetype | Description |
|---|---|
| ores.cmake.component.api_src | src/CMakeLists.txt for an .api component (component-api profile): pure-types library linking only the eventing/platform public surface. Output projects/{component_full}/src/CMakeLists.txt. |
| ores.cmake.component.core_src | src/CMakeLists.txt for a .core component (component-core profile): links its sibling api library ({{api_full_name}}.lib) publicly plus the NATS/service stack privately. Output projects/{component_full}/src/CMakeLists.txt. |
| ores.cmake.component.modeling | modeling/CMakeLists.txt for every component profile: the generate_<name>_diagram PlantUML target, wired into make_all_diagrams. Output projects/{component_full}/modeling/CMakeLists.txt. |
| ores.cmake.component.root | Tiny dispatcher: the component root CMakeLists.txt just descends into src/, tests/ and modeling/. Used by every component profile (component, component-api, component-core, component-service); output projects/{component_full}/CMakeLists.txt. |
| ores.cmake.component.src | src/CMakeLists.txt for a plain library component (component profile): one shared library from all *.cpp under src/, with the database/utility/sqlgen dependency set. Output projects/{component_full}/src/CMakeLists.txt. |
| ores.cmake.component.tests | tests/CMakeLists.txt for every component profile: a Catch2 test executable from all *.cpp under tests/, the test_<name> custom target wired into run_all_tests, and the CTest registration with XML output. (The repeated boilerplate across the 65 per-component test files is the subject of the centralise-test-target capture.) Output projects/{component_full}/tests/CMakeLists.txt. |
| ores.cmake.component.files_src | src/component_files.cmake for every component profile: an explicit, checked-in set(files ...) list of every *.cpp under src/ (plus, for Qt AUTOMOC components, a set(HEADERS ...) list). Included by CMakeLists.txt in place of file(GLOB_RECURSE ...). Regenerated by a dedicated script, not the general compass codegen regenerate path. Output projects/{component_dir}/src/component_files.cmake. |
| ores.cmake.component.files_tests | tests/component_files.cmake, the tests/ sibling of files_src. Output projects/{component_dir}/tests/component_files.cmake. |
See also
- ores.cmake — the parent technical space's generated facet/archetype catalogue and shared Mustache conventions.
- Other Technical Spaces § "CMake Technical Space" — the domain-concept overview of this technical space.
- Codegen template library — the groups overview.