| 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 avango.build |
|---|
| 25 | import os |
|---|
| 26 | |
|---|
| 27 | Alias('all', [Alias('shade-core'), Alias('shade')]) |
|---|
| 28 | Alias('check', Alias('check-shade')) |
|---|
| 29 | Alias('install', Alias('install-shade')) |
|---|
| 30 | Alias('check-shade', Alias('check-shade-core')) |
|---|
| 31 | Alias('install-shade', Alias('install-shade-core')) |
|---|
| 32 | |
|---|
| 33 | # |
|---|
| 34 | # Build core shade library |
|---|
| 35 | # |
|---|
| 36 | |
|---|
| 37 | def append_shade_core_options(env): |
|---|
| 38 | env.Append(CPPPATH=Dir('core/include').abspath) |
|---|
| 39 | # The PREFIX_* settings allow us to move the shade library file inside the |
|---|
| 40 | # AVANGO installation directories. Note that the build recipes need to be |
|---|
| 41 | # adjusted accordingly. |
|---|
| 42 | shade_core_libname = "avangoShadeCore" |
|---|
| 43 | Export("shade_core_libname") |
|---|
| 44 | env['PREFIX_LIB'] = os.path.join(env['PREFIX'], 'lib') |
|---|
| 45 | env['PREFIX_SHADER_LIB'] = os.path.join(env['PREFIX_LIB'], 'avango/shade') |
|---|
| 46 | env['PREFIX_INCLUDE'] = os.path.join(env['PREFIX'], 'include/avango/shade/core') |
|---|
| 47 | avango.build.add_library(env, "boost_signals") |
|---|
| 48 | avango.build.add_library(env, "boost_filesystem") |
|---|
| 49 | avango.build.add_library(env, "osg") |
|---|
| 50 | env.Append(LIBS=['GLEW']) # TODO remove from AVANGO build |
|---|
| 51 | |
|---|
| 52 | shade_core_env = avango.build.Environment() |
|---|
| 53 | append_shade_core_options(shade_core_env) |
|---|
| 54 | Export('shade_core_env') |
|---|
| 55 | |
|---|
| 56 | shade_core_example_env = shade_core_env.Clone() |
|---|
| 57 | Export('shade_core_example_env') |
|---|
| 58 | |
|---|
| 59 | shade_core_unittest_env = avango.build.TestEnvironment() |
|---|
| 60 | append_shade_core_options(shade_core_unittest_env) |
|---|
| 61 | shade_core_unittest_env.Append(CPPPATH=[Dir('../avango-unittest/include/avango/UnitTest++').abspath]) |
|---|
| 62 | Export('shade_core_unittest_env') |
|---|
| 63 | |
|---|
| 64 | SConscript('core/SConscript') |
|---|
| 65 | |
|---|
| 66 | avango.build.Environment.prepend_library_path(Dir('core').abspath) |
|---|
| 67 | |
|---|
| 68 | # |
|---|
| 69 | # Build avango.shade |
|---|
| 70 | # |
|---|
| 71 | |
|---|
| 72 | shade_env = avango.build.Environment() |
|---|
| 73 | avango.build.add_library(shade_env, 'avango-core') |
|---|
| 74 | avango.build.add_library(shade_env, 'avango-python') |
|---|
| 75 | avango.build.add_library(shade_env, 'avango-osg') |
|---|
| 76 | |
|---|
| 77 | shade_env['SUBST'] = { |
|---|
| 78 | 'PREFIX': avango.build.get_prefix().abspath, |
|---|
| 79 | 'PKG_CONFIG_REQUIRES': 'avango-core,avango-python,avango-osg', |
|---|
| 80 | 'AVANGO_SHADE_VERSION': '1.90.0', |
|---|
| 81 | 'AVANGO_SHADE_VERSION_MAJOR': '1', |
|---|
| 82 | 'AVANGO_SHADE_VERSION_MINOR': '90', |
|---|
| 83 | 'AVANGO_SHADE_VERSION_MAINT': '0', |
|---|
| 84 | } |
|---|
| 85 | |
|---|
| 86 | avango_shade_pc = shade_env.Subst('dist/pkg-config/avango-shade.pc.in') |
|---|
| 87 | Alias('shade', avango_shade_pc) |
|---|
| 88 | shade_env.Alias('install-shade', shade_env.Install(avango.build.get_pkgconfig_path(), avango_shade_pc)) |
|---|
| 89 | |
|---|
| 90 | config_h = shade_env.Subst('include/avango/shade/Config.h.in') |
|---|
| 91 | Alias('shade', config_h) |
|---|
| 92 | shade_env.Alias('install-shade', shade_env.Install(avango.build.get_include_path('avango/shade'), config_h)) |
|---|
| 93 | |
|---|
| 94 | SConscript ([ |
|---|
| 95 | 'include/SConscript', |
|---|
| 96 | 'src/avango/SConscript', |
|---|
| 97 | 'src/tests/SConscript', |
|---|
| 98 | 'python/SConscript', |
|---|
| 99 | ]) |
|---|
| 100 | |
|---|
| 101 | avango.build.make_vcproject(shade_env, 'avango-shade', 'shade') |
|---|