构建Qt 5和CMake应用程序需要哪些软件包?
我正在尝试在Ubuntu 13.10上构建sdrangelove ,它需要Qt 5并使用CMake作为其构建系统。 我需要安装什么软件包来提供它要求的文件?
有很多*qt5*
包,我已经尝试安装有前途的那些没有效果。 我发现的所有讨论都要求事情正常或者正在讨论编写CMake构建规则而不是执行它们。 我对Debian / Ubuntu包装的组织经验不多。
CMake Error at CMakeLists.txt:14 (find_package): By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Core", but CMake did not find one. Could not find a package configuration file provided by "Qt5Core" (requested version 5.0) with any of the following names: Qt5CoreConfig.cmake qt5core-config.cmake Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set "Qt5Core_DIR" to a directory containing one of the above files. If "Qt5Core" provides a separate development package or SDK, be sure it has been installed.
我在尝试编译KeePassX 2.0时偶然发现了这个问题。
帮助我的是使用apt-file搜索丢失的包:
例如运行这个:
apt-file search Qt5CoreConfig.cmake
返回以下包:
qtbase5-dev:/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake
qtbase5-gles-dev:/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake
然后可以使用apt或apt-get安装这些软件包,例如:
sudo apt install qtbase5-dev
我遗失的两件事:
-
构建不成功后,我必须删除
CMakeCache.txt
(或者只是清除构建目录); 否则,即使已安装所需的软件包,cmake
也会报告相同的错误。 -
提供
*.cmake
配置文件的软件包的名称格式为qt*5-dev
,例如我的问题qtcore5-dev
的错误。
此外,可以通过rpm直接打包安装来修复安装问题(参见内容https://centos.pkgs.org/7/epel-x86_64/phonon-qt5-devel-4.8.3-2.el7.x86_64 .rpm.html )。
另一种可能性是通过“源代码构建和安装”: http : //www.linuxfromscratch.org/blfs/view/7.9/kde/phonon.html
这通常是由于通过“apt-get”不正确地安装了phonon4qt5(版本4.8.3)。 有时,这可以通过“synaptic”安装来解决缺失的libs /部分包。