3838RabbitCommon=0
3939QXMPP=0
4040QZXING=0
41+ ZXING_CPP=0
4142
4243# Display detailed usage information
4344usage_long () {
@@ -107,7 +108,7 @@ parse_with_getopt() {
107108 # 后面没有冒号表示没有参数。后跟有一个冒号表示有参数。跟两个冒号表示有可选参数。
108109 # -l 或 --long 选项后面是可接受的长选项,用逗号分开,冒号的意义同短选项。
109110 # -n 选项后接选项解析错误时提示的脚本名字
110- OPTS=help,install:,source:,tools:,build:,verbose::,package:,package-tool:,system_update::,system-update::,base::,default::,default-qt5::,default-qt6::,macos::,qt::,rabbitcommon::,qxmpp::,qzxing::
111+ OPTS=help,install:,source:,tools:,build:,verbose::,package:,package-tool:,system_update::,system-update::,base::,default::,default-qt5::,default-qt6::,macos::,qt::,rabbitcommon::,qxmpp::,qzxing::,zxing-cpp::
111112
112113 # Parse arguments using getopt
113114 # -o: short options
@@ -280,6 +281,17 @@ parse_with_getopt() {
280281 esac
281282 shift 2
282283 ;;
284+ --zxing-cpp)
285+ case " $2 " in
286+ " " )
287+ ZXING_CPP=1
288+ ;;
289+ * )
290+ ZXING_CPP=" $2 "
291+ ;;
292+ esac
293+ shift 2
294+ ;;
283295 --) # End of options
284296 shift
285297 break
@@ -337,6 +349,7 @@ show_configuration() {
337349 echo " RabbitCommon: $RabbitCommon "
338350 echo " QXMPP: $QXMPP "
339351 echo " QZXing: $QZXing "
352+ echo " ZXing: $ZXING_CPP "
340353 echo " "
341354 echo " Other Settings:"
342355 echo " Verbose Mode: $BUILD_VERBOSE "
@@ -511,16 +524,20 @@ if [ $DEFAULT_LIBS -eq 1 ]; then
511524 qt6-svg-dev qt6-l10n-tools qt6-translations-l10n \
512525 qt6-scxml-dev qt6-multimedia-dev qt6-positioning-dev \
513526 libqt6sql6-mysql libqt6sql6-sqlite libqt6sql6-odbc libqt6sql6-psql \
514- qt6-speech-dev
527+ qt6-speech-dev libqt6qml6
515528 fi
516529 else
517530 if [ $QT -ne 1 ]; then
518531 package_install qt5-qmake qtbase5-dev qtbase5-dev-tools qttools5-dev \
519532 qtmultimedia5-dev libqt5scxml5-dev libqt5svg5-dev libqt5gstreamer-dev \
520- qtquickcontrols2-5-dev libqt5multimedia5-plugins
533+ qtquickcontrols2-5-dev libqt5multimedia5-plugins libqt5qml5
521534 fi
522535 package_install libqxmpp-dev
523536 fi
537+ if [ $ZXING_CPP -ne 1 ]; then
538+ package_install libzxing-dev
539+ fi
540+
524541 fi # apt
525542
526543 if [ " $PACKAGE_TOOL " = " dnf" ]; then
@@ -538,7 +555,7 @@ if [ $DEFAULT_LIBS -eq 1 ]; then
538555 fi
539556
540557 if [ $MACOS -eq 1 ]; then
541- package_install qt
558+ package_install qt zxing-cpp
542559 fi
543560fi
544561
@@ -636,5 +653,27 @@ if [ $QZXING -eq 1 ]; then
636653 popd
637654fi
638655
656+ if [ $ZXING_CPP -eq 1 ]; then
657+ echo_status " Install zxing-cpp ......"
658+ pushd " $SOURCE_DIR "
659+ if [ ! -d ${INSTALL_DIR} /${LIB_PATH} /cmake/ZXing ]; then
660+ if [ ! -d qzxing ]; then
661+ git clone -b v3.0.2 https://github.com/zxing-cpp/zxing-cpp.git
662+ cd zxing-cpp
663+ git submodule update --init --recursive
664+ fi
665+ cmake -E make_directory $BUILD_DEPEND_DIR /zxing-cpp
666+ pushd $BUILD_DEPEND_DIR /zxing-cpp
667+ cmake -S $SOURCE_DIR /zxing-cpp -DCMAKE_BUILD_TYPE=Release \
668+ -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
669+ -DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE} \
670+ -DZXING_EXAMPLES=OFF
671+ cmake --build . --config Release --parallel $( nproc)
672+ cmake --install . --config Release
673+ popd
674+ fi
675+ popd
676+ fi
677+
639678popd
640679popd
0 commit comments