Repository navigation
121 lines (108 loc) · 3.54 KB
/
Copy pathbuild-vtk.yml
File metadata and controls
121 lines (108 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Build VTK
on:
workflow_call:
inputs:
arch:
required: true
type: string
os:
required: true
type: string
build-type:
required: false
type: string
default: Release
vtk-hash:
required: true
type: string
build-options:
required: false
type: string
cache-prefix:
required: false
type: string
default: vtk
outputs:
cache-key:
value: ${{ jobs.vtk.outputs.cache-key }}
install-path:
value: ${{ jobs.vtk.outputs.install-path }}
jobs:
vtk:
runs-on: ${{ inputs.os }}
outputs:
cache-key: ${{ steps.set-outputs.outputs.cache-key }}
install-path: ${{ steps.set-outputs.outputs.install-path }}
env:
CACHE_KEY: ${{ inputs.cache-prefix }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.vtk-hash }}
steps:
- name: Cache VTK Build
id: cache-vtk
uses: actions/cache@v6
with:
path: vtk-install
lookup-only: true
key: ${{ env.CACHE_KEY }}
- name: Install Dependencies
if: contains(inputs.os, 'ubuntu') && steps.cache-vtk.outputs.cache-hit != 'true'
shell: bash
run: |
sudo apt update && sudo apt install -y cmake g++ libgl1-mesa-dev libxt-dev libxrender-dev libxext-dev libglu1-mesa-dev make
- name: Install CMake
uses: lukka/get-cmake@a1a8216777d3cbbf5602c73b9ddd3e98257ecdc4 # v4.5.1
with:
cmakeVersion: 4.3.4
# The job never checks out PlusLib itself (the superbuild clones it), so
# fetch just the local actions used below.
- name: Checkout CI actions
if: steps.cache-vtk.outputs.cache-hit != 'true'
uses: actions/checkout@v7
with:
sparse-checkout: .github/actions
path: pluslib-ci
- name: Install Qt
if: steps.cache-vtk.outputs.cache-hit != 'true'
uses: ./pluslib-ci/.github/actions/install-qt
with:
arch: ${{ inputs.arch }}
version: '5.15.0'
- name: Clone VTK
if: steps.cache-vtk.outputs.cache-hit != 'true'
shell: bash
run: |
mkdir vtk
cd vtk
git init
git remote add origin https://gitlab.kitware.com/vtk/vtk.git
git fetch --depth 1 origin ${{ inputs.vtk-hash }}
git checkout FETCH_HEAD
- name: Configure VTK
if: steps.cache-vtk.outputs.cache-hit != 'true'
shell: bash
run: |
cmake -S vtk -B vtk-build -G "Visual Studio 18 2026" -A ${{ inputs.arch }} \
-DCMAKE_INSTALL_PREFIX=vtk-install \
-DCMAKE_BUILD_TYPE=${{ inputs.build-type }} \
-DBUILD_SHARED_LIBS=ON \
-DVTK_BUILD_TESTING=OFF \
-DVTK_VERSIONED_INSTALL=OFF \
-DVTK_GROUP_ENABLE_Qt:STRING=YES \
-DQt5_DIR="${QT_DIR}" \
${{ inputs.build-options }}
- name: Build VTK
if: steps.cache-vtk.outputs.cache-hit != 'true'
shell: bash
run: |
cmake --build vtk-build --parallel 4 --config ${{ inputs.build-type }}
- name: Install VTK
if: steps.cache-vtk.outputs.cache-hit != 'true'
shell: bash
run: |
cmake --install vtk-build
- name: Set Outputs
id: set-outputs
shell: bash
run: |
echo "cache-key=$CACHE_KEY" >> $GITHUB_OUTPUT
INSTALL_PATH="$GITHUB_WORKSPACE/vtk-install/lib/cmake/vtk"
echo "install-path=$INSTALL_PATH" >> $GITHUB_OUTPUT