QuantLib icon indicating copy to clipboard operation
QuantLib copied to clipboard

cmake policy CMP0167

Open jongbongan opened this issue 4 months ago • 7 comments

Actually, it may not be a big deal.

I am currently using CMake >= 3.30 to build the project. It outputs a warning :

CMake Warning (dev) at CMakeLists.txt:164 (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.

In CMake document, (cmake --help-policy CMP0167) it says

.. versionadded:: 3.30

The ``FindBoost`` module is removed.

CMake 3.29 and below provide a ``FindBoost`` module, but it needs constant
updates to keep up with upstream Boost releases.  Upstream Boost 1.70
and above provide a ``BoostConfig.cmake`` package configuration file.
``find_package(Boost CONFIG)`` finds the upstream package directly,
without the find module.

CMake 3.30 and above prefer to not provide the ``FindBoost`` module
so that ``find_package(Boost)`` calls, without the ``CONFIG`` or
``NO_MODULE`` options, find the upstream ``BoostConfig.cmake`` directly.
This policy provides compatibility for projects that have not been ported
to use the upstream Boost package.

The ``OLD`` behavior of this policy is for ``find_package(Boost)`` to
load CMake's ``FindBoost`` module.  The ``NEW`` behavior is for
``find_package(Boost)`` to search for the upstream ``BoostConfig.cmake``.

This policy was introduced in CMake version 3.30.
It may be set by ``cmake_policy()`` or ``cmake_minimum_required()``.
If it is not set, CMake warns, and uses ``OLD`` behavior.

.. note::
  The ``OLD`` behavior of a policy is
  ``deprecated by definition``
  and may be removed in a future version of CMake.

I think it is better to suppress such a warning until we require the minimum version of Boost >= 1.70.

jongbongan avatar Oct 08 '24 01:10 jongbongan