Split examples CMakeLists.txt

Also, this converts the examples/CMakeLists.txt from explicitly
listing to just globbing for all the individual C files.
This commit is contained in:
Russell Belfer
2013-09-03 15:20:16 -07:00
parent d31e5655c2
commit 60ee53dfce
2 changed files with 15 additions and 34 deletions
+14
View File
@@ -0,0 +1,14 @@
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()