Merge pull request #4468 from libgit2/cmn/openssl-pc Make sure to include 'openssl' as a dep when building statically with SHA1DC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c8389c2..b03b96a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -184,6 +184,7 @@ IF (USE_HTTPS)
LIST(APPEND LIBGIT2_INCLUDES ${OPENSSL_INCLUDE_DIR})
LIST(APPEND LIBGIT2_LIBS ${OPENSSL_LIBRARIES})
LIST(APPEND LIBGIT2_PC_LIBS ${OPENSSL_LDFLAGS})
+ LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
ELSEIF (HTTPS_BACKEND STREQUAL "WinHTTP")
# WinHTTP setup was handled in the WinHTTP-specific block above
ELSE()
@@ -210,7 +211,7 @@ IF(SHA1_BACKEND STREQUAL "OpenSSL")
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
LIST(APPEND LIBGIT2_PC_LIBS "-lssl")
ELSE()
- SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} openssl")
+ LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
ENDIF()
ELSEIF(SHA1_BACKEND STREQUAL "CollisionDetection")
ADD_FEATURE_INFO(SHA ON "using CollisionDetection")
@@ -265,7 +266,7 @@ IF(NOT USE_BUNDLED_ZLIB)
LIST(APPEND LIBGIT2_LIBS "z")
LIST(APPEND LIBGIT2_PC_LIBS "-lz")
ELSE()
- SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib")
+ LIST(APPEND LIBGIT2_PC_REQUIRES "zlib")
ENDIF()
ADD_FEATURE_INFO(zlib ON "using system zlib")
ELSE()
@@ -439,6 +440,9 @@ IF (SONAME)
SET_TARGET_PROPERTIES(git2 PROPERTIES PREFIX "${LIBGIT2_PREFIX}")
ENDIF()
ENDIF()
+
+LIST(REMOVE_DUPLICATES LIBGIT2_PC_REQUIRES)
+STRING(REPLACE ";" " " LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES}")
STRING(REPLACE ";" " " LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS}")
CONFIGURE_FILE(${libgit2_SOURCE_DIR}/libgit2.pc.in ${libgit2_BINARY_DIR}/libgit2.pc @ONLY)