blob: e169e72fb68cecdbc9a234645ae73b37b4327929 [file] [log] [blame]
Ilya Moiseenko1762af72011-07-18 16:43:10 -07001## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
Alexander Afanasyev45b92d42011-08-14 23:11:38 -07003import os
4import Logs
5import Utils
6
Ilya Moiseenko1762af72011-07-18 16:43:10 -07007def build(bld):
Alexander Afanasyev45b92d42011-08-14 23:11:38 -07008 module = bld.create_ns3_module ('NDNabstraction', ['applications', 'core', 'network', 'point-to-point'])
Alexander Afanasyevc74a6022011-08-15 20:01:35 -07009 module.find_sources_in_dirs (['model', 'apps', 'helper'],[],['.cc']);
Alexander Afanasyev404c0792011-08-09 17:09:59 -070010
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070011 tests = bld.create_ns3_module_test_library('NDNabstraction')
12 tests.find_sources_in_dirs( ['test'], [], ['.cc'] );
Ilya Moiseenko1762af72011-07-18 16:43:10 -070013
14 headers = bld.new_task_gen('ns3header')
15 headers.module = 'NDNabstraction'
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070016 headers.find_sources_in_dirs( ['model', 'apps', 'helper'], [], ['.h'] );
Alexander Afanasyev43e70252011-08-08 18:48:18 -070017
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070018 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 Moiseenko1762af72011-07-18 16:43:10 -070034
Ilya Moiseenko54a6bba2011-08-01 11:01:26 -070035 if bld.env['ENABLE_OPENSSL']:
Alexander Afanasyev404c0792011-08-09 17:09:59 -070036 module.uselib = 'OPENSSL'
Ilya Moiseenko54a6bba2011-08-01 11:01:26 -070037
Ilya Moiseenko1762af72011-07-18 16:43:10 -070038 if bld.env['ENABLE_EXAMPLES']:
39 bld.add_subdirs('examples')
40
Ilya Moiseenko02fb7062011-08-11 17:18:00 -070041 bld.ns3_python_bindings()
Alexander Afanasyev43e70252011-08-08 18:48:18 -070042