unable to link mpi to paraview

I have -DPARAVIEW_USE_MPI=ON in my cmake invocation but when I build with Ninja I get:
Is there a switch to specify location to search for libraries?

[19300/19499] Linking CXX executable bin/pvtkpython FAILED: bin/pvtkpython
: && /usr/bin/c++ -O3 -DNDEBUG -Wl,-lc -Wl,-lc -Wl,–no-as-needed -Wl,–unresolved-symbols=ignore-in-shared-libs VTK/Wrapping/Python/CMakeFiles/pvtkpython.dir/vtkPythonAppInit.cxx.o -o bin/pvtkpython -Wl,-rpath,"$ORIGIN/…/lib64:/usr/local/tools/Anaconda3-2021-05/lib" lib64/libvtkWrappingPythonCore3.8-pv5.9.so.5.9 lib64/libvtkPythonInterpreter-pv5.9.so.5.9 lib64/libvtkParallelMPI-pv5.9.so.5.9 /usr/local/tools/Anaconda3-2021-05/lib/libpython3.8.so lib64/libvtkParallelCore-pv5.9.so.5.9 lib64/libvtkCommonCore-pv5.9.so.5.9 lib64/libvtksys-pv5.9.so.5.9 -ldl -Wl,-rpath-link,/home/ma/ParaView-v5.9.1/build_gcc8.4.1/lib64 && :
VTK/Wrapping/Python/CMakeFiles/pvtkpython.dir/vtkPythonAppInit.cxx.o: In function main': vtkPythonAppInit.cxx:(.text.startup+0x21): undefined reference to MPI_Init’
collect2: error: ld returned 1 exit status
[19317/19499] Building CXX object Plugins/StreamLinesRepresentation/Representations/CMakeFiles/vtkStreamLines.dir/vtkStreamLinesMapper.cxx.o
ninja: build stopped: subcommand failed.

Solved problem by explicity telling cmake where to locate the mpi library
-DMPI_C_LIBRARIES=${MPI_INSTALL_PREFIX}/lib/libmpi.so

Still not sure it could not resolve the libraries as I already had specified, paths were correct.
-DPARAVIEW_USE_MPI=ON