37

My simple Dockerfile:

FROM ubuntu:18.04

RUN apt update && apt upgrade -y

RUN apt install build-essential cmake qt5-default -y

RUN apt install qttools5-dev-tools -y

When I check linguist inside the container it's there:

root@9087245330a7:/# which linguist
/usr/bin/linguist

...but when I configure my app inside the container:

CMake Error at CMakeLists.txt:72 (find_package):
  By not providing "FindQt5LinguistTools.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "Qt5LinguistTools", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5LinguistTools"
  (requested version 5.5.1) 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.

What is going on? This works on Ubuntu 16.04 just fine.

juzzlin
  • 45,029
  • 5
  • 38
  • 50

1 Answers1

75

The problem was that in Ubuntu 18.04+ you need to install also qttools5-dev in order to get /usr/lib/x86_64-linux-gnu/cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake.

juzzlin
  • 45,029
  • 5
  • 38
  • 50
  • 3
    Great answer to a non-intuitive problem – greuze Oct 09 '18 at 14:41
  • Working fine to install ksnip. The problem said: "Could not find a package configuration file provided by "Qt5LinguistTools" with any of the following names: Qt5LinguistToolsConfig.cmake qt5linguisttools-config.cmake" but now is solved installing qttools5-dev – Indacochea Wachín Oct 22 '19 at 07:21
  • This got me past building kcoreaddons on Kubuntu 22.04. (Just noting for anyone else who finds this answer as I did.) – Alan De Smet Dec 26 '22 at 03:07