diff --git a/doc/cmake.dox b/doc/cmake.dox index b80791ca6..73732b990 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -167,6 +167,7 @@ are also available as preprocessor variables if including @ref Magnum/Magnum.h: - `MAGNUM_TARGET_GLES3` -- Defined if compiled for OpenGL ES 3.0 - `MAGNUM_TARGET_DESKTOP_GLES` -- Defined if compiled with OpenGL ES emulation on desktop OpenGL +- `MAGNUM_TARGET_WEBGL` --- Defined if compiled for WebGL If `MAGNUM_BUILD_DEPRECATED` is defined, the `MAGNUM_INCLUDE_DIR` variable also contains path directly to Magnum directory (i.e. for includes without `Magnum/` diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 22b5d029e..55addc7aa 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -92,6 +92,7 @@ # MAGNUM_TARGET_GLES3 - Defined if compiled for OpenGL ES 3.0 # MAGNUM_TARGET_DESKTOP_GLES - Defined if compiled with OpenGL ES # emulation on desktop OpenGL +# MAGNUM_TARGET_WEBGL - Defined if compiled for WebGL # # If `MAGNUM_BUILD_DEPRECATED` is defined, the `MAGNUM_INCLUDE_DIR` variable # also contains path directly to Magnum directory (i.e. for includes without @@ -207,6 +208,10 @@ string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_DESKTOP_GLES" _TARGET_D if(NOT _TARGET_DESKTOP_GLES EQUAL -1) set(MAGNUM_TARGET_DESKTOP_GLES 1) endif() +string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_WEBGL" _TARGET_WEBGL) +if(NOT _TARGET_WEBGL EQUAL -1) + set(MAGNUM_TARGET_WEBGL 1) +endif() # Dependent libraries and includes set(MAGNUM_INCLUDE_DIRS ${MAGNUM_INCLUDE_DIR}