forked from mryndzionek/esm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Core.cmake
79 lines (70 loc) · 2.04 KB
/
Core.cmake
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
set(ESM_CORE_SOURCES
"${CMAKE_CURRENT_LIST_DIR}/core/src/esm.c"
"${CMAKE_CURRENT_LIST_DIR}/core/src/esm_internal.c"
"${CMAKE_CURRENT_LIST_DIR}/core/src/esm_list.c"
"${CMAKE_CURRENT_LIST_DIR}/core/src/esm_queue.c"
"${CMAKE_CURRENT_LIST_DIR}/core/src/esm_timer.c"
"${CMAKE_CURRENT_LIST_DIR}/trace/src/trace.c"
"${CMAKE_CURRENT_LIST_DIR}/trace/src/rb.c"
)
set(ESM_CORE_HEADERS
"${CMAKE_CURRENT_LIST_DIR}/core/include"
"${CMAKE_CURRENT_LIST_DIR}/trace/include"
"${CMAKE_CURRENT_LIST_DIR}/modules/include"
)
macro(def_esm_app APPLICATION_NAME)
set(APP_NAME ${APPLICATION_NAME})
add_executable(${APP_NAME} "")
target_sources(${APP_NAME}
PUBLIC
${ESM_PLATFORM_SOURCES}
${ESM_CORE_SOURCES}
)
target_include_directories(${APP_NAME}
PUBLIC
${ESM_PLATFORM_HEADERS}
${ESM_CORE_HEADERS}
)
def_esm_platform()
endmacro(def_esm_app)
macro(end_esm_app)
if(${ESM_HSM})
target_sources(${APP_NAME}
PUBLIC
"${CMAKE_SOURCE_DIR}/core/src/hesm.c"
)
target_compile_definitions(${APP_NAME}
PRIVATE
-DESM_HSM
)
endif()
set(mSigs "")
foreach(ms ${ESM_APP_SIGNALS})
list(APPEND mSigs "ESM_SIGNAL(${ms})")
endforeach(ms)
string(REPLACE ";" " " mSigsStr "${mSigs}")
target_compile_definitions(${APP_NAME}
PUBLIC
-DESM_APP_SIGNALS=${mSigsStr}
)
set(mIds "")
foreach(ms ${ESM_APP_IDS})
list(APPEND mIds "ESM_ID(${ms})")
endforeach(ms)
string(REPLACE ";" " " mIdsStr "${mIds}")
target_compile_definitions(${APP_NAME}
PUBLIC
-DESM_APP_IDS=${mIdsStr}
)
set(mGrs "")
foreach(ms ${ESM_APP_GROUPS})
list(APPEND mGrs "ESM_GROUP(${ms})")
endforeach(ms)
string(REPLACE ";" " " mGrsStr "${mGrs}")
target_compile_definitions(${APP_NAME}
PUBLIC
-DESM_APP_GROUPS=${mGrsStr}
)
end_esm_platform()
unset(APP_NAME)
endmacro(end_esm_app)