Changeset View
Changeset View
Standalone View
Standalone View
CMakeLists.txt
| Show First 20 Lines • Show All 225 Lines • ▼ Show 20 Lines | if(WITH_X11) | ||||
| option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON) | option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON) | ||||
| option(WITH_X11_XF86VMODE "Enable X11 video mode switching" ON) | option(WITH_X11_XF86VMODE "Enable X11 video mode switching" ON) | ||||
| option(WITH_X11_XFIXES "Enable X11 XWayland cursor warping workaround" ON) | option(WITH_X11_XFIXES "Enable X11 XWayland cursor warping workaround" ON) | ||||
| option(WITH_X11_ALPHA "Enable X11 transparent background" ON) | option(WITH_X11_ALPHA "Enable X11 transparent background" ON) | ||||
| endif() | endif() | ||||
| if(UNIX AND NOT APPLE) | if(UNIX AND NOT APPLE) | ||||
| option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF) | option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" OFF) | ||||
| option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON) | option(WITH_SYSTEM_GLES "Use OpenGL ES library provided by the operating system" ON) | ||||
brecht: `WITH_GL_PROFILE_ES20` already exists for this purpose, it even mentions EGL in the description. | |||||
Done Inline ActionsI did not use WITH_GL_PROFILE_ES20 since this specifically refers to OpenGL ES 2.0, while WITH_GLES is supposed to cover any OpenGL ES usage. christian.rauch: I did not use `WITH_GL_PROFILE_ES20` since this specifically refers to OpenGL ES 2.0, while… | |||||
Done Inline ActionsWITH_GL_PROFILE_ES20 may have been better named WITH_GL_PROFILE_ES, but it really is intended for any OpenGL ES usage. If we have two flags it's too confusing. brecht: `WITH_GL_PROFILE_ES20` may have been better named `WITH_GL_PROFILE_ES`, but it really is… | |||||
Done Inline ActionsWould you mind, if I would then rename WITH_GL_PROFILE_ES20 to WITH_GL_PROFILE_ES and use it in place of WITH_GLES? christian.rauch: Would you mind, if I would then rename `WITH_GL_PROFILE_ES20` to `WITH_GL_PROFILE_ES` and use… | |||||
| else() | else() | ||||
| # not an option for other OS's | # not an option for other OS's | ||||
| set(WITH_SYSTEM_GLEW OFF) | set(WITH_SYSTEM_GLEW OFF) | ||||
| set(WITH_SYSTEM_GLES OFF) | set(WITH_SYSTEM_GLES OFF) | ||||
| endif() | endif() | ||||
| if(UNIX AND NOT APPLE) | if(UNIX AND NOT APPLE) | ||||
| ▲ Show 20 Lines • Show All 730 Lines • ▼ Show 20 Lines | if(WITH_GL_PROFILE_ES20) | ||||
| if(WITH_SYSTEM_GLES) | if(WITH_SYSTEM_GLES) | ||||
| if(NOT OPENGLES_LIBRARY) | if(NOT OPENGLES_LIBRARY) | ||||
| message(FATAL_ERROR | message(FATAL_ERROR | ||||
| "Unable to find OpenGL ES libraries. " | "Unable to find OpenGL ES libraries. " | ||||
| "Install them or disable WITH_SYSTEM_GLES." | "Install them or disable WITH_SYSTEM_GLES." | ||||
| ) | ) | ||||
| endif() | endif() | ||||
| list(APPEND BLENDER_GL_LIBRARIES OPENGLES_LIBRARY) | list(APPEND BLENDER_GL_LIBRARIES "${OPENGLES_LIBRARY}") | ||||
| else() | else() | ||||
| set(OPENGLES_LIBRARY "" CACHE FILEPATH "OpenGL ES 2.0 library file") | set(OPENGLES_LIBRARY "" CACHE FILEPATH "OpenGL ES 2.0 library file") | ||||
| mark_as_advanced(OPENGLES_LIBRARY) | mark_as_advanced(OPENGLES_LIBRARY) | ||||
| list(APPEND BLENDER_GL_LIBRARIES "${OPENGLES_LIBRARY}") | list(APPEND BLENDER_GL_LIBRARIES "${OPENGLES_LIBRARY}") | ||||
| if(NOT OPENGLES_LIBRARY) | if(NOT OPENGLES_LIBRARY) | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | else() | ||||
| if(OpenGL_GL_PREFERENCE STREQUAL "LEGACY" AND OPENGL_gl_LIBRARY) | if(OpenGL_GL_PREFERENCE STREQUAL "LEGACY" AND OPENGL_gl_LIBRARY) | ||||
| list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_gl_LIBRARY}) | list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_gl_LIBRARY}) | ||||
| else() | else() | ||||
| list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_opengl_LIBRARY} ${OPENGL_glx_LIBRARY}) | list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_opengl_LIBRARY} ${OPENGL_glx_LIBRARY}) | ||||
| endif() | endif() | ||||
| endif() | endif() | ||||
| if(WITH_GL_EGL) | if(WITH_GL_EGL) | ||||
| list(APPEND GL_DEFINITIONS -DWITH_GL_EGL) | find_package(OpenGL REQUIRED EGL) | ||||
| list(APPEND BLENDER_GL_LIBRARIES OpenGL::EGL) | |||||
| list(APPEND GL_DEFINITIONS -DWITH_GL_EGL -DGLEW_EGL -DGLEW_INC_EGL) | |||||
| if(WITH_SYSTEM_GLES) | if(WITH_SYSTEM_GLES) | ||||
| if(NOT OPENGLES_EGL_LIBRARY) | if(NOT OPENGLES_EGL_LIBRARY) | ||||
| message(FATAL_ERROR | message(FATAL_ERROR | ||||
| "Unable to find OpenGL ES libraries. " | "Unable to find OpenGL ES libraries. " | ||||
| "Install them or disable WITH_SYSTEM_GLES." | "Install them or disable WITH_SYSTEM_GLES." | ||||
| ) | ) | ||||
| endif() | endif() | ||||
| list(APPEND BLENDER_GL_LIBRARIES OPENGLES_EGL_LIBRARY) | list(APPEND BLENDER_GL_LIBRARIES ${OPENGLES_EGL_LIBRARY}) | ||||
| else() | else() | ||||
| set(OPENGLES_EGL_LIBRARY "" CACHE FILEPATH "EGL library file") | set(OPENGLES_EGL_LIBRARY "" CACHE FILEPATH "EGL library file") | ||||
| mark_as_advanced(OPENGLES_EGL_LIBRARY) | mark_as_advanced(OPENGLES_EGL_LIBRARY) | ||||
| list(APPEND BLENDER_GL_LIBRARIES "${OPENGLES_LIBRARY}" "${OPENGLES_EGL_LIBRARY}") | list(APPEND BLENDER_GL_LIBRARIES "${OPENGLES_LIBRARY}" "${OPENGLES_EGL_LIBRARY}") | ||||
| if(NOT OPENGLES_EGL_LIBRARY) | if(NOT OPENGLES_EGL_LIBRARY) | ||||
| Show All 23 Lines | |||||
| endif() | endif() | ||||
| if(WITH_GL_PROFILE_ES20) | if(WITH_GL_PROFILE_ES20) | ||||
| list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_ES20) | list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_ES20) | ||||
| else() | else() | ||||
| list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE) | list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE) | ||||
| endif() | endif() | ||||
| if(WITH_GL_EGL) | |||||
| list(APPEND GL_DEFINITIONS -DWITH_EGL) | |||||
| endif() | |||||
| #----------------------------------------------------------------------------- | #----------------------------------------------------------------------------- | ||||
| # Configure OpenMP. | # Configure OpenMP. | ||||
| if(WITH_OPENMP) | if(WITH_OPENMP) | ||||
| if(NOT OPENMP_CUSTOM) | if(NOT OPENMP_CUSTOM) | ||||
| find_package(OpenMP) | find_package(OpenMP) | ||||
| endif() | endif() | ||||
| if(OPENMP_FOUND) | if(OPENMP_FOUND) | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | if(WITH_GL_PROFILE_ES20) | ||||
| # ToDo: This is an experiment to eliminate ES 1 symbols, | # ToDo: This is an experiment to eliminate ES 1 symbols, | ||||
| # GLEW doesn't really properly provide this level of control | # GLEW doesn't really properly provide this level of control | ||||
| # (for example, without modification it eliminates too many symbols) | # (for example, without modification it eliminates too many symbols) | ||||
| # so there are lots of modifications to GLEW to make this work, | # so there are lots of modifications to GLEW to make this work, | ||||
| # and no attempt to make it work beyond Blender at this point. | # and no attempt to make it work beyond Blender at this point. | ||||
| list(APPEND GL_DEFINITIONS -DGL_ES_VERSION_1_0=0 -DGL_ES_VERSION_CL_1_1=0 -DGL_ES_VERSION_CM_1_1=0) | list(APPEND GL_DEFINITIONS -DGL_ES_VERSION_1_0=0 -DGL_ES_VERSION_CL_1_1=0 -DGL_ES_VERSION_CM_1_1=0) | ||||
| endif() | endif() | ||||
| if(WITH_GL_EGL) | |||||
| list(APPEND GL_DEFINITIONS -DGLEW_INC_EGL) | |||||
| endif() | |||||
| set(BLENDER_GLEW_LIBRARIES extern_glew_es bf_intern_glew_mx) | set(BLENDER_GLEW_LIBRARIES extern_glew_es bf_intern_glew_mx) | ||||
| else() | else() | ||||
| set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include") | set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include") | ||||
| list(APPEND GL_DEFINITIONS -DGLEW_STATIC) | list(APPEND GL_DEFINITIONS -DGLEW_STATIC) | ||||
| # This won't affect the non-experimental glew library, | # This won't affect the non-experimental glew library, | ||||
| ▲ Show 20 Lines • Show All 629 Lines • Show Last 20 Lines | |||||
WITH_GL_PROFILE_ES20 already exists for this purpose, it even mentions EGL in the description.
Can you chqnge the code so WITH_GLES is not needed?