Skip to content

chore(cmake): Standardize install(EXPORT) naming and namespace convention across ecosystem #456

Description

@kcenon

Part of #455

What

Standardize CMake install(EXPORT) target file names and namespace prefixes across all 8 ecosystem systems. Some systems have already adopted snake_case at the portfile level (kcenon/network_system#843, kcenon/monitoring_system#562), but the source-level export names remain inconsistent.

  • Current: Mixed conventions for export files and namespaces (see matrix below)
  • Expected: All systems use <name>-targets.cmake (snake_case + hyphen) and <name>:: (snake_case) namespace
  • Scope: CMakeLists.txt and cmake/*Install*.cmake across all 8 systems

Current State Matrix

System Export File Namespace Convention
common_system common_systemTargets kcenon:: no separator, custom ns
thread_system ThreadSystemTargets thread_system:: / ThreadSystem:: PascalCase, dual namespace
logger_system logger_system-targets LoggerSystem:: hyphen, PascalCase ns
container_system container_system-targets ContainerSystem:: hyphen, PascalCase ns
monitoring_system monitoring_system_targets monitoring_system:: underscore, snake_case ns
database_system database_system-targets DatabaseSystem:: hyphen, PascalCase ns
network_system network_system-targets NetworkSystem:: hyphen, PascalCase ns
pacs_system pacs_systemTargets kcenon::pacs:: no separator, nested ns

Proposed Standard

Field Convention Example
Export file <name>-targets.cmake network_system-targets.cmake
Namespace <name>:: network_system::
Config file <name>-config.cmake network_system-config.cmake
find_package find_package(<name> CONFIG) find_package(network_system CONFIG)

Why

Where

System Files to Modify
common_system CMakeLists.txt (lines 272-304)
thread_system cmake/ThreadSystemInstall.cmake (lines 114-122)
logger_system CMakeLists.txt (lines 648-654)
container_system CMakeLists.txt (lines 594-621)
monitoring_system CMakeLists.txt (lines 862-864) — already snake_case
database_system CMakeLists.txt (lines 373-404)
network_system cmake/NetworkSystemInstall.cmake (lines 69-71)
pacs_system CMakeLists.txt (lines 2253-2285)

How

Technical Approach

Each system needs:

  1. Change install(EXPORT ...) to use <name>-targets (snake_case + hyphen)
  2. Change NAMESPACE to <name>:: (snake_case)
  3. Update *Config.cmake.in to include("${CMAKE_CURRENT_LIST_DIR}/<name>-targets.cmake")
  4. Update overlay portfile if it has PascalCase wrapper workarounds (remove wrappers)

Phase Plan

Phase Systems Risk
1 monitoring_system (already done) None
2 common_system, thread_system Medium — most depended-upon
3 logger_system, container_system, database_system Low
4 network_system, pacs_system Low

Acceptance Criteria

  • All 8 systems use <name>-targets.cmake export file pattern
  • All 8 systems use <name>:: snake_case namespace
  • No PascalCase wrapper files in overlay ports
  • Consumer project can find_package() + target_link_libraries() using a predictable, consistent pattern across all 8 systems
  • Config templates reference correct targets file names

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions