Skip to content

Commit 7c8e638

Browse files
committed
Mise à jour cmake
1 parent f97b631 commit 7c8e638

14 files changed

+184
-32
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
/.flatpak/
66
/.flatpak-builder/
77
/Testing/
8-
/com.bitscripts.matrix/
8+
/com.bitscripts.matrix/
9+
/appimage/
10+
/CPACK/

AppImageBuilder.yaml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
2+
version: 1
3+
script: |
4+
# remove any existent binaries
5+
rm -rf AppDir | true
6+
7+
# compile and install binaries into AppDir
8+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
9+
make install DESTDIR=AppDir
10+
11+
# link plugins
12+
mkdir -p $APPDIR/usr/lib/x86_64-linux-gnu/qt6/plugins
13+
mkdir -p $APPDIR/usr/bin
14+
cd AppDir/usr/bin
15+
ln -s ../../usr/lib/x86_64-linux-gnu/qt6/plugins .
16+
cd ../..
17+
18+
# link ressource and translations
19+
mkdir -p $APPDIR/usr/share/qt6/resources
20+
mkdir -p $APPDIR/usr/share/qt6/translations
21+
ln -s usr/share/qt6/resources .
22+
ln -s usr/share/qt6/translations .
23+
cd ..
24+
AppDir:
25+
path: ./AppDir
26+
app_info:
27+
id: Matrix
28+
name: Matrix
29+
icon: Matrix.png
30+
version: '1.0.0'
31+
exec: usr/bin/Matrix
32+
exec_args: $@
33+
apt:
34+
arch: amd64
35+
allow_unauthenticated: true
36+
sources:
37+
- sourceline: deb http://fr.archive.ubuntu.com/ubuntu/ lunar main restricted
38+
- sourceline: deb http://fr.archive.ubuntu.com/ubuntu/ lunar-updates main restricted
39+
- sourceline: deb http://fr.archive.ubuntu.com/ubuntu/ lunar universe
40+
- sourceline: deb http://fr.archive.ubuntu.com/ubuntu/ lunar-updates universe
41+
- sourceline: deb http://fr.archive.ubuntu.com/ubuntu/ lunar multiverse
42+
- sourceline: deb http://fr.archive.ubuntu.com/ubuntu/ lunar-updates multiverse
43+
- sourceline: deb http://fr.archive.ubuntu.com/ubuntu/ lunar-backports main restricted universe multiverse
44+
- sourceline: deb http://security.ubuntu.com/ubuntu lunar-security main restricted
45+
- sourceline: deb http://security.ubuntu.com/ubuntu lunar-security universe
46+
- sourceline: deb http://security.ubuntu.com/ubuntu lunar-security multiverse
47+
include:
48+
- libxkbcommon0
49+
- libxkbcommon-x11-0
50+
- libxcb-icccm4
51+
- libxcb-xkb1
52+
- libxcb-render-util0
53+
- libxcb-randr0
54+
- libxcb-keysyms1
55+
- libxcb-xinerama0
56+
- libxcb-image0
57+
- libxcb-util1
58+
- libxinerama1
59+
- kwayland-data
60+
- kwin-wayland-backend-wayland
61+
- libqt6widgets6
62+
- libqt6core6
63+
- libqcoro6core0
64+
- libqt6core5compat6
65+
- libqt6multimedia6
66+
- libqt6multimediaquick6
67+
- libqt6multimediawidgets6
68+
- libqt6waylandclient6
69+
- libqt6waylandcompositor6
70+
- libqt6waylandeglclienthwintegration6
71+
- libqt6waylandeglcompositorhwintegration6
72+
- gstreamer1.0-opencv
73+
- libgstreamer-opencv1.0-0
74+
- libopencv-apps2d
75+
- libopencv-calib3d406
76+
- libopencv-contrib406
77+
- libopencv-core406
78+
- libopencv-dnn406
79+
- libopencv-features2d406
80+
- libopencv-flann406
81+
- libopencv-highgui406
82+
- libopencv-imgcodecs406
83+
- libopencv-imgproc406
84+
- libopencv-ml406
85+
- libopencv-objdetect406
86+
- libopencv-photo406
87+
- libopencv-shape406
88+
- libopencv-stitching406
89+
- libopencv-superres406
90+
- libopencv-video406
91+
- libopencv-videoio406
92+
- libopencv-viz406
93+
- libopencv406-jni
94+
- opencv-data
95+
- ffmpeg
96+
- gstreamer1.0-libav
97+
files:
98+
exclude:
99+
- usr/share/man
100+
- usr/share/doc/*/README.*
101+
- usr/share/doc/*/changelog.*
102+
- usr/share/doc/*/NEWS.*
103+
- usr/share/doc/*/TODO.*
104+
AppImage:
105+
arch: x86_64
106+
update-information: guess
107+
sign-key: None

