cmake - 如何设置 gperftools 路径变量 GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR?

标签 cmake catkin

在 catkin 项目中 catkin_make 失败。 CMakeLists 包括

find_package(Gperftools REQUIRED) 

我已经安装了 google-perftools:
google-perftools is already the newest version (2.4-0ubuntu5)

CMake 错误说它找不到 gperftools,或者至少找不到路径变量:
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Gperftools (missing: GPERFTOOLS_LIBRARIES
  GPERFTOOLS_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  tuw_mpn/FindGperftools.cmake:39 (find_package_handle_standard_args)
  tuw_mpn/CMakeLists.txt:40 (find_package)

经过几个小时的搜索,我还没有找到设置的描述。有人可以解释我如何解决这个错误吗?

提前致谢,我希望我已经为这个问题提供了足够的信息。

干杯,
迈克尔

最佳答案

不确定是哪个脚本 FindGperftools.cmake你用,但是this one搜索图书馆 tcmalloc_and_profiler和标题 gperftools/heap-profiler.h .

但包google-perftools doesn't provide这些文件。 (实际上,这个包不提供任何头文件或库。)

图书馆是provided来自 libgoogle-perftools4包裹。可能应该有一些提供标题的开发包。

关于cmake - 如何设置 gperftools 路径变量 GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40706802/

相关文章:

c++ - CXX 编译器标识未知 : xcode

c++ - 带有在项目中生成的 Qt automoc 文件的 CLion

windows - Windows下使用通过MSYS2安装的cmake 3.5.2, "MinGW Makefiles"生成器丢失

c++ - 使用ros launch创建一个目录,然后将它的路径传递给不同的节点

c++ - catkin_make »/usr/bin/ld : cannot find -lcsparse

静态库的c++链接器错误

c++ - ROS 与 QtCreator : autocompletion

docker - 无法在Dockerfile中使用* RUN *执行* catkin *命令

c++ - 无法将库与 cmake 中的测试二进制文件链接

c++ - CMake: `include_directories` 与 `target_link_libraries` 有什么区别