1 # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
4 #[=======================================================================[.rst:
8 FindModule for OpenGL and OpenGL Utility Library (GLU).
10 .. versionchanged:: 3.2
11 X11 is no longer added as a dependency on Unix/Linux systems.
13 .. versionadded:: 3.10
14 GLVND support on Linux. See the :ref:`Linux Specific` section below.
19 .. versionadded:: 3.10
21 This module respects several optional COMPONENTS: ``EGL``, ``GLX``, and
22 ``OpenGL``. There are corresponding import targets for each of these flags.
29 This module defines the :prop_tgt:`IMPORTED` targets:
32 Defined to the platform-specific OpenGL libraries if the system has OpenGL.
34 Defined if the system has OpenGL Utility Library (GLU).
36 .. versionadded:: 3.10
37 Additionally, the following GLVND-specific library targets are defined:
40 Defined to libOpenGL if the system is GLVND-based.
42 Defined if the system has OpenGL Extension to the X Window System (GLX).
44 Defined if the system has EGL.
49 This module sets the following variables:
52 True, if the system has OpenGL and all components are found.
53 ``OPENGL_XMESA_FOUND``
54 True, if the system has XMESA.
56 True, if the system has GLU.
57 ``OpenGL_OpenGL_FOUND``
58 True, if the system has an OpenGL library.
60 True, if the system has GLX.
62 True, if the system has EGL.
63 ``OPENGL_INCLUDE_DIR``
64 Path to the OpenGL include directory.
65 ``OPENGL_EGL_INCLUDE_DIRS``
66 Path to the EGL include directory.
68 Paths to the OpenGL library, windowing system libraries, and GLU libraries.
69 On Linux, this assumes GLX and is never correct for EGL-based targets.
70 Clients are encouraged to use the ``OpenGL::*`` import targets instead.
72 .. versionadded:: 3.10
73 Variables for GLVND-specific libraries ``OpenGL``, ``EGL`` and ``GLX``.
78 The following cache variables may also be set:
80 ``OPENGL_egl_LIBRARY``
81 Path to the EGL library.
82 ``OPENGL_glu_LIBRARY``
83 Path to the GLU library.
84 ``OPENGL_glx_LIBRARY``
85 Path to the GLVND 'GLX' library.
86 ``OPENGL_opengl_LIBRARY``
87 Path to the GLVND 'OpenGL' library
89 Path to the OpenGL library. New code should prefer the ``OpenGL::*`` import
92 .. versionadded:: 3.10
93 Variables for GLVND-specific libraries ``OpenGL``, ``EGL`` and ``GLX``.
100 Some Linux systems utilize GLVND as a new ABI for OpenGL. GLVND separates
101 context libraries from OpenGL itself; OpenGL lives in "libOpenGL", and
102 contexts are defined in "libGLX" or "libEGL". GLVND is currently the only way
103 to get OpenGL 3+ functionality via EGL in a manner portable across vendors.
104 Projects may use GLVND explicitly with target ``OpenGL::OpenGL`` and either
105 ``OpenGL::GLX`` or ``OpenGL::EGL``.
107 Projects may use the ``OpenGL::GL`` target (or ``OPENGL_LIBRARIES`` variable)
108 to use legacy GL interfaces. These will use the legacy GL library located
109 by ``OPENGL_gl_LIBRARY``, if available. If ``OPENGL_gl_LIBRARY`` is empty or
110 not found and GLVND is available, the ``OpenGL::GL`` target will use GLVND
111 ``OpenGL::OpenGL`` and ``OpenGL::GLX`` (and the ``OPENGL_LIBRARIES``
112 variable will use the corresponding libraries). Thus, for non-EGL-based
113 Linux targets, the ``OpenGL::GL`` target is most portable.
115 A ``OpenGL_GL_PREFERENCE`` variable may be set to specify the preferred way
116 to provide legacy GL interfaces in case multiple choices are available.
117 The value may be one of:
120 If the GLVND OpenGL and GLX libraries are available, prefer them.
121 This forces ``OPENGL_gl_LIBRARY`` to be empty.
123 .. versionchanged:: 3.11
124 This is the default, unless policy :policy:`CMP0072` is set to ``OLD``
125 and no components are requeted (since components
126 correspond to GLVND libraries).
129 Prefer to use the legacy libGL library, if available.
131 For EGL targets the client must rely on GLVND support on the user's system.
132 Linking should use the ``OpenGL::OpenGL OpenGL::EGL`` targets. Using GLES*
133 libraries is theoretically possible in place of ``OpenGL::OpenGL``, but this
134 module does not currently support that; contributions welcome.
136 ``OPENGL_egl_LIBRARY`` and ``OPENGL_EGL_INCLUDE_DIRS`` are defined in the case of
137 GLVND. For non-GLVND Linux and other systems these are left undefined.
142 On OSX FindOpenGL defaults to using the framework version of OpenGL. People
143 will have to change the cache values of OPENGL_glu_LIBRARY and
144 OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
145 #]=======================================================================]
147 set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
149 # Provide OPENGL_USE_<C> variables for each component.
150 foreach(component ${OpenGL_FIND_COMPONENTS})
151 string(TOUPPER ${component} _COMPONENT)
152 set(OPENGL_USE_${_COMPONENT} 1)
155 set(_OpenGL_CACHE_VARS)
160 set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32")
161 set (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32")
163 set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
164 set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
167 list(APPEND _OpenGL_CACHE_VARS
172 # The OpenGL.framework provides both gl and glu
173 find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X")
174 find_library(OPENGL_glu_LIBRARY OpenGL DOC
175 "GLU library for OS X (usually same as OpenGL library)")
176 find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OS X")
177 list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
179 list(APPEND _OpenGL_CACHE_VARS
185 if (CMAKE_SYSTEM_NAME MATCHES "HP-UX")
186 # Handle HP-UX cases where we only want to find OpenGL in either hpux64
187 # or hpux32 depending on if we're doing a 64 bit build.
188 if(CMAKE_SIZEOF_VOID_P EQUAL 4)
190 /opt/graphics/OpenGL/lib/hpux32/)
193 /opt/graphics/OpenGL/lib/hpux64/
194 /opt/graphics/OpenGL/lib/pa20_64)
196 elseif(CMAKE_SYSTEM_NAME STREQUAL Haiku)
198 /boot/develop/lib/x86)
199 set(_OPENGL_INCLUDE_PATH
200 /boot/develop/headers/os/opengl)
203 # The first line below is to make sure that the proper headers
204 # are used on a Linux machine with the NVidia drivers installed.
205 # They replace Mesa with NVidia's own library but normally do not
206 # install headers and that causes the linking to
207 # fail since the compiler finds the Mesa headers but NVidia's library.
208 # Make sure the NVIDIA directory comes BEFORE the others.
209 # - Atanas Georgiev <atanas@cs.columbia.edu>
210 find_path(OPENGL_INCLUDE_DIR GL/gl.h
211 /usr/share/doc/NVIDIA_GLX-1.0/include
212 /usr/openwin/share/include
213 /opt/graphics/OpenGL/include
214 ${_OPENGL_INCLUDE_PATH}
216 find_path(OPENGL_GLX_INCLUDE_DIR GL/glx.h ${_OPENGL_INCLUDE_PATH})
217 find_path(OPENGL_EGL_INCLUDE_DIR EGL/egl.h ${_OPENGL_INCLUDE_PATH})
218 find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
219 /usr/share/doc/NVIDIA_GLX-1.0/include
220 /usr/openwin/share/include
221 /opt/graphics/OpenGL/include
223 list(APPEND _OpenGL_CACHE_VARS
225 OPENGL_GLX_INCLUDE_DIR
226 OPENGL_EGL_INCLUDE_DIR
227 OPENGL_xmesa_INCLUDE_DIR
230 # Search for the GLVND libraries. We do this regardless of COMPONENTS; we'll
231 # take into account the COMPONENTS logic later.
232 find_library(OPENGL_opengl_LIBRARY
234 PATHS ${_OPENGL_LIB_PATH}
237 find_library(OPENGL_glx_LIBRARY
239 PATHS ${_OPENGL_LIB_PATH}
240 PATH_SUFFIXES libglvnd
243 find_library(OPENGL_egl_LIBRARY
245 PATHS ${_OPENGL_LIB_PATH}
246 PATH_SUFFIXES libglvnd
249 find_library(OPENGL_glu_LIBRARY
251 PATHS ${OPENGL_gl_LIBRARY}
252 /opt/graphics/OpenGL/lib
257 list(APPEND _OpenGL_CACHE_VARS
258 OPENGL_opengl_LIBRARY
264 set(_OpenGL_GL_POLICY_WARN 0)
265 if(NOT DEFINED OpenGL_GL_PREFERENCE)
266 set(OpenGL_GL_PREFERENCE "")
268 if(NOT OpenGL_GL_PREFERENCE STREQUAL "")
269 # A preference has been explicitly specified.
270 if(NOT OpenGL_GL_PREFERENCE MATCHES "^(GLVND|LEGACY)$")
272 "OpenGL_GL_PREFERENCE value '${OpenGL_GL_PREFERENCE}' not recognized. "
273 "Allowed values are 'GLVND' and 'LEGACY'."
276 elseif(OpenGL_FIND_COMPONENTS)
277 # No preference was explicitly specified, but the caller did request
278 # at least one GLVND component. Prefer GLVND for legacy GL.
279 set(OpenGL_GL_PREFERENCE "GLVND")
281 # No preference was explicitly specified and no GLVND components were
282 # requested. Use a policy to choose the default.
283 cmake_policy(GET CMP0072 _OpenGL_GL_POLICY)
284 if("x${_OpenGL_GL_POLICY}x" STREQUAL "xNEWx")
285 set(OpenGL_GL_PREFERENCE "GLVND")
287 set(OpenGL_GL_PREFERENCE "LEGACY")
288 if("x${_OpenGL_GL_POLICY}x" STREQUAL "xx")
289 set(_OpenGL_GL_POLICY_WARN 1)
292 unset(_OpenGL_GL_POLICY)
295 if("x${OpenGL_GL_PREFERENCE}x" STREQUAL "xGLVNDx" AND OPENGL_opengl_LIBRARY AND OPENGL_glx_LIBRARY)
296 # We can provide legacy GL using GLVND libraries.
297 # Do not use any legacy GL library.
298 set(OPENGL_gl_LIBRARY "")
300 # We cannot provide legacy GL using GLVND libraries.
301 # Search for the legacy GL library.
302 find_library(OPENGL_gl_LIBRARY
304 PATHS /opt/graphics/OpenGL/lib
308 PATH_SUFFIXES libglvnd
310 list(APPEND _OpenGL_CACHE_VARS OPENGL_gl_LIBRARY)
313 if(_OpenGL_GL_POLICY_WARN AND OPENGL_gl_LIBRARY AND OPENGL_opengl_LIBRARY AND OPENGL_glx_LIBRARY)
314 cmake_policy(GET_WARNING CMP0072 _cmp0072_warning)
315 message(AUTHOR_WARNING
316 "${_cmp0072_warning}\n"
317 "FindOpenGL found both a legacy GL library:\n"
318 " OPENGL_gl_LIBRARY: ${OPENGL_gl_LIBRARY}\n"
319 "and GLVND libraries for OpenGL and GLX:\n"
320 " OPENGL_opengl_LIBRARY: ${OPENGL_opengl_LIBRARY}\n"
321 " OPENGL_glx_LIBRARY: ${OPENGL_glx_LIBRARY}\n"
322 "OpenGL_GL_PREFERENCE has not been set to \"GLVND\" or \"LEGACY\", so for "
323 "compatibility with CMake 3.10 and below the legacy GL library will be used."
326 unset(_OpenGL_GL_POLICY_WARN)
328 # FPHSA cannot handle "this OR that is required", so we conditionally set what
329 # it must look for. First clear any previous config we might have done:
330 set(_OpenGL_REQUIRED_VARS)
332 # now we append the libraries as appropriate. The complicated logic
333 # basically comes down to "use libOpenGL when we can, and add in specific
334 # context mechanisms when requested, or we need them to preserve the previous
335 # default where glx is always available."
336 if((NOT OPENGL_USE_EGL AND
337 NOT OPENGL_opengl_LIBRARY AND
338 OPENGL_glx_LIBRARY AND
339 NOT OPENGL_gl_LIBRARY) OR
340 (NOT OPENGL_USE_EGL AND
341 NOT OPENGL_glx_LIBRARY AND
342 NOT OPENGL_gl_LIBRARY) OR
343 (NOT OPENGL_USE_EGL AND
344 OPENGL_opengl_LIBRARY AND
345 OPENGL_glx_LIBRARY) OR
347 list(APPEND _OpenGL_REQUIRED_VARS OPENGL_opengl_LIBRARY)
350 # GLVND GLX library. Preferred when available.
351 if((NOT OPENGL_USE_OPENGL AND
352 NOT OPENGL_USE_GLX AND
353 NOT OPENGL_USE_EGL AND
354 NOT OPENGL_glx_LIBRARY AND
355 NOT OPENGL_gl_LIBRARY) OR
357 NOT OPENGL_USE_EGL AND
358 NOT OPENGL_glx_LIBRARY AND
359 NOT OPENGL_gl_LIBRARY) OR
360 (NOT OPENGL_USE_EGL AND
361 OPENGL_opengl_LIBRARY AND
362 OPENGL_glx_LIBRARY) OR
363 (OPENGL_USE_GLX AND OPENGL_USE_EGL))
364 list(APPEND _OpenGL_REQUIRED_VARS OPENGL_glx_LIBRARY)
369 list(APPEND _OpenGL_REQUIRED_VARS OPENGL_egl_LIBRARY)
372 # Old-style "libGL" library: used as a fallback when GLVND isn't available.
373 if((NOT OPENGL_USE_EGL AND
374 NOT OPENGL_opengl_LIBRARY AND
375 OPENGL_glx_LIBRARY AND
376 OPENGL_gl_LIBRARY) OR
377 (NOT OPENGL_USE_EGL AND
378 NOT OPENGL_glx_LIBRARY AND
380 list(PREPEND _OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
383 # We always need the 'gl.h' include dir.
384 list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
386 unset(_OPENGL_INCLUDE_PATH)
387 unset(_OPENGL_LIB_PATH)
389 find_library(OPENGL_glu_LIBRARY
391 PATHS ${OPENGL_gl_LIBRARY}
392 /opt/graphics/OpenGL/lib
398 if(OPENGL_xmesa_INCLUDE_DIR)
399 set( OPENGL_XMESA_FOUND "YES" )
401 set( OPENGL_XMESA_FOUND "NO" )
404 if(OPENGL_glu_LIBRARY)
405 set( OPENGL_GLU_FOUND "YES" )
407 set( OPENGL_GLU_FOUND "NO" )
410 # OpenGL_OpenGL_FOUND is a bit unique in that it is okay if /either/ libOpenGL
412 # Using libGL with libEGL is never okay, though; we handle that case later.
413 if(NOT OPENGL_opengl_LIBRARY AND NOT OPENGL_gl_LIBRARY)
414 set(OpenGL_OpenGL_FOUND FALSE)
416 set(OpenGL_OpenGL_FOUND TRUE)
419 if(OPENGL_glx_LIBRARY AND OPENGL_GLX_INCLUDE_DIR)
420 set(OpenGL_GLX_FOUND TRUE)
422 set(OpenGL_GLX_FOUND FALSE)
425 if(OPENGL_egl_LIBRARY AND OPENGL_EGL_INCLUDE_DIR)
426 set(OpenGL_EGL_FOUND TRUE)
428 set(OpenGL_EGL_FOUND FALSE)
431 # User-visible names should be plural.
432 if(OPENGL_EGL_INCLUDE_DIR)
433 set(OPENGL_EGL_INCLUDE_DIRS ${OPENGL_EGL_INCLUDE_DIR})
436 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
437 if (CMAKE_FIND_PACKAGE_NAME STREQUAL "GLU")
438 # FindGLU include()'s this module. It's an old pattern, but rather than
439 # trying to suppress this from outside the module (which is then sensitive to
440 # the contents, detect the case in this module and suppress it explicitly.
441 set(FPHSA_NAME_MISMATCHED 1)
443 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS}
445 unset(FPHSA_NAME_MISMATCHED)
446 unset(_OpenGL_REQUIRED_VARS)
450 # ::OpenGL is a GLVND library, and thus Linux-only: we don't bother checking
451 # for a framework version of this library.
452 if(OPENGL_opengl_LIBRARY AND NOT TARGET OpenGL::OpenGL)
453 if(IS_ABSOLUTE "${OPENGL_opengl_LIBRARY}")
454 add_library(OpenGL::OpenGL UNKNOWN IMPORTED)
455 set_target_properties(OpenGL::OpenGL PROPERTIES IMPORTED_LOCATION
456 "${OPENGL_opengl_LIBRARY}")
458 add_library(OpenGL::OpenGL INTERFACE IMPORTED)
459 set_target_properties(OpenGL::OpenGL PROPERTIES IMPORTED_LIBNAME
460 "${OPENGL_opengl_LIBRARY}")
462 set_target_properties(OpenGL::OpenGL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
463 "${OPENGL_INCLUDE_DIR}")
466 # ::GLX is a GLVND library, and thus Linux-only: we don't bother checking
467 # for a framework version of this library.
468 if(OpenGL_GLX_FOUND AND NOT TARGET OpenGL::GLX AND TARGET OpenGL::OpenGL)
469 if(IS_ABSOLUTE "${OPENGL_glx_LIBRARY}")
470 add_library(OpenGL::GLX UNKNOWN IMPORTED)
471 set_target_properties(OpenGL::GLX PROPERTIES IMPORTED_LOCATION
472 "${OPENGL_glx_LIBRARY}")
474 add_library(OpenGL::GLX INTERFACE IMPORTED)
475 set_target_properties(OpenGL::GLX PROPERTIES IMPORTED_LIBNAME
476 "${OPENGL_glx_LIBRARY}")
478 set_target_properties(OpenGL::GLX PROPERTIES INTERFACE_LINK_LIBRARIES
480 set_target_properties(OpenGL::GLX PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
481 "${OPENGL_GLX_INCLUDE_DIR}")
484 if(OPENGL_gl_LIBRARY AND NOT TARGET OpenGL::GL)
485 # A legacy GL library is available, so use it for the legacy GL target.
486 if(IS_ABSOLUTE "${OPENGL_gl_LIBRARY}")
487 add_library(OpenGL::GL UNKNOWN IMPORTED)
488 if(OPENGL_gl_LIBRARY MATCHES "/([^/]+)\\.framework$")
489 set(_gl_fw "${OPENGL_gl_LIBRARY}/${CMAKE_MATCH_1}")
490 if(EXISTS "${_gl_fw}.tbd")
491 string(APPEND _gl_fw ".tbd")
493 set_target_properties(OpenGL::GL PROPERTIES
494 IMPORTED_LOCATION "${_gl_fw}")
496 set_target_properties(OpenGL::GL PROPERTIES
497 IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}")
500 add_library(OpenGL::GL INTERFACE IMPORTED)
501 set_target_properties(OpenGL::GL PROPERTIES
502 IMPORTED_LIBNAME "${OPENGL_gl_LIBRARY}")
504 set_target_properties(OpenGL::GL PROPERTIES
505 INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}")
506 elseif(NOT TARGET OpenGL::GL AND TARGET OpenGL::OpenGL AND TARGET OpenGL::GLX)
507 # A legacy GL library is not available, but we can provide the legacy GL
508 # target using GLVND OpenGL+GLX.
509 add_library(OpenGL::GL INTERFACE IMPORTED)
510 set_target_properties(OpenGL::GL PROPERTIES INTERFACE_LINK_LIBRARIES
512 set_property(TARGET OpenGL::GL APPEND PROPERTY INTERFACE_LINK_LIBRARIES
514 set_target_properties(OpenGL::GL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
515 "${OPENGL_INCLUDE_DIR}")
518 # ::EGL is a GLVND library, and thus Linux-only: we don't bother checking
519 # for a framework version of this library.
520 # Note we test for OpenGL::OpenGL as a target. When this module is updated to
521 # support GLES, we would additionally want to check for the hypothetical GLES
522 # target and enable EGL if either ::GLES or ::OpenGL is created.
523 if(TARGET OpenGL::OpenGL AND OpenGL_EGL_FOUND AND NOT TARGET OpenGL::EGL)
524 if(IS_ABSOLUTE "${OPENGL_egl_LIBRARY}")
525 add_library(OpenGL::EGL UNKNOWN IMPORTED)
526 set_target_properties(OpenGL::EGL PROPERTIES IMPORTED_LOCATION
527 "${OPENGL_egl_LIBRARY}")
529 add_library(OpenGL::EGL INTERFACE IMPORTED)
530 set_target_properties(OpenGL::EGL PROPERTIES IMPORTED_LIBNAME
531 "${OPENGL_egl_LIBRARY}")
533 set_target_properties(OpenGL::EGL PROPERTIES INTERFACE_LINK_LIBRARIES
535 # Note that EGL's include directory is different from OpenGL/GLX's!
536 set_target_properties(OpenGL::EGL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
537 "${OPENGL_EGL_INCLUDE_DIR}")
540 if(OPENGL_GLU_FOUND AND NOT TARGET OpenGL::GLU)
541 if(IS_ABSOLUTE "${OPENGL_glu_LIBRARY}")
542 add_library(OpenGL::GLU UNKNOWN IMPORTED)
543 if(OPENGL_glu_LIBRARY MATCHES "/([^/]+)\\.framework$")
544 set(_glu_fw "${OPENGL_glu_LIBRARY}/${CMAKE_MATCH_1}")
545 if(EXISTS "${_glu_fw}.tbd")
546 string(APPEND _glu_fw ".tbd")
548 set_target_properties(OpenGL::GLU PROPERTIES
549 IMPORTED_LOCATION "${_glu_fw}")
551 set_target_properties(OpenGL::GLU PROPERTIES
552 IMPORTED_LOCATION "${OPENGL_glu_LIBRARY}")
555 add_library(OpenGL::GLU INTERFACE IMPORTED)
556 set_target_properties(OpenGL::GLU PROPERTIES
557 IMPORTED_LIBNAME "${OPENGL_glu_LIBRARY}")
559 set_target_properties(OpenGL::GLU PROPERTIES
560 INTERFACE_LINK_LIBRARIES OpenGL::GL)
563 # OPENGL_LIBRARIES mirrors OpenGL::GL's logic ...
564 if(OPENGL_gl_LIBRARY)
565 set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY})
566 elseif(TARGET OpenGL::OpenGL AND TARGET OpenGL::GLX)
567 set(OPENGL_LIBRARIES ${OPENGL_opengl_LIBRARY} ${OPENGL_glx_LIBRARY})
569 set(OPENGL_LIBRARIES "")
571 # ... and also includes GLU, if available.
572 if(TARGET OpenGL::GLU)
573 list(APPEND OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY})
577 # This deprecated setting is for backward compatibility with CMake1.4
578 set(OPENGL_LIBRARY ${OPENGL_LIBRARIES})
579 # This deprecated setting is for backward compatibility with CMake1.4
580 set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
582 mark_as_advanced(${_OpenGL_CACHE_VARS})
583 unset(_OpenGL_CACHE_VARS)