在ubuntu 16.04

时间:2016-11-28 09:51:39

标签: ubuntu cmake dlib

我已根据official site上的说明安装了dlib。我也按照例子进行了单元测试,一切都很好。

但是我的Cmake在另一个项目中无法通过find_package(dlib REQUIRED)找到它,并提供了以下错误消息

  Could not find a package configuration file provided by "dlib" with any of
  the following names:

    dlibConfig.cmake
    dlib-config.cmake

  Add the installation prefix of "dlib" to CMAKE_PREFIX_PATH or set
  "dlib_DIR" to a directory containing one of the above files.  If "dlib"
  provides a separate development package or SDK, be sure it has been
  installed.

请帮助,谢谢!

如果我没记错,在ubuntu 14.04上没有这样的问题,message(STATUS ${dlib_DIR} ${dlib_LIB})应该提供类似/usr/local/lib/cmake/dlib/usr/local/lib/libdlib.so的内容。

1 个答案:

答案 0 :(得分:1)

事实证明,我必须添加include(xxx/dlib/dlib/cmake)才能让cmake知道该库。

我完全忘了手动将文件放在/usr/local/lib/cmake/dlib, /usr/local/lib/libdlib.so目录中,以方便将它们包含在Ubuntu 14.04系统中。