[glew] Fix build with CMake 4.0#44086
Conversation
|
IIUC you could use CMAKE_POLICY_VERSION_MINIMUM instead of adding a patch. |
Yes, that should probably also work, but I had the impression adapting cmake_minimum_required would be more consistent with the vcpkg codebase. A search for CMAKE_POLICY_VERSION_MINIMUM in the ports directory gave me no results, while there seems to be many patches with entries for cmake_minimum_required. Some examples for this are:
|
This variable comes with CMake 4.0, so you can't expect examples. |
|
@dg0yt Feel free to tell me in case I should change using a patch to using |
|
I am a community member. I can review and suggest, but that's all. Because this is the first PR dealing with CMake 4.0, it seems approriate to check all implementation options. AFAICT it is preferred to avoid patches if possible. |
|
Benefits of the patch:
So even my tendency is pro patch now. |
ports/glew/cmake_version.patch
Outdated
| -project (glew C) | ||
| +project (glew LANGUAGES C) |
There was a problem hiding this comment.
Anyways, this doesn't need a change AFAICT.
There was a problem hiding this comment.
You're right, this was part of the upstream repo commit that changed cmake_minimum_required, so I thought it was necessary, but the old definition is still valid with new CMake versions. I removed it from the patch now.
7c719d9 to
2870626
Compare
This PR fixes the compilation of the GLEW port with CMake 4.0, which removed compatibility with versions of CMake older than version 3.5 (see https://cmake.org/cmake/help/v4.0/release/4.0.html#deprecated-and-removed-features). I have tested on CMake 4.0.0 RC2 that the build process no longer fails with the proposed changes.
While this issue was fixed in the upstream repo some time ago, vcpkg uses the sources of the last release, which has been created a few years ago.
portfile.cmakemakes this statement why using the code from the main branch of the upstream repo is not directly possible:... so I think the solution proposed by this PR using a patch is the best solution for now.
./vcpkg x-add-version --alland committing the result.