-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.54 KB
/
Copy pathcmake-multi-platform.yml
File metadata and controls
61 lines (51 loc) · 1.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
name: CMake Multi-Platform
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Debug, Release]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '4.1.1'
# Linux Dependencies
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libopencv-dev libeigen3-dev libopenexr-dev
# Windows Dependencies
- name: Install Dependencies (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install opencv
choco install eigen
# Configure
- name: Configure with CMake
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
cmake -B build -S $GITHUB_WORKSPACE \
1-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DOpenCV_DIR=/usr/lib/x86_64-linux-gnu/cmake/opencv4
else
cmake -B build -S $GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
fi
# Build
- name: Build
run: cmake --build build --config ${{ matrix.build_type }} --parallel
# Install
- name: Install
run: cmake --install build --prefix instdir