Skip to content

cmake - fix deprecated FindBoost module warnings - #8220

Open
Andrej730 wants to merge 1 commit into
arvidn:RC_2_0from
Andrej730:cmake-findboost-warnings
Open

Andrej730 wants to merge 1 commit into
arvidn:RC_2_0from
Andrej730:cmake-findboost-warnings

Conversation

@Andrej730

Copy link
Copy Markdown
Contributor

Explicitly setting OLD behavior for policy to silence the warning below and keep behaviour consistent for older and newer cmake version, until we migrate to cmake 3.30.

CMake Warning (dev) at cmake/Modules/LibtorrentMacros.cmake:43 (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.

Call Stack (most recent call first):
  CMakeLists.txt:821 (find_public_dependency)
This warning is for project developers.  Use -Wno-dev to suppress it.

Explicitly setting `OLD` behavior for policy to silence the warning below and keep behaviour consistent for older and newer cmake version, until we migrate to cmake 3.30.
```
CMake Warning (dev) at cmake/Modules/LibtorrentMacros.cmake:43 (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.

Call Stack (most recent call first):
  CMakeLists.txt:821 (find_public_dependency)
This warning is for project developers.  Use -Wno-dev to suppress it.
```
@arvidn

arvidn commented Mar 23, 2026

Copy link
Copy Markdown
Owner

by suppressing this warning, it makes it more likely to forget replacing the FindBoost module with find_package(Boost CONFIG). Would it not be better to just do the switch?

@Andrej730

Copy link
Copy Markdown
Contributor Author

@arvidn it's up to you, I just wanted to keep behaviour consistent across different cmake versions and fix the warning. Let's just switch to CONFIG in Boost's find_package then?

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.

2 participants