Skip to content

Commit

Permalink
Patch VTK CMP0177 policy in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Meakk committed Nov 14, 2024
1 parent 1e30ee7 commit 7879ee7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/actions/vtk-install-dep/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runs:
uses: actions/cache@v4
with:
path: dependencies/vtk_install
key: vtk-${{env.VTK_SHA_OR_TAG}}-${{runner.os}}-${{inputs.raytracing_label}}-${{inputs.cpu}}-3
key: vtk-${{env.VTK_SHA_OR_TAG}}-${{runner.os}}-${{inputs.raytracing_label}}-${{inputs.cpu}}-4

- name: Setup VTK
if: steps.cache-vtk.outputs.cache-hit != 'true'
Expand All @@ -64,6 +64,12 @@ runs:
path: './dependencies/vtk'
ref: ${{env.VTK_SHA_OR_TAG}}

- name: Patch VTK
if: steps.cache-vtk.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}/dependencies/vtk
shell: bash
run: patch -p1 < $GITHUB_ACTION_PATH/policy_CMP0177.patch

# OpenVDB_CMAKE_PATH is required because of
# https://github.com/AcademySoftwareFoundation/openvdb/issues/1160 and
# https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10393
Expand Down
13 changes: 13 additions & 0 deletions .github/actions/vtk-install-dep/policy_CMP0177.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMake/vtkModule.cmake b/CMake/vtkModule.cmake
index b7ab326e3d..1049c4fde4 100644
--- a/CMake/vtkModule.cmake
+++ b/CMake/vtkModule.cmake
@@ -1,3 +1,8 @@
+# CMake 3.31 trigger a warning without this policy set
+if(POLICY CMP0174)
+ cmake_policy(SET CMP0174 OLD)
+endif()
+
get_filename_component(_vtkModule_dir "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)

#[==[.rst:

0 comments on commit 7879ee7

Please sign in to comment.