# CMake not find some QT5 packages

**URL:** https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167
**Category:** Usage
**Tags:** os:linux
**Created:** [May 7, 2020, 7:19pm UTC](https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167 "2020-05-07T19:19:11Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![FredMontteiro](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fredmontteiro/32/578_2.png) [@FredMontteiro](https://discourse.cmake.org/u/FredMontteiro)
#### Post date: [May 7, 2020, 7:19pm UTC](https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167/1 "2020-05-07T19:19:11Z")

</div>

Hi friends, I’m using the translator, my English is medium.

I am trying to install the Otter browser on Lubuntu via CMake / QT5.

I have QT5 installed on /opt/Qt5.14.2 and CMake installed on /home/“user”/cmake-3.17.2-Linux-x86\_64

To install the Otter browser I am following the GitHub thread.  
I am not going to put the Github link because I can only put 2 links here.

Briefly the GitHub link says to execute the 5 commands below:

_mkdir build_  
_cd build_  
_cmake …/_  
_make_  
_make install_

When I type the third command (cmake …/) I get the following: [Screenshot](https://drive.google.com/file/d/1ELQ1HyrHo_o2_esKHT4A0FZiLovRwVb5/view?usp=sharing)

I am also attached to “CMakeOutput.log”: [Log](https://drive.google.com/file/d/19EBxBNSgRq9IRCL6C7rlo_Apgm_d_6eM/view?usp=sharing)

How do I fix this problem?

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [May 8, 2020, 8:00am UTC](https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167/2 "2020-05-08T08:00:33Z")

</div>

It looks like CMake found the system Qt rather than yours. You need to tell CMake about your Qt installed in `/opt`. A typical way to do this would be to set `CMAKE_PREFIX_PATH`, which you can do like so (make sure you remove any previous build the first time you do this or it will continue to use the system Qt it found previously):

```auto
cmake -D CMAKE_PREFIX_PATH=/opt/Qt5.14.2 ..

```

Depending on what structure is used below `/opt/Qt5.14.2`, it might be enough to set `CMAKE_PREFIX_PATH` to just `/opt`, but you can try both and see what works for you.

---

<div class="post-metadata">

### Author: ![FredMontteiro](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fredmontteiro/32/578_2.png) [@FredMontteiro](https://discourse.cmake.org/u/FredMontteiro)
#### Post date: [May 11, 2020, 5:53am UTC](https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167/3 "2020-05-11T05:53:44Z")

</div>

Hi friend, I tried it in the two ways shown below:

_cmake -DCMAKE\_PREFIX\_PATH=/opt/Qt5.14.2_  
and  
_cmake -DCMAKE\_PREFIX\_PATH=/opt/_

Either way I got the same error. See the [Sreenshot1](https://drive.google.com/file/d/1gWqpOAbI-cRynwj9zcCHyLN6ZLbSqaBf/view?usp=sharing) and [Screenshot2.](https://drive.google.com/file/d/1Vbi94QGzUFjIxKGWgWEEYYscD5M16eak/view?usp=sharing)

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [May 11, 2020, 11:32am UTC](https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167/4 "2020-05-11T11:32:25Z")

</div>

Those screenshots show that you did not clear your build directory first, so it was just using the same location if found before instead of the new location you specified (see my previous comment: “_make sure you remove any previous build the first time you do this or it will continue to use the system Qt it found previously_”).

---

<div class="post-metadata">

### Author: ![FredMontteiro](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fredmontteiro/32/578_2.png) [@FredMontteiro](https://discourse.cmake.org/u/FredMontteiro)
#### Post date: [May 11, 2020, 11:37pm UTC](https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167/5 "2020-05-11T23:37:36Z")

</div>

Hi, sorry for my ignorance. I am not sure which directory to remove.

In **/home/“me”** the only unusual directories are _“cmake-3.17.2-Linux-x86\_64”_  
and _“otter-browser-master”_.

In **/opt** the only unusual directory is _“Qt5.14.2”_.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [May 12, 2020, 12:42pm UTC](https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167/6 "2020-05-12T12:42:52Z")

</div>

You need to remove `CMakeCache.txt` from the `/home/df/otter-browser-master/build` directory (or you can just delete everything in that `build` directory if you prefer).

By the way, your posts are getting flagged as spam due to the links to the screenshots. It is better to cut-and-paste the text output directly in your posts if they are reasonably short.

---

<div class="post-metadata">

### Author: ![FredMontteiro](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fredmontteiro/32/578_2.png) [@FredMontteiro](https://discourse.cmake.org/u/FredMontteiro)
#### Post date: [May 13, 2020, 8:50am UTC](https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167/7 "2020-05-13T08:50:50Z")

</div>

I uninstalled Qt5.14.2 from **/opt** and reinstalled in **/home/df/Applications/Qt** according to the tutorial of the official Qt channel.

Then I removed all the contents of the **/home/df/otter-browser-master/build** directory  
I did not remove the directory, only its contents.

Then I changed the end of the command you showed me.

It looks like this:  
_cmake -DCMAKE\_PREFIX\_PATH=/home/df/Applications/Qt_

I am still getting the same error.

 ![2020-05-13-054405_1360x768_scrot](https://discourse.cmake.org/uploads/default/original/1X/df6f392127568abb1971626fa9160136ebca8053.png)

---

<div class="post-metadata">

### Author: ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)
#### Post date: [May 13, 2020, 9:29am UTC](https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167/8 "2020-05-13T09:29:11Z")

</div>

In order to build, Otter Browser needs one of the three web backends that it supports: QtWebEngine, QtWebKit and Hunspell. CMake didn’t find any of these, so it failed to configure.

You need to install QtWebEngine or QWebKit when installing Qt. AFAIK, they are not part of the default Qt packages.

---

<div class="post-metadata">

### Author: ![FredMontteiro](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fredmontteiro/32/578_2.png) [@FredMontteiro](https://discourse.cmake.org/u/FredMontteiro)
#### Post date: [May 13, 2020, 11:20am UTC](https://discourse.cmake.org/t/cmake-not-find-some-qt5-packages/1167/9 "2020-05-13T11:20:38Z")

</div>

Hi friend, thank you very much for your help. How to install QtWebEngine or QWebKit when installing Qt?

Really like you said the installation of the latest online installation package **qt-unified-linux-x64-3.2.2-online.run** does not have this option.
