-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
240 lines (210 loc) · 4.76 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
cmake_minimum_required(VERSION 3.20)
project(libdes)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
include(FindPkgConfig)
# numactl
pkg_check_modules(numactl REQUIRED IMPORTED_TARGET numa)
get_target_property(
NUMACTL_INC
PkgConfig::numactl
INTERFACE_INCLUDE_DIRECTORIES
)
# zlib
pkg_check_modules(zlib REQUIRED IMPORTED_TARGET zlib)
get_target_property(
ZLIB_INC
PkgConfig::zlib
INTERFACE_INCLUDE_DIRECTORIES
)
# libprim
pkg_check_modules(libprim REQUIRED IMPORTED_TARGET libprim)
get_target_property(
LIBPRIM_INC
PkgConfig::libprim
INTERFACE_INCLUDE_DIRECTORIES
)
# librnd
pkg_check_modules(librnd REQUIRED IMPORTED_TARGET librnd)
get_target_property(
LIBRND_INC
PkgConfig::librnd
INTERFACE_INCLUDE_DIRECTORIES
)
add_library(
des
SHARED
${PROJECT_SOURCE_DIR}/src/des/Logger.cc
${PROJECT_SOURCE_DIR}/src/des/Component.cc
${PROJECT_SOURCE_DIR}/src/des/Observer.cc
${PROJECT_SOURCE_DIR}/src/des/Event.cc
${PROJECT_SOURCE_DIR}/src/des/Time.cc
${PROJECT_SOURCE_DIR}/src/des/ActiveComponent.cc
${PROJECT_SOURCE_DIR}/src/des/MpScQueue.cc
${PROJECT_SOURCE_DIR}/src/des/Simulator.cc
${PROJECT_SOURCE_DIR}/src/des/Mapper.cc
${PROJECT_SOURCE_DIR}/src/des/util/RoundRobinMapper.cc
${PROJECT_SOURCE_DIR}/src/des/util/BasicObserver.cc
${PROJECT_SOURCE_DIR}/src/des/util/Scheduler.cc
${PROJECT_SOURCE_DIR}/src/des/util/SpinLock.cc
${PROJECT_SOURCE_DIR}/src/des/util/RandomMapper.cc
${PROJECT_SOURCE_DIR}/src/des/Mapper.h
${PROJECT_SOURCE_DIR}/src/des/timeconf.h
${PROJECT_SOURCE_DIR}/src/des/Time.h
${PROJECT_SOURCE_DIR}/src/des/Logger.h
${PROJECT_SOURCE_DIR}/src/des/Component.h
${PROJECT_SOURCE_DIR}/src/des/Event.h
${PROJECT_SOURCE_DIR}/src/des/Simulator.h
${PROJECT_SOURCE_DIR}/src/des/ActiveComponent.h
${PROJECT_SOURCE_DIR}/src/des/Observer.h
${PROJECT_SOURCE_DIR}/src/des/des.h
${PROJECT_SOURCE_DIR}/src/des/MpScQueue.h
${PROJECT_SOURCE_DIR}/src/des/cacheline_util.h
${PROJECT_SOURCE_DIR}/src/des/util/SpinLock.h
${PROJECT_SOURCE_DIR}/src/des/util/RandomMapper.h
${PROJECT_SOURCE_DIR}/src/des/util/BasicObserver.h
${PROJECT_SOURCE_DIR}/src/des/util/Scheduler.h
${PROJECT_SOURCE_DIR}/src/des/util/RoundRobinMapper.h
)
set_target_properties(
des
PROPERTIES
LINKER_LANGUAGE
CXX
POSITION_INDEPENDENT_CODE
ON
)
target_include_directories(
des
PUBLIC
${PROJECT_SOURCE_DIR}/src
${NUMACTL_INC}
${ZLIB_INC}
${LIBPRIM_INC}
${LIBRND_INC}
)
target_link_libraries(
des
PkgConfig::numactl
PkgConfig::zlib
PkgConfig::libprim
PkgConfig::librnd
)
include(GNUInstallDirs)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/Mapper.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/timeconf.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/Time.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/Logger.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/Component.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/Event.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/Simulator.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/ActiveComponent.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/Observer.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/des.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/MpScQueue.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/cacheline_util.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/util/SpinLock.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/util/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/util/RandomMapper.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/util/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/util/BasicObserver.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/util/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/util/Scheduler.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/util/
)
install(
FILES
${PROJECT_SOURCE_DIR}/src/des/util/RoundRobinMapper.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/des/util/
)
install(
TARGETS
des
)
configure_file(
${PROJECT_SOURCE_DIR}/libdes.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libdes.pc
@ONLY
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/libdes.pc
DESTINATION
${CMAKE_INSTALL_LIBDIR}/pkgconfig/
)