Skip to content

Resolve installed Boost dependencies from the producer configuration - #253

Open
dajiaohuang wants to merge 1 commit into
daniele77:masterfrom
dajiaohuang:fix/installed-boost-dependencies-20261016
Open

dajiaohuang wants to merge 1 commit into
daniele77:masterfrom
dajiaohuang:fix/installed-boost-dependencies-20261016

Conversation

@dajiaohuang

Copy link
Copy Markdown

Problem

Installing with CLI_UseBoostAsio=ON and compiled Boost libraries succeeds, but a fresh consumer using only find_package(cli CONFIG REQUIRED) and cli::cli fails CMake generation: the exported link interface references Boost::system without defining that imported target. It also exports Boost::date_time.

The package config tests the consumer's CLI_UseBoostAsio, rather than the configuration that created the exported target. This revisits the installed-package behavior discussed in #117, including the current header-only fallback.

Change

Record whether compiled Boost targets were exported, substitute that fact into the installed config, and discover both exported Boost components. Do not require compiled Boost libraries for the header-only fallback or no-Asio configuration.

Add an install-and-consume CTest covering compiled Boost, header-only Boost, and no Boost modes.

Validation

  • Fresh installed consumer fails on master 769c5fa with missing Boost::system; succeeds after the change.
  • All three install/consumer configurations passed on Ubuntu 24.04 / CMake 3.28 / GCC 13 / Boost 1.83.
  • Six Boost-enabled examples compiled; a public installed consumer executed its addition command successfully.
  • Windows/macOS, old CMake, standalone-Asio and the full CI matrix were not run locally.

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