Browse Source

CMake: install and automatically use Find modules of dependencies.

In short this means the users no longer need to care about FindSDL2 etc.,
it'll just get done automatically. They don't need to drag along
FindMagnum / FindCorrade anymore either, but having them gives a much
more reasonable error message if the library cannot be located at all, so
I still recommend having them.
pull/650/head
Vladimír Vondruš 2 years ago
parent
commit
282f95d723
  1. 2
      doc/changelog-old.dox
  2. 4
      doc/changelog.dox
  3. 36
      doc/cmake.dox
  4. 17
      doc/getting-started.dox
  5. 16
      doc/namespaces.dox
  6. 6
      doc/platforms-android.dox
  7. 12
      doc/platforms-html5.dox
  8. 7
      doc/troubleshooting.dox
  9. 41
      modules/CMakeLists.txt
  10. 34
      modules/FindMagnum.cmake
  11. 5
      src/Magnum/Audio/Extensions.h
  12. 9
      src/Magnum/Platform/AndroidApplication.h
  13. 8
      src/Magnum/Platform/EmscriptenApplication.h
  14. 4
      src/Magnum/Platform/GlfwApplication.h
  15. 7
      src/Magnum/Platform/Sdl2Application.h
  16. 6
      src/Magnum/Platform/WindowlessEglApplication.h
  17. 5
      src/Magnum/Platform/WindowlessIosApplication.h
  18. 5
      src/Magnum/Platform/XEglApplication.h

2
doc/changelog-old.dox

