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
9a102446
Unverified
Commit
9a102446
authored
Mar 21, 2020
by
Edward Thomson
Committed by
GitHub
Mar 21, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5455 from pks-t/pks/cmake-install-dirs
cmake: use install directories provided via GNUInstallDirs
parents
44372ce5
87fc539f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
19 deletions
+12
-19
CMakeLists.txt
+1
-0
README.md
+3
-3
cmake/Modules/PkgBuildConfig.cmake
+3
-5
src/CMakeLists.txt
+5
-11
No files found.
CMakeLists.txt
View file @
9a102446
...
...
@@ -36,6 +36,7 @@ INCLUDE(AddCFlagIfSupported)
INCLUDE
(
FindPkgLibraries
)
INCLUDE
(
FindThreads
)
INCLUDE
(
FindStatNsec
)
INCLUDE
(
GNUInstallDirs
)
INCLUDE
(
IdeSplitSources
)
INCLUDE
(
FeatureSummary
)
INCLUDE
(
EnableWarnings
)
...
...
README.md
View file @
9a102446
...
...
@@ -247,9 +247,9 @@ For more advanced use or questions about CMake please read <https://cmake.org/Wi
The following CMake variables are declared:
-
`
BIN_INSTALL_
DIR`
: Where to install binaries to.
-
`
LIB_INSTALL_
DIR`
: Where to install libraries to.
-
`
INCLUDE_INSTALL_
DIR`
: Where to install headers to.
-
`
CMAKE_INSTALL_BIN
DIR`
: Where to install binaries to.
-
`
CMAKE_INSTALL_LIB
DIR`
: Where to install libraries to.
-
`
CMAKE_INSTALL_INCLUDE
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/vmg/clar
)
-based test suite (defaults to ON)
-
`THREADSAFE`
: Build libgit2 with threading support (defaults to ON)
...
...
cmake/Modules/PkgBuildConfig.cmake
View file @
9a102446
...
...
@@ -27,8 +27,8 @@ function(pkg_build_config)
# Write .pc "header"
file
(
WRITE
"
${
PKGCONFIG_FILE
}
"
"prefix=
\"
${
CMAKE_INSTALL_PREFIX
}
\"\n
"
"libdir=
\"
${
LIB_INSTALL_
DIR
}
\"\n
"
"includedir=
\"
${
INCLUDE_INSTALL_
DIR
}
\"\n
"
"libdir=
\"
${
CMAKE_INSTALL_FULL_LIB
DIR
}
\"\n
"
"includedir=
\"
${
CMAKE_INSTALL_FULL_INCLUDE
DIR
}
\"\n
"
"
\n
"
"Name:
${
PKGCONFIG_NAME
}
\n
"
"Description:
${
PKGCONFIG_DESCRIPTION
}
\n
"
...
...
@@ -73,7 +73,5 @@ function(pkg_build_config)
file
(
APPEND
"
${
PKGCONFIG_FILE
}
"
"Cflags: -I
\$
{includedir}
${
PKGCONFIG_CFLAGS
}
\n
"
)
# Install .pc file
install
(
FILES
"
${
PKGCONFIG_FILE
}
"
DESTINATION
"
${
LIB_INSTALL_DIR
}
/pkgconfig"
)
install
(
FILES
"
${
PKGCONFIG_FILE
}
"
DESTINATION
"
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig"
)
endfunction
()
src/CMakeLists.txt
View file @
9a102446
...
...
@@ -21,12 +21,6 @@ SET(LIBGIT2_INCLUDES
SET
(
LIBGIT2_SYSTEM_INCLUDES
""
)
SET
(
LIBGIT2_LIBS
""
)
# Installation paths
#
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
(
INCLUDE_INSTALL_DIR include CACHE PATH
"Where to install headers to."
)
# Enable tracing
IF
(
ENABLE_TRACE
)
SET
(
GIT_TRACE 1
)
...
...
@@ -391,9 +385,9 @@ ENDIF ()
# Install
INSTALL(TARGETS git2
RUNTIME DESTINATION
${
BIN_INSTALL_
DIR
}
LIBRARY DESTINATION
${
LIB_INSTALL_
DIR
}
ARCHIVE DESTINATION
${
LIB_INSTALL_
DIR
}
RUNTIME DESTINATION
${
CMAKE_INSTALL_BIN
DIR
}
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIB
DIR
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIB
DIR
}
)
INSTALL(DIRECTORY
${
libgit2_SOURCE_DIR
}
/include/git2 DESTINATION
${
INCLUDE_INSTALL_DIR
}
)
INSTALL(FILES
${
libgit2_SOURCE_DIR
}
/include/git2.h DESTINATION
${
INCLUDE_INSTALL_DIR
}
)
INSTALL(DIRECTORY
${
libgit2_SOURCE_DIR
}
/include/git2 DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
)
INSTALL(FILES
${
libgit2_SOURCE_DIR
}
/include/git2.h DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
)
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