Skip to content

[cmake] Require CMake 3.15 or newer#1358

Open
gruenich wants to merge 3 commits intojbeder:masterfrom
gruenich:feature/cmake-require-3.15
Open

[cmake] Require CMake 3.15 or newer#1358
gruenich wants to merge 3 commits intojbeder:masterfrom
gruenich:feature/cmake-require-3.15

Conversation

@gruenich
Copy link
Copy Markdown
Contributor

@gruenich gruenich commented Apr 29, 2025

  • The currently used version of Google-test 1.13 still triggers a CMake deprecation warning with CMake 3.30 or newer. We need to decide on which version of Google-test we want to update. I see no reason to not choose the most recent version 1.16 which requires C++14 (like Google-test 1.13) and CMake 3.13. (I went for Google-test 1.16)
  • Adjust CI to test for both CMake 3.15 and 4.3, the new min and max required version.

@henryiii
Copy link
Copy Markdown

For context, googletest does not specify a range, which is why the minimum matters there.

@gruenich gruenich force-pushed the feature/cmake-require-3.15 branch from bcaca6d to 35ad556 Compare May 1, 2025 17:21
@gruenich
Copy link
Copy Markdown
Contributor Author

gruenich commented May 1, 2025

@henryiii How did you image testing with distinct versions of CMake? Downloading and building CMake from source seems excessive.

@henryiii
Copy link
Copy Markdown

henryiii commented May 1, 2025

I do it in pybind11 and CLI11 (local support action). Basically jwlawson/actions-setup-cmake downloads binaries pretty quickly.

@gruenich gruenich force-pushed the feature/cmake-require-3.15 branch 3 times, most recently from f698b0c to 4e3c06b Compare April 12, 2026 16:06
@gruenich
Copy link
Copy Markdown
Contributor Author

I removed a maximum version, just requiring 3.15 seems the saner choice for now.

Two points are left:

  1. Are you okay with relicensing the quick_cmake action from CLI?
  2. The Action is not reported as a success. Not sure what I missed.

@SGSSGene
Copy link
Copy Markdown
Collaborator

Thank you for updating this PR, I will take a look at it this week.
I can't decide relicensing issues, only @jbeder can do that.

2. The Action is not reported as a success. Not sure what I missed.

Github does not provide a runner for ubuntu 26.04. Please use 24.04 or pick any other image, see https://github.com/actions/runner-images

@jbeder
Copy link
Copy Markdown
Owner

jbeder commented Apr 13, 2026

What does this mean, relicensing?

@henryiii
Copy link
Copy Markdown

CMake is designed to always have an upper version due to its policy system. Upper versions keep newer CMake versions working longer. Setting a minimum version of 3.15 and not setting an upper version might start throwing a warning at some point in the near future. Be setting an upper version too, say to 4.0, should work for many many more years.

The policies will be set to 3.15 if you don't set an upper version. While they will be set to the highest version that CMake supports up until the upper version if you set an upper version. So as long as CMake supports whatever value is in the upper version as its minimum version, it will still work.

3.4...3.15 doesn't show a warning today, for example, because CMake does know how to build stuff for 3.15 without a warning. While 3.4 by itself can't be used, because CMake doesn't have those policies anymore

@jbeder
Copy link
Copy Markdown
Owner

jbeder commented Apr 13, 2026

Sure, I'll leave that to @SGSSGene to decide. But there was some discussion about relicensing?

@gruenich gruenich force-pushed the feature/cmake-require-3.15 branch from 4e3c06b to 33d173f Compare April 13, 2026 16:02
@gruenich
Copy link
Copy Markdown
Contributor Author

But there was some discussion about relicensing?

Yes. I copied the file .github/actions/quick_cmake/action.yml from henryiii's repository https://github.com/CLIUtils/CLI11 which is licensed under a 3-clause BSD license. This is MIT, so we need @henryiii's permission to adopt the license.

Ensure that oldest supportest version of CMake can configure project
Copy quick_cmake from CLIUtils/CLI11
@henryiii
Copy link
Copy Markdown

You have my permission, certainly.

@gruenich gruenich force-pushed the feature/cmake-require-3.15 branch from 33d173f to 4da4169 Compare April 13, 2026 16:11
@jbeder
Copy link
Copy Markdown
Owner

jbeder commented Apr 13, 2026

Ah, that's fine, it's pretty small and straightforward code.

@gruenich gruenich marked this pull request as ready for review April 13, 2026 21:33
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

Successfully merging this pull request may close these issues.

4 participants