Cross compile VTK with vcpkg for windows on linux (Ubuntu 20.04)

I am trying to cross compile VTK through vcpkg on Ubuntu 20.04 for windows. I am using mingw through ubuntu repository as well as MXE. The compilation is failing due to hdf5 not able to successfully compile.

I am issuing the following command on vcpkg

vcpkg install vtk:x64-mingw-dynamic

How did you cross compile vtk considering hdf5?

Note that cross-compiling VTK requires compiling the host tools separately (see the VTK_BUILD_COMPILE_TOOLS_ONLY option). Other than that, it may involve hard-coding some try_compile results (HDF5 is one perennial culprit of try_run as well). You might be able to get away by setting CMAKE_CROSSCOMPILING_EMULATOR to wine so that compiled things can be run “natively”.