Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Build QT5.15.2 module from split source
I am interested in building only specific modules from the "split source" packages available from here: http://download.qt.io/official_releases/qt/5.15/5.15.2/submodules/ . More specifically, I am interested in building qtbase and qtsvg. For the record, I am building on Windows using Visual Studio 2019 and jom.
I am successful in building the qtbase module, out of source, using the split source package. For doing so, I unpack the qtbase package in qt-5.15.2/src/qtbase . Then I create an out-of-source build directory ( qt-5.15.2/build ), and I call configure / jom / jom install from there.
(in qt-5.15.2 dir) mkdir build cd build ..\src\qtbase\configure.bat -confirm-license -opensource -opengl desktop -mp -nomake tests -nomake examples -prefix ..\inst jom jom install
According to this thread ( https://stackoverflow.com/questions/55276709/how-to-build-a-selection-of-qt5-submodules-from-source ), I should be able to build qtsvg "in addition to" qtbase. More specifically, that thread suggest to do the following:
(in qt-5.15.2/build dir) mkdir qtsvg cd qtsvg ..\..\inst\bin\qmake.exe ..\..\src\qtsvg
However when doing so, the build quickly fails with the following error message:
[path]/src/qtsvg/.qmake.conf:1: Cannot find feature qt_build_config Could not find qmake spec 'win32-msvc'. Error processing project file: ..\..\src\qtsvg\qtsvg.pro
So, can anyone help me understand how to build specific modules from the "split source" packages available from the above link? In particular, how can I build qtsvg in addition to qtbase with the same configuration options.
Thank you very much.
Hi and welcome to devnet,
I do not affirm it's the source of your issue but I would use a full path for the prefix parameter.
Thank you for your help, unfortunately it produces the exact same error message. Actually, the compilation/installation of qtbase works, it is only the qtsvg part that does not.
Can you test an other module like qtserialport ?
Thanks again for your help. Unfortunately, it results in similar message. I execute the following:
(in qt-5.15.2/build dir) mkdir qtserialport cd qtserialport ..\..\inst\bin\qmake.exe ..\..\src\qtserialport
and obtain the following messages:
[path]/src/qtserialport/.qmake.conf:1: Cannot find feature qt_build_config Could not find qmake spec 'win32-msvc'. Error processing project file: ..\..\src\qtserialport\qtserialport.pro
I feel I am missing a step or something. I feel that similarly to qtbase, I would need to "configure" the qtsvg build, or at the very least to make it "know" about the qtbase configuration. However, by directly invoking qmake with a project path, I feel like qmake is not taking my configure options into account.
Thanks again for your help!
Note that I am used to build only parts of Qt but from the full sources. If that would be an option, you should test that.
I would prefer not having to download and unpack the whole source if possible. I would assume that if the split source packages are distributed it would be possible to build related libs from them, but I may be the only one trying to do that, since I wasn't able to find the build instruction for those...?
Anyway, as a plan B, that could be an option to only build required modules from the whole source (qt-everywhere-src-5.15.2.zip I assume?). Could you point me to or explain how to do this only for qtbase and qtsvg?
Exactly the same as you did with the split sources.
What I usually do is have a build dir that follows the same layout as Qt's sources.
Then you build qtbase as you just did followed by qtsvg.
FrancoisD last edited by FrancoisD
So I think it was a "dirty build dir" problem... I restarted by unpacking the source again and retried the procedure from the start, and it worked. Thank you very much for your help, really appreciated!
Now for the record, in case someone else try to do the same build as I did, here are the steps to build modules from the "split source" packages.
- Unpack each split source package in its own directory (e.g. tmp\src\qtbase, tmp\src\qtsvg, etc.)
- Create an out-of-source build directory (e.g. tmp\build)
- Go to that build directory and run configure with your preferred options (e.g. ..\src\qtbase\configure.bat [options])
- Build qtbase (e.g. jom)
- Install qtbase (e.g. jom install)
- Now for each additional module, create a subdirectory for that module under the build directory (e.g. tmp\build\qtsvg)
- Go to that subdirectory and call qmake on your submodule (e.g. ..\..\prefix\bin\qmake.exe ..\..\src\qtsvg)
- Build the submodule (e.g. jom)
- Install the submodule (e.g. jom install)
Thanks again for your help and have a great day!
Thanks for the feedback !
Happy coding :-)