How can I use preCICE with a non-default MPI implementation?

When I build preCICE, it uses the default MPI implementation. How could I use e.g. MPICH?

preCICE uses the CMake module FindMPI.

Thus, you can simply set the CMake variable
MPI_CXX_COMPILER to the compiler wrapper.
This requires you to reconfigure a new preCICE build as it changes cached variables.

There is now also an example in the preCICE wiki.