Modernize Boost detection for CMake 3.30+ master
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 31 Dec 2025 15:02:00 +0000 (16:02 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 31 Dec 2025 16:05:21 +0000 (17:05 +0100)
commit4f600d690ee0dcbecef4b02edb5700fe84c4a9b3
treef555ae040be3b5334767f45bc75cbb25a3bc0883
parentf7ed9dd371f9387ed5b715a4f316eea9f85de48d
Modernize Boost detection for CMake 3.30+

Add CMP0167 policy for CMake 3.30+ to suppress FindBoost deprecation warning.
Use modern Boost imported targets when available (CMake 3.30+).

Fall back to old-style variables for backward compatibility.

Move detection of "Boost" to test/CMakeLists.txt only.

Tested with:

cmake version   gcc version   Boost version
3.31.6 (F42)    15.2.1        1.83.0
3.28.2          4.4.4         1.44.0
3.28.2          8.3.1         1.76.0
CMakeLists.txt
test/CMakeLists.txt