diff options
Diffstat (limited to 'build_files/cmake')
-rw-r--r-- | build_files/cmake/Modules/FindOpenGLES.cmake | 76 | ||||
-rw-r--r-- | build_files/cmake/macros.cmake | 18 |
2 files changed, 87 insertions, 7 deletions
diff --git a/build_files/cmake/Modules/FindOpenGLES.cmake b/build_files/cmake/Modules/FindOpenGLES.cmake new file mode 100644 index 00000000000..1bb06c2f31c --- /dev/null +++ b/build_files/cmake/Modules/FindOpenGLES.cmake @@ -0,0 +1,76 @@ +# - 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 + +# If OPENGLES_ROOT_DIR was defined in the environment, use it. +IF(NOT OPENGLES_ROOT_DIR AND NOT $ENV{OPENGLES_ROOT_DIR} STREQUAL "") + SET(OPENGLES_ROOT_DIR $ENV{OPENGLES_ROOT_DIR}) +ENDIF() + +SET(_opengles_SEARCH_DIRS + ${OPENGLES_ROOT_DIR} + /usr/local +) + +FIND_PATH(OPENGLES_INCLUDE_DIR + NAMES + GLES2/gl2.h + HINTS + ${_opengles_SEARCH_DIRS} +) + +FIND_LIBRARY(OPENGLES_LIBRARY + NAMES + GLESv2 + PATHS + ${_opengles_SEARCH_DIRS} + PATH_SUFFIXES + lib64 lib +) + +FIND_PATH(OPENGLES_EGL_INCLUDE_DIR + NAMES + EGL/egl.h + HINTS + ${_opengles_SEARCH_DIRS} +) + +FIND_LIBRARY(OPENGLES_EGL_LIBRARY + NAMES + EGL + HINTS + ${_opengles_SEARCH_DIRS} + PATH_SUFFIXES + lib64 lib +) + +IF(OPENGLES_EGL_LIBRARY AND OPENGLES_EGL_INCLUDE_DIR) + SET(OPENGL_EGL_FOUND "YES") +ELSE() + SET(OPENGL_EGL_FOUND "NO") +ENDIF() + +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") +ELSE() + SET(OPENGLES_FOUND "NO") +ENDIF() + +MARK_AS_ADVANCED( + OPENGLES_EGL_INCLUDE_DIR + OPENGLES_EGL_LIBRARY + OPENGLES_INCLUDE_DIR +) + diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index adbba817150..b42e62e719c 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() @@ -557,6 +559,8 @@ macro(SETUP_BLENDER_SORTED_LIBS) extern_wcwidth extern_libmv extern_glog + + bf_intern_glew_mx ) if(WITH_COMPOSITOR) @@ -574,7 +578,7 @@ macro(SETUP_BLENDER_SORTED_LIBS) endif() if(NOT WITH_SYSTEM_GLEW) - list(APPEND BLENDER_SORTED_LIBS extern_glew) + list(APPEND BLENDER_SORTED_LIBS ${BLENDER_GLEW_LIBRARIES}) endif() if(WITH_BINRELOC) |