-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathCMakeLists.txt
143 lines (119 loc) · 3.61 KB
/
CMakeLists.txt
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
project( kogmo_rtdb )
cmake_minimum_required(VERSION 2.8)
# Remove definitions that would include UniBw customizations to RTDB
# (see tas_build.cmake)
remove_definitions( ${RTDB_OBJECT_DEFS} )
file( GLOB RTDB_FUNCS ./objects/kogmo_rtdb_obj_*_funcs.c )
file( GLOB RTDB_RECORD ./record/kogmo_rtdb_avirawcodec.c ./record/kogmo_rtdb_timeidx.c )
set(SOURCES
rtdb/kogmo_rtdb_obj_local.c
rtdb/kogmo_rtdb_ipc_posix.c
rtdb/kogmo_rtdb_rtmalloc.c
rtdb/kogmo_time.c
rtdb/kogmo_rtdb_helpers.c
rtdb/kogmo_rtdb_housekeeping.c
rtdb/kogmo_rtdb_obj_base_funcs.c
rtdb/kogmo_rtdb_objdata.c
rtdb/kogmo_rtdb_objmeta.c
rtdb/kogmo_rtdb_objdata_slot.c
rtdb/kogmo_rtdb_trace.c
rtdb/kogmo_rtdb_utils.c
rtdb/rtmalloc/suba.c
${RTDB_FUNCS}
${RTDB_RECORD}
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include/
${CMAKE_CURRENT_SOURCE_DIR}/
${CMAKE_CURRENT_SOURCE_DIR}/rtdb/
${CMAKE_CURRENT_SOURCE_DIR}/objects/
)
add_definitions(
-DRTMALLOC_suba
-DKOGMO_RTDB_INCLUDE_A2_OBJECTS
-fPIC
-c
-Wall
-O2
-g
-Wstrict-prototypes
-fno-strict-aliasing
-D_GNU_SOURCE
-D_REENTRANT
)
# Build libkogmo_rtdb
add_library( kogmo_rtdb SHARED ${SOURCES} )
if(macx)
target_link_libraries( kogmo_rtdb pthread m c)
else()
target_link_libraries( kogmo_rtdb rt pthread m c)
endif()
FILE( GLOB API_HEADERS "include/*" )
install( FILES ${API_HEADERS} DESTINATION "include/kogmo_rtdb/" )
#set( OBJ_HEADERS
# ${CMAKE_CURRENT_SOURCE_DIR}/objects/kogmo_rtdb_obj_base.h
# ${CMAKE_CURRENT_SOURCE_DIR}/objects/kogmo_rtdb_obj_base_funcs.h
# ${CMAKE_CURRENT_SOURCE_DIR}/objects/kogmo_rtdb_obj_funcs.h
# ${CMAKE_CURRENT_SOURCE_DIR}/objects/kogmo_rtdb_obj_packing.h
# )
#install( FILES ${OBJ_HEADERS} DESTINATION "include/kogmo_rtdb/base" )
# Install for default target (libraries should do so)
add_custom_command( TARGET kogmo_rtdb
POST_BUILD
COMMAND make install
)
project( kogmo_rtdb_applications )
include_directories( BEFORE
${CMAKE_CURRENT_SOURCE_DIR}/include/
${CMAKE_CURRENT_SOURCE_DIR}/
${CMAKE_CURRENT_SOURCE_DIR}/rtdb/
${CMAKE_CURRENT_SOURCE_DIR}/objects/
)
add_definitions(
-DRTMALLOC_suba
-DKOGMO_RTDB_INCLUDE_A2_OBJECTS
-fPIC
-c
-Wall
-O2
-g
-Wstrict-prototypes
-D_GNU_SOURCE
-D_REENTRANT
)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
# Build kogmo_rtdb_man
add_executable( kogmo_rtdb_man rtdb/kogmo_rtdb_man.c )
target_link_libraries( kogmo_rtdb_man kogmo_rtdb )
# Build kogmo_rtdb_dump
add_executable( kogmo_rtdb_dump rtdb/kogmo_rtdb_dump.c )
target_link_libraries( kogmo_rtdb_dump kogmo_rtdb )
# Build kogmo_rtdb_play
add_executable( kogmo_rtdb_play record/kogmo_rtdb_play.c )
target_link_libraries( kogmo_rtdb_play kogmo_rtdb )
# Build kogmo_rtdb_record
add_executable( kogmo_rtdb_record record/kogmo_rtdb_record.c )
target_link_libraries( kogmo_rtdb_record kogmo_rtdb )
# Build kogmo_time_convert
add_executable( kogmo_time_convert rtdb/kogmo_time_convert.c )
target_link_libraries( kogmo_time_convert kogmo_rtdb )
# Build kogmo_rtdb_reader
add_executable( kogmo_rtdb_reader examples/kogmo_rtdb_reader.c )
target_link_libraries( kogmo_rtdb_reader kogmo_rtdb )
# Build kogmo_rtdb_writer
add_executable( kogmo_rtdb_writer examples/kogmo_rtdb_writer.c )
target_link_libraries( kogmo_rtdb_writer kogmo_rtdb )
# All of RTDB
add_custom_target( rtdb )
add_dependencies( rtdb
kogmo_rtdb
kogmo_rtdb_man
kogmo_rtdb_dump
kogmo_rtdb_record
kogmo_time_convert
kogmo_rtdb_play
kogmo_rtdb_reader
kogmo_rtdb_writer
)