构建 massif-visualizer:包括找不到加载文件 CMakeFindDependencyMacro

Building massif-visualizer: include could not find load file CMakeFindDependencyMacro

我正在尝试在 CentOS 7 上构建 massif-visualizer。不幸的是,我不得不尝试猜测依赖项,因为它们并未全部列在 INSTALL 文件中。到目前为止:

yum install git
yum install kdelibs-devel extra-cmake-modules \
            qt5-qtsvg-devel qt5-qtxmlpatterns-devel \
            kf5-kparts-devel kf5-karchive-devel
git clone https://github.com/KDE/massif-visualizer
cd massif-visualizer
mkdir build
(cd build && cmake .. && make && make install)

这些 Qt5 和 KF5 包主要是通过反复试验以及来自 CMake 错误消息的一些模式匹配添加到 yum 命令中的……但我似乎无法弄清楚如何解决这些最后的错误:

-- Could not set up the appstream test. appstreamcli is missing.
CMake Error at /usr/lib64/cmake/KF5Archive/KF5ArchiveConfig.cmake:37 (include):
  include could not find load file:

    CMakeFindDependencyMacro
Call Stack (most recent call first):
  /usr/share/ECM/find-modules/FindKF5.cmake:74 (find_package)
  CMakeLists.txt:34 (find_package)


CMake Error at /usr/lib64/cmake/KF5Archive/KF5ArchiveConfig.cmake:38 (find_dependency):
  Unknown CMake command "find_dependency".
Call Stack (most recent call first):
  /usr/share/ECM/find-modules/FindKF5.cmake:74 (find_package)
  CMakeLists.txt:34 (find_package)

这是因为在CentOS 7 上,CMake (2.8.12.2) 太旧了吗?还是别的?

是的,CMake 2.8.12.2 太旧了。请改用 CMake 3:

yum install epel-release
yum install cmake3

(cd build && cmake3 .. && make && make install)
#                 ^

现在安装抱怨 KChart 但这是一个单独的问题。


最后,这是我的完整步骤:

yum install epel-release
yum install subversion git cmake3 tar wget
yum install boost boost-devel
yum install kdelibs-devel extra-cmake-modules \
   graphviz-devel kdepim-devel \
   qt5-qtsvg-devel qt5-qtxmlpatterns-devel \
   kf5-kparts-devel kf5-karchive-devel \
   kf5-kiconthemes-devel kf5-kdoctools-devel
git clone https://github.com/KDE/massif-visualizer
wget https://download.kde.org/stable/kgraphviewer/2.4.0/kgraphviewer-2.4.0.tar.xz
wget https://download.kde.org/stable/kdiagram/2.6.0/src/kdiagram-2.6.0.tar.xz
tar xf kgraphviewer-2.4.0.tar.xz
tar xf kdiagram-2.6.0.tar.xz

for DIR in kgraphviewer-2.4.0 kdiagram-2.6.0 massif-visualizer
do
   cd $DIR
   mkdir build
   (cd build && cmake3 .. && make && make install)
   cd -
done

然后 valgrind --tool=massif myApp 最后 massif-visualiser massif.out.<PID> 来自 KDE 会话中的终端。