【发布时间】:2014-06-28 07:18:24
【问题描述】:
我正在按照 README.md 文件中指定的 libgit2 安装说明进行操作。
指定为“安装前缀”的正确目录是什么?
这是来自 README.md 的相关摘录:
The `libgit2` library is built using [CMake](<http://www.cmake.org>) (version 2.6 or newer) on all platforms.
On most systems you can build the library using the following commands
$ mkdir build && cd build
$ cmake ..
$ cmake --build .
Alternatively you can point the CMake GUI tool to the CMakeLists.txt file and generate platform specific build project or IDE workspace.
To install the library you can specify the install prefix by setting:
$ cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix
$ cmake --build . --target install
【问题讨论】:
-
FTR,没有什么 libgit2 特定的。安装前缀与任何应用程序/库的所有其他构建系统中的相同。
-
@CarlosMartinNieto 很遗憾 libgit2 没有将其设置为合理的默认值,当它本应继续安装到最可能的位置时,我花了很多时间来解决这个问题。
-
CMake 会这样做,如果您不指定任何内容,它会尝试安装到
/usr/local/,这是用户安装的程序和库的正确默认值。跨度>
标签: libgit2