Yes you can build the plugins at the same time you build hdf5. I do it with tgz files - I plan to move it to use FetchContent like the compression filters, soon.
This is how I do it, you may need to do something different. Note that I use the cacheinit.cmake file for all the other settings.