Skip to content

cmake has now deprecated support for versions prior to 3.5 #685

@john-forrest

Description

@john-forrest

cmake 3.27 has now deprecated support for versions prior to 3.5 but hunter is littered with minimum required statements such as:

cmake_minimum_required(VERSION 3.0)

The effect of this with the latest release is to have lots of warnings along the lines of (when configuring with hunter):

CMake Deprecation Warning at C:/hunter/cmake/modules/hunter_calculate_config_sha1.cmake:4 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

Things are still working: this is just a warning and the what is effectively a compatibility mode with 3.0 is still working, albeit
rather noisily. However the warnings are annoying (you get multiple ones per build) and do hint of a larger issue in the
near(?) future when the support is actually removed. At that point (based on what happened when earliest minimum
support went up last time) there will still be a warning but, instead of acting in (say) 3.0 compatibility mode, cmake will
act in 3.5 - assuming you are not actually using cmake that ancient.

The obvious thing to do would be to place all cmake_minimum_required within hunter, where the min is less that 3.5, with something like:

cmake_minimum_required(3.0...3.5)

With any cmake version after 3.12, this would run in 3.5 compatibility-mode instead of 3.0. If that does not work then it
would need fixing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions