summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-05-14 23:09:26 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-05-14 23:40:20 +0200
commit3bbc87d697b24725beb8dcd41fa83ca604d3a9e2 (patch)
tree9614afe77e660933226ef453db0e0da73313f14a
parent000e68961cb44b04435a733e151f8b1357547bd1 (diff)
downloadlibgit2-3bbc87d697b24725beb8dcd41fa83ca604d3a9e2.tar.gz
CMake: allow appending a string to the library filename
This helps us install multiple versions of the library side-by-side.
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 402ff2226..1ffe1ddd4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,6 +24,7 @@ OPTION( BUILD_EXAMPLES "Build library usage example apps" OFF )
OPTION( TAGS "Generate tags" OFF )
OPTION( PROFILE "Generate profiling information" OFF )
OPTION( ENABLE_TRACE "Enables tracing support" OFF )
+OPTION( SONAME_APPEND "Append the given string to the library's filename" OFF )
IF(MSVC)
# This option is only availalbe when building with MSVC. By default,
# libgit2 is build using the stdcall calling convention, as that's what
@@ -304,6 +305,9 @@ MSVC_SPLIT_SOURCES(git2)
IF (SONAME)
SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING})
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR})
+ IF (SONAME_APPEND)
+ SET_TARGET_PROPERTIES(git2 PROPERTIES OUTPUT_NAME "git2-${SONAME_APPEND}")
+ ENDIF()
ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY)