Skip to content
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

Use GLVND also for old cmake versions #2826

Merged
merged 1 commit into from
Dec 11, 2022

Conversation

simendsjo
Copy link
Contributor

Use GLVND also when legacy implementations exist for old cmake versions <= 3.10. This is a breaking change for old cmake versions (prior to around 2017-10-05) which will now use GLVND rather than defaulting to libGL.

This fixes the following warning when building:

CMake Warning (dev) at /gnu/store/qv13zgbmyx0vjav8iiqp772kp6rxvwnd-cmake-3.24.2/share/cmake-3.24/Modules/FindOpenGL.cmake:315 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /home/simendsjo/.guix-profile/lib/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /home/simendsjo/.guix-profile/lib/libOpenGL.so
    OPENGL_glx_LIBRARY: /home/simendsjo/.guix-profile/lib/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  cmake/LibraryConfigurations.cmake:21 (find_package)
  src/CMakeLists.txt:46 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

See https://cmake.org/cmake/help/latest/policy/CMP0072.html

Closes #2825

Use GLVND also when legacy implementations exist for old cmake versions
<= 3.10. This is a breaking change for old cmake versions (prior to
around 2017-10-05) which will now use GLVND rather than defaulting to
libGL.

This fixes the following warning when building:

    CMake Warning (dev) at /gnu/store/qv13zgbmyx0vjav8iiqp772kp6rxvwnd-cmake-3.24.2/share/cmake-3.24/Modules/FindOpenGL.cmake:315 (message):
      Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
      available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.

      FindOpenGL found both a legacy GL library:

        OPENGL_gl_LIBRARY: /home/simendsjo/.guix-profile/lib/libGL.so

      and GLVND libraries for OpenGL and GLX:

        OPENGL_opengl_LIBRARY: /home/simendsjo/.guix-profile/lib/libOpenGL.so
        OPENGL_glx_LIBRARY: /home/simendsjo/.guix-profile/lib/libGLX.so

      OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
      compatibility with CMake 3.10 and below the legacy GL library will be used.
    Call Stack (most recent call first):
      cmake/LibraryConfigurations.cmake:21 (find_package)
      src/CMakeLists.txt:46 (include)
    This warning is for project developers.  Use -Wno-dev to suppress it.

See https://cmake.org/cmake/help/latest/policy/CMP0072.html

Closes raysan5#2825
@raysan5 raysan5 merged commit 884d30b into raysan5:master Dec 11, 2022
@raysan5
Copy link
Owner

raysan5 commented Dec 11, 2022

@simendsjo Thanks for the addition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[build] CMake fails with OpenGL_GL_PREFERENCE not set to GLVND or LEGACY
2 participants