-
Notifications
You must be signed in to change notification settings - Fork 0
187 lines (166 loc) · 5.98 KB
/
Copy pathCI.yml
File metadata and controls
187 lines (166 loc) · 5.98 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Build Qt CMake Project
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-macos:
name: Build on macOS
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install Homebrew dependencies
run: |
brew install cmake pkg-config nasm yasm x264 x265 opencv
echo "OPENCV_ROOT_PATH=$(brew --prefix opencv)" >> $GITHUB_ENV
export OPENCV_ROOT_PATH=$(brew --prefix opencv)
- name: Download 3rd_party
run: |
curl -L -o 3rd_party.tar.gz https://github.com/Areay7/LearnCode/releases/download/v1.1.1/3rd_party.tar.gz
tar -xzf 3rd_party.tar.gz
- name: Build FFmpeg 4.4.5
run: |
if [ ! -d "ffmpeg" ]; then
wget https://ffmpeg.org/releases/ffmpeg-4.4.5.tar.bz2
tar xjvf ffmpeg-4.4.5.tar.bz2
(
cd ffmpeg-4.4.5 && \
./configure --pkg-config-flags=--static --enable-shared --disable-static --extra-libs=-lpthread --extra-libs=-lm \
--enable-gpl --enable-nonfree --enable-libx264 --enable-libx265 --enable-postproc \
--prefix=$(pwd)/../ffmpeg
)
(
cd ffmpeg-4.4.5 && \
make -j$(sysctl -n hw.ncpu) && \
make install
)
fi
echo "FFMPEG_ROOT_PATH=$(pwd)/ffmpeg" >> $GITHUB_ENV
- name: Install Qt 6.5.3 with modules
uses: jurplel/install-qt-action@v3
with:
version: '6.5.3'
target: 'desktop'
arch: 'clang_64'
modules: 'qt5compat qtmultimedia'
- name: Configure project
run: |
mkdir build && cd build
cmake ../ToolKit \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_PREFIX_PATH="$Qt6_DIR" \
-DFFMPEG_ROOT="$FFMPEG_ROOT_PATH" \
-DOPENCV_ROOT="$OPENCV_ROOT_PATH"
- name: Build
run: |
cd build
make -j$(sysctl -n hw.ncpu)
build-linux:
name: Build on Ubuntu
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y build-essential cmake pkg-config git curl tar \
libx11-dev libgl1-mesa-dev libpulse-dev \
yasm nasm libx264-dev libx265-dev libnuma-dev \
libgtk-3-dev libjpeg-dev libpng-dev libtiff-dev \
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
libeigen3-dev libtbb-dev
- name: Download and Build FFmpeg 4.4.5
run: |
wget https://ffmpeg.org/releases/ffmpeg-4.4.5.tar.bz2
tar xjvf ffmpeg-4.4.5.tar.bz2
mkdir ffmpeg && cd ffmpeg-4.4.5
./configure \
--enable-shared \
--disable-static \
--enable-gpl \
--enable-nonfree \
--enable-libx264 \
--enable-libx265 \
--enable-postproc \
--prefix=$(pwd)/../ffmpeg
make -j$(nproc)
make install
cd ..
echo "FFMPEG_ROOT_PATH=$(pwd)/ffmpeg" >> $GITHUB_ENV
- name: Download and Build OpenCV 4.4.0
run: |
git clone --branch 4.4.0 https://github.com/opencv/opencv.git
git clone --branch 4.4.0 https://github.com/opencv/opencv_contrib.git
mkdir -p opencv/build && cd opencv/build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$(pwd)/../../opencv-install \
-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-DBUILD_opencv_world=ON \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DWITH_GTK=OFF
make -j$(nproc)
make install
cd ../..
echo "OPENCV_ROOT_PATH=$(pwd)/opencv-install" >> $GITHUB_ENV
- name: Install Qt 6.5.3 with modules
uses: jurplel/install-qt-action@v3
with:
version: '6.5.3'
target: 'desktop'
arch: 'gcc_64'
modules: 'qt5compat qtmultimedia'
- name: Clone and Build QtMqtt 6.5.3
run: |
git clone --branch v6.5.3 https://github.com/qt/qtmqtt.git
mkdir -p qtmqtt/build && cd qtmqtt/build
cmake .. \
-DCMAKE_PREFIX_PATH="$Qt6_DIR" \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/qtmqtt-install \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON
make -j$(nproc)
make install
ln -sf libQt6Mqtt.so ${{ github.workspace }}/qtmqtt-install/lib/libQtMqtt.so
cd ../..
echo "MQTT_ROOT=${{ github.workspace }}/qtmqtt-install" >> $GITHUB_ENV
ls -l ${{ github.workspace }}/qtmqtt-install/lib
- name: Configure ToolKit
run: |
mkdir build && cd build
cmake ../ToolKit \
-DCMAKE_PREFIX_PATH="$Qt6_DIR" \
-DFFMPEG_ROOT="$FFMPEG_ROOT_PATH" \
-DOPENCV_ROOT="$OPENCV_ROOT_PATH" \
-DMQTT_ROOT="$MQTT_ROOT"
- name: Build ToolKit
run: |
cd build
make -j$(nproc)
build-windows:
name: Build on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Download 3rd_party
run: |
curl -L -o 3rd_party.tar.gz https://github.com/Areay7/LearnCode/releases/download/v1.1.1/3rd_party.tar.gz
tar -xzf 3rd_party.tar.gz
- name: Install Qt 6.5.3 with modules
uses: jurplel/install-qt-action@v3
with:
version: '6.5.3'
target: 'desktop'
arch: 'win64_msvc2019_64'
modules: 'qt5compat qtmultimedia'
- name: Enable MSVC Developer Environment
uses: ilammy/msvc-dev-cmd@v1
- name: Configure and Build
run: |
mkdir build
cd build
cmake ../ToolKit -DCMAKE_PREFIX_PATH="%Qt6_DIR%" -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release