美文网首页
VS 2019下编译QT5.15源码

VS 2019下编译QT5.15源码

作者: ogood | 来源:发表于2020-06-11 02:13 被阅读0次

    第一步:准备
    1.下载qt源码
    http://mirrors.ustc.edu.cn/qtproject/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.zip
    也可以单独下载模块单独编译
    single为整体打包,submodule为单独源码编译。
    http://download.qt.io/official_releases/qt
    并解压到C:\qt-everywhere-src-5.15.0
    新建目标文件夹c:\qt-build-5.15
    2.下载Perl解释器
    https://www.activestate.com/activeperl
    安装时候记得勾选添加到PATH
    3.下载Python
    安装时勾选添加到PATH

    第二步:生成makefile文件
    打开Native tools command prompt for vs 2019
    cd到C:\qt-everywhere-src-5.15.0文件夹下
    执行

    configure -developer-build -confirm-license -opensource -platform win32-msvc -debug-and-release -force-debug-info -opengl dynamic -prefix "C:\\qt-build-5.15" -qt-sqlite -qt-pcre -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -qt-freetype -skip qtwebengine -nomake tests -no-compile-examples -nomake examples -mp
    

    develop build

    configure -developer-build -confirm-license -opensource -platform win32-msvc  -opengl desktop -prefix "C:\\Users\\*\\Documents\\code\\qt-5.15-b1" -nomake tests -nomake examples -mp
    

    参数解释:https://doc.qt.io/qt-5/configure-options.html
    中文解释:https://www.cnblogs.com/chenfulin5/p/5798764.html

    如果是编译submodule模块,下面没有configure文件,需要执行qmake,生成makefile,然后nnmake执行编译,make install转移到prefix目录。

    第三步:开始编译
    等待configure执行完毕,直接输入 nmake&& nmake install

    第四步:创建vs项目
    安装qt addin之后,设置qt版本为c:\qt-build-5.15目录, 同时设置项目属性,在c/c++代码生成目录下,设置运行库为MT(静态库)或MD(动态库)。

    参考:https://doc.qt.io/qt-5/windows-building.html
    附全部参数
    -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake tests -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qttools -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -skip qtxmlpatterns -no-feature-texthtmlparser -no-feature-textodfwriter -no-feature-concurrent -no-feature-effects -no-feature-sharedmemory -no-feature-systemsemaphore -no-feature-im -no-feature-process -no-feature-dom -no-feature-filesystemmodel -no-feature-filesystemwatcher -no-feature-graphicsview -no-feature-graphicseffect -no-feature-sizegrip -no-feature-calendarwidget -no-feature-printpreviewwidget -no-feature-keysequenceedit -no-feature-colordialog -no-feature-filedialog -no-feature-fontdialog -no-feature-printpreviewdialog -no-feature-progressdialog -no-feature-inputdialog -no-feature-errormessage -no-feature-wizard -no-feature-datawidgetmapper -no-feature-imageformat_bmp -no-feature-imageformat_ppm -no-feature-imageformat_xbm -no-feature-imageformat_png -no-feature-imageformat_jpeg -no-feature-image_heuristic_mask -no-feature-image_text -no-feature-colornames -no-feature-cups -no-feature-paint_debug -no-feature-freetype -no-feature-translation -no-feature-codecs -no-feature-big_codecs -no-feature-iconv -no-feature-ftp -no-feature-udpsocket -no-feature-networkproxy -no-feature-socks5 -no-feature-networkdiskcache -no-feature-bearermanagement -no-feature-completer -no-feature-fscompleter -no-feature-desktopservices -no-feature-mimetype -no-feature-systemtrayicon -no-feature-undocommand -no-feature-undostack -no-feature-undogroup -no-feature-undoview -no-feature-statemachine -no-feature-gestures -no-feature-dbus

    ////linux ubuntu 64
    ./configure -developer-build -confirm-license -opensource -linuxfb -prefix "/home/qt-5.15-build" -nomake tests -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qttools -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -skip qtxmlpatterns

    相关文章

      网友评论

          本文标题:VS 2019下编译QT5.15源码

          本文链接:https://www.haomeiwen.com/subject/vqeductx.html