forked from nasa/trick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
423 lines (384 loc) · 20.2 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
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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
cmake_minimum_required(VERSION 3.1)
# trick is a C/C++ project, but we have some macOS
# configuration to do before CMake searches for compilers
project(trick NONE)
set(TRICK_MAJOR 19)
set(TRICK_MINOR 8)
set(TRICK_TINY 0)
# set TRICK_PRERELEASE TO EMPTY STRING "" ON RELEASE
set(TRICK_PRERELEASE "-beta")
# On macOS Mojave and Catalina, the compilers in /usr/bin
# are the ones that include the correct C standard library system headers
if(CMAKE_SYSTEM_NAME MATCHES Darwin)
if ( (NOT DEFINED CMAKE_C_COMPILER) AND (NOT DEFINED ENV{CC}) AND (EXISTS /usr/bin/cc) )
set(CMAKE_C_COMPILER /usr/bin/cc)
endif()
if ( (NOT DEFINED CMAKE_CXX_COMPILER) AND (NOT DEFINED ENV{CXX}) AND (EXISTS /usr/bin/c++) )
set(CMAKE_CXX_COMPILER /usr/bin/c++)
endif()
endif()
enable_language(C)
enable_language(CXX)
#set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(TRICK_FORCE_32BIT OFF CACHE BOOL "Set Trick to compile in 32bit mode")
#set(USE_JAVA ON CACHE BOOL "Use java")
set(USE_ER7_UTILS ON CACHE BOOL "Use er7_utils")
set(UDUNITS2_ROOT "" CACHE STRING "UDUNITS home directory")
set(TRICK_MONGOOSE "0" CACHE STRING "Enable webserver")
#message("UDUNITS2_ROOT = ${UDUNITS2_ROOT}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if(EXISTS "/etc/redhat-release")
if(TRICK_FORCE_32BIT)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib64)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib64)
endif()
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
include(UseJava)
find_package(Java REQUIRED)
find_package(Maven REQUIRED)
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
find_package(LLVM 3.4 REQUIRED)
find_package(Perl REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(SWIG REQUIRED)
find_package(Tee REQUIRED)
find_package(Threads REQUIRED)
find_package(UDUNITS2 REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(HDF5)
find_package(GSL)
find_package(X11)
find_package(Motif)
add_definitions( -DTRICK_VER=${TRICK_MAJOR} )
if(USE_ER7_UTILS)
add_definitions( -DUSE_ER7_UTILS_INTEGRATORS)
endif()
if(GSL_FOUND)
add_definitions( -D_HAVE_GSL)
endif()
if(USE_MONGOOSE)
add_definitions(-DUSE_MONGOOSE)
endif()
include_directories( ${CMAKE_BINARY_DIR}/include)
include_directories( ${CMAKE_BINARY_DIR}/include/trick/compat)
file(COPY bin DESTINATION ${CMAKE_BINARY_DIR})
file(COPY include DESTINATION ${CMAKE_BINARY_DIR})
file(COPY libexec DESTINATION ${CMAKE_BINARY_DIR})
file(COPY share DESTINATION ${CMAKE_BINARY_DIR})
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include/mongoose)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/temp_src/io_src)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/temp_src/lex_yacc)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/temp_src/mongoose)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/temp_src/swig)
# copy er7_util header files to build directory
file(GLOB_RECURSE ER7_UTIL_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/trick_source/er7_utils ${CMAKE_CURRENT_SOURCE_DIR}/trick_source/er7_utils/*.hh)
foreach ( infile ${ER7_UTIL_HEADERS} )
get_filename_component(dir ${infile} DIRECTORY)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/trick_source/er7_utils/${infile} DESTINATION "${CMAKE_BINARY_DIR}/include/er7_utils/${dir}")
endforeach(infile)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/share/trick/makefiles/config_user_cmake.mk.in ${CMAKE_BINARY_DIR}/share/trick/makefiles/config_user.mk)
###############################################################
# mongoose lib
###############################################################
if(USE_MONGOOSE)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/include/mongoose/mongoose.h
COMMAND curl --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/6.16/mongoose.h
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/include/mongoose
)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/temp_src/mongoose/mongoose.c
COMMAND curl --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/6.16/mongoose.c
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/temp_src/mongoose
DEPENDS ${CMAKE_BINARY_DIR}/include/mongoose/mongoose.h
)
add_library(mongoose STATIC ${CMAKE_BINARY_DIR}/temp_src/mongoose/mongoose.c)
target_include_directories( mongoose PUBLIC ${CMAKE_BINARY_DIR}/include/mongoose )
endif()
###############################################################
# io_src files
###############################################################
set( IO_SRC
${CMAKE_BINARY_DIR}/temp_src/io_src/class_map.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_ABM_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_AttributesMap.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_BC635Clock.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_CheckPointAgent.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_CheckPointRestart.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Clock.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_CommandLineArguments.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_DRAscii.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_DRBinary.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_DRHDF5.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_DataRecordDispatcher.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_DataRecordGroup.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_DebugPause.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_EchoJobs.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_EnumAttributesMap.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Environment.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Euler_Cromer_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Euler_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Event.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_EventInstrument.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_EventManager.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_EventProcessor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Executive.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_ExecutiveException.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_ExternalApplication.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Flag.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_FrameDataRecordGroup.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_FrameLog.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_GetTimeOfDayClock.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_IPPython.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_IPPythonEvent.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_ITimer.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_InputProcessor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_InstrumentBase.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_IntegLoopManager.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_IntegLoopScheduler.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_IntegLoopSimObject.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_JITEvent.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_JITInputFile.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_JSONVariableServer.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_JSONVariableServerThread.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_JobData.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MM4_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MSConnect.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MSSharedMem.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MSSocket.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MTV.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MalfunctionsTrickView.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Master.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MemoryManager.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MessageCout.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MessageFile.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MessageLCout.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MessagePublisher.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MessageSubscriber.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MessageTCDevice.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MessageThreadedCout.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MonteCarlo.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MonteMonitor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_MonteVar.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_NL2_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_PlaybackFile.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RK2_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RK4_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RKF45_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RKF78_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RKG4_Integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RealtimeSync.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RemoteShell.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RtiEvent.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RtiExec.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RtiList.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_RtiStager.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_STLInterface.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_ScheduledJobQueue.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Scheduler.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Sie.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_SimControlPanel.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_SimObject.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_SimTime.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Slave.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_StripChart.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_TPROCTEClock.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_ThreadBase.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_ThreadTrigger.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Threads.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Timer.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_TrickView.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_UCFn.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_UdUnits.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Unit.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_UnitTest.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_UnitsMap.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_VariableServer.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_VariableServerListenThread.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_VariableServerReference.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_VariableServerThread.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_Zeroconf.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_attributes.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_dllist.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_io_alloc.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_lqueue.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_lstack.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_message_type.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_mm_error.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_ms_sim_mode.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_n_choose_m.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_parameter_types.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rand_generator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_reference.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_reference_frame.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_regula_falsi.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_sim_mode.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_tc.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_time_offset.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_trick_error_hndlr.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_tsm.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_units_conv.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_value.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_var.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_variable_server_sync_types.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_wave_form.cpp
)
set( ER7_UTILS_IO_SRC
${CMAKE_BINARY_DIR}/temp_src/io_src/io_abm4_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_abm4_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_abm4_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_base_integration_group.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_beeman_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_beeman_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_bogus_integration_controls.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_deletable.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_euler_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_euler_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_euler_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_generalized_position_derivative.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_integrable_object.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_integration_controls.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_integration_messages.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_integration_technique.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_integrator_constructor_factory.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_integrator_interface.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_integrator_result.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_integrator_result_merger.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_integrator_result_merger_container.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_left_quaternion_functions.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_mm4_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_mm4_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_nl2_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_nl2_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_position_verlet_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_position_verlet_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_priming_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_priming_integration_controls.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_priming_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_priming_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_ratio128.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rk2_heun_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rk2_heun_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rk2_heun_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rk2_midpoint_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rk2_midpoint_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rk2_midpoint_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rk4_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rk4_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rk4_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rk4_second_order_ode_integrator_base.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rkf45_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rkf45_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rkf45_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rkf78_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rkf78_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rkf78_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rkg4_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rkg4_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_rkg4_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_single_cycle_integration_controls.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_standard_integration_controls.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_state_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_symplectic_euler_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_symplectic_euler_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_time_interface.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_trick_first_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_trick_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_trick_second_order_ode_integrator.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_uint128.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_velocity_verlet_integrator_constructor.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_velocity_verlet_second_order_ode_integrator.cpp
)
set(ENV{TRICK_ICG_EXCLUDE} ${CMAKE_BINARY_DIR}/include/mongoose)
set(ICG_FLAGS -I${CMAKE_BINARY_DIR}/include -I${CMAKE_BINARY_DIR}/include/trick/compat -I${UDUNITS2_INCLUDES} -DTRICK_VER=${TRICK_MAJOR} -DUSE_ER7_UTILS_INTEGRATORS)
add_custom_command(OUTPUT ${IO_SRC} ${ER7_UTILS_IO_SRC}
COMMAND TRICK_HOME=${CMAKE_BINARY_DIR} TRICK_ICG_EXCLUDE=${CMAKE_BINARY_DIR}/include/mongoose ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/trick-ICG -force -sim_services -m -n -o ${CMAKE_BINARY_DIR}/temp_src/io_src ${ICG_FLAGS} ${CMAKE_BINARY_DIR}/include/trick/files_to_ICG.hh
DEPENDS trick-ICG
)
add_library( trick STATIC $<TARGET_OBJECTS:sim_services_objs> $<TARGET_OBJECTS:trick_utils_objs> ${IO_SRC})
target_include_directories( trick PUBLIC ${UDUNITS2_INCLUDES} )
add_library( er7_utils STATIC $<TARGET_OBJECTS:er7_utils_objs> ${ER7_UTILS_IO_SRC})
# fake dependency to avoid double ICG
add_dependencies(er7_utils trick)
###############################################################
# libtrick_pyip.a
###############################################################
set( TRICK_SWIG_SRC
trick_source/trick_swig/PrimitiveAttributesMap
trick_source/trick_swig/swig_convert_units
trick_source/trick_swig/swig_global_vars
)
# Generated SWIG files
set( SWIG_SRC
${CMAKE_BINARY_DIR}/temp_src/swig/sim_services_wrap
${CMAKE_BINARY_DIR}/temp_src/swig/swig_double_wrap
${CMAKE_BINARY_DIR}/temp_src/swig/swig_int_wrap
${CMAKE_BINARY_DIR}/temp_src/swig//swig_ref_wrap
)
set( SWIG_SRC_BASENAME
sim_services
swig_double
swig_int
swig_ref
)
set(SWIG_FLAGS -DUSE_ER7_UTILS_INTEGRATORS)
if(GSL_FOUND)
list( APPEND SWIG_FLAGS -D_HAVE_GSL )
endif()
if(USE_MONGOOSE)
list( APPEND SWIG_FLAGS -DUSE_MONGOOSE)
list( APPEND IO_SRC
${CMAKE_BINARY_DIR}/temp_src/io_src/io_WebServer.cpp
${CMAKE_BINARY_DIR}/temp_src/io_src/io_WebSocketSession.cpp
)
endif()
foreach ( infile ${SWIG_SRC_BASENAME} )
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/temp_src/swig/${infile}_wrap.cpp
COMMAND ${SWIG_EXECUTABLE} ${SWIG_FLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}/trick_source -I${CMAKE_CURRENT_SOURCE_DIR}/include -I${CMAKE_CURRENT_SOURCE_DIR} -c++ -python -includeall -ignoremissing -w201,362,389,451 -o $@ -outdir ${CMAKE_BINARY_DIR}/share/trick/swig ${CMAKE_CURRENT_SOURCE_DIR}/trick_source/trick_swig/${infile}.i
)
endforeach(infile)
add_library( trick_pyip STATIC $<TARGET_OBJECTS:input_processor_objs> ${TRICK_SWIG_SRC} ${SWIG_SRC})
target_include_directories( trick_pyip PUBLIC ${PYTHON_INCLUDE_DIRS} )
target_include_directories( trick_pyip PUBLIC ${UDUNITS2_INCLUDES} )
if(GSL_FOUND)
target_include_directories( trick_pyip PUBLIC ${GSL_INCLUDE_DIRS} )
endif()
target_include_directories( trick_pyip PUBLIC trick_source )
###############################################################
# libtrickHTTP.a
###############################################################
if(USE_MONGOOSE)
set( TRICKHTTP_SRC
trick_source/web/HttpServer/src/VariableServerSession
trick_source/web/HttpServer/src/VariableServerVariable
trick_source/web/HttpServer/src/WebServer
trick_source/web/HttpServer/src/http_GET_handlers
trick_source/web/HttpServer/src/simpleJSON
)
add_library( trickHTTP STATIC ${TRICKHTTP_SRC})
add_dependencies( trickHTTP mongoose)
endif()
###############################################################
# Other Trick libraries
###############################################################
add_subdirectory(trick_source/codegen/Interface_Code_Gen)
add_subdirectory(trick_source/er7_utils)
add_subdirectory(trick_source/sim_services)
add_subdirectory(trick_source/trick_utils)
add_subdirectory(trick_source/java)
add_subdirectory(trick_source/data_products)