Let’s say a group builds their in-house code with cmake and they link all their external dependencies via cmake modules, a natural question would be: is there also such a thing for preCICE?
Being a CMake project, preCICE generates a
preciceCongfig.cmake file instead of providing a
This file is available
- after configuration in the directory
- after installation in the
- after installing the Debian package in
To use preCICE from another CMake project, you simply have to:
find the package
find_package(precice REQUIRED CONFIG)
link to the library to your target
target_link_libraries(yourTarget PRIVATE precice::precice)
for locations not searched by CMake: tell CMake where to find the config when configuring the dependant
cmake -DpreciceDIR=dir/of/precice/config ..
This allows you to easily handle multiple installations in parallel such as:
- Debian package (works without passing the
- Custom release build
- Custom debug build
This is especially useful when benchmarking cases or debugging adapters.