CMake upgrade? #1058

Closed
opened 2026-10-05 05:00:55 +02:00 by adam · 3 comments
Owner

The minimum supported cmake version is 3.13, which is quite old by now.
Would you consider bumping it to something more recent?

For a comparison, this page aggregates information about what versions are shipped by distributions: https://pkgs.org/download/cmake

The minimum supported cmake version is 3.13, which is quite old by now. Would you consider bumping it to something more recent? For a comparison, this page aggregates information about what versions are shipped by distributions: https://pkgs.org/download/cmake <!-- github-sync-id:2870277168 -->
adam closed this issue 2026-10-05 05:00:55 +02:00
Author
Owner

At some point, sure. Do you have some specific feature in mind which is missing from 3.13?

At some point, sure. Do you have some specific feature in mind which is missing from 3.13? <!-- github-comment-id:2676085297 -->
Author
Owner

While building I noticed this warning:

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

And here's the policy description:

CMP0167
-------

.. 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 suppose it would be wise to use the official Find Module for Boost. Perhaps a simple cmake_policy might be enough.

While building I noticed this warning: ``` CMake Warning (dev) at CMakeLists.txt:264 (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. ``` And here's the policy description: ``` CMP0167 ------- .. 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 suppose it would be wise to use the official Find Module for Boost. Perhaps a simple `cmake_policy` might be enough. <!-- github-comment-id:2676187314 -->
Author
Owner

I usually look at https://packages.debian.org/search?keywords=cmake&searchon=names&suite=all&section=all and https://packages.ubuntu.com/search?keywords=cmake&searchon=names&suite=all&section=all to decide how far to bump the minimum versions of deps, targeting approximately debian stable and a couple of ubuntu LTSes, and taking into account the benefits which new versions bring.

3.30 is too new for now.

I'm up for changing the find_package to CONFIG mode, but need to check the minimum version of boost which gained support for BoostConfig.cmake, and whether that version is in distros already

I usually look at https://packages.debian.org/search?keywords=cmake&searchon=names&suite=all&section=all and https://packages.ubuntu.com/search?keywords=cmake&searchon=names&suite=all&section=all to decide how far to bump the minimum versions of deps, targeting approximately debian stable and a couple of ubuntu LTSes, and taking into account the benefits which new versions bring. 3.30 is too new for now. I'm up for changing the find_package to CONFIG mode, but need to check the minimum version of boost which gained support for BoostConfig.cmake, and whether that version is in distros already <!-- github-comment-id:2676220850 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#1058