Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
john-forrest opened this issue Jul 23, 2023 · 5 comments
Closed

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

john-forrest opened this issue Jul 23, 2023 · 5 comments

Comments

@john-forrest
Copy link

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.

@NeroBurner
Copy link

I'm in favor of this proposal. Could you create a Pull-Request for me to review and merge?

But I'd even push the actual minimum required version to 3.5

NeroBurner added a commit that referenced this issue Sep 25, 2023
* Minimum cmake version required now 3.5
  Replace all "cmake_minimum_required" for cmake versions with 3.5
  with 3.5 itself - reflecting soon to be the minimum version that
  cmake supports.
* Minimum cmake version required in PR template now 3.5 too
* Update cmake.rst in documentation
  Remove general references for cmake prior to 3.5 except for pure history comment.

---------

Co-authored-by: NeroBurner <pyro4hell@gmail.com>
@NeroBurner
Copy link

@gdalex
Copy link

gdalex commented Sep 25, 2023

I believe that https://github.com/cpp-pm/gate/blob/master/cmake/HunterGate.cmake should be also updated to 3.5, right?

@NeroBurner
Copy link

It doesn't issue a deprecation warning as is fixed here, but to be thorough yes, this should also be updated. Wanna open a PR and ping me over there?

@gdalex
Copy link

gdalex commented Sep 25, 2023

will do 👍

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

No branches or pull requests

3 participants