summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-12-17 14:55:11 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-12-17 14:55:11 (GMT)
commit2913876c58daec60fec24c6b47c16c3d13b28405 (patch)
tree34f0691a1c66fe4ea9b177ed3001a6c57a1ab6c7
parente51fa1dc4dcc8c06899f2681890ec61b2517420d (diff)
parent08580be2ada7b226c3b8f91b6ecdbc57d843d42e (diff)
downloadCMake-2913876c58daec60fec24c6b47c16c3d13b28405.zip
CMake-2913876c58daec60fec24c6b47c16c3d13b28405.tar.gz
CMake-2913876c58daec60fec24c6b47c16c3d13b28405.tar.bz2
Merge topic 'FindOpenGL-no-osx-AGL'
08580be2 FindOpenGL: Don't add AGL to OPENGL_LIBRARIES on OS X.
-rw-r--r--Modules/FindOpenGL.cmake12
1 files changed, 8 insertions, 4 deletions
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index a7eefa7..93e488b 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -71,9 +71,11 @@ elseif (WIN32)
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")
+ # The OpenGL.framework provides both gl and glu
+ find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X")
+ find_library(OPENGL_glu_LIBRARY OpenGL DOC
+ "GLU library for OS X (usually same as OpenGL library)")
+ find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OS X")
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
else()
@@ -149,7 +151,9 @@ if(OPENGL_gl_LIBRARY)
set( OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES})
if(OPENGL_glu_LIBRARY)
set( OPENGL_GLU_FOUND "YES" )
- set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} )
+ if(NOT "${OPENGL_glu_LIBRARY}" STREQUAL "${OPENGL_gl_LIBRARY}")
+ set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} )
+ endif()
else()
set( OPENGL_GLU_FOUND "NO" )
endif()