| 1 | # -*- Mode:Python -*- |
|---|
| 2 | |
|---|
| 3 | ########################################################################## |
|---|
| 4 | # # |
|---|
| 5 | # This file is part of AVANGO. # |
|---|
| 6 | # # |
|---|
| 7 | # Copyright 1997 - 2010 Fraunhofer-Gesellschaft zur Foerderung der # |
|---|
| 8 | # angewandten Forschung (FhG), Munich, Germany. # |
|---|
| 9 | # # |
|---|
| 10 | # AVANGO is free software: you can redistribute it and/or modify # |
|---|
| 11 | # it under the terms of the GNU Lesser General Public License as # |
|---|
| 12 | # published by the Free Software Foundation, version 3. # |
|---|
| 13 | # # |
|---|
| 14 | # AVANGO is distributed in the hope that it will be useful, # |
|---|
| 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # |
|---|
| 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
|---|
| 17 | # GNU General Public License for more details. # |
|---|
| 18 | # # |
|---|
| 19 | # You should have received a copy of the GNU Lesser General Public # |
|---|
| 20 | # License along with AVANGO. If not, see <http://www.gnu.org/licenses/>. # |
|---|
| 21 | # # |
|---|
| 22 | ########################################################################## |
|---|
| 23 | |
|---|
| 24 | import sys |
|---|
| 25 | import os, os.path |
|---|
| 26 | sys.path.insert(0, os.path.join(os.getcwd(), 'avango-build', 'src')) |
|---|
| 27 | |
|---|
| 28 | import avango.build |
|---|
| 29 | import avango.build.oshelper |
|---|
| 30 | |
|---|
| 31 | opts = avango.build.options |
|---|
| 32 | opts.AddOptions( |
|---|
| 33 | BoolOption('DISTRIBUTION_SUPPORT', |
|---|
| 34 | 'Switch to enable distribution support (requires ensemble module)', |
|---|
| 35 | False), |
|---|
| 36 | BoolOption('ZMQ_DISTRIBUTION_SUPPORT', |
|---|
| 37 | 'Switch to enable distribution support with zmq', |
|---|
| 38 | False), |
|---|
| 39 | BoolOption('OPENSCENEGRAPH_SUPPORT', |
|---|
| 40 | 'Enable building OpenSceneGraph module', |
|---|
| 41 | True), |
|---|
| 42 | BoolOption('OPENSCENEGRAPH_DEBUG', |
|---|
| 43 | 'Use debug version of OpenSceneGraph library', |
|---|
| 44 | False), |
|---|
| 45 | BoolOption('SHADE_SUPPORT', |
|---|
| 46 | 'Enable building shade module', |
|---|
| 47 | False), |
|---|
| 48 | BoolOption('OPENAL_SUPPORT', |
|---|
| 49 | 'Enable building OpenAL sound module', |
|---|
| 50 | False), |
|---|
| 51 | BoolOption('DISPLAY_SUPPORT', |
|---|
| 52 | 'Enable building display setup module (REQUIRED)', |
|---|
| 53 | True), |
|---|
| 54 | BoolOption('CONNECT_SUPPORT', |
|---|
| 55 | 'Enable building module to connect mobile devices to AVANGO', |
|---|
| 56 | False), |
|---|
| 57 | BoolOption('CONNECT_CSHARP_SUPPORT', |
|---|
| 58 | 'Enable C# support for the connect module', |
|---|
| 59 | False), |
|---|
| 60 | BoolOption('VRPN_SUPPORT', |
|---|
| 61 | 'Enable VRPN support for the AvangoDaemon module', |
|---|
| 62 | False), |
|---|
| 63 | BoolOption('UTILS_SUPPORT', |
|---|
| 64 | 'Enable building utility module (REQUIRED)', |
|---|
| 65 | True), |
|---|
| 66 | ) |
|---|
| 67 | |
|---|
| 68 | avango.build.setup() |
|---|
| 69 | |
|---|
| 70 | avango.build.set_config('avango-unittest', avango.build.PlainConfig(libraries = ['avangoUnitTest++'])) |
|---|
| 71 | avango.build.set_config('avango-core', avango.build.PlainConfig(libraries = ['avango'], dependencies = ["boost_signals", "boost_thread"])) |
|---|
| 72 | |
|---|
| 73 | avango.build.set_config('avango-python', avango.build.PlainConfig(libraries = ['avangoScript'])) |
|---|
| 74 | |
|---|
| 75 | # avango.build.set_config('avango-osg', avango.build.PlainConfig(libraries = ['avangoOsg', 'avangoOsgParticle'])) |
|---|
| 76 | avango.build.set_config('avango-osg', avango.build.PlainConfig(libraries = ['avangoOsg'], dependencies = ['osg', 'osgDB', 'osgViewer', 'osgParticle', 'osgText', 'osgUtil'])) |
|---|
| 77 | avango.build.set_config('avango-shade', avango.build.PlainConfig(libraries = ['avangoSloow', 'shade'])) |
|---|
| 78 | avango.build.set_config('avango-osgparticle', avango.build.PlainConfig(libraries = ['avangoOsgParticle'])) |
|---|
| 79 | |
|---|
| 80 | avango.build.set_config('avango-osgviewer', avango.build.PlainConfig(libraries = ['avangoOsgViewer'])) |
|---|
| 81 | avango.build.set_config('avango-daemon', avango.build.PlainConfig(libraries = ['avangoDaemon'])) |
|---|
| 82 | |
|---|
| 83 | env = avango.build.Environment() |
|---|
| 84 | |
|---|
| 85 | if env['DISTRIBUTION_SUPPORT']: |
|---|
| 86 | avango.build.Environment.add_search_path('avango-ensemble') |
|---|
| 87 | if env['OPENSCENEGRAPH_DEBUG']: |
|---|
| 88 | avango.build.set_config_flag("OPENSCENEGRAPH_DEBUG", True) |
|---|
| 89 | |
|---|
| 90 | used_libs = Split(""" |
|---|
| 91 | dl |
|---|
| 92 | boost_thread |
|---|
| 93 | boost_signals |
|---|
| 94 | boost_python |
|---|
| 95 | osg |
|---|
| 96 | osgDB |
|---|
| 97 | osgViewer |
|---|
| 98 | osgParticle |
|---|
| 99 | osgText |
|---|
| 100 | """) |
|---|
| 101 | for lib in used_libs: |
|---|
| 102 | avango.build.Environment.add_search_path(lib) |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | avango.build.SConscript('avango-unittest/SConscript') |
|---|
| 106 | avango.build.TestEnvironment.add_library('avango-unittest') |
|---|
| 107 | |
|---|
| 108 | # List is ordered by dependency of modules |
|---|
| 109 | avango.build.SConscript('avango-build/SConscript') |
|---|
| 110 | avango.build.SConscript('avango-core/SConscript') |
|---|
| 111 | avango.build.SConscript('avango-python/SConscript') |
|---|
| 112 | if env['OPENSCENEGRAPH_SUPPORT']: |
|---|
| 113 | avango.build.SConscript('avango-osg/SConscript') |
|---|
| 114 | if env['SHADE_SUPPORT']: |
|---|
| 115 | avango.build.SConscript('avango-shade/SConscript') |
|---|
| 116 | avango.build.SConscript('avango-moving/SConscript') |
|---|
| 117 | avango.build.SConscript('avango-menu/SConscript') |
|---|
| 118 | if not avango.build.oshelper.os_is_windows() and \ |
|---|
| 119 | not avango.build.oshelper.os_is_mac(): #FIXME get module running under Windows/MAC |
|---|
| 120 | avango.build.SConscript('avango-daemon/SConscript') |
|---|
| 121 | if not avango.build.oshelper.os_is_windows() and \ |
|---|
| 122 | not avango.build.oshelper.os_is_mac(): #FIXME get module running under Windows/MAC |
|---|
| 123 | avango.build.SConscript('avango-sound/SConscript') |
|---|
| 124 | if env['OPENAL_SUPPORT']: |
|---|
| 125 | avango.build.SConscript('avango-openal/SConscript') |
|---|
| 126 | avango.build.SConscript('avango-tools/SConscript') |
|---|
| 127 | if env['DISPLAY_SUPPORT']: |
|---|
| 128 | avango.build.SConscript('avango-display/SConscript') |
|---|
| 129 | if env['CONNECT_SUPPORT']: |
|---|
| 130 | avango.build.SConscript('avango-connect/SConscript') |
|---|
| 131 | if env['UTILS_SUPPORT']: |
|---|
| 132 | avango.build.SConscript('avango-utils/SConscript') |
|---|
| 133 | avango.build.SConscript('avango-inspector/SConscript') |
|---|
| 134 | avango.build.SConscript('avango-doc/SConscript') |
|---|
| 135 | avango.build.SConscript('examples/SConscript') |
|---|