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] Upgrade cmake_minimum_required to 3.10 #3166

Closed
owent opened this issue Nov 25, 2024 · 1 comment · Fixed by #3167
Closed

[CMake] Upgrade cmake_minimum_required to 3.10 #3166

owent opened this issue Nov 25, 2024 · 1 comment · Fixed by #3167
Assignees
Labels
triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@owent
Copy link
Member

owent commented Nov 25, 2024

Is your feature request related to a problem?
The new cmake (3.30+) will produce a warning like this:

CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):Compatibility with CMake < 3.10 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.CMake (cmake_minimum_required)

Describe the solution you'd like
Since cmake 3.16, there have been a lot of changes of CONFIG package names in FindXXX scripts, and a lot of policies changes.
I just want to discuss if we can upgrade the minimum version to cmake to 3.16 or upper.

Describe alternatives you've considered
We use cmake_minimum_required(VERSION 3.24) and cmake_minimum_required(VERSION 3.27) to avoid writing too much compact codes to keep the same behiour in old and new cmake. It's OK for me to upgrade the minimal requirement to 3.24 or 3.27, but I think we can discuss if it will bring difficulty to other cases and if it's worth doing the upgrade.

@owent owent self-assigned this Nov 25, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 25, 2024
@marcalff
Copy link
Member

Currently, in a major application instrumented with opentelemetry-cpp, we (at work) use cmake_minimum_required(VERSION 3.14.6).

Unless some features from CMake 3.16/3.24/3.27 are used explicitly, in opentelemetry-cpp/CMakeList.txt, there is no reason to require this minimum version in my understanding, a simple cmake_minimum_required(VERSION 3.10) should have the same effect.

This does not prevent people to use 3.16/3.24/3.27 or later if they want to.

So overall, in favor of the more conservative version 3.10 to clear the deprecation warning.

@marcalff marcalff changed the title [CMake] Upgrade cmake_minimum_required to 3.16 [CMake] Upgrade cmake_minimum_required to 3.10 Nov 27, 2024
@marcalff marcalff mentioned this issue Nov 27, 2024
3 tasks
@marcalff marcalff added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants