Skip to content

CMake: silence CMP0167 from MRViewer Boost::locale lookup#6076

Merged
Fedr merged 1 commit into
masterfrom
cmake/fix-cmp0167-mrviewer-boost-locale
May 8, 2026
Merged

CMake: silence CMP0167 from MRViewer Boost::locale lookup#6076
Fedr merged 1 commit into
masterfrom
cmake/fix-cmp0167-mrviewer-boost-locale

Conversation

@Fedr
Copy link
Copy Markdown
Contributor

@Fedr Fedr commented May 8, 2026

Summary

Switch the find_package(Boost ... locale) call in source/MRViewer/CMakeLists.txt to CONFIG mode on non-Emscripten builds, mirroring the pattern already used in MRMesh/CMakeLists.txt and MRPch/CMakeLists.txt.

This silences the CMP0167 deprecation warning ("The FindBoost module is removed") emitted by CMake 3.30+ when the legacy FindBoost module is invoked indirectly via vcpkg's Boost wrapper.

Why

CMake 3.30 removed the bundled FindBoost module in favor of Boost's own BoostConfig.cmake. Calling find_package(Boost ...) without CONFIG falls into the legacy module path, triggering:

CMake Warning (dev) at C:/vcpkg/installed/.../share/boost/vcpkg-cmake-wrapper.cmake:3 (_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):
  C:/vcpkg/scripts/buildsystems/vcpkg.cmake:813 (include)
  source/MRViewer/CMakeLists.txt:110 (find_package)

vcpkg already ships BoostConfig.cmake (its wrapper just forwards to it), so switching to CONFIG mode is a no-op functionally — the same Boost is found, only the legacy code path is avoided.

The Emscripten branch keeps module mode because vcpkg's Emscripten Boost port doesn't install CMake config files; that branch additionally sets CMP0167 OLD so the warning stays suppressed there too.

Test plan

  • CMP0167 warning gone from the windows-vs2019-meshlib configure log (the job that originated the warning).
  • Windows MSVC 2019 / MSVC 2022 build & test jobs pass.
  • Linux x64 (GCC 12/13/14, Clang 20) and arm64 (GCC 11, Clang 20, ubuntu22/24) build & test jobs pass.
  • macOS arm64 Debug + Release build & test jobs pass.
  • Emscripten Singlethreaded / Multithreaded / Multithreaded-64Bit configure, build & runtime tests pass — Boost::locale linkage unchanged on WASM.

Use Boost's own CMake config (BoostConfig.cmake) for the
`find_package(Boost ... locale)` call, mirroring the pattern already
used in MRMesh and MRPch. This stops CMake 3.30+ from emitting the
CMP0167 deprecation warning ("The FindBoost module is removed") on
non-Emscripten builds. The Emscripten branch keeps module mode,
since vcpkg's Emscripten Boost port doesn't ship a CMake config.
@Fedr Fedr merged commit f880841 into master May 8, 2026
39 checks passed
@Fedr Fedr deleted the cmake/fix-cmp0167-mrviewer-boost-locale branch May 8, 2026 18:25
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.

1 participant