Repository navigation
Conversation
Signed-off-by: Abhishek Agarwal <agab0323@gmail.com>
fruffy
reviewed
Dec 4, 2026
|
|
||
| cmake_minimum_required(VERSION 3.10) | ||
|
|
||
| # Find Boost through its BoostConfig.cmake; CMake 3.30+ drops FindBoost |
Contributor
There was a problem hiding this comment.
Not a big fan of cmake policy setting, what is the actual fix here?
We can have different behavior for different cmake versions if necessary.
Member
Author
There was a problem hiding this comment.
yeahh right fair point. There's no functional bug. It only removes the CMP0167 deprecation warning that CMake 3.30+ prints on every configure, CI included.
I switched to your suggestion in 1df177d: CONFIG mode for CMake 3.30+, the old call otherwise. BOOST_ROOT is passed as a hint because config mode ignores it here. Does this look better?
Signed-off-by: Abhishek Agarwal <agab0323@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With CMake 3.30 and newer, every configure prints the CMP0167 warning ("The FindBoost module is removed"). It also shows in both
test-cmakejobs on main, e.g. https://github.com/p4lang/behavioral-model/actions/runs/47344195452. Nothing fails today;cmake --help-policy CMP0167says the old FindBoost behavior "may be removed in a future version of CMake".With CMake 3.30 and newer, this calls
find_package(Boost CONFIG ...), which loads Boost's ownBoostConfig.cmakedirectly. Older CMake keeps the current call. FindBoost already hands off toBoostConfig.cmakewhen it exists ("If found, the package configuration file is loaded and this module returns with no further action",cmake --help-module FindBoost), so on those systems only that extra step goes away.BOOST_ROOTis passed as a hint, because config mode does not read it with this project'scmake_minimum_required(VERSION 3.10)(CMP0144 is not set).CMAKE_PREFIX_PATHandBoost_DIRwork as before. FindBoost-only settings such asBoost_NO_BOOST_CMAKEno longer apply with CMake 3.30+; nothing in the repo uses them.Testing
Fresh configure of main and of main with this change, Arch Linux, Boost 1.92:
Boost_DIRis the same. The generatedbuild.ninjadiffers only in the rule that re-runs CMake (FindBoost.cmakeis no longer an input). Same with-DENABLE_PACKET_TRACE=ON -DENABLE_WERROR=ONon CMake 4.4.4.build.ninjais identical to main.BoostConfig.cmakestops configure,-DBOOST_ROOT=...,BOOST_ROOTin the environment and-DCMAKE_PREFIX_PATH=...all pick it up, as on main.BoostConfig.cmakeand thethreadandprogram_optionsconfig files ship with CI's Boost 1.83 (see the log above), Ubuntu's Boost 1.90 packages (used byDockerfile.ubuntu-26.04) and Fedora'sboost-devel(43, 45 and rawhide).