From 9ee8e8ceb8112b404bd5d28b8491dbfa5514fd2d Mon Sep 17 00:00:00 2001 From: Fedor Chelnokov Date: Fri, 8 May 2026 20:14:53 +0300 Subject: [PATCH] CMake: silence CMP0167 from MRViewer Boost::locale lookup 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. --- source/MRViewer/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/MRViewer/CMakeLists.txt b/source/MRViewer/CMakeLists.txt index 8be42d6e82d5..af5409f0edf0 100644 --- a/source/MRViewer/CMakeLists.txt +++ b/source/MRViewer/CMakeLists.txt @@ -107,7 +107,15 @@ IF(NOT MRVIEWER_NO_VOXELS) ENDIF() IF(NOT MRVIEWER_NO_LOCALE) - find_package(Boost COMPONENTS locale REQUIRED) + # Emscripten's Boost package doesn't contain CMake config files + IF(EMSCRIPTEN) + IF(POLICY CMP0167) + cmake_policy(SET CMP0167 OLD) + ENDIF() + find_package(Boost COMPONENTS locale REQUIRED) + ELSE() + find_package(Boost CONFIG COMPONENTS locale REQUIRED) + ENDIF() target_link_libraries(${PROJECT_NAME} PRIVATE Boost::locale) ENDIF()