forked from EMOD-Hub/EMOD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConscript
107 lines (90 loc) · 3.19 KB
/
SConscript
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
# -*- mode: python; -*-
# This Python script, SConscript, invoked by the SConstruct in this directory,
#
# 1. delegates to other per-module SConscript files for executable and library
# (static and/or dynamic)
import os
import sys
import shutil
import pdb
Import('env')
def InstallEmodules(src, dst):
print( "\nInstalling from " + src + " to " + dst + "..." )
if os.path.isfile(dst):
print( "Warning: " + dst + " is a file\n" )
return;
if os.path.exists(dst) != True:
print( "Creating " + dst + " in " + os.getcwd() )
os.mkdir(dst)
srcfiles = os.path.join(src,'*.dll')
for root, dirs, files in os.walk(src):
for file in files:
if file.endswith('.dll') or file.endswith('.exe'):
full_fn = os.path.join(root,file);
print( "copying: " + full_fn )
shutil.copy2(full_fn, dst);
# if --install is on, just copy the dlls (assumed there already) and finish
dst_path = env['Install']
if dst_path != "":
InstallEmodules(Dir('.').abspath, dst_path)
#InstallEmodules(Dir('#').abspath, dst_path)
print("Finished installing.\n")
sys.exit(0)
env.Prepend( CPPPATH=[
"#/Eradication",
"#/interventions",
"#/campaign",
"#/baseReportLib",
"#/utils",
"#/libsqlite",
"#/cajun/include",
"#/rapidjson/include",
"#/rapidjson/modp",
"#/snappy",
"#/lz4/lib"])
# set the common libraries
env.Prepend( LIBPATH = [
"$BUILD_DIR/reporters",
"$BUILD_DIR/baseReportLib",
"$BUILD_DIR/campaign",
"$BUILD_DIR/cajun",
"$BUILD_DIR/libsqlite",
"$BUILD_DIR/snappy",
"$BUILD_DIR/lz4",
"$BUILD_DIR/utils"])
env.Prepend( LIBS=[
"reporters",
"baseReportLib",
"campaign",
"cajun",
"libsqlite",
"snappy",
"lz4",
"utils"])
# First static libs
print( "Build static libraries baseReportLib, cajun, campaign, coreLib, sqlite, snappy, and utils lib's." )
SConscript( [ 'baseReportLib/SConscript',
'cajun/SConscript',
'campaign/SConscript',
'reporters/SConscript',
'Eradication/SConscript_coreLib',
'libsqlite/SConscript',
'snappy/SConscript',
'lz4/SConscript',
'utils/SConscript' ])
# Finally executable
SConscript('Eradication/SConscript')
def OptionalScript(sconscript_name):
sconscript_path = os.path.join(Dir('#').abspath, sconscript_name)
if os.path.isfile(sconscript_path):
SConscript(sconscript_name)
else:
print("Skipping missing script: '{0}'".format(sconscript_path))
disease = "ALL"
if 'Disease' in env and len(env['Disease']) > 0:
disease = env["Disease"]
if( (disease == "ALL") or (disease == "STI") or (disease == "HIV") ):
OptionalScript('reporters/SConscript_STI_RelationshipQueue')
if( disease == "ALL"):
OptionalScript('UnitTest++/SConscript')
OptionalScript('componentTests/SConscript')