FindOpenGL: Document how to use macOS X11 OpenGL
Dicourse-topic: https://discourse.cmake.org/t/9466
This commit is contained in:
parent
a13f62427b
commit
1dbfe638da
@ -177,9 +177,24 @@ GLVND. For non-GLVND Linux and other systems these are left undefined.
|
|||||||
macOS-Specific
|
macOS-Specific
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
On OSX FindOpenGL defaults to using the framework version of OpenGL. People
|
On macOS this module defaults to using the macOS-native framework
|
||||||
will have to change the cache values of OPENGL_glu_LIBRARY and
|
version of OpenGL. To use the X11 version of OpenGL on macOS, one
|
||||||
OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
|
can disable searching of frameworks. For example:
|
||||||
|
|
||||||
|
.. code-block:: cmake
|
||||||
|
|
||||||
|
find_package(X11)
|
||||||
|
if(APPLE AND X11_FOUND)
|
||||||
|
set(CMAKE_FIND_FRAMEWORK NEVER)
|
||||||
|
find_package(OpenGL)
|
||||||
|
unset(CMAKE_FIND_FRAMEWORK)
|
||||||
|
else()
|
||||||
|
find_package(OpenGL)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
An end user building this project may need to point CMake at their
|
||||||
|
X11 installation, e.g., with ``-DOpenGL_ROOT=/opt/X11``.
|
||||||
|
|
||||||
#]=======================================================================]
|
#]=======================================================================]
|
||||||
|
|
||||||
set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
|
set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
|
||||||
|
Loading…
Reference in New Issue
Block a user