-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Set CMake minimum requirement to 3.5 #1228
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
Conversation
cmake_minimum_required(VERSION 2.x) has the effect that recent cmake 3.x has the defaults that were considered sensible a decade ago. Instead, use `cmake_minimum_required(VERSION 2.x..3.y)` so that newer cmake uses modern defaults for policies, without dropping cmake 2.x support.
ping @nemequ |
Note : By now, things have moved on, and we could update the minimum version, up to a maximum of It's just that there is no point in reducing compatibility (by increasing the minimum version requirement) if there is no benefit in exchange, and so far, no one has been able to articulate what is gained by updating the minimum version to something more recent. |
Feel free to update the PR accordingly. This is more of an issue promoted to a actionable change :p |
I think Consequently, I think this is the minimum version this PR should jump to. I prefer a single minimum version number, because otherwise, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change minimum to 3.5
Done |
if("${CMAKE_VERSION}" VERSION_LESS "3.0") | ||
project(LZ4 C) | ||
else() | ||
cmake_policy (SET CMP0048 NEW) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question : is it now useless to specify this line ?
cmake_policy (SET CMP0048 NEW)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the policy is from 3.0 and with minimum required >= 3.0 it's automatically NEW.
The policies are always such that new cmake behaves the same as the "minimum required" cmake version.
Thanks @haampie |
cmake_minimum_required(VERSION 2.x)
has the effect that any recent CMake runs with default settings that were considered sensible a decade ago.Instead, use
cmake_minimum_required(VERSION 2.x...3.y)
so that newer CMake uses modern defaults for policies, without dropping CMake 2.x support.One such policy that I need for example is CMP0042, which makes CMake output
@rpath/liblz4.dylib
as install name on macOS, so that packages linking to it register@rpath/liblz4.dylib
as a load command, so that rpaths will be considered to locate it. Without it, dependents typically fail at runtime and cannot locate the library if it's in a non-system dir.