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
6700cb99
Commit
6700cb99
authored
Sep 03, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1828 from libgit2/examples-cmakelists
Split examples CMakeLists.txt
parents
d31e5655
60ee53df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
34 deletions
+15
-34
CMakeLists.txt
+1
-34
examples/CMakeLists.txt
+14
-0
No files found.
CMakeLists.txt
View file @
6700cb99
...
...
@@ -409,38 +409,5 @@ IF (TAGS)
ENDIF ()
IF (BUILD_EXAMPLES)
FILE(GLOB_RECURSE EXAMPLE_SRC examples/network/*.c examples/network/*.h)
ADD_EXECUTABLE(cgit2
${
EXAMPLE_SRC
}
)
IF(WIN32 OR ANDROID)
TARGET_LINK_LIBRARIES(cgit2 git2)
ELSE()
TARGET_LINK_LIBRARIES(cgit2 git2 pthread)
ENDIF()
ADD_EXECUTABLE(git-diff examples/diff.c)
TARGET_LINK_LIBRARIES(git-diff git2)
ADD_EXECUTABLE(git-general examples/general.c)
TARGET_LINK_LIBRARIES(git-general git2)
ADD_EXECUTABLE(git-showindex examples/showindex.c)
TARGET_LINK_LIBRARIES(git-showindex git2)
ADD_EXECUTABLE(git-rev-list examples/rev-list.c)
TARGET_LINK_LIBRARIES(git-rev-list git2)
ADD_EXECUTABLE(git-rev-parse examples/rev-parse.c)
TARGET_LINK_LIBRARIES(git-rev-parse git2)
ADD_EXECUTABLE(git-log examples/log.c)
TARGET_LINK_LIBRARIES(git-log git2)
ADD_EXECUTABLE(git-status examples/status.c)
TARGET_LINK_LIBRARIES(git-status git2)
ADD_EXECUTABLE(git-init examples/init.c)
TARGET_LINK_LIBRARIES(git-init git2)
ADD_EXECUTABLE(git-cat-file examples/cat-file.c)
TARGET_LINK_LIBRARIES(git-cat-file git2)
ADD_SUBDIRECTORY(examples)
ENDIF ()
examples/CMakeLists.txt
0 → 100644
View file @
6700cb99
FILE
(
GLOB_RECURSE SRC_EXAMPLE_GIT2 network/*.c network/*.h
)
ADD_EXECUTABLE
(
cgit2
${
SRC_EXAMPLE_GIT2
}
)
IF
(
WIN32 OR ANDROID
)
TARGET_LINK_LIBRARIES
(
cgit2 git2
)
ELSE
()
TARGET_LINK_LIBRARIES
(
cgit2 git2 pthread
)
ENDIF
()
FILE
(
GLOB SRC_EXAMPLE_APPS RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*.c
)
FOREACH
(
src_app
${
SRC_EXAMPLE_APPS
}
)
STRING
(
REPLACE
".c"
""
app_name
${
src_app
}
)
ADD_EXECUTABLE
(
${
app_name
}
${
src_app
}
)
TARGET_LINK_LIBRARIES
(
${
app_name
}
git2
)
ENDFOREACH
()
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