@ -1192,7 +1192,7 @@ a high-level overview.
[mosra/magnum#113](https://github.com/mosra/magnum/issues/113)) [mosra/magnum#113](https://github.com/mosra/magnum/issues/113))
- Explicit list of extensions that are available in WebGL builds - Explicit list of extensions that are available in WebGL builds
- New page explaining @ref opengl-wrapping "OpenGL wrapper layer" - New page explaining @ref opengl-wrapping "OpenGL wrapper layer"
- Documented extra CMake modules in @ref cmake-modules - Documented extra CMake modules
- The @ref building documentation now prefers package installation instead of - The @ref building documentation now prefers package installation instead of
manual build manual build
- Clarified behavior of @ref Math::Matrix4::lookAt() (see - Clarified behavior of @ref Math::Matrix4::lookAt() (see

4
doc/changelog.dox

@ -1096,6 +1096,10 @@ See also:
to copy resources and assets to the APK. See @ref platforms-android-apps-cmake "the corresponding Android platform documentation" to copy resources and assets to the APK. See @ref platforms-android-apps-cmake "the corresponding Android platform documentation"
and [mosra/toolchains#10](https://github.com/mosra/toolchains/pull/10) for and [mosra/toolchains#10](https://github.com/mosra/toolchains/pull/10) for
more information more information
- Magnum now automatically installs and uses Find modules for its
dependencies in a way that doesn't clash with modules of the same name
potentially installed by other software, meaning the user doesn't need to
copy and carry them along anymore (see [mosra/magnum#436](https://github.com/mosra/magnum/issues/436))
@subsection changelog-latest-bugfixes Bug fixes @subsection changelog-latest-bugfixes Bug fixes

36
doc/cmake.dox

@ -53,10 +53,7 @@ find_package(Magnum REQUIRED ...) # see below
@endcode @endcode
Otherwise, if CMake won't be able to find this file in predefined locations, it Otherwise, if CMake won't be able to find this file in predefined locations, it
will error out even if Magnum might be installed on the system. There are other will error out even if Magnum might be installed on the system. Note that the
Find modules that you might need for particular features or platforms, see
the @ref cmake-modules "full list below". Each library that needs one of the
extra modules also mentions the requirement in its documentation. Note that the
module files are updated as the library evolves, you are encouraged to update module files are updated as the library evolves, you are encouraged to update
your copies from time to time to avoid strange building issues. your copies from time to time to avoid strange building issues.
@ -352,36 +349,5 @@ Corrade library provides also its own set of CMake macros and variables, see
@ref corrade-cmake "its documentation" for more information. @ref corrade-cmake "its documentation" for more information.
@ref cmake-plugins "Plugins repository", @ref cmake-integration "Integration repository" @ref cmake-plugins "Plugins repository", @ref cmake-integration "Integration repository"
and @ref cmake-extras "Extras repository" have also their own CMake modules. and @ref cmake-extras "Extras repository" have also their own CMake modules.
@section cmake-modules Other CMake modules
The `modules/` directory of Magnum sources contains more useful CMake modules.
If a library requires presence of any of these, it mentions them in its usage
documentation.
- [FindOpenAL.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenAL.cmake)
--- CMake module for finding OpenAL. This is a forked version of the
upstream module that works properly with
@ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". Copy this to your module
directory if you want to use the @ref Audio library on Emscripten.
- [FindGLFW.cmake](https://github.com/mosra/magnum/blob/master/modules/FindGLFW.cmake)
--- CMake module for finding GLFW. Copy this to your module directory if
you want to use @ref Platform::GlfwApplication.
- [FindEGL.cmake](https://github.com/mosra/magnum/blob/master/modules/FindEGL.cmake)
--- CMake module for finding EGL. Copy this to your module directory if you
want to use the @ref GL library on embedded platforms such as
@ref CORRADE_TARGET_IOS "iOS", @ref CORRADE_TARGET_ANDROID "Android",
@ref CORRADE_TARGET_WINDOWS_RT "Windows RT" or
@ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" or if you want to use EGL
instead of GLX/WGL/CGL on a desktop platform.
- [FindOpenGLES2.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenGLES2.cmake),
[FindOpenGLES3.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenGLES3.cmake)
--- CMake module for finding OpenGL ES 2.0 / 3.0 library. Copy this to your
module directory if you want to use the @ref GL library on
@ref MAGNUM_TARGET_GLES "OpenGL ES".
- [FindSDL2.cmake](https://github.com/mosra/magnum/blob/master/modules/FindSDL2.cmake)
--- CMake module for finding SDL 2. Copy this to your module directory if
you want to use @ref Platform::Sdl2Application.
*/ */
} }

17
doc/getting-started.dox

@ -149,12 +149,11 @@ systems, and outside of the standard prefix if using MinGW on Windows).
@section getting-started-review 2. Review project structure @section getting-started-review 2. Review project structure
The base project consists of just six files in two subfolders (plus the three The base project consists of just five files in two subfolders (plus the three
extra directories with dependencies you might have added): extra directories with dependencies you might have added):
modules/FindCorrade.cmake modules/FindCorrade.cmake
modules/FindMagnum.cmake modules/FindMagnum.cmake
modules/FindSDL2.cmake
src/MyApplication.cpp src/MyApplication.cpp
src/CMakeLists.txt src/CMakeLists.txt
CMakeLists.txt CMakeLists.txt
@ -163,14 +162,14 @@ In root there is the project-wide `CMakeLists.txt`, which you have seen above.
It just sets up project name, specifies module directory and delegates It just sets up project name, specifies module directory and delegates
everything important to `CMakeLists.txt` in the `src/` subdirectory. everything important to `CMakeLists.txt` in the `src/` subdirectory.
The `modules/` directory contains CMake modules for finding the needed The `modules/` directory contains CMake modules for finding the Magnum
dependencies. These are needed mainly with externally installed dependencies dependencies. These are mainly useful with externally installed dependencies
(@ref getting-started-setup-install "Option B" above), less so for the CMake (@ref getting-started-setup-install "Option B" above), less so for the CMake
subproject setup. Unlike modules for finding e.g. OpenGL, which are a part of subproject setup. You don't *strictly* need them as they're part of the Magnum
the standard CMake installation, these aren't and thus have to be distributed installation, but if they're present, they provide a much better failure
with the project. These files are verbatim copied from the diagnostic in case Magnum cannot be found at all. These files are verbatim
[modules/](https://github.com/mosra/magnum/tree/master/modules) directory in copied from the [modules/](https://github.com/mosra/magnum/tree/master/modules)
the Magnum repository. directory in the Magnum repository.
The `src/` directory contains the actual project. To keep things simple, the The `src/` directory contains the actual project. To keep things simple, the
project consists of just a single `MyApplication.cpp` file with the most project consists of just a single `MyApplication.cpp` file with the most

16
doc/namespaces.dox

@ -288,9 +288,8 @@ Audio import, playback and integration with @ref SceneGraph.
This library depends on the [OpenAL](https://www.openal.org/) library and is This library depends on the [OpenAL](https://www.openal.org/) library and is
built if `MAGNUM_WITH_AUDIO` is enabled when building Magnum. To use this built if `MAGNUM_WITH_AUDIO` is enabled when building Magnum. To use this
library with CMake, put [FindOpenAL.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenAL.cmake) library with CMake, request the `Audio` component of the `Magnum` package and
into your `modules/` directory, request the `Audio` component of the `Magnum` link to the `Magnum::Audio` target:
package and link to the `Magnum::Audio` target:
@code{.cmake} @code{.cmake}
find_package(Magnum REQUIRED Audio) find_package(Magnum REQUIRED Audio)
@ -368,12 +367,6 @@ find_package(Magnum REQUIRED GL)
target_link_libraries(your-app PRIVATE Magnum::GL) target_link_libraries(your-app PRIVATE Magnum::GL)
@endcode @endcode
In case you're building for EGL or OpenGL ES platforms, you also need to put
[FindEGL.cmake](https://github.com/mosra/magnum/blob/master/modules/FindEGL.cmake),
[FindOpenGLES2.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenGLES2.cmake)
or [FindOpenGLES3.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenGLES3.cmake)
into your `modules/` directory.
See @ref building, @ref cmake and @ref opengl for more information. See @ref building, @ref cmake and @ref opengl for more information.
@m_class{m-block m-success} @m_class{m-block m-success}
@ -896,9 +889,8 @@ C++14 wrappers and helpers for Vulkan development.
This library is depends on [Vulkan](https://www.khronos.org/vulkan/) and is This library is depends on [Vulkan](https://www.khronos.org/vulkan/) and is
built if `MAGNUM_WITH_VK` is enabled when building Magnum. To use this library built if `MAGNUM_WITH_VK` is enabled when building Magnum. To use this library
with CMake, put [FindVulkan.cmake](https://github.com/mosra/magnum/blob/master/modules/FindVulkan.cmake) with CMake, request the `Vk` component of the `Magnum` package and link to the
into your `modules/` directory, request the `Vk` component of the `Magnum` `Magnum::Vk` target:
package and link to the `Magnum::Vk` target:
@code{.cmake} @code{.cmake}
find_package(Magnum REQUIRED Vk) find_package(Magnum REQUIRED Vk)

6
doc/platforms-android.dox

@ -109,12 +109,6 @@ information about OpenGL testing.
@section platforms-android-apps Building and installing graphics apps @section platforms-android-apps Building and installing graphics apps
In case you don't have an OpenGL ES build set up yet, you need to copy
`FindEGL.cmake` and `FindOpenGLES2.cmake` (or `FindOpenGLES3.cmake`) from the
[modules/](https://github.com/mosra/magnum/tree/master/modules) directory in
Magnum source to the `modules/` dir in your project so it is able to find EGL
and OpenGL ES libraries.
Magnum provides Android application wrapper in @ref Platform::AndroidApplication. Magnum provides Android application wrapper in @ref Platform::AndroidApplication.
See its documentation for more information about general usage. You can also See its documentation for more information about general usage. You can also
use the Android Native Activity directly or any other way. use the Android Native Activity directly or any other way.

12
doc/platforms-html5.dox

@ -96,12 +96,6 @@ node my-application.js
@section platforms-html5-apps Building and deploying graphical apps @section platforms-html5-apps Building and deploying graphical apps
In case you don't have an OpenGL ES build set up yet, you need to copy
`FindOpenGLES2.cmake` (or `FindOpenGLES3.cmake`) from the
[modules/](https://github.com/mosra/magnum/tree/master/modules) directory in
Magnum source to the `modules/` dir in your project so it is able to find the
WebGL libraries.
Magnum provides Emscripten application wrappers in @ref Platform::Sdl2Application Magnum provides Emscripten application wrappers in @ref Platform::Sdl2Application
and @ref Platform::EmscriptenApplication. See their documentation for more and @ref Platform::EmscriptenApplication. See their documentation for more
information about general usage. You can also use the Emscripten APIs directly information about general usage. You can also use the Emscripten APIs directly
@ -209,12 +203,6 @@ webserver again by pressing @m_class{m-label m-warning} **Ctrl**
@section platforms-html5-windowless-apps Building and deploying windowless apps @section platforms-html5-windowless-apps Building and deploying windowless apps
In case you don't have an EGL + OpenGL ES build set up yet, you need to copy
`FindEGL.cmake` and `FindOpenGLES2.cmake` (or `FindOpenGLES3.cmake`) from the
[modules/](https://github.com/mosra/magnum/tree/master/modules) directory in
Magnum source to the `modules/` dir in your project so it is able to find the
EGL and WebGL libraries.
Windowless Magnum apps (i.e. apps that use the OpenGL context without a window) Windowless Magnum apps (i.e. apps that use the OpenGL context without a window)
can be run in the browser as well using the @ref Platform::WindowlessEglApplication can be run in the browser as well using the @ref Platform::WindowlessEglApplication
class. See its documentation for more information about general usage. You can class. See its documentation for more information about general usage. You can

7
doc/troubleshooting.dox

@ -37,9 +37,10 @@ If your project suddenly stops building after a Magnum upgrade, check these
things: things:
- If building fails on the CMake step, be sure that you have up-to-date - If building fails on the CMake step, be sure that you have up-to-date
`FindCorrade.cmake`, `FindMagnum.cmake` and other CMake modules in your `FindCorrade.cmake` and `FindMagnum.cmake` CMake modules in your project.
project (`FindSDL2.cmake`, ...). They are contained in `modules/` directory They are contained in the [modules/](https://github.com/mosra/magnum/tree/master/modules)
of Magnum repositories and also get installed into `share/cmake/Magnum`. directory of Magnum repositories and also get installed into
`share/cmake/Corrade` and `share/cmake/Magnum`.
- In very rare cases the CMake build directory may not survive an upgrade. If - In very rare cases the CMake build directory may not survive an upgrade. If
you get some particularly cursed errors, try recreating it from scratch. you get some particularly cursed errors, try recreating it from scratch.
- The library is constantly evolving, meaning that APIs may get deprecated - The library is constantly evolving, meaning that APIs may get deprecated

41
modules/CMakeLists.txt

@ -28,4 +28,45 @@ set(Magnum_MODULES
FindMagnum.cmake FindMagnum.cmake
MagnumConfig.cmake) MagnumConfig.cmake)
# IMPORTANT: When adding a new module here, be sure to update the
# find_path(_MAGNUM_DEPENDENCY_MODULE_DIR ...) list in FindMagnum.cmake to
# avoid breakages when the directory contains only that new module.
set(Magnum_DEPENDENCY_MODULES )
# TODO update once AndroidApplication uses GL only optionally
if(MAGNUM_WITH_ANDROIDAPPLICATION OR MAGNUM_WITH_WINDOWLESSEGLAPPLICATION OR MAGNUM_WITH_WINDOWLESSIOSAPPLICATION OR MAGNUM_WITH_XEGLAPPLICATION OR MAGNUM_WITH_EGLCONTEXT OR ((MAGNUM_WITH_SDL2APPLICATION OR MAGNUM_WITH_SDL2APPLICATION) AND MAGNUM_TARGET_GL AND MAGNUM_TARGET_EGL))
list(APPEND Magnum_DEPENDENCY_MODULES
FindEGL.cmake)
endif()
if(MAGNUM_WITH_GLFWAPPLICATION)
list(APPEND Magnum_DEPENDENCY_MODULES
FindGLFW.cmake)
endif()
if(MAGNUM_WITH_AUDIO)
list(APPEND Magnum_DEPENDENCY_MODULES
FindOpenAL.cmake)
endif()
if(MAGNUM_WITH_GL AND MAGNUM_TARGET_GLES)
if(MAGNUM_TARGET_GLES2)
list(APPEND Magnum_DEPENDENCY_MODULES
FindOpenGLES2.cmake)
else()
list(APPEND Magnum_DEPENDENCY_MODULES
FindOpenGLES3.cmake)
endif()
endif()
if(MAGNUM_WITH_SDL2APPLICATION)
list(APPEND Magnum_DEPENDENCY_MODULES
FindSDL2.cmake)
endif()
if(MAGNUM_WITH_VK)
list(APPEND Magnum_DEPENDENCY_MODULES
FindVulkan.cmake)
endif()
install(FILES ${Magnum_MODULES} DESTINATION ${MAGNUM_CMAKE_MODULE_INSTALL_DIR}) install(FILES ${Magnum_MODULES} DESTINATION ${MAGNUM_CMAKE_MODULE_INSTALL_DIR})
if(Magnum_DEPENDENCY_MODULES)
install(FILES ${Magnum_DEPENDENCY_MODULES} DESTINATION ${MAGNUM_CMAKE_MODULE_INSTALL_DIR}/dependencies)
endif()
# Magnum dependency module dir for superprojects
set(_MAGNUM_DEPENDENCY_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "")

34
modules/FindMagnum.cmake

@ -323,6 +323,30 @@ if(MAGNUM_BUILD_DEPRECATED)
endif() endif()
endif() endif()
# CMake module dir for dependencies. It might not be present at all if no
# feature that needs them is enabled, in which case it'll be left at NOTFOUND.
# But in that case it should also not be subsequently needed for any
# find_package(). If this is called from a superproject, the
# _MAGNUM_DEPENDENCY_MODULE_DIR is already set by modules/CMakeLists.txt.
find_path(_MAGNUM_DEPENDENCY_MODULE_DIR
NAMES
FindEGL.cmake FindGLFW.cmake FindOpenAL.cmake FindOpenGLES2.cmake
FindOpenGLES3.cmake FindSDL2.cmake FindVulkan.cmake
PATH_SUFFIXES share/cmake/Magnum/dependencies)
mark_as_advanced(_MAGNUM_DEPENDENCY_MODULE_DIR)
# If the module dir is found and is not present in CMAKE_MODULE_PATH already
# (such as when someone explicitly added it, or if it's the Magnum's modules/
# dir in case of a superproject), add it as the first before all other. Set a
# flag to remove it again at the end, so the modules don't clash with Find
# modules of the same name from other projects.
if(_MAGNUM_DEPENDENCY_MODULE_DIR AND NOT _MAGNUM_DEPENDENCY_MODULE_DIR IN_LIST CMAKE_MODULE_PATH)
set(CMAKE_MODULE_PATH ${_MAGNUM_DEPENDENCY_MODULE_DIR} ${CMAKE_MODULE_PATH})
set(_MAGNUM_REMOVE_DEPENDENCY_MODULE_DIR_FROM_CMAKE_PATH ON)
else()
unset(_MAGNUM_REMOVE_DEPENDENCY_MODULE_DIR_FROM_CMAKE_PATH)
endif()
# Base Magnum library # Base Magnum library
if(NOT TARGET Magnum::Magnum) if(NOT TARGET Magnum::Magnum)
add_library(Magnum::Magnum UNKNOWN IMPORTED) add_library(Magnum::Magnum UNKNOWN IMPORTED)
@ -710,6 +734,9 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
# Decide if the library was found. If not, skip the rest, which # Decide if the library was found. If not, skip the rest, which
# populates the target properties and finds additional dependencies. # populates the target properties and finds additional dependencies.
# This means that the rest can also rely on that e.g. FindEGL.cmake is
# present in _MAGNUM_DEPENDENCY_MODULE_DIR -- given that the library
# needing EGL was found, it likely also installed FindEGL for itself.
if(((_component IN_LIST _MAGNUM_LIBRARY_COMPONENTS OR _component IN_LIST _MAGNUM_PLUGIN_COMPONENTS) AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR AND (MAGNUM_${_COMPONENT}_LIBRARY_DEBUG OR MAGNUM_${_COMPONENT}_LIBRARY_RELEASE)) OR (_component IN_LIST _MAGNUM_EXECUTABLE_COMPONENTS AND MAGNUM_${_COMPONENT}_EXECUTABLE)) if(((_component IN_LIST _MAGNUM_LIBRARY_COMPONENTS OR _component IN_LIST _MAGNUM_PLUGIN_COMPONENTS) AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR AND (MAGNUM_${_COMPONENT}_LIBRARY_DEBUG OR MAGNUM_${_COMPONENT}_LIBRARY_RELEASE)) OR (_component IN_LIST _MAGNUM_EXECUTABLE_COMPONENTS AND MAGNUM_${_COMPONENT}_EXECUTABLE))
set(Magnum_${_component}_FOUND TRUE) set(Magnum_${_component}_FOUND TRUE)
else() else()
@ -1112,6 +1139,13 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.16)
set(_MAGNUM_REASON_FAILURE_MESSAGE REASON_FAILURE_MESSAGE "${_MAGNUM_REASON_FAILURE_MESSAGE}") set(_MAGNUM_REASON_FAILURE_MESSAGE REASON_FAILURE_MESSAGE "${_MAGNUM_REASON_FAILURE_MESSAGE}")
endif() endif()
# Remove Magnum's dependency module dir from CMAKE_MODULE_PATH again. Do it
# before the FPHSA call which may exit early in case of a failure.
if(_MAGNUM_REMOVE_DEPENDENCY_MODULE_DIR_FROM_CMAKE_PATH)
list(REMOVE_ITEM CMAKE_MODULE_PATH ${_MAGNUM_DEPENDENCY_MODULE_DIR})
unset(_MAGNUM_REMOVE_DEPENDENCY_MODULE_DIR_FROM_CMAKE_PATH)
endif()
# Complete the check with also all components # Complete the check with also all components
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Magnum find_package_handle_standard_args(Magnum

5
src/Magnum/Audio/Extensions.h

@ -49,9 +49,8 @@ compile-time decisions rather than @ref Extension instances. See
This library depends on the [OpenAL](https://www.openal.org/) library and is This library depends on the [OpenAL](https://www.openal.org/) library and is
built if `MAGNUM_WITH_AUDIO` is enabled when building Magnum. To use this built if `MAGNUM_WITH_AUDIO` is enabled when building Magnum. To use this
library with CMake, put [FindOpenAL.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenAL.cmake) library with CMake, request the `Audio` component of the `Magnum` package and
into your `modules/` directory, request the `Audio` component of the `Magnum` link to the `Magnum::Audio` target:
package and link to the `Magnum::Audio` target:
@code{.cmake} @code{.cmake}
find_package(Magnum REQUIRED Audio) find_package(Magnum REQUIRED Audio)

9
src/Magnum/Platform/AndroidApplication.h

@ -90,12 +90,9 @@ together with a troubleshooting guide is available in @ref platforms-android.
@section Platform-AndroidApplication-usage General usage @section Platform-AndroidApplication-usage General usage
This application library is built if `MAGNUM_WITH_ANDROIDAPPLICATION` is This application library is built if `MAGNUM_WITH_ANDROIDAPPLICATION` is
enabled when building Magnum. To use this library with CMake, put enabled when building Magnum. To use this library with CMake, request the
[FindEGL.cmake](https://github.com/mosra/magnum/blob/master/modules/FindEGL.cmake) `AndroidApplication` component of the `Magnum` package and link to the
and [FindOpenGLES2.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenGLES2.cmake) (or `Magnum::AndroidApplication` target:
[FindOpenGLES3.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenGLES3.cmake))
into your `modules/` directory, request the `AndroidApplication` component of
the `Magnum` package and link to the `Magnum::AndroidApplication` target:
@code{.cmake} @code{.cmake}
find_package(Magnum REQUIRED) find_package(Magnum REQUIRED)

8
src/Magnum/Platform/EmscriptenApplication.h

@ -141,11 +141,9 @@ together with a troubleshooting guide is available in @ref platforms-html5.
@section Platform-EmscriptenApplication-usage General usage @section Platform-EmscriptenApplication-usage General usage
This application library is built if `MAGNUM_WITH_EMSCRIPTENAPPLICATION` is This application library is built if `MAGNUM_WITH_EMSCRIPTENAPPLICATION` is
enabled when building Magnum. To use this library with CMake, put enabled when building Magnum. To use this library with CMake, request the
[FindOpenGLES2.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenGLES2.cmake) (or `EmscriptenApplication` component of the `Magnum` package and link to the
[FindOpenGLES3.cmake](https://github.com/mosra/magnum/blob/master/modules/FindOpenGLES3.cmake)) `Magnum::EmscriptenApplication` target:
into your `modules/` directory, request the `EmscriptenApplication` component
of the `Magnum` package and link to the `Magnum::EmscriptenApplication` target:
@code{.cmake} @code{.cmake}
find_package(Magnum REQUIRED) find_package(Magnum REQUIRED)

4
src/Magnum/Platform/GlfwApplication.h

@ -101,9 +101,7 @@ See @ref cmake for more information.
This application library depends on the [GLFW](http://glfw.org) library and is This application library depends on the [GLFW](http://glfw.org) library and is
built if `MAGNUM_WITH_GLFWAPPLICATION` is enabled when building Magnum. To use built if `MAGNUM_WITH_GLFWAPPLICATION` is enabled when building Magnum. To use
this library with CMake, put this library with CMake, request the `GlfwApplication` component of the
[FindGLFW.cmake](https://github.com/mosra/magnum/blob/master/modules/FindGLFW.cmake)
into your `modules/` directory, request the `GlfwApplication` component of the
`Magnum` package and link to the `Magnum::GlfwApplication` target: `Magnum` package and link to the `Magnum::GlfwApplication` target:
@code{.cmake} @code{.cmake}

7
src/Magnum/Platform/Sdl2Application.h

@ -211,10 +211,9 @@ final package along with a PowerShell script for easy local installation.
This application library depends on the [SDL2](http://www.libsdl.org) library This application library depends on the [SDL2](http://www.libsdl.org) library
(Emscripten has it built in) and is built if `MAGNUM_WITH_SDL2APPLICATION` is (Emscripten has it built in) and is built if `MAGNUM_WITH_SDL2APPLICATION` is
enabled when building Magnum. To use this library with CMake, put enabled when building Magnum. To use this library with CMake, request the
[FindSDL2.cmake](https://github.com/mosra/magnum/blob/master/modules/FindSDL2.cmake) `Sdl2Application` component of the `Magnum` package and link to the
into your `modules/` directory, request the `Sdl2Application` component of `Magnum::Sdl2Application` target:
the `Magnum` package and link to the `Magnum::Sdl2Application` target:
@code{.cmake} @code{.cmake}
find_package(Magnum REQUIRED Sdl2Application) find_package(Magnum REQUIRED Sdl2Application)

6
src/Magnum/Platform/WindowlessEglApplication.h

@ -497,10 +497,8 @@ together with a troubleshooting guide is available in @ref platforms-html5.
@section Platform-WindowlessEglApplication-usage General usage @section Platform-WindowlessEglApplication-usage General usage
This application library is built if `MAGNUM_WITH_WINDOWLESSEGLAPPLICATION` is This application library is built if `MAGNUM_WITH_WINDOWLESSEGLAPPLICATION` is
enabled when building Magnum. To use this library from CMake, put enabled when building Magnum. To use this library from CMake, request the
[FindEGL.cmake](https://github.com/mosra/magnum/blob/master/modules/FindEGL.cmake) `WindowlessEglApplication` component of the `Magnum` package and link to the
into your `modules/` directory, request the `WindowlessEglApplication`
component of the `Magnum` package and link to the
`Magnum::WindowlessEglApplication` target: `Magnum::WindowlessEglApplication` target:
@code{.cmake} @code{.cmake}

5
src/Magnum/Platform/WindowlessIosApplication.h

@ -278,9 +278,8 @@ See @ref cmake for more information.
@section Platform-WindowlessIosApplication-usage General usage @section Platform-WindowlessIosApplication-usage General usage
This application library is built if `MAGNUM_WITH_WINDOWLESSIOSAPPLICATION` is This application library is built if `MAGNUM_WITH_WINDOWLESSIOSAPPLICATION` is
enabled when building Magnum. To use this library from CMake, put [FindEGL.cmake](https://github.com/mosra/magnum/blob/master/modules/FindEGL.cmake) enabled when building Magnum. To use this library from CMake, request the
into your `modules/` directory, request the `WindowlessIosApplication` `WindowlessIosApplication` component of the `Magnum` package and link to the
component of the `Magnum` package and link to the
`Magnum::WindowlessIosApplication` target: `Magnum::WindowlessIosApplication` target:
@code{.cmake} @code{.cmake}

5
src/Magnum/Platform/XEglApplication.h

@ -58,9 +58,8 @@ more information.
This application library depends on **X11** and **EGL** libraries and is built This application library depends on **X11** and **EGL** libraries and is built
if `MAGNUM_WITH_XEGLAPPLICATION` is enabled when building Magnum. To use this if `MAGNUM_WITH_XEGLAPPLICATION` is enabled when building Magnum. To use this
library from CMake, put [FindEGL.cmake](https://github.com/mosra/magnum/blob/master/modules/FindEGL.cmake) library from CMake, request the `XEglApplication` component of the `Magnum`
into your `modules/` directory, request the `XEglApplication` component of the package and link to the `Magnum::XEglApplication` target:
`Magnum` package and link to the `Magnum::XEglApplication` target:
@code{.cmake} @code{.cmake}
find_package(Magnum REQUIRED XEglApplication) find_package(Magnum REQUIRED XEglApplication)

Loading…
Cancel
Save