mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Add a FindLIBGIT2 based on our FindMarble.
It currently searches for the .a (preferred) or the .so in the following directories, in order: ${CMAKE_CURRENT_SOURCE_DIR}/../libgit2, /usr/local, and /usr. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
46990f4ac8
commit
8b2ba50a62
1 changed files with 36 additions and 0 deletions
36
cmake/Modules/FindLIBGIT2.cmake
Normal file
36
cmake/Modules/FindLIBGIT2.cmake
Normal file
|
@ -0,0 +1,36 @@
|
|||
# - Try to find the LibGit2 Library
|
||||
# Once done this will define
|
||||
#
|
||||
# LIBGIT2_FOUND - system has LibGit2
|
||||
# LIBGIT2_INCLUDE_DIR - the LibGit2 include directory
|
||||
# LIBGIT2_LIBRARIES
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
# in cache already
|
||||
IF ( LIBGIT2_INCLUDE_DIR AND LIBGIT2_LIBRARIES )
|
||||
SET( LIBGIT2_FIND_QUIETLY TRUE )
|
||||
ENDIF ()
|
||||
|
||||
FIND_PATH( LIBGIT2_INCLUDE_DIR
|
||||
NAMES git2.h
|
||||
HINTS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../libgit2/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY( LIBGIT2_LIBRARIES
|
||||
NAMES
|
||||
libgit2.a
|
||||
git2
|
||||
HINTS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../libgit2/build
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
)
|
||||
SET(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -lssl -lcrypto)
|
||||
|
||||
INCLUDE( FindPackageHandleStandardArgs )
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS( git2 DEFAULT_MSG LIBGIT2_INCLUDE_DIR LIBGIT2_LIBRARIES )
|
Loading…
Add table
Reference in a new issue