summaryrefslogtreecommitdiff
path: root/examples/CMakeLists.txt
blob: 49edaec0f23082c6fdbd6dc539b898ec55885236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDES})
INCLUDE_DIRECTORIES(SYSTEM ${LIBGIT2_SYSTEM_INCLUDES})

FILE(GLOB_RECURSE SRC_EXAMPLE_GIT2 network/*.c network/*.h common.?)
ADD_EXECUTABLE(cgit2 ${SRC_EXAMPLE_GIT2})
SET_TARGET_PROPERTIES(cgit2 PROPERTIES C_STANDARD 90)

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})
	IF(NOT ${app_name} STREQUAL "common")
		ADD_EXECUTABLE(${app_name} ${src_app} "common.c")
		TARGET_LINK_LIBRARIES(${app_name} git2)
		SET_TARGET_PROPERTIES(${app_name} PROPERTIES C_STANDARD 90)
	ENDIF()
ENDFOREACH()