Skip to content

Commit cef2099

Browse files
committed
Allow libgit2 location override for redis backend
1 parent e47313d commit cef2099

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

redis/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
PROJECT(libgit2-redis C)
22
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
33

4-
INCLUDE(../CMake/FindLibgit2.cmake)
54
INCLUDE(../CMake/FindHiredis.cmake)
65

76
# Build options
87
OPTION (BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON)
98
OPTION (BUILD_TESTS "Build Tests" ON)
9+
SET (PC_LIBGIT2_LIBRARY_DIRS "" CACHE STRING "libgit2 path")
10+
SET (PC_LIBGIT2_INCLUDE_DIRS "" CACHE STRING "libgit2 include directories")
11+
12+
# Allow overriding to local libgit2. I'm pretty sure I'm doing this wrong.
13+
IF (${PC_LIBGIT2_INCLUDE_DIRS} STREQUAL "")
14+
INCLUDE(../CMake/FindLibgit2.cmake)
15+
ELSE ()
16+
SET (LIBGIT2_LIBRARIES ${PC_LIBGIT2_LIBRARY_DIRS})
17+
SET (LIBGIT2_INCLUDE_DIRS ${PC_LIBGIT2_INCLUDE_DIRS})
18+
ENDIF ()
1019

1120
# Build Release by default
1221
IF (NOT CMAKE_BUILD_TYPE)

0 commit comments

Comments
 (0)