diff options
Diffstat (limited to 'cmake/modules/FindLibgit2.cmake')
-rw-r--r-- | cmake/modules/FindLibgit2.cmake | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cmake/modules/FindLibgit2.cmake b/cmake/modules/FindLibgit2.cmake new file mode 100644 index 0000000..410eab0 --- /dev/null +++ b/cmake/modules/FindLibgit2.cmake | |||
@@ -0,0 +1,33 @@ | |||
1 | # - Try to find the libgit2 library | ||
2 | # Once done this will define | ||
3 | # | ||
4 | # LIBGIT2_FOUND - System has libgit2 | ||
5 | # LIBGIT2_INCLUDE_DIR - The libgit2 include directory | ||
6 | # LIBGIT2_LIBRARIES - The libraries needed to use libgit2 | ||
7 | # LIBGIT2_DEFINITIONS - Compiler switches required for using libgit2 | ||
8 | |||
9 | |||
10 | # use pkg-config to get the directories and then use these values | ||
11 | # in the FIND_PATH() and FIND_LIBRARY() calls | ||
12 | #FIND_PACKAGE(PkgConfig) | ||
13 | #PKG_SEARCH_MODULE(PC_LIBGIT2 libgit2) | ||
14 | |||
15 | SET(LIBGIT2_DEFINITIONS ${PC_LIBGIT2_CFLAGS_OTHER}) | ||
16 | |||
17 | FIND_PATH(LIBGIT2_INCLUDE_DIR NAMES git2.h | ||
18 | HINTS | ||
19 | ${PC_LIBGIT2_INCLUDEDIR} | ||
20 | ${PC_LIBGIT2_INCLUDE_DIRS} | ||
21 | ) | ||
22 | |||
23 | FIND_LIBRARY(LIBGIT2_LIBRARIES NAMES git2 | ||
24 | HINTS | ||
25 | ${PC_LIBGIT2_LIBDIR} | ||
26 | ${PC_LIBGIT2_LIBRARY_DIRS} | ||
27 | ) | ||
28 | |||
29 | |||
30 | INCLUDE(FindPackageHandleStandardArgs) | ||
31 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(libgit2 DEFAULT_MSG LIBGIT2_LIBRARIES LIBGIT2_INCLUDE_DIR) | ||
32 | |||
33 | MARK_AS_ADVANCED(LIBGIT2_INCLUDE_DIR LIBGIT2_LIBRARIES) | ||