ores.cmake.component.files_src

Table of Contents

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 of every *.hpp under include/, included by CMakeLists.txt in place of file(GLOB_RECURSE ...) – the idiomatic CMake approach (real build carries zero GLOB; an external generator regenerates the list on demand) rather than the CONFIGURE_DEPENDS mitigation. Output projects/{component_dir}/src/component_files.cmake.

See the Template variable reference for the complete list of available variables and their semantics. This archetype adds three more, none sourced from the model like every other field – computed by a filesystem scan at render time (projects/ores.codegen/src/codegen/core.py's _COMPONENT_FILES_TEMPLATES branch):

files
paths, relative to src/, of every *.cpp under it.
headers
paths, relative to include/, of every *.hpp under it (empty for a component with no include/ directory).
has_headers
boolean gate so the HEADERS block is only emitted when headers is non-empty.

Template

The full template source. Edit here and re-tangle with compass build --direct tangle_codegen_templates to regenerate library/templates/cmake_component_files_src.mustache.

{{! GENERATED FILE — tangled from projects/ores.codegen/library/templates/ores.cmake.component.files_src.org. Edit the org source. }}
{{{cmake_license}}}
{{! Regenerate: projects/ores.codegen/scripts/regenerate_cmake_component_files.py --component <name> (or --all). Never hand-edit. }}
{{#component}}
set(files
{{#files}}
    "{{.}}"
{{/files}}
)
{{#has_headers}}

# Headers must be listed for AUTOMOC to find Q_OBJECT declarations.
set(HEADERS
{{#headers}}
    "${CMAKE_CURRENT_SOURCE_DIR}/../include/{{.}}"
{{/headers}}
)
{{/has_headers}}
{{/component}}

See also

Emacs 29.3 (Org mode 9.6.15)