Skip to content

Commit

Permalink
doc: add documentation for using CPM.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Nov 4, 2024
1 parent 114ba73 commit 24502d1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions doc/building-corrade.dox
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ platforms.
- @ref building-corrade-packages-gentoo
- @ref building-corrade-packages-rpm
- @ref building-corrade-packages-brew
- @ref building-corrade-packages-cpm
- @ref building-corrade-packages-vcpkg
- @ref building-corrade-packages-conan
- @ref building-corrade-packages-hunter
Expand Down Expand Up @@ -235,6 +236,36 @@ If you want to pass additional flags to CMake or
@ref building-corrade-features "enable / disable additional features", edit the
`*.rb` file.

@subsection building-corrade-packages-cpm CMake Package Manager / CPM

If you're using [CPM](https://github.com/cpm-cmake/CPM.cmake), adding Corrade
as a dependency can be done with the following. If you're fetching the `master`
branch, it's recommended to disable `GIT_SHALLOW` to perform a full clone
including all tags. If not, the build prints a warning about being unable to
fetch a Git version for the `version.h` header, and will generate a fallback
file instead.

@code{.cmake}
CPMAddPackage(
NAME corrade
GIT_REPOSITORY https://github.com/mosra/corrade.git
GIT_TAG master
GIT_SHALLOW NO)
@endcode

If you want to pass additional flags to CMake or
@ref building-corrade-features "enable / disable additional features", pass
then via `OPTIONS`, for example:

@code{.cmake}
CPMAddPackage(
NAME corrade
...
OPTIONS
"CORRADE_BUILD_DEPRECATED OFF"
"CORRADE_WITH_INTERCONNECT OFF")
@endcode

@subsection building-corrade-packages-vcpkg Vcpkg package

Corrade is available as a [Vcpkg](https://github.com/Microsoft/vcpkg) package.
Expand Down

0 comments on commit 24502d1

Please sign in to comment.