HDF5 is the library that most commonly breaks ITK build. It is always a huge pain. I’m not surprised that it broke your build, too.
If this solves all your problems and this workaround is acceptable for you then it is good. I’m not sure if this is the cleanest solution, but if you submit a pull request then I’m sure that at some point @jcfr can have a look at it and merge it if there are no better ideas.