Modernize Boost module finding for CMake 3.30+
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 31 Dec 2025 10:36:59 +0000 (11:36 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 31 Dec 2025 11:09:24 +0000 (12:09 +0100)
commitb8d24365f69863e2afd8ba6ee1486a0257550403
tree66daf046161620d9be4d6ad144737625d0e66ebd
parent0f51eaee7781255862608aa27447f906541c8a7e
Modernize Boost module finding for CMake 3.30+

Add CMP0167 policy to suppress FindBoost deprecation warning on CMake 3.30+

Use modern Boost imported targets (Boost::iostreams, Boost::thread,
Boost::unit_test_framework) when available (CMAKE_VERSION >= 3.30)

Fallback to old-style variables for CMake 3.28.

Split target_link_libraries calls: Boost libraries + non-Boost libraries.

"include_directories" for Boost handled in root CMakeLists.txt.

Fixes: CMake warning about deprecated FindBoost module on CMake 3.30+:
*******************************************
CMake Warning (dev) at CMakeLists.txt:137 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.
*******************************************
CMakeLists.txt
src/CMakeLists.txt
test/CMakeLists.txt