QT移植到ARM开发板

一、切换到qt-everywhere-src-5.12.9/qtbase/mkspecs目录

  1、cp -r linux-arm-gnueabi-g++/   linux-arm-gnueabihf-g++/   /*拷贝linux-arm-gnueabi-g++*/

  2、修改 linux-arm-gnueabihf-g++/qmake.conf文件

  //添加

  QT_QPA_DEFAULT_PLATFORM = linuxfb

  QMAKE_CFLAGS += -O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon -mfloat-abi=hard
  QMAKE_CXXFLAGS += -O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon -mfloat-abi=hard

  //修改为自己的编译器

  # modifications to g++.conf
  QMAKE_CC = arm-linux-gnueabihf-gcc
  QMAKE_CXX = arm-linux-gnueabihf-g++
  QMAKE_LINK = arm-linux-gnueabihf-g++
  QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++

  # modifications to linux.conf
  QMAKE_AR = arm-linux-gnueabihf-ar cqs
  QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
  QMAKE_NM = arm-linux-gnueabihf-nm -P
  QMAKE_STRIP = arm-linux-gnueabihf-strip

二、切换到qt-everywhere-src-5.12.9/目录新建autoconfig.sh文件,内容如下(要添加tslib可在最后添加):

#!/bin/bash
./configure -prefix /usr/local/lib/qt \
-opensource \
-confirm-license \
-release \
-strip \
-shared \
-xplatform linux-arm-gnueabihf-g++ \
-optimized-qmake \
-c++std c++11 \
--rpath=no \
-pch \
-skip qt3d \
-skip qtactiveqt \
-skip qtandroidextras \
-skip qtcanvas3d \
-skip qtconnectivity \
-skip qtdatavis3d \
-skip qtdoc \
-skip qtgamepad \
-skip qtlocation \
-skip qtmacextras \
-skip qtnetworkauth \
-skip qtpurchasing \
-skip qtremoteobjects \
-skip qtscript \
-skip qtscxml \
-skip qtsensors \
-skip qtspeech \
-skip qtsvg \
-skip qttools \
-skip qttranslations \
-skip qtwayland \
-skip qtwebengine \
-skip qtwebview \
-skip qtwinextras \
-skip qtx11extras \
-skip qtxmlpatterns \
-nomake examples \
-nomake tools -nomake tests \
-gui \
-widgets \
-dbus-runtime \
--glib=no \
--iconv=no \
--pcre=qt \
--zlib=qt \
-no-openssl \
--freetype=qt \
--harfbuzz=qt \
-no-opengl \
-linuxfb \
--xcb=no \
--libpng=qt \
--libjpeg=qt \
--sqlite=qt \
-plugin-sql-sqlite \
-recheck-all

三、更改属性 chmod u+x autoconfig.sh  执行./autoconfig.sh

四、make -j4

五、sudo make install

posted @ 2023-03-28 19:31  *^VV^*  阅读(169)  评论(0编辑  收藏  举报