diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2013-04-17 10:59:52 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2013-04-17 10:59:52 (GMT) |
commit | 5be35935dceb55923b954ef683aea02af6a92c86 (patch) | |
tree | e240313dc682256921dcb2adcd834cf85121ed55 /Modules/FindOpenGL.cmake | |
parent | b10a1713dcec004df950108a5734a8872919040c (diff) | |
download | CMake-5be35935dceb55923b954ef683aea02af6a92c86.zip CMake-5be35935dceb55923b954ef683aea02af6a92c86.tar.gz CMake-5be35935dceb55923b954ef683aea02af6a92c86.tar.bz2 |
FindOpenGL: require headers to be found on non-Windows platforms (#13746)
Diffstat (limited to 'Modules/FindOpenGL.cmake')
-rw-r--r-- | Modules/FindOpenGL.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index 5f782dc..83fcc3d 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -28,9 +28,12 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY) + if (CYGWIN) find_path(OPENGL_INCLUDE_DIR GL/gl.h ) + list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR) find_library(OPENGL_gl_LIBRARY opengl32 ) @@ -51,6 +54,7 @@ elseif (APPLE) find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX") find_library(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX") find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX") + list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR) else() if (CMAKE_SYSTEM_NAME MATCHES "HP-UX") @@ -85,6 +89,7 @@ else() /opt/graphics/OpenGL/include /usr/X11R6/include ${_OPENGL_INCLUDE_PATH} ) + list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR) find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h /usr/share/doc/NVIDIA_GLX-1.0/include @@ -153,7 +158,8 @@ set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR}) # handle the QUIETLY and REQUIRED arguments and set OPENGL_FOUND to TRUE if # all listed variables are TRUE include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL DEFAULT_MSG OPENGL_gl_LIBRARY) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS}) +unset(_OpenGL_REQUIRED_VARS) mark_as_advanced( OPENGL_INCLUDE_DIR |