I want to build applications requiring Qt5 via CMake.

Which libraries do I have to install to achieve that?

What I have tried so far is searching for anything containing qt 5 core and dev, but have turned up empty:

apt-cache search qt | grep dev | grep core

only returns

libtulip-dev - Tulip graph library - core development files

The only thing seeming half-way to fit is "libqt5core5a", but installing that doesn't provide any development libraries...

Do I need any additional repositories? The ones from Kubuntu maybe?

Searching the web didn't yet give me any proper answers too (probably not the right keywords, I know, but :o). I e.g. found this question: What package do I need to build a Qt 5 & CMake application?, but there is no qtcore5-dev package in trusty repositories it seems...

Edit: Upon further experimenting, I did have qmake installed, but the 4.8.6 version (qt4-qmake). Trying to install the 5.x version brought no joy, though - (sudo apt-get purge qt4-qmake && sudo apt-get install qt5-qmake) - qmake now reports:

qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory

Is there something broken in the repositories here?


2 Answers 2



> apt-file search Qt5CoreConfig.cmake

was what I was missing. This got me

qtbase5-dev: /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake

Installing that seems to lead to CMake finding Qt5. qmake still reports the same problem when directly called though...some remnant from qt4 still installed it seems...

Edit: As for the qmake problem, this is fixed by

sudo apt-get install qt5-default
  • 1
    Didn't knew of apt-flie, very useful indeed.
    – user69112
    Nov 15, 2014 at 11:55

1) Where is your qtchooser configuration file?

$: locate qtchooser | grep conf

2) From the list of conf files, probably there is one call "default.conf" This one is a link to one of the others (4.conf or qt4.conf or 5.conf or qt5.conf). Choose the one that makes sense too you, and create a link to it.

Suppose your default file path is


Create backup: $: cd $(dirname /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf) $: cp -av default.conf default.conf_backup

Let's say you target is /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf

Then: $: sudo ln -s /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf default.conf

3) Is the path to your qmake right?

Check qmake location $: locate qmake | grep bin

Is the same one as indicated in your modified qtchooser/default.conf? $: cat /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf

If the answer is YES, then you are done. If the anser is no, then you need to modify the file:

Create backup:

  $: cd $(dirname /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf)
  $: cp -av qt5.conf qt5.conf_backup

Edit file and change path to your qmake location

  $ sudo vi qt5.conf

Now it is done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.