Skip to content

fix(build): link kcenon::common_system target for vcpkg find_package support#571

Merged
kcenon merged 1 commit into
mainfrom
fix/issue-569-link-common-system-target-vcpkg
Mar 10, 2026
Merged

fix(build): link kcenon::common_system target for vcpkg find_package support#571
kcenon merged 1 commit into
mainfrom
fix/issue-569-link-common-system-target-vcpkg

Conversation

@kcenon

@kcenon kcenon commented Mar 10, 2026

Copy link
Copy Markdown
Owner

Closes #569

Summary

  • Link kcenon::common_system imported target to ThreadSystem in create_thread_system_targets() when found via find_package(common_system CONFIG) (vcpkg path)
  • Add find_dependency(common_system CONFIG REQUIRED) to both consumer-side config templates (ThreadSystemConfig.cmake.in and thread_system-config.cmake.in) for transitive dependency resolution

Problem

When thread_system is consumed via find_package(ThreadSystem CONFIG) (the vcpkg path), find_common_system_dependency() 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

The add_subdirectory() path works because it adds include directories globally via include_directories(), but the find_package() path relies on proper target linkage to propagate include directories.

Changes

File Change
cmake/ThreadSystemTargets.cmake Link kcenon::common_system to ThreadSystem when target exists
cmake/ThreadSystemConfig.cmake.in Add find_dependency(common_system CONFIG REQUIRED)
cmake/thread_system-config.cmake.in Add find_dependency(common_system CONFIG REQUIRED)

Test Plan

  • Local CMake configure succeeds
  • Full Release build succeeds (MSVC)
  • Smoke tests pass
  • CI passes on all platforms (Linux/Windows/macOS)
  • vcpkg overlay port build succeeds (vcpkg install kcenon-thread-system)
  • Downstream find_package(ThreadSystem CONFIG) resolves common_system transitively

…path

When common_system is found via find_package(common_system CONFIG), the
kcenon::common_system imported target carries include directories and
transitive dependencies. Without linking this target to ThreadSystem,
downstream vcpkg consumers fail with missing headers.

- Link kcenon::common_system to ThreadSystem in create_thread_system_targets()
  when the target exists (vcpkg/find_package path)
- Add find_dependency(common_system CONFIG REQUIRED) to both config templates
  (ThreadSystemConfig.cmake.in and thread_system-config.cmake.in) so
  downstream find_package(ThreadSystem) resolves common_system transitively

Closes #569
@github-actions

Copy link
Copy Markdown
Contributor

📊 Performance Benchmark Results

Performance Benchmark Report

No benchmark data available.

ℹ️ No baseline reference available

This is the first benchmark run or baseline file is missing.

@kcenon kcenon merged commit 5cd32cd into main Mar 10, 2026
26 checks passed
@kcenon kcenon deleted the fix/issue-569-link-common-system-target-vcpkg branch March 10, 2026 02:40
kcenon added a commit that referenced this pull request Apr 13, 2026
…path (#571)

When common_system is found via find_package(common_system CONFIG), the
kcenon::common_system imported target carries include directories and
transitive dependencies. Without linking this target to ThreadSystem,
downstream vcpkg consumers fail with missing headers.

- Link kcenon::common_system to ThreadSystem in create_thread_system_targets()
  when the target exists (vcpkg/find_package path)
- Add find_dependency(common_system CONFIG REQUIRED) to both config templates
  (ThreadSystemConfig.cmake.in and thread_system-config.cmake.in) so
  downstream find_package(ThreadSystem) resolves common_system transitively

Closes #569
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.

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

1 participant