构建massif-visualizer:include无法找到加载文件CMakeFindDependencyMacro

时间:2018-03-17 18:52:56

标签: cmake centos valgrind centos7 massif

我正在尝试在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软件包很大程度上是通过试验和错误添加到yum命令,以及来自CMake错误消息的一些模式匹配......但我似乎无法弄清楚如何解决这些最后的错误:

-- 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)太旧了吗?或其他什么?

1 个答案:

答案 0 :(得分:1)

是的,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 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会话中的终端。