Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Forcing qt5 build in case both qt4 and qt5 installed #1450

Closed
pfalcon opened this issue Sep 8, 2014 · 4 comments
Closed

Forcing qt5 build in case both qt4 and qt5 installed #1450

pfalcon opened this issue Sep 8, 2014 · 4 comments
Labels

Comments

@pfalcon
Copy link

pfalcon commented Sep 8, 2014

I'm on Ubuntu 14.04 with *-dev packages for both qt4 and qt5 installed. And doing "qmake; make", I see that qt4 is being picked up. Running "/usr/lib/x86_64-linux-gnu/qt5/bin/qmake" doesn't solve the issue. I also see that PPA version is compiled against qt4 either. Googling around, I see that people rather have other way around - qt5 being picked up instead of qt4. So, are there any preference on qupzilla side for qt4 and how to override it? If not, any hints how to select which version to use? Thanks!

@JHooverman
Copy link
Member

Did you try to invoke?

qt5-make
make

You should install this package
https://launchpad.net/ubuntu/trusty/+package/qt5-qmake
if this is not already the case.

@pfalcon
Copy link
Author

pfalcon commented Sep 8, 2014

There's no "qt5-make" command, nor "qt5-qmake". But I do have "qt5-qmake" package installed, and it has:

$ dpkg -L qt5-qmake
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake
...

which I tried to run - its path gets recorded into generated Makefile, but typical compile line is still:

g++ -c -m64 -pipe -g -Wall -W -D_REENTRANT -fPIC -DQUPZILLA_VERSION="1.7.0" -DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER -DQUPZILLA_DEBUG_BUILD -DUSE_QTWEBKIT_2_2 -DUSE_QTWEBKIT_2_3 -DUSE_LIBPATH="/usr/lib/x86_64-linux-gnu" -DUSE_DATADIR="/usr/share/qupzilla" -DGIT_REVISION="8b3da86976" -DQZ_WS_X11 -DQT_PLUGIN -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtWebKit -I/usr/include/qt4 -I../../lib/3rdparty -I../../lib/adblock -I../../lib/app -I../../lib/autofill -I../../lib/bookmarks -I../../lib/cookies -I../../lib/downloads -I../../lib/history -I../../lib/navigation -I../../lib/network -I../../lib/notifications -I../../lib/opensearch -I../../lib/other -I../../lib/plugins -I../../lib/popupwindow -I../../lib/preferences -I../../lib/rss -I../../lib/session -I../../lib/sidebar -I../../lib/tabwidget -I../../lib/tools -I../../lib/webkit -I../../lib/webtab -Ibuild -Ibuild -o build/sbi_imagesicon.o sbi_imagesicon.cpp

@nowrep
Copy link
Member

nowrep commented Sep 8, 2014

The Qt version used to build depends only on qmake.
If your qmake command is for Qt 4 version, then you will get qupzilla built with Qt 4.

You might need to run qmake -r after a build config change to update all makefiles recursively.

@nowrep nowrep closed this as completed Sep 8, 2014
@nowrep nowrep added the Invalid label Sep 8, 2014
@pfalcon
Copy link
Author

pfalcon commented Sep 8, 2014

Ok, so Ubuntu 14.04 has "qtchooser" package which provides /usr/bin/qmake whcih redirects either to /usr/lib/x86_64-linux-gnu/qt4/bin/qmake or /usr/lib/x86_64-linux-gnu/qt5/bin/qmake. So happens that on my system it redirects to qt4 versions. Running qt5 version directly doesn't help (probably because for other tools, qt4 versions get selected) still. qtchooser says:

$ qtchooser 
Usage:
  qtchooser { -l | -list-versions | -print-env }
  qtchooser -run-tool=<tool name> [-qt=<Qt version>] [program arguments]
  <executable name> [-qt=<Qt version>] [program arguments]

Environment variables accepted:
 QTCHOOSER_RUNTOOL  name of the tool to be run (same as the -run-tool argument)
 QT_SELECT          version of Qt to be run (same as the -qt argument)

And indeed doing "export QT_SELECT=5" does the trick (I believe I previously tried "QT_SELECT=5 qmake", but maybe I did something wrong (I now running qmake -r all the time, before just qmake)).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants