How do I use qt after building it from source?
-
I am trying to build and use latest Qt5.8 from git source. I want to do an out of source build, so I cloned the source code from git into a folder called
qt5
. Then I created a folder next to it calledQt5.8_Oct24
. Inside theqt5
folder I do this:~$git checkout -b v5.8.0-alpha1 ~$git submodule update --init
And then from inside
Qt5.8_Oct24
I configure and build the project like so:~$../qt5/configure -developer-build -opensource ~$make -j9
This tool a while, and I do not see any errors in the output. However, inside the build directory I only see the following folders:
/Qt5.8_Oct24$ ls Makefile qtandroidextras qtcanvas3d qtdeclarative qtenginio qtimageformats qtpim qtqa qtserialbus qtsvg qtwebsockets txmlpatterns qtactiveqt qtbase qtconnectivity qtdocgallery qtgamepad qtmacextras qtpurchasing qtscxml qtserialport qtwayland qtx11extras
Does that look correct?
Inside the
qtbase/bin
folder I see a number of binary files, includingqmake
. What steps do I need to take next to use this new build from both command line and from inside Qt Creator? I would like to be able to access the latest version of examples from within Qt Creator. -
Hi,
Unless you plan to hack on Qt, don't use the -developer-build option.
To configure Qt Creator, add a new Qt version in the Build and Run preferences and then make a Kit with.
One thing you can also to to speed up compilation is to disable building of the tests and examples.
-
How do I make the examples from the new build available in Qt Creator?
Also I noriced some of the libraries that were present in the source directory were not built and that is causing problem. In particular, theqtscript
folder exist in the source but not in the build directory. When I try to build Qt Creator it fails sayingProject ERROR: Unknown module(s) in QT: script
. So how do I make sure all libraries included in theqt5
source directory will get built?Thanks for your quick reply @SGaist !
-
You have to clone qtscript by hand. It's been deprecated and removed.
-
@SGaist thanks. It is strange that Qt Creator still depends on
qtscript
even though it is deprecated. You think that is a bug?The second part of my question was about the examples, any ideas on how I could make the examples from the new build available in Qt Creator?
-
AFAIK, Qt Creator still uses it a bit.
That part I don't remember. Usually when I need to one of the samples (i.e. the regular expression example) I build it directly or open it from its folder.