Commit 60ee53df by Russell Belfer

Split examples CMakeLists.txt

Also, this converts the examples/CMakeLists.txt from explicitly
listing to just globbing for all the individual C files.
parent d31e5655
...@@ -409,38 +409,5 @@ IF (TAGS) ...@@ -409,38 +409,5 @@ IF (TAGS)
ENDIF () ENDIF ()
IF (BUILD_EXAMPLES) IF (BUILD_EXAMPLES)
FILE(GLOB_RECURSE EXAMPLE_SRC examples/network/*.c examples/network/*.h) ADD_SUBDIRECTORY(examples)
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)
ENDIF () ENDIF ()
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()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment