Commit 2c2e924bd9e13a7b5883a0697353e435de08c9c0

David Brooks 2019-05-21T20:17:48

We still need to update pkgconfig variables when zlib is unbundled (#5079).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c23e019..2469962 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -327,6 +327,11 @@ IF(NOT USE_BUNDLED_ZLIB)
 	IF(ZLIB_FOUND)
 		LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${ZLIB_INCLUDE_DIRS})
 		LIST(APPEND LIBGIT2_LIBS ${ZLIB_LIBRARIES})
+        IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+            LIST(APPEND LIBGIT2_PC_LIBS "-lz")
+        ELSE()
+            LIST(APPEND LIBGIT2_PC_REQUIRES "zlib")
+        ENDIF()
 		ADD_FEATURE_INFO(zlib ON "using system zlib")
 	ELSE()
 		MESSAGE(STATUS "zlib was not found; using bundled 3rd-party sources." )