How to compile only a minimum set of modules?
-
I'm trying to compile Qt 5.6.1 from source, which I downloaded as a .zip. In our application we only use a small subset of the modules - to be precize, in our CMake-based infrastructure we have currently:
find_package(Qt5Core REQUIRED) find_package(Qt5Widgets REQUIRED) find_package(Qt5OpenGL REQUIRED) find_package(Qt5Concurrent REQUIRED) find_package(Qt5Designer REQUIRED) find_package(Qt5Svg REQUIRED) find_package(Qt5Test REQUIRED) find_package(Qt5PrintSupport REQUIRED) find_package(Qt5Gui REQUIRED)
As far as I can tell, this only requires qtbase, qtsvg, and qttools (possibly some more, but I can't find easily how these package names map into module names).
According to http://doc.qt.io/qt-5/configure-options.html: 'it is possible to include or exclude particular Qt modules'. In other words: I expected to be able to tell the configure script to skip all modules, except the ones mentioned above. But the documentation then only mentions how to skip individual modules.
Am I really forced to write out a -skip module for every single module, except the ones I need, or is there some more efficient way to compile only what I need? Maybe I should just simply remove the folders from the base source folder?
-
Hi Jakob!
@Jakob said in How to compile only a minimum set of modules?:
Am I really forced to write out a -skip module for every single module, except the ones I need, or is there some more efficient way to compile only what I need?
No, you can build individual modules (bear in mind, here I mean qtbase, qt3d etc.) After you run configure, you can call
make
like this:$ make module-qtbase
to build the base module for example.
@Jakob said in How to compile only a minimum set of modules?:
Maybe I should just simply remove the folders from the base source folder?
No, don't do that. Just build whatever you need (as shown above) and install it ( into a prefixed location) with the usual
make install
.Kind regards.
-
@kshegunov
Thanx a lot for your answer - it makes a lot of sense. One question remains: will theinstall
target know which individual modules I chose to build? Typically theinstall
target is just a alias for all available installation targets, which would then recursively still build everything. -
@Jakob said in How to compile only a minimum set of modules?:
Typically the install target is just a alias for all available installation targets, which would then recursively still build everything.
Yes, you might be right about this. I often build "developers' build", so there's no install step, and you're probably right that it'll try to build the other modules. Hm. I don't know if you can request specific modules directly from the
configure
script. I'll check something and get back to you.