Solved Build Qt 5.6 with examples installed
-
Hi,
Just some additional notes. Qt's
make install
call will install all of Qt in one known location like/usr/local/qt5
unless you toyed with the various prefix related variables. Why not globally in the system ? Because it would overwrite what your distribution is providing and while it should likely not be a problem, your distribution might be patching Qt for e.g. security purposes or bug fixes not yet upstreamed etc.Also doing a
-developer-build
implies that you are building Qt with the intention to work on it for either bug fixes and/or feature implementation. If you want a "no install" build follow the recommendation provided here. -
Why not globally in the system ? Because it would overwrite what your distribution is providing and while it should likely not be a problem, your distribution might be patching Qt for e.g. security purposes or bug fixes not yet upstreamed etc.
Forget that maintainers sometimes do small patches. Doing
make install
introduces terrible pollution to the system locations and makes maintaining your system hell!Also doing a -developer-build implies that you are building Qt with the intention to work on it for either bug fixes and/or feature implementation.
It does? I don't do these things, but I like the developers build very much. :)
-
Thanks for all the input!.
I personally use Debian (testing flavor), but any good distro is enough for development
I like Debian, also. I use it for my server at work.
I'm building this LFS system just because I wanted to see if I could, and to learn more about the inner workings of the operating system. I'm actually building it on a flash drive. If nothing else, it has helped me become more comfortable with installing and configuring software from source on Linux. This is just something for me to play around with.Doing make install introduces terrible pollution to the system locations and makes maintaining your system hell!
I am installing Qt under /opt by making a directory with the full version name (qt-5.6.0 in this case) then a symbolic link /opt/qt5 pointing to that directory. More details on the configuration are in that link I posted, if you're interested. So it's not polluting my /usr directory tree at all using
make install
. Please don't take this as arguing against your approach. I appreciate the tip and knowing about other options. This is just the way I am choosing to do it this time around.I did succeed in building with the examples, They all installed, but only 2 examples showed up on the Qt Creator Welcome page, the Context2d and Default Prototypes. After investigating I found that the examples-manifest.xml file in the doc/qtscript/ directory for those 2 examples didn't have qtbase/ prefixing all the paths, but the rest that I checked do. I removed the qtbase/ prefix from all the paths in the xml file in the doc/qtgui/ directory and those examples then appeared on the Welcome page. I ended up doing, as root,
find $QT5DIR/doc/ -name examples-manifest.xml -exec sed -i -e "s@qtbase/@@g" {} \;
to change the rest of the files. I can't say for sure if all the examples are showing up, but there are a bunch there now. Is there something I could have done in the configure stage when building to make them correct in the first place?Thanks again for the help!
Paul -
I'm building this LFS system just because I wanted to see if I could, and to learn more about the inner workings of the operating system.
Fair enough.
I am installing Qt under /opt by making a directory with the full version name (qt-5.6.0 in this case) then a symbolic link /opt/qt5 pointing to that directory. ... So it's not polluting my /usr directory tree at all using make install.
Then you're using a prefix for your configure script, which is really good. I learned the hard way to do that. ;)
Is there something I could have done in the configure stage when building to make them correct in the first place?
I don't know anything special that needs to be done for the examples. Perhaps @SGaist will rescue me yet again ... :)
Kind regards.
-
You don't need any symbolic link, just use Qt from /opt directly.
As for the examples-manifest-xml files, you may have found something new.
I don't build the examples when building Qt because it's essentially wasted time and disk space. They are easy to find and build otherwise. (e.g. the Regular Expression tool).
AFAIK, the configure call looks good. Did you call configure only once or did you re-run it without cleaning the sources ?
-
You don't need any symbolic link, just use Qt from /opt directly.
I realize I don't need the link, just thought it would make it easier for managing future builds.
I don't build the examples when building Qt because it's essentially wasted time and disk space.
Maybe some day I'll feel the same way :) Not quite there yet! Seriously though, my main thing is I want to know how to do it if desired. It was bugging me that it didn't work like I expected.
Did you call configure only once or did you re-run it without cleaning the sources ?
Not very likely. I built out of source in a directory along side the source. I delete the build directory and recreate it if I change anything in the configuration. I don't recall deviating from that procedure.
I appreciate all the help. I'll mark this solved since my question was answered and I was able to accomplish what I wanted. Maybe I'll fire up a fresh build before I go to bed tonight and see if the results with the examples-manifest.xml files repeats.
Paul
-
Good ! Out of source builds are way nicer :)
That would be interesting yes, there might be a bug lurking there.
-
I re-built last night and got the same results with the examples-manifest.xml files. For reference, here is how I built:
export QT5PREFIX=/opt/qt5 ../qt-everywhere-opensource-src-5.6.0/configure \ -prefix $QT5PREFIX \ -sysconfdir /etc/xdg \ -confirm-license \ -opensource \ -dbus-linked \ -openssl-linked \ -system-harfbuzz \ -system-sqlite \ -no-rpath \ -optimized-qmake \ -skip qtwebengine make make docs
I also noticed that my fix for removing the
qtbase/
from the path in the xml files only fixed the examples that are built in the qtbase build directory. Fixing the rest of the files manually won't be quite as easy because some have the same name twice like thisqt<module>/qt<module>/
and some have it like thisqt<module>/<module>
. Only the firstqt<module>/
needs to be removed. Plus,qt<module>/
is in the URLs, which need to remain. Here are example entries from the build directories to show what I am talking about. Note thedocUrl=
,imageURL=
,projectPath=
and<fileToOpen>
tags.qtbase/doc/qtgui/examples-manifest.xml
<example name="Analog Clock Window Example" docUrl="qthelp://org.qt-project.qtgui.560/qtgui/qtgui-analogclock-example.html" projectPath="qtbase/gui/analogclock/analogclock.pro" imageUrl="qthelp://org.qt-project.qtgui.560/qtgui/images/analogclock-window-example.png"> <description><![CDATA[The Analog Clock Window example shows how to draw the contents of a custom window.]]></description> <tags>android,ios,gui,clock,analog,window</tags> <fileToOpen mainFile="true">qtbase/gui/analogclock/main.cpp</fileToOpen> </example>
qt3d/doc/qt3d/examples-manifest.xml
<example name="Qt 3D: Audio Visualizer Example" docUrl="qthelp://org.qt-project.qt3d.560/qt3d/qt3d-audio-visualizer-qml-example.html" projectPath="qt3d/qt3d/audio-visualizer-qml/audio-visualizer-qml.pro" imageUrl="qthelp://org.qt-project.qt3d.560/qt3d/images/audio-visualizer-qml-example.png"> <description><![CDATA[Demonstrates combining Qt 3D rendering and Qt Quick 2 elements.]]></description> <tags>qt3d,audio,visualizer</tags> <fileToOpen>qt3d/qt3d/audio-visualizer-qml/main.cpp</fileToOpen> <fileToOpen mainFile="true">qt3d/qt3d/audio-visualizer-qml/main.qml</fileToOpen> </example>
qtmultimedia/doc/qtmultimedia/examples-manifest.xml
<example name="Audio Devices Example" docUrl="qthelp://org.qt-project.qtmultimedia.560/qtmultimedia/qtmultimedia-multimedia-audiodevices-example.html" projectPath="qtmultimedia/multimedia/audiodevices/audiodevices.pro" imageUrl="qthelp://org.qt-project.qtmultimedia.560/qtmultimedia/images/audiodevices.png"> <description><![CDATA[Testing the available audio devices and their configuration.]]></description> <tags>devices,multimedia,audio</tags> <fileToOpen>qtmultimedia/multimedia/audiodevices/main.cpp</fileToOpen> <fileToOpen>qtmultimedia/multimedia/audiodevices/audiodevices.h</fileToOpen> <fileToOpen mainFile="true">qtmultimedia/multimedia/audiodevices/audiodevices.cpp</fileToOpen> </example>
The 2 example projects that I mentioned in an earlier post are the only ones that work without modification. So I don't know if this is a bug in Qt Creator, the Qt build, or neither one and there is something else gone wrong on my end. As another note, the xml files on my Windows box, which were installed with the online installer, don't have the extra prefix in the paths, which leads me to believe it is not a problem with Qt Creator.
Paul
-
Just to be sure, is that after running
make install
? -
I didn't install this time. I just compared them with the files in the original build directory and installation directory. I still have the new build directory so I can do a
make install
to see if that changes anything.Paul