Commit c1cf1af4 by nulltoken

cmake: Add option to specify the name of the binary

parent 5a6e45cc
...@@ -27,7 +27,8 @@ OPTION( BUILD_EXAMPLES "Build library usage example apps" OFF ) ...@@ -27,7 +27,8 @@ OPTION( BUILD_EXAMPLES "Build library usage example apps" OFF )
OPTION( TAGS "Generate tags" OFF ) OPTION( TAGS "Generate tags" OFF )
OPTION( PROFILE "Generate profiling information" OFF ) OPTION( PROFILE "Generate profiling information" OFF )
OPTION( ENABLE_TRACE "Enables tracing support" OFF ) OPTION( ENABLE_TRACE "Enables tracing support" OFF )
OPTION( SONAME_APPEND "Append the given string to the library's filename" OFF ) OPTION( LIBGIT2_FILENAME "Name of the produced binary" OFF )
IF(MSVC) IF(MSVC)
# This option is only availalbe when building with MSVC. By default, # This option is only availalbe when building with MSVC. By default,
# libgit2 is build using the stdcall calling convention, as that's what # libgit2 is build using the stdcall calling convention, as that's what
...@@ -326,8 +327,9 @@ MSVC_SPLIT_SOURCES(git2) ...@@ -326,8 +327,9 @@ MSVC_SPLIT_SOURCES(git2)
IF (SONAME) IF (SONAME)
SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING}) SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING})
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR}) SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR})
IF (SONAME_APPEND) IF (LIBGIT2_FILENAME)
SET_TARGET_PROPERTIES(git2 PROPERTIES OUTPUT_NAME "git2-${SONAME_APPEND}") ADD_DEFINITIONS(-DLIBGIT2_FILENAME=\"${LIBGIT2_FILENAME}\")
SET_TARGET_PROPERTIES(git2 PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME})
ENDIF() ENDIF()
ENDIF() ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY)
......
#include <winver.h> #include <winver.h>
#include "../../include/git2/version.h" #include "../../include/git2/version.h"
#ifndef INCLUDE_LIB #ifndef LIBGIT2_FILENAME
#define LIBGIT2_FILENAME "git2.dll" # define LIBGIT2_FILENAME "git2"
#else
#define LIBGIT2_FILENAME "libgit2.dll"
#endif #endif
VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
...@@ -27,9 +25,9 @@ BEGIN ...@@ -27,9 +25,9 @@ BEGIN
BEGIN BEGIN
VALUE "FileDescription", "libgit2 - the Git linkable library\0" VALUE "FileDescription", "libgit2 - the Git linkable library\0"
VALUE "FileVersion", LIBGIT2_VERSION "\0" VALUE "FileVersion", LIBGIT2_VERSION "\0"
VALUE "InternalName", LIBGIT2_FILENAME "\0" VALUE "InternalName", LIBGIT2_FILENAME ".dll\0"
VALUE "LegalCopyright", "Copyright (C) the libgit2 contributors. All rights reserved.\0" VALUE "LegalCopyright", "Copyright (C) the libgit2 contributors. All rights reserved.\0"
VALUE "OriginalFilename", LIBGIT2_FILENAME "\0" VALUE "OriginalFilename", LIBGIT2_FILENAME ".dll\0"
VALUE "ProductName", "libgit2\0" VALUE "ProductName", "libgit2\0"
VALUE "ProductVersion", LIBGIT2_VERSION "\0" VALUE "ProductVersion", LIBGIT2_VERSION "\0"
VALUE "Comments", "For more information visit http://libgit2.github.com/\0" VALUE "Comments", "For more information visit http://libgit2.github.com/\0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment