2

Can please someone explain in detail how to build a single qt module. I tried to understand the build sources documentation, but there is no info on how to build just a single module, let alone what to do with it after. I would like to do some modification on the qtmultimedia module, build it with the changes and use that module in my existing QT installation. I need only the IOS part.

3 Answers 3

3

From Qt 6 the build system is based on cmake. I found this blog post useful https://www.qt.io/blog/qt-6-build-system There is a section on "Building Qt Modules".

qt-configure-module is the tool of choice when building a Qt module separately against an installed Qt. The qt-configure-module script takes the same arguments a top-level Qt configure call would - restricted to the arguments that apply to the module we're currently configuring.

In the following example we first build and install qtbase, then qtdeclarative with the qml-network feature turned off.

mkdir ~/dev/qt/qtbase-build
cd ~/dev/qt/qtbase-build
../qtbase/configure -prefix /opt/Qt/6.0.0
cmake --build .
cmake --install .

mkdir ~/dev/qt/qtdeclarative-build
cd ~/dev/qt/qtdeclarative-build
/opt/Qt/6.0.0/bin/qt-configure-module ../qtdeclarative -no-qml-network
cmake --build .
cmake --install .
Sign up to request clarification or add additional context in comments.

Comments

2

Use the qmake executable from the Qt build you want to build with to create a Makefile. Then run make.

<path_to_qt_build>/bin/qmake <path_to_module>
make [or nmake or jom for windows]

2 Comments

I managed to run the qmake, but what will happen to my other installations of that module? Will it be overwritten, if not how do I use that module inside my QML file?
It will be added/replaced to the Qt build to which qmake belonged. The module will simply be available for that Qt build. Other Qt builds are unrelated.
2

After configuring process just put:

make -j<N> module-<foo>,

where "foo" is a module's name you are desired of

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.