Browse Source

Tweaked cmake-subproject section for clarity.

pull/418/head
jackcamp 6 years ago
parent
commit
c410ffc50f
  1. 24
      doc/cmake.dox

24
doc/cmake.dox

@ -65,16 +65,16 @@ separate them with semicolons.
@section cmake-subproject Using Magnum as a CMake subproject @section cmake-subproject Using Magnum as a CMake subproject
A self-contained alternative to the above is adding Corrade and Magnum A self-contained alternative to a shared instance of the libraries, is
repositories into your project (as a Git submodule, bundling a downloaded to add the repositories directly into your project (as Git submodules, bundling
archive etc.) and use @cb{.cmake} add_subdirectory() @ce. With that approach downloaded archives etc.), and then to use Cmake's @cb{.cmake} add_subdirectory() @ce
you don't need to care about `FindCorrade.cmake` / `FindMagnum.cmake`, however feature to compile them on demand. With this approach, you don't need to care about
the usual tradeoffs when bundling code apply --- slower full rebuilds, IDEs manually installing Magnum and Corrade, however the usual tradeoffs
having more to parse etc. In this case, the when bundling code apply --- slower full rebuilds, IDEs having more to parse etc.
@ref building-features "build-time options" are @cmake set() @ce before In this case, @ref building-features "build-time options" can be @cmake set() @ce
the @cmake add_subdirectory() @ce call. Note that, unless you require CMake before calling @cmake add_subdirectory() @ce .
3.13 at least, it's needed to use the `CACHE ... FORCE` arguments Note that, unless you require CMake 3.13 at least, it's necessary to use the `CACHE ... FORCE`
[in order to have the options set properly](https://cmake.org/cmake/help/latest/policy/CMP0077.html). For example: arguments [in order to have the options set properly](https://cmake.org/cmake/help/latest/policy/CMP0077.html). For example:
@code{.cmake} @code{.cmake}
add_subdirectory(corrade EXCLUDE_FROM_ALL) # so only things you use are built add_subdirectory(corrade EXCLUDE_FROM_ALL) # so only things you use are built
@ -85,7 +85,9 @@ add_subdirectory(magnum EXCLUDE_FROM_ALL)
find_package(Magnum REQUIRED ...) # see below find_package(Magnum REQUIRED ...) # see below
@endcode @endcode
Note that the @cb{.cmake} find_package() @ce call is needed in both the Note that the use of @cb{.cmake} add_subdirectory() @ce does not replace
the configuration necessary for an installed version of magnum.
The modules directory and calls to @cb{.cmake} find_package() @ce are needed in both the
installed and the subproject case for a properly configured environment. installed and the subproject case for a properly configured environment.
To simplify your project setup, the subproject globally configures To simplify your project setup, the subproject globally configures

Loading…
Cancel
Save