build.sh: if new enough libgit2 is installed, use it

Right now this is only designed for Linux where current distros all should have
a new enough libgit2 (and our instructions tell people to install this with
system tools, so we should also use it).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-01-16 15:56:56 -08:00
parent c749498beb
commit 73641c4e73
3 changed files with 53 additions and 40 deletions

View file

@ -22,8 +22,13 @@ HINTS
/usr/include
)
IF ( LIBGIT2_DYNAMIC )
SET( LIBGIT2_SO libgit2.so )
ENDIF()
FIND_LIBRARY( LIBGIT2_LIBRARIES
NAMES
${LIBGIT2_SO}
libgit2.a
git2
HINTS
@ -36,4 +41,4 @@ SET(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -lssl -lcrypto)
INCLUDE( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( git2 DEFAULT_MSG LIBGIT2_INCLUDE_DIR LIBGIT2_LIBRARIES )
include_directories(${LIBGIT2_INCLUDE_DIR}})
include_directories(${LIBGIT2_INCLUDE_DIR}})