forked from XiaochenCui/libtask
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
29 lines (22 loc) · 823 Bytes
/
CMakeLists.txt
File metadata and controls
29 lines (22 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
cmake_minimum_required(VERSION 3.10)
project(LIBTASK C)
set(C_STANDARD 89)
if(UNIX)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fomit-frame-pointer ")
endif()
message("Generated with config types: ${CMAKE_CONFIGURATION_TYPES}")
set(BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BUILD_DIR}/lib)
file(GLOB lib_files
${CMAKE_SOURCE_DIR}/src/*.c
${CMAKE_SOURCE_DIR}/src/*.h
)
add_library(task STATIC ${lib_files})
set(TARGET_LIST testdelay primes helloworld chan_1 chan_2 chan_3)
foreach (TARGET ${TARGET_LIST})
add_executable(${TARGET} examples/${TARGET}.c)
target_include_directories(${TARGET} PRIVATE src)
target_link_libraries(${TARGET} task)
endforeach()