earcut.hpp icon indicating copy to clipboard operation
earcut.hpp copied to clipboard

Use a range for CMake minimum versions, 3.2...3.12: support CMake 4.0

Open musicinmybrain opened this issue 9 months ago • 3 comments

CMake 4.0 drops support for CMake <3.5, so minimum versions need to be adjusted for forward compatibility. ~~As long as we are touching the minimum version, let’s advance to 3.12, which can be considered the oldest “modern” CMake release, and which is available in all known supported Linux distributions today.~~

musicinmybrain avatar Mar 06 '25 11:03 musicinmybrain

Thanks for the heads up. But since we don't need any newer features, I think we should only advance to 3.5 if that's what cmake still supports. Also the README.md would probably need a small update for the required cmake version.

mrgreywater avatar Mar 06 '25 13:03 mrgreywater

Thanks for the heads up. But since we don't need any newer features, I think we should only advance to 3.5 if that's what cmake still supports. Also the README.md would probably need a small update for the required cmake version.

Ok, adjusted on both counts and force-pushed.

Looking back at CMakeLists.txt, there are a couple of workarounds that you could dispense with if you did choose to update the minimum version to 3.12:

https://github.com/mapbox/earcut.hpp/blob/7fa7aa30183849e988ae79ab2eef19f9ae97acf4/CMakeLists.txt#L27-L30

https://github.com/mapbox/earcut.hpp/blob/7fa7aa30183849e988ae79ab2eef19f9ae97acf4/CMakeLists.txt#L37-L40

musicinmybrain avatar Mar 06 '25 15:03 musicinmybrain

I’m going to update this again to set a minimum version range, 3.2...3.12. That way, CMake 3.2 will still work (as before this PR), if anyone is still using it, but CMake releases that can’t support such old policy versions (e.g., CMake 4.0 can’t support CMake<3.5, and CMake<3.10 is already deprecated) can still work with a higher minimum version.

musicinmybrain avatar Mar 06 '25 15:03 musicinmybrain

Sorry to bump, but it would be nice to get this merged so it can used with CMake 4.0.

InoUno avatar Aug 17 '25 08:08 InoUno

Thanks for the PR! Superceded by https://github.com/mapbox/earcut.hpp/pull/128

mourner avatar Sep 18 '25 12:09 mourner