Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
c497a63b
Commit
c497a63b
authored
Oct 19, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1001 from veeti/build-fixes
Changes to CMake for packaging
parents
11c2a9c6
88e0fc05
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
14 deletions
+9
-14
CMakeLists.txt
+6
-11
README.md
+2
-2
libgit2.pc.in
+1
-1
No files found.
CMakeLists.txt
View file @
c497a63b
...
...
@@ -66,9 +66,9 @@ ELSE (ZLIB_FOUND)
ENDIF
()
# Installation paths
SET
(
INSTALL_BIN
bin CACHE PATH
"Where to install binaries to."
)
SET
(
BIN_INSTALL_DIR
bin CACHE PATH
"Where to install binaries to."
)
SET
(
LIB_INSTALL_DIR lib CACHE PATH
"Where to install libraries to."
)
SET
(
IN
STALL_INC
include CACHE PATH
"Where to install headers to."
)
SET
(
IN
CLUDE_INSTALL_DIR
include CACHE PATH
"Where to install headers to."
)
# Build options
OPTION
(
BUILD_SHARED_LIBS
"Build Shared Library (OFF for Static)"
ON
)
...
...
@@ -93,8 +93,8 @@ IF (MSVC)
# Precompiled headers
ELSE
()
SET
(
CMAKE_C_FLAGS_DEBUG
"-O0 -g
${
CMAKE_C_FLAGS
}
"
)
SET
(
CMAKE_C_FLAGS
"-O2 -g -D_GNU_SOURCE -Wall -Wextra -Wno-missing-field-initializers -Wstrict-aliasing=2 -Wstrict-prototypes -Wmissing-prototypes
${
CMAKE_C_FLAGS
}
"
)
SET
(
CMAKE_C_FLAGS_DEBUG
"-O0 -g"
)
IF
(
MINGW
)
# MinGW always does PIC and complains if we tell it to
STRING
(
REGEX REPLACE
"-fPIC"
""
CMAKE_SHARED_LIBRARY_C_FLAGS
"
${
CMAKE_SHARED_LIBRARY_C_FLAGS
}
"
)
ELSE
()
...
...
@@ -163,20 +163,15 @@ IF (MSVC)
SET_SOURCE_FILES_PROPERTIES
(
src/win32/precompiled.c COMPILE_FLAGS
"/Ycprecompiled.h"
)
ENDIF
()
# Backward compatibility with INSTALL_LIB variable
if
(
INSTALL_LIB
)
set
(
LIB_INSTALL_DIR
"
${
INSTALL_LIB
}
"
)
ENDIF
()
# Install
INSTALL
(
TARGETS git2
RUNTIME DESTINATION
${
INSTALL_BIN
}
RUNTIME DESTINATION
${
BIN_INSTALL_DIR
}
LIBRARY DESTINATION
${
LIB_INSTALL_DIR
}
ARCHIVE DESTINATION
${
LIB_INSTALL_DIR
}
)
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/libgit2.pc DESTINATION
${
LIB_INSTALL_DIR
}
/pkgconfig
)
INSTALL
(
DIRECTORY include/git2 DESTINATION
${
IN
STALL_INC
}
)
INSTALL
(
FILES include/git2.h DESTINATION
${
IN
STALL_INC
}
)
INSTALL
(
DIRECTORY include/git2 DESTINATION
${
IN
CLUDE_INSTALL_DIR
}
)
INSTALL
(
FILES include/git2.h DESTINATION
${
IN
CLUDE_INSTALL_DIR
}
)
# Tests
IF
(
BUILD_CLAR
)
...
...
README.md
View file @
c497a63b
...
...
@@ -66,9 +66,9 @@ For more advanced use or questions about CMake please read <http://www.cmake.org
The following CMake variables are declared:
-
`
INSTALL_BIN
`
: Where to install binaries to.
-
`
BIN_INSTALL_DIR
`
: Where to install binaries to.
-
`LIB_INSTALL_DIR`
: Where to install libraries to.
-
`IN
STALL_INC
`
: Where to install headers to.
-
`IN
CLUDE_INSTALL_DIR
`
: Where to install headers to.
-
`BUILD_SHARED_LIBS`
: Build libgit2 as a Shared Library (defaults to ON)
-
`BUILD_CLAR`
: Build
[
Clar
](
https://github.com/tanoku/clar
)
-based test suite (defaults to ON)
-
`THREADSAFE`
: Build libgit2 with threading support (defaults to OFF)
...
...
libgit2.pc.in
View file @
c497a63b
libdir=@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@
includedir=@CMAKE_INSTALL_PREFIX@/@IN
STALL_INC
@
includedir=@CMAKE_INSTALL_PREFIX@/@IN
CLUDE_INSTALL_DIR
@
Name: libgit2
Description: The git library, take 2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment