Skip to content

Centralize CMake component packaging - #228

Draft
VolkerChristian wants to merge 6 commits into
masterfrom
agent/centralize-component-packaging
Draft

Centralize CMake component packaging#228
VolkerChristian wants to merge 6 commits into
masterfrom
agent/centralize-component-packaging

Conversation

@VolkerChristian

@VolkerChristian VolkerChristian commented Jul 30, 2026

Copy link
Copy Markdown
Member

What changed

  • introduce one canonical snodec_add_component(...) declaration beside each component target
  • move primary headers and additional development files into repeatable HEADERS and DEVELOPMENT_FILES sections of that declaration
  • remove snodec_install_component_headers(...) and snodec_install_component_development_files(...)
  • make component declarations metadata-only; they no longer emit partial install/package state while subdirectories are still being processed
  • add one generic snodec_finalize_components(...) phase after every component has registered
  • centralize late installation of runtime targets, namelinks, archives, headers, development files, CMake exports, package config files, and version metadata
  • retain the runtime/-dev package split and generated find_package(snodec COMPONENTS ...) model
  • keep snodec_finalize_cpack_components() as a CPack adapter over the already-finalized component registry
  • expose generator-neutral component metadata and resolved dependency definitions for future OpenWrt package generation

Design

Each component now has exactly one owning declaration. The declaration records its target, public status, dependency overrides, install destinations, header sets, and development files. No global file contains a second component inventory.

snodec_finalize_components(...) runs once after all component subdirectories. It validates duplicate and missing registrations, resolves runtime and public-development dependency graphs, rejects cycles, creates all install/export rules, and generates the installed CMake package model.

CPack consumes that finalized registry rather than owning component metadata. The same registry can be consumed by an OpenWrt adapter through:

  • snodec_get_components(...)
  • snodec_get_public_components(...)
  • snodec_get_component_dependency_definitions(...)
  • snodec_get_component_metadata(...)

This prepares OpenWrt reuse without pretending that CPack itself produces OpenWrt .ipk packages.

Validation

  • the new refactor is one linear commit on the previously green packaging head
  • 68 files changed in that successor commit
  • fresh full configuration with applications and tests enabled
  • epoll, poll, and select configuration matrix
  • duplicate, missing-dependency, cycle, declaration, repeated-header-set, finalization, and metadata-contract tests
  • installed snodecConfig.cmake and version metadata remain equivalent
  • generated CPack component and dependency metadata remain equivalent
  • isolated runtime/development package fixture verifies repeated header roots, extra development files, namelinks, exports, and dependency separation
  • full GitHub Actions build passes
  • all CTest tests pass
  • complete Debian component-package generation passes
  • final package layout and dependency validation passes

@VolkerChristian
VolkerChristian force-pushed the agent/centralize-component-packaging branch from 555a974 to 6abed7e Compare July 30, 2026 16:47
@VolkerChristian
VolkerChristian force-pushed the agent/centralize-component-packaging branch from bf77f60 to e281cda Compare July 30, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant