From 5bd5a3fc7d072ab334d41041f73d3e380ece129d Mon Sep 17 00:00:00 2001 From: Oliver Lantwin Date: Mon, 11 May 2026 22:43:01 +0200 Subject: [PATCH] fix(build): Request Boost::serialization when BUILD_EXAMPLES is ON The propagator example (examples/advanced/propagator/src/CMakeLists.txt) links unconditionally against Boost::serialization, but the top-level CMakeLists.txt only requested the `serialization` component via find_package when BUILD_BASEMQ=ON. With CMP0167=NEW (CMake 3.30+), find_package(Boost) delegates to BoostConfig.cmake, which only defines imported targets for explicitly requested components. Configuring with BUILD_BASEMQ=OFF and BUILD_EXAMPLES=ON therefore fails: CMake Error at examples/advanced/propagator/src/CMakeLists.txt:48 (target_link_libraries): Target "ExPropagator" links to: Boost::serialization but the target was not found. Add `serialization` to the BUILD_EXAMPLES branch so the component is requested whenever any example that needs it is built. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22dbb6106e..3f324667a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,7 +227,7 @@ if(BUILD_BASEMQ OR BUILD_EXAMPLES OR BUILD_TESTING) list(APPEND boost_dependencies filesystem serialization program_options) endif() if(BUILD_EXAMPLES) - list(APPEND boost_dependencies program_options) + list(APPEND boost_dependencies program_options serialization) endif() if(BUILD_TESTING) list(APPEND boost_dependencies filesystem)