mirror of
https://github.com/Kitware/CMake.git
synced 2026-06-24 08:47:59 +00:00
Merge topic 'fix-opengl-legacy'
69956c6f63 FindOpenGL: Fix OpenGL and GLX result variables with legacy GL
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12205
This commit is contained in:
@@ -529,12 +529,6 @@ else()
|
|||||||
list(APPEND _OpenGL_CACHE_VARS OPENGL_gl_LIBRARY)
|
list(APPEND _OpenGL_CACHE_VARS OPENGL_gl_LIBRARY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# When preferring legacy, linking OpenGL and GLX should behave the same as linking legacy GL.
|
|
||||||
if(OpenGL_GL_PREFERENCE STREQUAL "LEGACY")
|
|
||||||
set(OpenGL_glx_LIBRARY "${OPENGL_gl_LIBRARY}")
|
|
||||||
set(OpenGL_opengl_LIBRARY "${OPENGL_gl_LIBRARY}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(_OpenGL_GL_POLICY_WARN AND OPENGL_gl_LIBRARY AND OPENGL_opengl_LIBRARY AND OPENGL_glx_LIBRARY)
|
if(_OpenGL_GL_POLICY_WARN AND OPENGL_gl_LIBRARY AND OPENGL_opengl_LIBRARY AND OPENGL_glx_LIBRARY)
|
||||||
cmake_policy(ISSUE_WARNING CMP0072 POST
|
cmake_policy(ISSUE_WARNING CMP0072 POST
|
||||||
"FindOpenGL found both a legacy GL library:\n"
|
"FindOpenGL found both a legacy GL library:\n"
|
||||||
@@ -548,6 +542,12 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
unset(_OpenGL_GL_POLICY_WARN)
|
unset(_OpenGL_GL_POLICY_WARN)
|
||||||
|
|
||||||
|
# When preferring legacy, linking OpenGL and GLX should behave the same as linking legacy GL.
|
||||||
|
if(OpenGL_GL_PREFERENCE STREQUAL "LEGACY")
|
||||||
|
set(OPENGL_glx_LIBRARY "${OPENGL_gl_LIBRARY}")
|
||||||
|
set(OPENGL_opengl_LIBRARY "${OPENGL_gl_LIBRARY}")
|
||||||
|
endif()
|
||||||
|
|
||||||
# FPHSA cannot handle "this OR that is required", so we conditionally set what
|
# FPHSA cannot handle "this OR that is required", so we conditionally set what
|
||||||
# it must look for. First clear any previous config we might have done:
|
# it must look for. First clear any previous config we might have done:
|
||||||
set(_OpenGL_REQUIRED_VARS)
|
set(_OpenGL_REQUIRED_VARS)
|
||||||
|
|||||||
Reference in New Issue
Block a user