Calling configure will now implicitly run init-repository when appropriate. See further down below for what "appropriate" means. All supported init-repository options can be passed to configure as except for -mirror, -oslo, -berlin. This includes useful options like -submodules, -no-resolve-deps and -no-optional-deps. When running configure on a qt5.git clone without any submodules cloned, configure will exit with a helpful error message suggesting to pass -init-submodules, so it automatically clones missing repositories. This means cloning is opt-in, so that internet access is not done implicitly. The error message also suggests passing the -submodules option. This will affect which submodules will be cloned by init-repository and which submodules will be configured by configure. In this case -submodules is effectively an alias of init-repository's -module-subset for cloning purposes. When calling configure a second time, without -init-submodules, on an already configured repo, init-repository behavior is entirely skipped. -submodules now accepts init-repository-style special values like "essential", "addon", "all", "existing", "-deprecated" for the purpose of cloning submodules. The values are then translated into actual repos that should also be configured or skipped by configure. The default subset of cloned submodules is currently the same one as init-repository, "default", which clones 44 actively maintained repositories as well as deprecated submodules. If configure is called a second time WITH -init-submodules, it's the same as calling init-repository --force to re-initialize submodules. In this case passing something like --submodules existing,<additional-submodules> might make sense to add or remove submodules. As a drive-by this also fixes the bug where you couldn't pass a configure -- -DFOO=0 parameter to configure, because it got treated as '0>', redirecting from a different stream than stdout, leading to empty content in the file. [ChangeLog][General][Build System] The configure script now implicitly calls init-repository when appropriate and accepts init-repository command line options. Fixes: QTBUG-120030 Task-number: QTBUG-122622 Change-Id: Iedbfcbf0a87c8ee89e40d00b6377b68296a65a62 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> |
||
---|---|---|
.github | ||
LICENSES | ||
cmake | ||
coin | ||
qt3d@30776960db | ||
qt5compat@c2f49b9db5 | ||
qtactiveqt@a74633ca86 | ||
qtbase@364e1c5f30 | ||
qtcanvas3d@1319e0965f | ||
qtcharts@df900cebab | ||
qtcoap@dc2f091cee | ||
qtconnectivity@d90a294146 | ||
qtdatavis3d@39aaac4dc1 | ||
qtdeclarative@db5eefc33c | ||
qtdoc@2300c7ca44 | ||
qtfeedback@9ac8d8c272 | ||
qtgamepad@5fe6fd206f | ||
qtgraphs@ce1da90f18 | ||
qtgrpc@cffa433422 | ||
qthttpserver@b752273b9c | ||
qtimageformats@d99033517a | ||
qtlanguageserver@e39846fda9 | ||
qtlocation@774a44208b | ||
qtlottie@b1c32001d7 | ||
qtmqtt@ac0bcc66f8 | ||
qtmultimedia@e8f88cc506 | ||
qtnetworkauth@f87cd7fa7a | ||
qtopcua@a35123fcd8 | ||
qtpim@02efef5ee6 | ||
qtpositioning@4df59ee414 | ||
qtqa@a5b680b919 | ||
qtquick3d@61124cbbbb | ||
qtquick3dphysics@0e9ff1637a | ||
qtquickeffectmaker@cd990f7645 | ||
qtquicktimeline@f92cd3f877 | ||
qtremoteobjects@7b7b454a81 | ||
qtrepotools@130826c46e | ||
qtscxml@7959905c4f | ||
qtsensors@722c5abd6d | ||
qtserialbus@eebcaf7bbb | ||
qtserialport@3234a30f79 | ||
qtshadertools@d7ede2c75f | ||
qtspeech@581370e256 | ||
qtsvg@4545854924 | ||
qtsystems@434af789f0 | ||
qttools@2d04db99f5 | ||
qttranslations@687c04a08c | ||
qtvirtualkeyboard@9df444d438 | ||
qtwayland@9b9dc62dd7 | ||
qtwebchannel@9fdc1c30cc | ||
qtwebengine@2d42f4d15d | ||
qtwebglplugin@531fb30d53 | ||
qtwebsockets@ed5d76585e | ||
qtwebview@a99fb1d6ac | ||
qtxmlpatterns@05ab444844 | ||
tests/manual/RunCMake | ||
.commit-template | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.tag | ||
CMakeLists.txt | ||
CONTRIBUTING.md | ||
README.git | ||
README.md | ||
README.md.template | ||
_clang-format | ||
configure | ||
configure.bat | ||
configure.json | ||
init-repository | ||
init-repository.bat | ||
init-repository.pl |
README.md
HOW TO BUILD Qt 6
Synopsis
System requirements
- C++ compiler supporting the C++17 standard
- CMake
- Ninja
- Python 3
For more details, see also https://doc.qt.io/qt-6/build-sources.html
Linux, Mac:
cd <path>/<source_package>
./configure -prefix $PWD/qtbase
cmake --build .
Windows:
- Open a command prompt.
- Ensure that the following tools can be found in the path:
- Supported compiler (Visual Studio 2019 or later, or MinGW-builds gcc 8.1 or later)
- Python 3 ([https://www.python.org/downloads/windows/] or from Microsoft Store)
cd <path>\<source_package>
configure -prefix %CD%\qtbase
cmake --build .
More details follow.
Build!
Qt is built with CMake, and a typical
configure && cmake --build .
build process is used.
If Ninja is installed, it is automatically chosen as CMake generator.
Some relevant configure options (see configure -help):
-release
Compile and link Qt with debugging turned off.-debug
Compile and link Qt with debugging turned on.
Example for a release build:
./configure -prefix $PWD/qtbase
cmake --build .
Example for a developer build: (enables more autotests, builds debug version of libraries, ...)
./configure -developer-build
cmake --build .
See output of ./configure -help
for documentation on various options to
configure.
The above examples will build whatever Qt modules have been enabled by default in the build system.
It is possible to build selected repositories with their dependencies by doing
a ninja <repo-name>/all
. For example, to build only qtdeclarative,
and the modules it depends on:
./configure
ninja qtdeclarative/all
This can save a lot of time if you are only interested in a subset of Qt.
Hints
The submodule repository qtrepotools
contains useful scripts for
developers and release engineers. Consider adding qtrepotools/bin
to your PATH
environment variable to access them.
Building Qt from git
See http://wiki.qt.io/Building_Qt_6_from_Git and README.git for more information. See http://wiki.qt.io/Qt_6 for the reference platforms.
Documentation
After configuring and compiling Qt, building the documentation is possible by running
cmake --build . --target docs
After having built the documentation, you need to install it with the following command:
cmake --build . --target install_docs
The documentation is installed in the path specified with the
configure argument -docdir
.
Information about Qt's documentation is located in qtbase/doc/README
Note: Building the documentation is only tested on desktop platforms.