waLBerla 7.2
|
The recommended way to embed waLBerla into your own CMake project is to integrate its build system with your own CMake tree, such that waLBerla is built from source alongside your project. There are two ways to achieve this in a stable and reproducible manner: Git submodules and FetchContent
To include waLBerla as a submodule, run the following commands inside your project folder:
After waLBerla has been downloaded, git commit
the submodule. You may then add waLBerla to your CMake project by adding the following to your root CMakeLists.txt
:
CMake allows us to download and include external projects into a build tree at configuration time using FetchContent
. This can be more convenient and easier to reproduce than Git submodules, or other ways of semi-manual installation.
To include waLBerla into your CMake project using FetchContent
, add the following lines to your CMakeLists.txt
:
Using the GIT_TAG
option you can specify the exact Git revision to include: We recommend fixing this to a specific commit hash or tag to avoid surprising changes. In this case, you will have to remember to regularily update this dependency.