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
953e1f93
Commit
953e1f93
authored
Jun 13, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: Cleanup CMake
parent
1a7b52dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
30 deletions
+11
-30
CMakeLists.txt
+11
-30
No files found.
CMakeLists.txt
View file @
953e1f93
...
@@ -24,14 +24,6 @@ SET(LIBGIT2_VERSION_STRING "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${
...
@@ -24,14 +24,6 @@ SET(LIBGIT2_VERSION_STRING "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${
# Find required dependencies
# Find required dependencies
INCLUDE_DIRECTORIES
(
deps/zlib src include
)
INCLUDE_DIRECTORIES
(
deps/zlib src include
)
# Try finding openssl
FIND_PACKAGE
(
OpenSSL
)
IF
(
OPENSSL_CRYPTO_LIBRARIES
)
SET
(
SHA1_TYPE
"openssl"
CACHE STRING
"Which SHA1 implementation to use: builtin, ppc, openssl"
)
ELSEIF
()
SET
(
SHA1_TYPE
"builtin"
CACHE STRING
"Which SHA1 implementation to use: builtin, ppc"
)
ENDIF
()
# Installation paths
# Installation paths
SET
(
INSTALL_BIN bin CACHE PATH
"Where to install binaries to."
)
SET
(
INSTALL_BIN bin CACHE PATH
"Where to install binaries to."
)
SET
(
INSTALL_LIB lib CACHE PATH
"Where to install libraries to."
)
SET
(
INSTALL_LIB lib CACHE PATH
"Where to install libraries to."
)
...
@@ -68,20 +60,9 @@ IF (WIN32 AND NOT CYGWIN)
...
@@ -68,20 +60,9 @@ IF (WIN32 AND NOT CYGWIN)
FILE
(
GLOB SRC_PLAT src/win32/*.c
)
FILE
(
GLOB SRC_PLAT src/win32/*.c
)
ENDIF
()
ENDIF
()
# Specify sha1 implementation
IF
(
SHA1_TYPE STREQUAL
"ppc"
)
ADD_DEFINITIONS
(
-DPPC_SHA1
)
FILE
(
GLOB SRC_SHA1 src/ppc/*.c
)
ELSEIF
(
SHA1_TYPE STREQUAL
"openssl"
)
ADD_DEFINITIONS
(
-DOPENSSL_SHA1
)
SET
(
SRC_SHA1
)
INCLUDE_DIRECTORIES
(
${
OPENSSL_INCLUDE_DIR
}
)
SET
(
LIB_SHA1
${
OPENSSL_CRYPTO_LIBRARIES
}
)
ENDIF
()
# Compile and link libgit2
# Compile and link libgit2
ADD_LIBRARY
(
git2
${
SRC
}
${
SRC_PLAT
}
${
SRC_SHA1
}
${
SRC_ZLIB
}
)
ADD_LIBRARY
(
git2
${
SRC
}
${
SRC_PLAT
}
${
SRC_SHA1
}
${
SRC_ZLIB
}
)
TARGET_LINK_LIBRARIES
(
git2
${
LIB_SHA1
}
${
CMAKE_THREAD_LIBS_INIT
}
)
TARGET_LINK_LIBRARIES
(
git2
${
CMAKE_THREAD_LIBS_INIT
}
)
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
}
)
...
@@ -95,13 +76,13 @@ INSTALL(DIRECTORY include/git2 DESTINATION ${INSTALL_INC} )
...
@@ -95,13 +76,13 @@ INSTALL(DIRECTORY include/git2 DESTINATION ${INSTALL_INC} )
INSTALL
(
FILES include/git2.h DESTINATION
${
INSTALL_INC
}
)
INSTALL
(
FILES include/git2.h DESTINATION
${
INSTALL_INC
}
)
# Tests
# Tests
#
IF (BUILD_TESTS)
IF
(
BUILD_TESTS
)
#
SET(TEST_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/tests/resources" CACHE PATH "Path to test resources.")
SET
(
TEST_RESOURCES
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/tests/resources"
CACHE PATH
"Path to test resources."
)
#
ADD_DEFINITIONS(-DTEST_RESOURCES=\"${TEST_RESOURCES}\")
ADD_DEFINITIONS
(
-DTEST_RESOURCES=\
"
${
TEST_RESOURCES
}
\"
)
#
#
INCLUDE_DIRECTORIES(tests)
INCLUDE_DIRECTORIES(tests)
# ADD_EXECUTABLE(libgit2_test tests/libgit2_test.cpp
)
FILE(GLOB SRC_TEST tests/t??-*.c
)
# TARGET_LINK_LIBRARIES(libgit2_test git2 ${LIB_SHA1} ${CMAKE_THREAD_LIBS_INIT})
#
ADD_EXECUTABLE(libgit2_test tests/test_main.c tests/test_lib.c tests/test_helpers.c
${
SRC
}
${
SRC_PLAT
}
${
SRC_SHA1
}
${
SRC_TEST
}
${
SRC_ZLIB
}
)
# ADD_TEST(libgit2_test libgit2_test
)
TARGET_LINK_LIBRARIES(libgit2_test
${
CMAKE_THREAD_LIBS_INIT
}
)
#
ENDIF ()
ENDIF ()
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