Paraview on windows: Use htf5::hdf5 (#44161)

* Use hdf5::hdf5 on Windows from Paraview CMake
   This patch is already applied on VTK 9 or greater.
* Add comments stating that vtk and paraview patches are the same and should be modified in concert.
This commit is contained in:
Dan Lipsa 2024-05-21 11:05:32 -04:00 committed by GitHub
parent 08834e2b03
commit 4bf5cc9a9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 0 deletions

View File

@ -307,6 +307,9 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage):
# https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9690 # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9690
patch("vtk-xdmf2-hdf51.13.1.patch", when="@5.8:5.10") patch("vtk-xdmf2-hdf51.13.1.patch", when="@5.8:5.10")
patch("vtk-xdmf2-hdf51.13.2.patch", when="@5.8:5.11.0") patch("vtk-xdmf2-hdf51.13.2.patch", when="@5.8:5.11.0")
# a patch with the same name is also applied to vtk
# the two patches are the same but for the path to the files they patch
patch("vtk_alias_hdf5.patch", when="@5.9.0: platform=windows")
# Fix VTK to work with external freetype using CONFIG mode for find_package # Fix VTK to work with external freetype using CONFIG mode for find_package
patch("FindFreetype.cmake.patch", when="@5.10.1:") patch("FindFreetype.cmake.patch", when="@5.10.1:")

View File

@ -0,0 +1,14 @@
diff --git a/CMake/patches/99/FindHDF5.cmake b/CMake/patches/99/FindHDF5.cmake
index b54877d519..adf5d84430 100644
--- a/VTK/CMake/patches/99/FindHDF5.cmake
+++ b/VTK/CMake/patches/99/FindHDF5.cmake
@@ -1150,6 +1150,9 @@ if (HDF5_FOUND)
endif ()
endif ()
endforeach ()
+ if(NOT TARGET "hdf5")
+ add_library(hdf5 ALIAS hdf5::hdf5)
+ endif()
unset(hdf5_lang)
if (HDF5_DIFF_EXECUTABLE AND NOT TARGET hdf5::h5diff)

View File

@ -124,6 +124,8 @@ class Vtk(CMakePackage):
patch("vtk_movie_link_ogg.patch", when="@8.2") patch("vtk_movie_link_ogg.patch", when="@8.2")
patch("vtk_use_sqlite_name_vtk_expects.patch", when="@8.2") patch("vtk_use_sqlite_name_vtk_expects.patch", when="@8.2")
patch("vtk_proj_include_no_strict.patch", when="@9: platform=windows") patch("vtk_proj_include_no_strict.patch", when="@9: platform=windows")
# a patch with the same name is also applied to paraview
# the two patches are the same but for the path to the files they patch
patch("vtk_alias_hdf5.patch", when="@9: platform=windows") patch("vtk_alias_hdf5.patch", when="@9: platform=windows")
patch("vtk_findproj_config.patch", when="platform=windows") patch("vtk_findproj_config.patch", when="platform=windows")
with when("~osmesa"): with when("~osmesa"):