paraview-5.8 : Unknown CMake command "ADD_PARAVIEW_PLUGIN".

Many things changed for building plugins between paraview-5.6 and paraview-5.7, with some further (minor) refinements for paraview-5.8.

This might be one place to start:
https://discourse.paraview.org/t/building-plugins-modules-with-paraview-5-7-0-cmake/

You need to change a few things when scanning for files etc. It might be hard to follow, but here is my real-world example for building a paraview plugin both with paraview <= 5.6 and paraview >= 5.7. Examining the differences might give you clues for your own plugin.

Example: https://develop.openfoam.com/modules/visualization/-/tree/develop/src/paraview-plugins/blockMeshReader