CMakeLists.txt 611 Bytes
Newer Older
1 2 3
LINK_DIRECTORIES(${LIBGIT2_LIBDIRS})
INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDES})

4
FILE(GLOB_RECURSE SRC_EXAMPLE_GIT2 network/*.c network/*.h common.?)
5 6 7 8 9 10 11 12 13 14
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})
15 16 17 18
	IF(NOT ${app_name} STREQUAL "common")
		ADD_EXECUTABLE(${app_name} ${src_app} "common.c")
		TARGET_LINK_LIBRARIES(${app_name} git2)
	ENDIF()
19
ENDFOREACH()