CMakeLists.txt

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ target_link_libraries(${PROJECT_NAME}
3636
Qt6::Widgets
3737
Qt6::Multimedia
3838
${OpenCV_LIBS}
39-
xcb
4039
)
4140

4241
find_path( AVCODEC_INCLUDE_DIR libavcodec/avcodec.h )
@@ -52,30 +51,50 @@ add_custom_command(
5251
COMMENT "Copying font directory"
5352
)
5453

55-
file(COPY ${CMAKE_SOURCE_DIR}/com.bitscripts.matrix.png
56-
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
54+
file(COPY ${CMAKE_SOURCE_DIR}/Matrix.png
55+
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/share/icons)
56+
57+
file(COPY ${CMAKE_SOURCE_DIR}/Matrix.png
58+
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin/matrixresources/icons)
5759

5860
file(COPY ${CMAKE_SOURCE_DIR}/MatrixLogo.png
59-
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
61+
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin/matrixresources/icons)
62+
63+
file(COPY ${CMAKE_SOURCE_DIR}/fonts/mtx.ttf
64+
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin/matrixresources/fonts)
6065

6166
INSTALL(TARGETS ${PROJECT_NAME}
6267
LIBRARY
6368
DESTINATION lib)
6469

65-
INSTALL(FILES ${CMAKE_SOURCE_DIR}/com.bitscripts.matrix.png
70+
INSTALL(FILES ${CMAKE_SOURCE_DIR}/Matrix.png
6671
DESTINATION share/icons)
6772

68-
INSTALL(FILES ${CMAKE_SOURCE_DIR}/com.bitscripts.matrix.png
69-
DESTINATION bin)
73+
INSTALL(FILES ${CMAKE_SOURCE_DIR}/Matrix.png
74+
DESTINATION bin/matrixresources/icons)
7075

7176
INSTALL(FILES ${CMAKE_SOURCE_DIR}/MatrixLogo.png
72-
DESTINATION bin)
77+
DESTINATION bin/matrixresources/icons)
7378

7479
INSTALL(FILES ${CMAKE_SOURCE_DIR}/fonts/mtx.ttf
75-
DESTINATION bin/fonts)
80+
DESTINATION bin/matrixresources/fonts)
81+
82+
set(APP_DESKTOP_FILE "matrix.desktop")
83+
configure_file(${CMAKE_SOURCE_DIR}/${APP_DESKTOP_FILE} ${CMAKE_BINARY_DIR}/${APP_DESKTOP_FILE} @ONLY)
84+
install(FILES ${CMAKE_BINARY_DIR}/${APP_DESKTOP_FILE} DESTINATION share/applications)
7685

77-
INSTALL(FILES ${CMAKE_SOURCE_DIR}/com.bitscripts.matrix.desktop
78-
DESTINATION share/applications)
7986

8087
INSTALL(TARGETS ${PROJECT_NAME}
8188
DESTINATION bin)
89+
90+
set(CPACK_GENERATOR "DEB")
91+
set(CPACK_PACKAGE_NAME "Matrix")
92+
set(CPACK_PACKAGE_VERSION "1.0.0")
93+
set(CPACK_PACKAGE_VENDOR "Bit-Scripts")
94+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Video processing with Matrix effect")
95+
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Matrix")
96+
set(CPACK_PACKAGE_CONTACT "Paul WOISARD <paulwoisard@gmail.com>")
97+
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt6widgets6, libqt6core6, libqt6multimedia6, gstreamer1.0-opencv, libopencv-apps2d, libopencv-core406, libopencv-imgcodecs406, libopencv-imgproc406, libopencv-objdetect406, libopencv-photo406, libopencv-shape406, libopencv-video406, libopencv-videoio406, opencv-data, ffmpeg, gstreamer1.0-libav, v4l2loopback-utils, v4l2loopback-dkms")
98+
99+
# Include CPack module
100+
include(CPack)

