libvncserver icon indicating copy to clipboard operation
libvncserver copied to clipboard

CMakeLists.txt: Bump cmake_minimum_required() to 3.10. Make code buil…

Open sunweaver opened this issue 2 months ago • 5 comments

…d with CMake 4 without deprecation warning (as of now).

sunweaver avatar Oct 10 '25 13:10 sunweaver

Hi Mike! What's the improvement related to c81c7bdf498a05a6062d436c488d2071a551d421 ?

bk138 avatar Oct 10 '25 15:10 bk138

As someone who packages software, I hit this quite a bit with projects when we started using CMake > v4, requiring adding extra configure flags to override it -DCMAKE_POLICY_VERSION_MINIMUM=3.5, and hoping that the project isn't doing anything that would break from this (which they might).

https://fedoraproject.org/wiki/Changes/CMake4.0 is a good writeup

Like https://cmake.org/cmake/help/latest/policy/CMP0054.html is a concrete example of cmake behavior would change from this.

The main benefit of updating this is not just go rid of of a warning/error, but is in my opinion that everyone using cmake from 3.5 to 4.x will see the same behavior building libvncserver, ensuring things get tested properly. This does come with the cost of no longer supporting cmake 3.4, because one can't set a policy newer than the cmake version used.

Micket avatar Nov 27 '25 02:11 Micket

@Micket but this here PR ups the min required version to 3.10 - while it's a minor nitpick thing and I really don't want to think too much about it, I still wonder why.

bk138 avatar Nov 27 '25 07:11 bk138

@bk138 CMake4 has stopped support for cmake_minimum_required() less than 3.5 (but throws a warning that versions between 3.5 and less than 3.10 will also likely be unsupported in some next version of CMake).

sunweaver avatar Nov 27 '25 09:11 sunweaver

Oh., nevermind me, I'm just blind! I thought the linked commit in the comment was from this PR. (I blame it on reading this at 3:00 AM)

The actual policy change here would be https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-10 si CMP0066 to CMP0071 but none of them would affect this project as far as i can see (maybe indirectly via find_package in some cases). I skimmed the new features up to 3.10, but I don't see any features between 3.6-3.10 that would benefit this project, so I think the warning is about it then.

Micket avatar Nov 27 '25 11:11 Micket