nigels-com / glew

The OpenGL Extension Wrangler Library
Other
2.58k stars 608 forks source link

CMakeLists is illformed #395

Closed SpaceIm closed 8 months ago

SpaceIm commented 9 months ago

CMakeLists.txt of glew is illformed. cmake_minimum_required() then project() must be the first instructions in a CMakeLists (some specific instructions may be called between cmake_minimum_required() and project(), but it's an edge case).

Currently, glew CMakeLists defeats any cmake toolchain.

Moreover cmake_minimum_required has been updated in https://github.com/nigels-com/glew/pull/391, but several explicit POLICIES have been kept, while it doesn't make sense anymore since bump of min CMake version automatically set these POLICIES to NEW. It's also not clear why this bump was required. It's not because some distro provides a specific CMake version by default, that you have to bump min CMake version in a library. You bump min version depending on CMake policies you want, and CMake features you want to use, it doesn't make sense to hard fail with older CMake versions if not necessary.

If it was due to https://github.com/nigels-com/glew/issues/388, well 3.5 is sufficient. 3.15 is also considered as a very good min version for CMake policies.