Skip to content

Commit

Permalink
CI: Use qt6 in ubuntu.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Aug 11, 2023
1 parent ca77a71 commit 5adf459
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
BUILD_TYPE: [Release, Debug]

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

env:
BUILD_TYPE: ${{matrix.BUILD_TYPE}}
Expand Down Expand Up @@ -55,14 +55,16 @@ jobs:
cmake build-essential \
debhelper fakeroot graphviz \
libglu1-mesa-dev libpulse-mainloop-glib0 \
qttools5-dev qttools5-dev-tools qtbase5-dev qtbase5-dev-tools \
qtmultimedia5-dev qtlocation5-dev libqt5svg5-dev \
qtwebengine5-dev libqtermwidget5-0-dev libqt5serialport5-dev\
qt6-tools-dev qt6-tools-dev-tools \
qt6-base-dev qt6-base-dev-tools qt6-qpa-plugins \
libqt6svg6-dev qt6-l10n-tools qt6-translations-l10n \
qt6-scxml-dev qt6-multimedia-dev libqt6serialport6-dev \
qt6-webengine-dev qt6-webengine-dev-tools \
libutf8proc-dev libpam0g-dev \
libxkbcommon-dev libxkbcommon-x11-dev xorg-dev libx11-xcb-dev \
libx11-dev libxfixes-dev \
libdlib-dev libopencv-dev libopencv-contrib-dev \
libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libavresample-dev libavutil-dev \
libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libswresample-dev libavutil-dev \
libsqlite3-dev
- name: Cache installed
Expand Down Expand Up @@ -117,7 +119,8 @@ jobs:
SeetaQualityAssessor_DIR: ${{env.INSTALL_DIR}}/lib/cmake
facedetection_DIR: ${{env.INSTALL_DIR}}/lib/cmake/facedetection
run: |
./build_debpackage.sh /usr/lib/`uname -m`-linux-gnu/qt5
export Qt6_DIR=/usr/lib/`uname -a`-linux-gnu/cmake/Qt6
./build_debpackage.sh
cp ../facerecognizer_${{env.FaceRecognizer_VERSION}}_amd64.deb facerecognizer_${{env.FaceRecognizer_VERSION}}_amd64.deb
- name: Update xml file
Expand Down
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 2.8)

project(FaceRecognizer)

SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

if(POLICY CMP0083)
Expand All @@ -21,6 +25,11 @@ endif()

OPTION(ENABLE_DOWNLOAD_MODULE "Enable automation download module files" OFF)

#打开 qt 编译工具
SET(CMAKE_AUTOUIC ON)
SET(CMAKE_AUTOMOC ON)
SET(CMAKE_AUTORCC ON)

#需要的QT组件
if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
Expand All @@ -47,15 +56,6 @@ if(Qt${QT_VERSION_MAJOR}_FOUND)
endif()
get_filename_component(QT_INSTALL_DIR "${Qt${QT_VERSION_MAJOR}_DIR}/../../.." ABSOLUTE)

#打开 qt 编译工具
SET(CMAKE_AUTOUIC ON)
SET(CMAKE_AUTOMOC ON)
SET(CMAKE_AUTORCC ON)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

IF(MSVC)
# This option is to enable the /MP switch for Visual Studio 2005 and above compilers
OPTION(WIN32_USE_MP "Set to ON to build with the /MP option (Visual Studio 2005 and above)." ON)
Expand Down
14 changes: 4 additions & 10 deletions build_debpackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ if [ -n "$1" -a -z "$QT_ROOT" ]; then
QT_ROOT=$1
fi

if [ -z "$QT_ROOT" ]; then
help "QT_ROOT don't exist: $QT_ROOT"
fi

if [ -n "$2" ]; then
export ThirdLibs_DIR=$2
fi
Expand Down Expand Up @@ -44,9 +40,7 @@ if [ -z "$ENABLE_DOWNLOAD_MODULE" ]; then
fi

export RabbitCommon_DIR=$RabbitCommon_DIR
export QT_ROOT=$QT_ROOT
export PATH=$QT_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$QT_ROOT/lib/i386-linux-gnu:$QT_ROOT/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$QT_ROOT/lib/pkgconfig:$PKG_CONFIG_PATH
fakeroot debian/rules binary
#dpkg-buildpackage -us -uc -b
#fakeroot debian/rules binary
#dpkg-buildpackage -us -uc -b #The -us -uc tell it there is no need to GPG sign the package. the -b is build binary
dpkg-buildpackage -us -uc #The -us -uc tell it there is no need to GPG sign the package

6 changes: 5 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ endif
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
override_dh_auto_configure:
dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/FaceRecognizer -DQt5_DIR=${QT_ROOT}/lib/cmake/Qt5 -DRabbitCommon_DIR=${RabbitCommon_DIR} -DENABLE_DOWNLOAD_MODUEL=${ENABLE_DOWNLOAD_MODULE} ${PARAS}
dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/FaceRecognizer \
-DRabbitCommon_DIR=${RabbitCommon_DIR} \
-DENABLE_DOWNLOAD_MODUEL=${ENABLE_DOWNLOAD_MODULE} \
${PARAS}

override_dh_auto_build:
dh_auto_build -- $(if "`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`" = "0",, -j`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`)
Expand Down

0 comments on commit 5adf459

Please sign in to comment.