3

我在 cmake 中使用 pkgconfig 链接到外部库。即使存在一个 external_package.pc 文件(具有明显正确的信息),cmake 也会给我一个错误。

CMakeLists 文件如下所示:

project(juicer)
set(VERSION 1.0)
# Find packages
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
find_package(Tracter REQUIRED)

FindTracter 文件如下所示:

find_package(PkgConfig)
pkg_check_modules(TRACTER REQUIRED tracter)

错误:

-- checking for module 'tracter'
--   package 'tracter' not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:279 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:333 (_pkg_check_modules_internal)
  cmake/FindTracter.cmake:10 (pkg_check_modules)
  CMakeLists.txt:22 (find_package)

我是使用 CMake 的新手,非常感谢您的帮助。谢谢阿克沙特

4

0 回答 0