用Git创建Qt5/Qt6

获取源码

首先要克隆Qt5 git仓库的最高一级

#第一种方式,速度快,后续init -repository不易掉线
$ git clone git://code.qt.io/qt/qt5.git

#第二种方式
#或者有防火墙的话,使用下面的http协议也可以
$ git clone https://code.qt.io/qt/qt5.git

#上面这两条命令,可以用git bash在我们自己电脑上某个目录下面输入

clone完成后,如下图所示(我是在一个名字叫git的目录下clone的)

之后,切换目标分支。直接克隆下来,默认是dev分支(也就是永久分支,始终处于开发状态的分支;通过cd qt5,我们可以看到"(dev)"这个标签 ),我们可以通过git checkout 5.12 切换到5.12分支上去。

$ cd qt5
$ git checkout 5.12

最后,获取我们所需要的子模块的代码。我们可以使用qt5/init-repository来克隆Qt5不同子模块的代码(想要哪一个就要哪一个)。

perl init-repository --module-subset=default,-qtwebengine  
#--module-subset=default,-qtwebengine的意思是,下载默认的模块,除了Qt WebEngine。
之所以这样,是因为,Qt WebEngine需要花费很长时间编译,而且通常是编译错误的一个源头。
所以,推荐,只有打算使用的时候,才下载该模块。
当然,我们可以重新跑init-repository脚本,来添加该模块。

clone过程开始,坐等就行。注意,采用https(SSL,也就是第二种clone方式)clone,需要网速比较好才行,否则,clone的过程不会特别顺利,中间容易掉线。我也是clone了好几次才成功的,时间也是专门选在没啥人上网的大早上.......如果等不及,还是用SSH(第一种clone)吧。

当然,用第二种方式clone容易掉线的一个原因是源码确实比较大,也可以逐个submodule clone(以子模块qtbase为例,命令是,perl init-repository -f --module-subset=qtbase)。

关于git clone报错

如果采用https(SSL)clone,可能会遇到报错。例如,

 error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054,或者,error: RPC failed; curl 18 transfer closed with outstanding read data remaining。

这两种错误,解决方法有好几种,估计要试试。参见参考链接。我是通过提高网速解决的。

配置和编译

进行中......

 

参考链接

Building Qt 5 from Git

Building Qt 5 from Git 中文版

Building Qt 6 from Git

git clone 报错:error: RPC failed; curl 18 transfer closed with outstanding read data remain 有原因分析及解决方案

git clone时RPC failed; curl 18 transfer closed with outstanding read data remaining 提到了失败的原因可能是网速慢

【git clone】 error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054

给git-bash安装某些应用(make,wget,hugo,xpdf,nano)

让GIT BASH支持make

Windows下GitBash提示bash: make: command not found解决办法,非常简单有效!

How to add more commands to Git Bash?

windows+CMake+mingw 搭建c c++开发环境

MINGW里面没有mingw32 make.exe

make.exe 下载 ftp

bash git 如何切换目录_给git-bash加点儿料——gcc、make、cmake

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This directory contains the Qt3D project for Qt5: * Qt3D QML bindings and * Qt3D C++ APIs Building Qt3D ================== Qt5 is a rapidly changing bleeding edge environment. This branch is our initial support for it and thus is also rapidly changing and bleeding edge. This branch is experimental, and unsupported. This information is provided for advanced use only. No guarantees about API stability or even if this works at all are supplied, use at your own risk. First fetch the Qt5 source tree and Qt3D master branch: cd ~/depot git clone ssh://codereview.qt-project.org:29418/qt/qt5.git cd qt5 ./init-repository --codereview-username \ --module-subset=qtbase,qtsvg,qtdeclarative,qttools,qtxmlpatterns,qtdoc,qlalr,qtrepotools,qtqa,qtlocation,qt3d git submodule foreach "git fetch gerrit && git reset --hard gerrit/master" cd qt3d scp -p -P 29418 codereview.qt-project.org:hooks/commit-msg .git/hooks/ git fetch gerrit git checkout --track -b master gerrit/master If you are reading this file then somehow you probably already got this far anyway. Now build Qt5, which will also build Qt3D as a module: cd ~/build mkdir qt5 cd qt5 ~/depot/qt5/configure -developer-build -opensource -confirm-license -no-webkit -no-phonon -nomake tests \ -nomake examples -declarative -opengl -svg && make -j 4 What's in Qt3D ================== Directory structure: src/threed/ This is the main library of the Qt3D project, containing abstractions for cross-platform GL, shaders, lighting models, and so on. src/plugins/ Scene format loading plugins. src/imports/ QML import plugins. util/ Various utilities that are useful when working with Qt3D. examples/ Some examples of using Qt3D QML bindings and Qt3D C++ API. demos/ Some more complex demos of using Qt3D QML bindings and Qt3D C++ API. tests/auto/qml3d/ Unit tests for the QML bindings. tests/auto/threed/ Unit tests for the C++ API doc/ Documentation. devices/symbian/ Symbian deployment file Documentation ============= The documentation can be generated with "make docs". It will be placed into "doc/html" in the build directory. Packages ======== This section is only for those developing Qt3D. Read on to discover how the building of packages works. This section is also important if you want to change how the structure of the Qt3D pro files work. To build Qt3D, run: qmake && make The .pro files will cause the toolchain to place the libraries, QML files and meshes of Qt3D directly into place, as part of the compile process. The files go into the bin/ directory, and the executables can be run directly from there. If you are doing a developer build, plugins will be installed in such a way that Qt will find them. After building the tree the install step is invoked using the INSTALL_ROOT environment export to cause the installation rules to place all the files into a sandboxed install tree, ready for packaging: INSTALL_ROOT=tmp make install Examples ======== Some examples require assimp library to parse the content. Go to http://assimp.sourceforge.net/ and build and install the assimp library. Then configure Qt3D to include assimp and run qmake && make.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值