web-dev-qa-db-fra.com

CMake ne peut pas trouver Qt5LinguistTools dans Docker / Ubuntu 18.04

Mon Dockerfile simple:

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

Quand je vérifie linguist à l'intérieur du conteneur, c'est là:

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

... mais quand je configure mon application à l'intérieur du conteneur:

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.

Que se passe-t-il? Cela fonctionne sur Ubuntu 16.04 ça va.

12
juzzlin

Le problème était que dans Ubuntu 18.04+, vous devez également installer qttools5-dev afin d'obtenir /usr/lib/x86_64-linux-gnu/cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake.

15
juzzlin