安装了带有自制软件的GTK+,但pkg_check_modules无法识别它



我正在尝试编译一个开源的repo,这需要gtk+在CMakeLists.txt文件:

pkg_check_modules (GTK     REQUIRED gtk+-2.0>=2.12)

所以我安装了gtk+-2.0与homebrew:

~  brew install gtk
Warning: gtk+-2.24.23 already installed

和确保pkg-config识别它,我已经尝试:

~  pkg-config --modversion gtk+-2.0
2.24.23

这是完全正确的,但是当我用ccmake ..配置项目时,我得到了错误:

CMake Error at /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPkgConfig.cmake:279 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPkgConfig.cmake:333 (_pkg_check_modules_internal)
  CMakeLists.txt:194 (pkg_check_modules)

我该如何解决这个问题?

你试过了吗

export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:$PKG_CONFIG_PATH

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"

从https://github.com/naxuroqa/Venom/issues/4

# issuecomment - 27215983

你只需要安装pkg-config:

brew install pkg-config

最新更新