From a8dee3a614692b7e4f4a897cc32f85a19c965dff Mon Sep 17 00:00:00 2001 From: Jason Wilkins Date: Wed, 11 Jun 2014 20:26:22 -0500 Subject: GHOST Refactor for EGL Contexts Documentation to appear here: http://wiki.blender.org/index.php/User:Jwilkins/VFX/GHOST_Refactor_for_EGL Missing from this commit is support for systems other than Windows. This also only builds with CMake. --- build_files/cmake/Modules/FindOpenGLES.cmake | 51 ++++++++++++++++++++++++++++ build_files/cmake/macros.cmake | 14 ++++---- 2 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 build_files/cmake/Modules/FindOpenGLES.cmake (limited to 'build_files/cmake') diff --git a/build_files/cmake/Modules/FindOpenGLES.cmake b/build_files/cmake/Modules/FindOpenGLES.cmake new file mode 100644 index 00000000000..981a1abb0a9 --- /dev/null +++ b/build_files/cmake/Modules/FindOpenGLES.cmake @@ -0,0 +1,51 @@ +# - Try to find OpenGLES +# Once done this will define +# +# OPENGLES_FOUND - system has OpenGLES and EGL +# OPENGL_EGL_FOUND - system has EGL +# OPENGLES_INCLUDE_DIR - the GLES include directory +# OPENGLES_LIBRARY - the GLES library +# OPENGLES_EGL_INCLUDE_DIR - the EGL include directory +# OPENGLES_EGL_LIBRARY - the EGL library +# OPENGLES_LIBRARIES - all libraries needed for OpenGLES +# OPENGLES_INCLUDES - all includes needed for OpenGLES + +FIND_PATH(OPENGLES_INCLUDE_DIR GLES2/gl2.h + /usr/openwin/share/include + /opt/graphics/OpenGL/include /usr/X11R6/include + /usr/include +) + +FIND_LIBRARY(OPENGLES_LIBRARY + NAMES GLESv2 + PATHS /opt/graphics/OpenGL/lib + /usr/openwin/lib + /usr/shlib /usr/X11R6/lib + /usr/lib +) + +FIND_PATH(OPENGLES_EGL_INCLUDE_DIR EGL/egl.h + /usr/openwin/share/include + /opt/graphics/OpenGL/include /usr/X11R6/include + /usr/include +) + +FIND_LIBRARY(OPENGLES_EGL_LIBRARY + NAMES EGL + PATHS /usr/shlib /usr/X11R6/lib + /usr/lib +) + +SET(OPENGL_EGL_FOUND "NO") +IF(OPENGLES_EGL_LIBRARY AND OPENGLES_EGL_INCLUDE_DIR) + SET(OPENGL_EGL_FOUND "YES") +ENDIF() + +SET(OPENGLES_FOUND "NO") +IF(OPENGLES_LIBRARY AND OPENGLES_INCLUDE_DIR AND + OPENGLES_EGL_LIBRARY AND OPENGLES_EGL_INCLUDE_DIR) + SET(OPENGLES_LIBRARIES ${OPENGLES_LIBRARY} ${OPENGLES_LIBRARIES} + ${OPENGLES_EGL_LIBRARY}) + SET(OPENGLES_INCLUDES ${OPENGLES_INCLUDE_DIR} ${OPENGLES_EGL_INCLUDE_DIR}) + SET(OPENGLES_FOUND "YES") +ENDIF() diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 772ff6d7596..80a4858bf94 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -284,8 +284,7 @@ macro(setup_liblinks set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}") target_link_libraries(${target} - ${OPENGL_gl_LIBRARY} - ${OPENGL_glu_LIBRARY} + ${BLENDER_GL_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${FREETYPE_LIBRARY}) @@ -305,7 +304,7 @@ macro(setup_liblinks endif() if(WITH_SYSTEM_GLEW) - target_link_libraries(${target} ${GLEW_LIBRARY}) + target_link_libraries(${target} ${BLENDER_GLEW_LIBRARIES}) endif() if(WITH_BULLET AND WITH_SYSTEM_BULLET) target_link_libraries(${target} ${BULLET_LIBRARIES}) @@ -359,9 +358,12 @@ macro(setup_liblinks endif() if(WITH_CODEC_FFMPEG) - # Strange!, without this ffmpeg gives linking errors (on linux) - # even though its linked above - target_link_libraries(${target} ${OPENGL_glu_LIBRARY}) + # Strange! Without this ffmpeg gives linking errors (on linux), + # even though it's linked above. + # XXX: Does FFMPEG depend on GLU? + if(WITH_GLU) + target_link_libraries(${target} ${OPENGL_glu_LIBRARY}) + endif() target_link_libraries(${target} ${FFMPEG_LIBRARIES}) endif() -- cgit v1.2.3