-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
56 lines (51 loc) · 2.58 KB
/
SConstruct
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
# ISL scons script
#
# To build & install type 'scons & sudo scons install' in command line.
# To uninstall type 'sudo scons uninstall' in command line.
# Run 'scons -h' to list build options.
#
# TODO "prefix" as scons option support.
import os
AddOption('--build-scada',
dest = 'build-scada',
action = 'store_true',
help = 'Build SCADA module (depends on libmodbus, http://libmodbus.org/) (the same as if \'ISL_BUILD_SCADA\' environment variable is set to \'yes\')')
AddOption('--build-examples',
dest = 'build-examples',
action = 'store_true',
help = 'Build ISL examples of use (the same as if \'ISL_BUILD_EXAMPLES\' environment variable is set to \'yes\')')
AddOption('--build-tests',
dest = 'build-tests',
action = 'store_true',
help = 'Build ISL tests (the same as if \'ISL_BUILD_TESTS\' environment variable is set to \'yes\')')
AddOption('--core-debugging',
dest = 'core-debugging',
action = 'store_true',
help = 'Turn on ISL core debugging (the same as if \'ISL_CORE_DEBUGGING\' environment variable is set to \'yes\')')
AddOption('--prefix',
dest = 'prefix',
nargs = 1,
type = 'string',
action = 'store',
help = 'Prefix for installation. Usage: "scons --prefix=<instalation_path> install"')
sconscriptTargets = ['src/SConscript']
if GetOption('build-scada') or os.environ.get('ISL_BUILD_SCADA', '').upper() == 'YES':
sconscriptTargets.append('modules/scada/SConscript')
if GetOption('build-tests') or os.environ.get('ISL_BUILD_TESTS', '').upper() == 'YES':
sconscriptTargets.append('modules/scada/tests/SConscript')
if GetOption('build-examples') or os.environ.get('ISL_BUILD_EXAMPLES', '').upper() == 'YES':
sconscriptTargets.append('examples/SConscript')
if GetOption('build-tests') or os.environ.get('ISL_BUILD_TESTS', '').upper() == 'YES':
sconscriptTargets.append('tests/SConscript')
SConscript(sconscriptTargets)
#SConscript('src/SConscript', variant_dir = 'build/src', duplicate = 0)
#if GetOption('build-scada') or os.environ.get('ISL_BUILD_SCADA', '').upper() == 'YES':
# SConscript('modules/scada/SConscript', variant_dir = 'build/modules/scada', duplicate = 0)
#if GetOption('build-examples') or os.environ.get('ISL_BUILD_EXAMPLES', '').upper() == 'YES':
# SConscript('examples/SConscript', variant_dir = 'build/examples', duplicate = 0)
#if GetOption('build-tests') or os.environ.get('ISL_BUILD_TESTS', '').upper() == 'YES':
# SConscript('tests/SConscript', variant_dir = 'build/tests', duplicate = 0)
# Uninstall section
env = Environment()
uninstaller = env.Command('uninstall', None, Delete(env.FindInstalledFiles()))
env.Alias('uninstall', uninstaller)