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"
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}")