1

My question is very similar to this one.

I am trying to build a Qt5 project with Cmake and I am getting this error :

-- QT_DIR: /Users/Shared/Qt/5.12.11/clang_64
-- CMAKE_PREFIX_PATH (should contain the QT install path): /Users/Shared/Qt/5.12.11/clang_64/lib/cmake/Qt5
-- Finding Qt package Core
-- Finding Qt package Network
-- Finding Qt package Gui
-- Finding Qt package Widgets
-- Finding Qt package LinguistTools
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5LinguistTools"
  with any of the following names:

    Qt5LinguistToolsConfig.cmake
    qt5linguisttools-config.cmake

  Add the installation prefix of "Qt5LinguistTools" to CMAKE_PREFIX_PATH or
  set "Qt5LinguistTools_DIR" to a directory containing one of the above
  files.  If "Qt5LinguistTools" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  /home/mickael/mega/dev/desktop/src/MEGASync/mega/contrib/cmake/CMakeLists.txt:257 (find_package)
  CMakeLists.txt:97 (include)

I am using Ubuntu 22.04, fully updated. Here is the output of apt search qttools :

Sorting... Done
Full Text Search... Done
qt5-doc/now 5.15.3-1 all [installed,local]
  Qt 5 API Documentation

qtcharts5-doc/now 5.15.3-1 all [installed,local]
  Qt charts QCH documentation

qtscxml5-doc/now 5.15.3-1 all [installed,local]
  Qt SCXML QCH documentation

qtserialbus5-doc/now 5.15.3-1 all [installed,local]
  Qt serialbus serial bus access QCH documentation

qttools5-dev-tools/now 5.15.3-1 amd64 [installed,local]
  Qt 5 development tools

qttools5-doc/now 5.15.3-1 all [installed,local]
  Qt 5 tools documentation

As you can see, qttools5-dev-tools is already installed. There is no qttools5-dev package, I guess that it has been renamed to qttools5-dev-tools in Ubuntu 22 repository. The only relevant package that shows up searching for linguist is qttranslations-l10n and it is already installed :

qttranslations5-l10n/now 5.15.3-1 all [installed,local]
  translations for Qt 5

Still, there is no Qt5LinguistTools cmake file and I need to use qt5_add_translation() in my Cmake file.

Do you know which package / how can I use qt translation tools in Cmake?

Mickaël C. Guimarães
  • 1,020
  • 2
  • 14
  • 32
  • 1
    The online search states that [qttools5-dev](https://packages.ubuntu.com/jammy/amd64/qttools5-dev/filelist) package **exists** in Ubuntu 22.04, and exactly this package provides file `Qt5LinguistToolsConfig.cmake`. The package [qttools5-dev-tools](https://packages.ubuntu.com/jammy/amd64/qttools5-dev-tools/filelist) provides other files. – Tsyvarev Jun 23 '23 at 16:21
  • I marked your question as a duplicate of the one which you referenced, because the solution to your problem is the same as to duplicate one: install the package `qttools5-dev`. Your answer - adding `universe` repository - provides a "bridge" to the duplicate one - installing the package `qttools5-dev`. Note, that "duplicate" mark does NOT mean that your question is bad. The mark just prevents to post other answers to your question, because we (Stack Overflow community) tend to have all solutions to a problem in the single place. – Tsyvarev Jun 23 '23 at 18:25
  • 1
    ok, I agree. I didn't remove my question because someone might have the same issue as me, and might benefit from the "repository" issue I had. – Mickaël C. Guimarães Jun 25 '23 at 08:57

1 Answers1

1

It turns out that the issue was that I didn't have the "universe" repositories checked in Ubuntu, and qttools5-dev package is in universe repositories.

The solution was to enabled them, then run apt update and install the package.

Mickaël C. Guimarães
  • 1,020
  • 2
  • 14
  • 32