CMake dependency management

We employ CPM, a CMake dependency management solution, to integrate third-party dependencies.

Dependencies are downloaded at configure-time into the build directory. Dependencies get build in the build directory inside the _deps-subdirectory.

To speed things up you can specify a cache directory for the downloads by setting CPM_SOURCE_CACHE either as an environment or CMake variable:

# Can be placed in .bashrc or .bash_profile:
# OR
cmake ... -DCPM_SOURCE_CACHE=$HOME/.cache/CPM

Some dependencies (those which are added with CPMFindPackage()) are first searched to be locally installed on the system with a fallback to CPM if not found. You can disable the search for local packages with CPM_DOWNLOAD_ALL.

Further information

This article was written by Lars Bilke. If you are missing something or you find an error please let us know. Generated with Hugo 0.79.0. Last revision: February 11, 2021
Commit: [web] Added docs on CPM. 88c6a8a2e  | Edit this page on