summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRandolph M. Fritz <rmfritz3@gmail.com>2023-12-10 01:35:08 (GMT)
committerBrad King <brad.king@kitware.com>2023-12-11 15:28:59 (GMT)
commit1dbfe638da55b181ce9c0897d52becc680d02b64 (patch)
treea3aab104dc0473ddf42c5975863eb30f5f4bf586 /Modules
parenta13f62427bdd15fe6061dcdd0de1904a6257210d (diff)
downloadCMake-1dbfe638da55b181ce9c0897d52becc680d02b64.zip
CMake-1dbfe638da55b181ce9c0897d52becc680d02b64.tar.gz
CMake-1dbfe638da55b181ce9c0897d52becc680d02b64.tar.bz2
FindOpenGL: Document how to use macOS X11 OpenGL
Dicourse-topic: https://discourse.cmake.org/t/9466
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindOpenGL.cmake21
1 files changed, 18 insertions, 3 deletions
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index b1e144f..5c4839c 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -177,9 +177,24 @@ GLVND. For non-GLVND Linux and other systems these are left undefined.
macOS-Specific
^^^^^^^^^^^^^^
-On OSX FindOpenGL defaults to using the framework version of OpenGL. People
-will have to change the cache values of OPENGL_glu_LIBRARY and
-OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
+On macOS this module defaults to using the macOS-native framework
+version of OpenGL. To use the X11 version of OpenGL on macOS, one
+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)