PKGBUILD

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
pkgname=matrix-app
2+
pkgver=1.0.13
3+
pkgrel=1
4+
pkgdesc="Video processing with Matrix effect"
5+
arch=('x86_64')
6+
url="https://github.com/Bit-Scripts/Matrix_CPP"
7+
license=('MIT')
8+
depends=('qt6-base' 'opencv' 'ffmpeg' 'v4l2loopback-dkms' 'v4l2loopback-utils')
9+
makedepends=('cmake')
10+
source=("v${pkgver}.tar.gz::https://github.com/Bit-Scripts/Matrix_CPP/archive/refs/tags/v${pkgver}.tar.gz")
11+
sha256sums=('3749c4694908ceca997a460943ae3551f59cc9e87fb8b63ceed6ea08019b01e5')
12+
13+
build() {
14+
cd "${srcdir}/v${pkgver}"
15+
mkdir -p build
16+
cd build
17+
cmake ..
18+
make
19+
}
20+
21+
package() {
22+
cd "${srcdir}/v${pkgver}/build"
23+
make DESTDIR="${pkgdir}/" install
24+
}

cameracapture.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ void CameraCapture::processFrame()
6464
frame.step,
6565
QImage::Format_RGB888);
6666

67-
QString appDir = QCoreApplication::applicationDirPath();
68-
QImage logo = QImage(appDir + "/MatrixLogo.png");
67+
QImage logo = QImage("/usr/bin/matrixresources/icons/MatrixLogo.png");
6968

7069
QImage resizedLogo = logo.scaled(image.width(), image.height(), Qt::KeepAspectRatio);
7170

com.bitscripts.matrix.flatpak

-9.95 MB
Binary file not shown.

com.bitscripts.matrix.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"sources": [
3434
{
3535
"type": "archive",
36-
"url": "https://github.com/Bit-Scripts/Matrix_CPP/archive/refs/tags/v1.0.11.tar.gz",
37-
"sha256": "864e06b32d9476466ad2a9bf0fd794d7eb62c82b2a0817f2512c13272f5fecdf"
36+
"url": "https://github.com/Bit-Scripts/Matrix_CPP/archive/refs/tags/v1.0.12.tar.gz",
37+
"sha256": "76e52258ee4f9053af15c3d015c9adfa5d275653fa8537fe26e07d47ab07627f"
3838
}
3939
]
4040
}

com.bitscripts.matrix.png

-3.35 KB
Binary file not shown.

main.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ int main(int argc, char *argv[]) {
1111
translator.load("qt_fr", QLibraryInfo::path(QLibraryInfo::TranslationsPath));
1212
QApplication::installTranslator(&translator);
1313

14-
QString appDir = QCoreApplication::applicationDirPath();
15-
QIcon icon(appDir + "/com.bitscripts.matrix.png");
14+
QIcon icon("/usr/bin/matrixresources/icons/Matrix.png");
1615

1716
MainWindow mainWindow;
1817
mainWindow.resize(1280,720);
1918
mainWindow.setWindowTitle("Matrix");
2019
mainWindow.setWindowIcon(icon);
2120
mainWindow.show();
2221

23-
2422
return app.exec();
2523
}

mainwindow.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</property>
1616
<property name="windowIcon">
1717
<iconset>
18-
<normaloff>com.bitscripts.matrix.png</normaloff>com.bitscripts.matrix.png</iconset>
18+
<normaloff>Matrix.png</normaloff>Matrix.png</iconset>
1919
</property>
2020
<widget class="QWidget" name="centralwidget"/>
2121
</widget>

0 commit comments

Comments
 (0)