Commit 9a668abd34f2e2157e2f2c9400614c30fe58af14

Marc Strapetz 2016-03-15T18:32:37

Option "LIBGIT2_PREFIX" to set the CMAKE's TARGET_PROPERTIES PREFIX This is especially useful in combination with MinGW to yield the Windows-compliant DLL name "git2.dll" instead of "libgit2.dll"

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b211a2e..c79b263 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -608,6 +608,8 @@ IF (SONAME)
 	IF (LIBGIT2_FILENAME)
 		ADD_DEFINITIONS(-DLIBGIT2_FILENAME=\"${LIBGIT2_FILENAME}\")
 		SET_TARGET_PROPERTIES(git2 PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME})
+	ELSEIF (DEFINED LIBGIT2_PREFIX)
+		SET_TARGET_PROPERTIES(git2 PROPERTIES PREFIX "${LIBGIT2_PREFIX}")
 	ENDIF()
 ENDIF()
 STRING(REPLACE ";" " " LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS}")