【发布时间】:2015-05-29 08:08:57
【问题描述】:
首先:我使用 OS X 10.10 Yosemite,我从终端完成所有操作,不涉及 XCode IDE 或其他 GUI。我从 Homebrew 安装了 pkg-config 0.28 版。
我想构建一些依赖于 Ogre 1.8 的软件。我构建并安装了 OGRE(通过 CMAKE_INSTALL_PREFIX)到我的主目录中的自定义位置。
布局如下:
~/install/bin contains binaries
~/install/include contains OGRE include headers
~/install/lib contains static libraries, e.g. libOgreMainStatic.a
~/install/lib/pkgconfig contains *.pc files for Ogre, e.g. OGRE.pc
在我将路径添加到 PKG_CONFIG_PATH 之前,我得到了这个:
$ pkg-config --variable pc_path OGRE
Package OGRE was not found in the pkg-config search path.
Perhaps you should add the directory containing `OGRE.pc'
to the PKG_CONFIG_PATH environment variable
No package 'OGRE' found
这是预期的行为。然后我将 ~/install/lib/pkgconfig 添加到我的 PKG_CONFIG_PATH 中,如下所示:
$ export PKG_CONFIG_PATH=~/install/lib/pkgconfig
$ echo $PKG_CONFIG_PATH
/Users/myusername/install/lib/pkgconfig
跑步
$ pkg-config --variable pc_path OGRE
<empty line while I expected the path to OGRE.pc>
再次只显示一个空行,但没有错误消息。
当我现在为要构建的软件运行 CMake 时,它会说:
$ cmake .
<snip>
-- checking for module 'OGRE'
-- package 'OGRE' not found
我做错了什么?在 Linux 上,它使用相同的命令。
【问题讨论】:
标签: build homebrew pkg-config