Skip to content

fix(build): Link kcenon::common_system target in ThreadSystemDependencies.cmake for vcpkg find_package support #569

Description

@kcenon

What

When thread_system is consumed via find_package(common_system CONFIG) (the standard vcpkg path), ThreadSystemDependencies.cmake::find_common_system_dependency() successfully locates common_system but does not link the kcenon::common_system target to the ThreadSystem library. This causes downstream builds to fail with:

fatal error: 'kcenon/common/patterns/result.h' file not found

Why

  • This is the single blocker preventing vcpkg overlay port builds for kcenon-thread-system (monitoring_system#282)
  • Since thread_system is Tier 1, this cascades to all downstream libraries: logger_system, monitoring_system, network_system, and pacs_system
  • The add_subdirectory() path works because it adds include directories directly, but the find_package() path (used by vcpkg) relies on proper target linkage

Where

  • cmake/ThreadSystemDependencies.cmakefind_common_system_dependency() function
  • cmake/ThreadSystemConfig.cmake.in — consumer-side config template

How

  1. In find_common_system_dependency(), after find_package(common_system CONFIG) succeeds, link the target:
    if(common_system_FOUND AND TARGET kcenon::common_system)
        target_link_libraries(ThreadSystem PUBLIC kcenon::common_system)
    endif()
  2. Verify ThreadSystemConfig.cmake.in includes find_dependency(common_system CONFIG REQUIRED)
  3. Test with vcpkg overlay port build

Acceptance Criteria

  • find_package(common_system CONFIG) path properly links kcenon::common_system to ThreadSystem target
  • vcpkg overlay port build succeeds (vcpkg install kcenon-thread-system)
  • Downstream find_package(ThreadSystem CONFIG) resolves common_system transitively
  • Existing add_subdirectory() path remains unaffected
  • CI passes on all platforms (Linux/Windows/macOS)

Context

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingbuildBuild system and configurationdependenciesExternal dependencies managementpriority:highHigh priority issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions