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
19a766a2
Commit
19a766a2
authored
Dec 18, 2012
by
Sascha Cunz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collect configuration options at the top of the file
- Also document the -DSTDCALL even better.
parent
521479b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
15 deletions
+27
-15
CMakeLists.txt
+27
-15
No files found.
CMakeLists.txt
View file @
19a766a2
...
...
@@ -14,6 +14,33 @@
PROJECT
(
libgit2 C
)
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.6
)
# Build options
#
OPTION
(
BUILD_SHARED_LIBS
"Build Shared Library (OFF for Static)"
ON
)
OPTION
(
THREADSAFE
"Build libgit2 as threadsafe"
OFF
)
OPTION
(
BUILD_CLAR
"Build Tests using the Clar suite"
ON
)
OPTION
(
BUILD_EXAMPLES
"Build library usage example apps"
OFF
)
OPTION
(
TAGS
"Generate tags"
OFF
)
OPTION
(
PROFILE
"Generate profiling information"
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 the CLR expects by
# default and how the Windows API is built.
#
# If you are writing a C or C++ program and want to link to libgit2, you have to
# either:
# - Add /Gz to the compiler options of _your_ program / library.
# - Turn this option off by invoking CMake with the "-DSTDCALL=Off" argument.
#
OPTION
(
STDCALL
"Build libgit2 with the __stdcall convention"
ON
)
ENDIF
()
# 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."
)
FILE
(
STRINGS
"include/git2/version.h"
GIT2_HEADER REGEX
"^#define LIBGIT2_VERSION
\"
[^
\"
]*
\"
$"
)
STRING
(
REGEX REPLACE
"^.*LIBGIT2_VERSION
\"
([0-9]+).*$"
"
\\
1"
LIBGIT2_VERSION_MAJOR
"
${
GIT2_HEADER
}
"
)
...
...
@@ -71,23 +98,8 @@ ELSE()
FILE
(
GLOB SRC_ZLIB deps/zlib/*.c
)
ENDIF
()
# 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."
)
# Build options
OPTION
(
BUILD_SHARED_LIBS
"Build Shared Library (OFF for Static)"
ON
)
OPTION
(
THREADSAFE
"Build libgit2 as threadsafe"
OFF
)
OPTION
(
BUILD_CLAR
"Build Tests using the Clar suite"
ON
)
OPTION
(
BUILD_EXAMPLES
"Build library usage example apps"
OFF
)
OPTION
(
TAGS
"Generate tags"
OFF
)
OPTION
(
PROFILE
"Generate profiling information"
OFF
)
# Platform specific compilation flags
IF
(
MSVC
)
# Default to stdcall, as that's what the CLR expects and how the Windows API is built
OPTION
(
STDCALL
"Buildl libgit2 with the __stdcall convention"
ON
)
STRING
(
REPLACE
"/Zm1000"
" "
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
"
)
...
...
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