Browse Source

modules: we don't need GL(ES) include files.

Don't try to look for them if we don't use them. It only makes people
install additional outdated crap on their machines for no reason. The
only case where platform-specific GL headers are needed is in case of
iOS which doesn't provide any means of function pointer loading, but
there the include is passed implicitly from the framework.
pull/364/head
Vladimír Vondruš 7 years ago
parent
commit
f6503d52d9
  1. 2
      doc/changelog.dox
  2. 18
      modules/FindOpenGLES2.cmake
  3. 18
      modules/FindOpenGLES3.cmake

2
doc/changelog.dox

@ -399,6 +399,8 @@ See also:
- `FindEGL.cmake`, `FindOpenAL.cmake`, `FindOpenGLES2.cmake` and - `FindEGL.cmake`, `FindOpenAL.cmake`, `FindOpenGLES2.cmake` and
`FindOpenGLES3.cmake` now explicitly link to the `GL` and `openal` `FindOpenGLES3.cmake` now explicitly link to the `GL` and `openal`
libraries on Emscripten, which is needed for `MINIMAL_BUILD` libraries on Emscripten, which is needed for `MINIMAL_BUILD`
- `FindOpenGLES2.cmake` and `FindOpenGLES3.cmake` don't require GL ES headers
to be installed on the system anymore, as Magnum uses its own copies
- Fixed linking of static `Any*` plugins when the libraries are otherwise - Fixed linking of static `Any*` plugins when the libraries are otherwise
build as dynamic build as dynamic
- Removed mention of the outdated Ubuntu PPA from @ref building as it doesn't - Removed mention of the outdated Ubuntu PPA from @ref building as it doesn't

18
modules/FindOpenGLES2.cmake

@ -10,7 +10,10 @@
# Additionally these variables are defined for internal usage: # Additionally these variables are defined for internal usage:
# #
# OPENGLES2_LIBRARY - OpenGL ES 2 library # OPENGLES2_LIBRARY - OpenGL ES 2 library
# OPENGLES2_INCLUDE_DIR - Include dir #
# Please note this find module is tailored especially for the needs of Magnum.
# In particular, it depends on its platform definitions and doesn't look for
# OpenGL ES includes as Magnum has its own, generated using flextGL.
# #
# #
@ -53,17 +56,9 @@ else()
OpenGLES) OpenGLES)
endif() endif()
# Include dir
find_path(OPENGLES2_INCLUDE_DIR NAMES
GLES2/gl2.h
# iOS
ES2/gl.h)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG
OPENGLES2_LIBRARY OPENGLES2_LIBRARY)
OPENGLES2_INCLUDE_DIR)
if(NOT TARGET OpenGLES2::OpenGLES2) if(NOT TARGET OpenGLES2::OpenGLES2)
# Work around BUGGY framework support on macOS. Do this also in case of # Work around BUGGY framework support on macOS. Do this also in case of
@ -78,7 +73,4 @@ if(NOT TARGET OpenGLES2::OpenGLES2)
set_property(TARGET OpenGLES2::OpenGLES2 PROPERTY set_property(TARGET OpenGLES2::OpenGLES2 PROPERTY
IMPORTED_LOCATION ${OPENGLES2_LIBRARY}) IMPORTED_LOCATION ${OPENGLES2_LIBRARY})
endif() endif()
set_property(TARGET OpenGLES2::OpenGLES2 PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${OPENGLES2_INCLUDE_DIR})
endif() endif()

18
modules/FindOpenGLES3.cmake

@ -10,7 +10,10 @@
# Additionally these variables are defined for internal usage: # Additionally these variables are defined for internal usage:
# #
# OPENGLES3_LIBRARY - OpenGL ES 3 library # OPENGLES3_LIBRARY - OpenGL ES 3 library
# OPENGLES3_INCLUDE_DIR - Include dir #
# Please note this find module is tailored especially for the needs of Magnum.
# In particular, it depends on its platform definitions and doesn't look for
# OpenGL ES includes as Magnum has its own, generated using flextGL.
# #
# #
@ -57,17 +60,9 @@ else()
OpenGLES) OpenGLES)
endif() endif()
# Include dir
find_path(OPENGLES3_INCLUDE_DIR NAMES
GLES3/gl3.h
# iOS
ES3/gl.h)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args("OpenGLES3" DEFAULT_MSG find_package_handle_standard_args("OpenGLES3" DEFAULT_MSG
OPENGLES3_LIBRARY OPENGLES3_LIBRARY)
OPENGLES3_INCLUDE_DIR)
if(NOT TARGET OpenGLES3::OpenGLES3) if(NOT TARGET OpenGLES3::OpenGLES3)
# Work around BUGGY framework support on macOS. Do this also in case of # Work around BUGGY framework support on macOS. Do this also in case of
@ -83,9 +78,6 @@ if(NOT TARGET OpenGLES3::OpenGLES3)
IMPORTED_LOCATION ${OPENGLES3_LIBRARY}) IMPORTED_LOCATION ${OPENGLES3_LIBRARY})
endif() endif()
set_property(TARGET OpenGLES3::OpenGLES3 PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${OPENGLES3_INCLUDE_DIR})
# Emscripten needs a special flag to use WebGL 2. CMake 3.13 allows to set # Emscripten needs a special flag to use WebGL 2. CMake 3.13 allows to set
# this via INTERFACE_LINK_OPTIONS, for older versions we modify the global # this via INTERFACE_LINK_OPTIONS, for older versions we modify the global
# CMAKE_EXE_LINKER_FLAGS inside FindMagnum.cmake. # CMAKE_EXE_LINKER_FLAGS inside FindMagnum.cmake.

Loading…
Cancel
Save