Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 1 | ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 3 | import os |
| 4 | import Logs |
| 5 | import Utils |
| 6 | |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 7 | def build(bld): |
Ilya Moiseenko | 1eff17d | 2011-08-17 10:55:53 -0700 | [diff] [blame] | 8 | module = bld.create_ns3_module ('NDNabstraction', ['applications', 'core', 'network', 'point-to-point','topology-read','visualizer']) |
Alexander Afanasyev | c74a602 | 2011-08-15 20:01:35 -0700 | [diff] [blame] | 9 | module.find_sources_in_dirs (['model', 'apps', 'helper'],[],['.cc']); |
Alexander Afanasyev | 404c079 | 2011-08-09 17:09:59 -0700 | [diff] [blame] | 10 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 11 | tests = bld.create_ns3_module_test_library('NDNabstraction') |
| 12 | tests.find_sources_in_dirs( ['test'], [], ['.cc'] ); |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 13 | |
| 14 | headers = bld.new_task_gen('ns3header') |
| 15 | headers.module = 'NDNabstraction' |
Alexander Afanasyev | c74a602 | 2011-08-15 20:01:35 -0700 | [diff] [blame] | 16 | headers.find_sources_in_dirs( ['model', 'apps', 'helper'], [], ['.h'] ); |
Alexander Afanasyev | 43e7025 | 2011-08-08 18:48:18 -0700 | [diff] [blame] | 17 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 18 | for path in ["examples"]: |
| 19 | anode = bld.path.find_dir (path) |
| 20 | if not anode or not anode.is_child_of(bld.srcnode): |
| 21 | raise Utils.WscriptError("Unable to use '%s' - either because \ |
| 22 | it's not a relative path"", or it's not child of \ |
| 23 | '%s'."%(name,bld.srcnode)) |
| 24 | bld.rescan(anode) |
| 25 | for filename in bld.cache_dir_contents[anode.id]: |
| 26 | if filename.startswith('.') or not filename.endswith(".cc"): |
| 27 | continue |
| 28 | name = filename[:-len(".cc")] |
| 29 | obj = bld.create_ns3_program(name, ['NDNabstraction']) |
| 30 | obj.path = obj.path.find_dir (path) |
| 31 | obj.source = filename |
| 32 | obj.target = name |
| 33 | obj.name = obj.target |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 34 | |
Ilya Moiseenko | 54a6bba | 2011-08-01 11:01:26 -0700 | [diff] [blame] | 35 | if bld.env['ENABLE_OPENSSL']: |
Alexander Afanasyev | 404c079 | 2011-08-09 17:09:59 -0700 | [diff] [blame] | 36 | module.uselib = 'OPENSSL' |
Ilya Moiseenko | 54a6bba | 2011-08-01 11:01:26 -0700 | [diff] [blame] | 37 | |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 38 | if bld.env['ENABLE_EXAMPLES']: |
| 39 | bld.add_subdirs('examples') |
| 40 | |
Ilya Moiseenko | 02fb706 | 2011-08-11 17:18:00 -0700 | [diff] [blame] | 41 | bld.ns3_python_bindings() |
Alexander Afanasyev | 43e7025 | 2011-08-08 18:48:18 -0700 | [diff] [blame] | 42 | |