-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcosmos-core.pri
386 lines (316 loc) · 14.5 KB
/
cosmos-core.pri
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# Global COSMOS qmake include file
# Include this file if you want to use COSMOS within Qt Creator
# if you are compiling with a GCC compiler we suggest that you add '-j'
# to the make arguments to speed up the compilation time
# The reason to keep the variable COSMOS_SOURCE_CORE instead of just COSMOS_SOURCE/core
# is that if for any reason the core folder is not named "core" (ex: when downloading the master
# from bitbucket and unzipping it out of place) then the user can still compile the code within core
# define the COSMOS_SOURCE variable by default
COSMOS_SOURCE_CORE = $$PWD
COSMOS_SOURCE = $$COSMOS_SOURCE_CORE/..
#message(" ")
message("cosmos-core.pri >>")
################################################################################
# Mac config
################################################################################
macx { #mac
#message( "Building on MAC OS X" )
}
################################################################################
# Unix config
################################################################################
unix:!macx {
#message( "Building on Unix" )
# add libraries
LIBS += -pthread #-ljpeg
}
#message("")
#message("COSMOS Modules >>")
#--------------------------------------------------------------------
#add COSMOS support to the path
INCLUDEPATH += $$COSMOS_SOURCE_CORE/libraries # generic path to allow for math/types.h etc.
INCLUDEPATH += $$COSMOS_SOURCE_CORE/libraries/agent
INCLUDEPATH += $$COSMOS_SOURCE_CORE/libraries/math
INCLUDEPATH += $$COSMOS_SOURCE_CORE/libraries/support
INCLUDEPATH += $$COSMOS_SOURCE_CORE/libraries/thirdparty
INCLUDEPATH += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib
INCLUDEPATH += $$COSMOS_SOURCE_CORE/libraries/thirdparty/jpeg
#--------------------------------------------------------------------
# Add all COSMOS support libraries
contains(MODULES, SUPPORT) {
message( "Add library: SUPPORT" )
#SOURCES += $$files($$COSMOS_SOURCE_CORE/libraries/support/*.cpp)
#HEADERS += $$files($$COSMOS_SOURCE_CORE/libraries/support/*.h)
MODULES += ZLIB
}
# -----------------------------------------------
# Tier 1 libraries,
# these libraries depend on Tier 0 libraries
contains(MODULES, agentlib){
message( "- support/agentlib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/agent/agentclass.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/agent/agentclass.h
MODULES += socketlib # agentlib depends on socketlib
MODULES += sliplib # and sliplib
MODULES += elapsedtime # and elapsedtime
MODULES += jsonlib
MODULES += timelib
MODULES += timeutils
MODULES += stringlib
MODULES += datalib
MODULES += cosmoserrno
}
contains(MODULES, elapsedtime){
message( "- support/elapsedtime" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/elapsedtime.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/elapsedtime.h
}
contains(MODULES, socketlib){
message( "- support/socketlib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/socketlib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/socketlib.h
MODULES += mathlib
}
contains(MODULES, jsondef){
message( "- support/jsondef" )
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/jsondef.h
}
contains(MODULES, jsonlib){
message( "- support/jsonlib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/jsonlib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/jsonlib.h
MODULES += convertlib
MODULES += objlib
}
contains(MODULES, objlib){
message( "- support/objlib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/objlib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/objlib.h
MODULES += mathlib
}
contains(MODULES, timelib){
message( "- support/timelib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/timelib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/timelib.h
MODULES += ephemlib
MODULES += datalib
}
contains(MODULES, datalib){
message( "- support/datalib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/datalib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/datalib.h
MODULES += zlib
MODULES += datadef
MODULES += jsondef
MODULES += jsonlib
MODULES += timelib
}
contains(MODULES, convertlib){
message( "- support/convertlib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/convertlib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/convertlib.h
MODULES += geomag
}
contains(MODULES, convertdef){
message( "- support/convertdef" )
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/convertdef.h
}
contains(MODULES, ephemlib){
message( "- support/ephemlib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/ephemlib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/ephemlib.h
MODULES += jpleph
}
contains(MODULES, geomag){
message( "- support/geomag" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/geomag.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/geomag.h
}
contains(MODULES, physicslib){
message( "- physics/physicslib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/physics/physicslib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/physics/physicslib.h
MODULES += nrlmsise
}
contains(MODULES, demlib){
message( "- support/demlib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/demlib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/demlib.h
}
contains(MODULES, cosmoserrno){
message( "- support/cosmos-errno" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/cosmos-errno.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/cosmos-errno.h
}
# -----------------------------------------------
# Tier 0 libraries
# -----------------------------------------------
# The following libraries do not depend on other libraries
# These are self contained, they are the building blocks for
# more complext libraries such as agentlib
contains(MODULES, gp_cosmostimeutils){
message( "- support/gp_cosmostimeutils" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/gp_cosmostimeutils.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/gp_cosmostimeutils.h
}
# -----------------------------------------------
# Tier 0 libraries for Math
contains(MODULES, mathlib){
message( "- math/mathlib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/math/mathlib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/math/mathlib.h
MODULES += math-vector
MODULES += math-matrix
MODULES += math-rotation
# MODULES += math-quaternion
}
contains(MODULES, math-lsfit){
message( "- math/lsfit" )
HEADERS += $$COSMOS_SOURCE_CORE/libraries/math/lsfit.h
SOURCES += $$COSMOS_SOURCE_CORE/libraries/math/lsfit.cpp
}
contains(MODULES, math-matrix){
message( "- math/matrix" )
HEADERS += $$COSMOS_SOURCE_CORE/libraries/math/matrix.h
SOURCES += $$COSMOS_SOURCE_CORE/libraries/math/matrix.cpp
MODULES += math-vector
}
contains(MODULES, math-vector){
message( "- math/vector" )
HEADERS += $$COSMOS_SOURCE_CORE/libraries/math/vector.h
SOURCES += $$COSMOS_SOURCE_CORE/libraries/math/vector.cpp
}
contains(MODULES, math-rotation){
message( "- math/rotation" )
HEADERS += $$COSMOS_SOURCE_CORE/libraries/math/rotation.h
SOURCES += $$COSMOS_SOURCE_CORE/libraries/math/rotation.cpp
}
# contains(MODULES, math-quaternion){
# message( "- math/quaternion" )
# HEADERS += $$COSMOS_SOURCE_CORE/libraries/math/quaternion.h
# SOURCES += $$COSMOS_SOURCE_CORE/libraries/math/quaternion.cpp
# }
# -----------------------------------------------
# Tier 0 libraries for physics
message( "physics" )
contains(MODULES, physics-keplerianorbit){
# message( "- physics/keplerianorbit" )
# HEADERS += $$COSMOS_SOURCE_CORE/libraries/physics/keplerianorbit.h
# SOURCES += $$COSMOS_SOURCE_CORE/libraries/physics/keplerianorbit.cpp
# MODULES += physics-constants
}
contains(MODULES, physics-constants){
message( "- physics/constants" )
HEADERS += $$COSMOS_SOURCE_CORE/libraries/physics/constants.h
SOURCES += $$COSMOS_SOURCE_CORE/libraries/physics/constants.cpp
}
# -----------------------------------------------
# Tier 0 libraries for physics
message( "- support/" )
contains(MODULES, stringlib){
message( "- support/stringlib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/stringlib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/stringlib.h
}
contains(MODULES, jpleph){
message( "- support/jpleph" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/jpleph.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/jpleph.h
}
contains(MODULES, sliplib){
message( "- support/sliplib" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/sliplib.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/sliplib.h
}
contains(MODULES, timeutils){
message( "- support/timeutils" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/timeutils.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/timeutils.h
}
contains(MODULES, nrlmsise){
message( "- support/nrlmsise" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/nrlmsise-00.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/nrlmsise-00.h
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/nrlmsise-00_data.cpp
}
contains(MODULES, print_utils){
message( "- support/print_utils" )
SOURCES += $$COSMOS_SOURCE_CORE/libraries/support/print_utils.cpp
HEADERS += $$COSMOS_SOURCE_CORE/libraries/support/print_utils.h
}
#--------------------------------------------------------------------
# Add COSMOS core devices libraries
include( $$COSMOS_SOURCE_CORE/libraries/device/cosmos-core-devices.pri )
#--------------------------------------------------------------------
# Add COSMOS core thirdparty libraries
# Add Zlib
contains(MODULES, zlib){
message( "- thirdparty/zlib" )
# note: sometimes including all the files with * creates problems
#SOURCES += $$files($$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/*.c)
#HEADERS += $$files( $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/*.h)
#SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/*.c
#HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/*.h
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/adler32.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/compress.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/crc32.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/deflate.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/gzclose.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/gzlib.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/gzread.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/gzwrite.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/infback.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/inffast.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/inflate.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/inftrees.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/trees.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/uncompr.c
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/zutil.c
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/crc32.h
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/deflate.h
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/gzguts.h
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/inffast.h
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/inffixed.h
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/inflate.h
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/inftrees.h
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/trees.h
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/zconf.h
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/zlib.h
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/zlib/zutil.h
}
# Add JPEG
contains(MODULES, jpeg){
message( "- thirdparty/jpeg" )
SOURCES += $$files($$COSMOS_SOURCE_CORE/libraries/thirdparty/jpeg/*.c)
HEADERS += $$files($$COSMOS_SOURCE_CORE/libraries/thirdparty/jpeg/*.h)
}
# Add Eigen
contains(MODULES, thirdparty-Eigen){
message( "- thirdparty/Eigen" )
# We just need to inlcude the parent folder for Eigen
# then in the code we alwas reference it using
# #include <Eigen/Eigen>
#INCLUDEPATH += $$COSMOS_SOURCE_CORE/libraries/thirdparty
}
#--------------------------------------------------------------------
# Windows config
#--------------------------------------------------------------------
win32 {
#message( "Building on Win32" )
# add libraries for MinGW
*-g++* {
#message("Compiler: MinGW")
LIBS += -lpthread -lwsock32 -lwinmm -lws2_32 -liphlpapi
QMAKE_CXXFLAGS += -Wall -pedantic -std=c++11 -pthread
}
*-msvc* {
#message("Compiler: MSVC")
LIBS += -lwsock32 -lwinmm -lws2_32 -liphlpapi
QMAKE_CXXFLAGS += -W4 -D_CRT_NONSTDC_NO_DEPRECATE
# include dirent for MSVC
INCLUDEPATH += $$COSMOS_SOURCE_CORE/libraries/thirdparty/dirent
SOURCES += $$COSMOS_SOURCE_CORE/libraries/thirdparty/dirent/dirent.c
HEADERS += $$COSMOS_SOURCE_CORE/libraries/thirdparty/dirent/dirent.h
}
}
message("cosmos-core")