Skip to content

feat(cmake): adopt snake_case install(EXPORT) name for vcpkg compatibility #424

Description

@kcenon

What

Change the CMake install(EXPORT) name from ContainerSystemTargets to container_system_targets,
and update the config install destination to lib/cmake/container_system.

Why

The monitoring_system vcpkg overlay ports standardized on snake_case PACKAGE_NAME
to match vcpkg port naming conventions (kcenon-container-systemcontainer_system).

Currently the portfile must work around this with a wrapper config file:

# vcpkg-ports/kcenon-container-system/portfile.cmake (wrapper workaround)
vcpkg_cmake_config_fixup(
    PACKAGE_NAME container_system
    CONFIG_PATH lib/cmake/ContainerSystem   # <-- PascalCase upstream path
)
file(WRITE ".../container_system-config.cmake"
    "include(\".../ContainerSystemConfig.cmake\")\n"  # <-- indirection wrapper
)

Once this upstream adopts snake_case natively, the CONFIG_PATH override and
wrapper file in the portfile can be removed.

Where

How

Acceptance Criteria

  • find_package(container_system CONFIG) works directly from the installed cmake directory
  • No wrapper config file needed in the vcpkg portfile
  • ContainerSystem::container target still usable (target namespace unchanged)
  • Existing consumers' target_link_libraries(... ContainerSystem::container) still compile

Implementation

In CMakeLists.txt:

# Before
install(EXPORT ContainerSystemTargets
    NAMESPACE ContainerSystem::
    DESTINATION lib/cmake/ContainerSystem
)
configure_package_config_file(... INSTALL_DESTINATION lib/cmake/ContainerSystem)

# After
install(EXPORT ContainerSystemTargets
    NAMESPACE ContainerSystem::
    DESTINATION lib/cmake/container_system
)
configure_package_config_file(... INSTALL_DESTINATION lib/cmake/container_system)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions