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:
export CPM_SOURCE_CACHE=$HOME/.cache/CPM
# 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.
All dependencies integrated with CPM internally become part of the CMake configuration. Some dependencies
are not compatible with this approach (e.g. VTK and PETSc) and are therefore integrated as CMake external projects. Per
default they are automatically downloaded, configured and build inside the build directory during CMake
configuration. If CPM_SOURCE_CACHE is set the downloads and builds are cached in the
specified directory as well under $CPM_SOURCE_CACHE/_ext. To remove the cache simply delete
the cache folder and configure a new build.
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.147.9
in CI job 639840
|
Last revision: September 27, 2025
Commit: [cmake] Remove linker warnings when building mpmetis. 852270d
| Edit
this page on