blob: 6cb8dd285ee4e04ab02126528babdf0dc729b5fc [file] [log] [blame]
Alexander Afanasyevc3d29902018-06-29 18:20:55 -04001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
3top = '..'
4
5def build(bld):
Davide Pesaventod4689c82021-10-07 02:53:03 -04006 # List all .cpp files (whole example in one .cpp)
7 for ex in bld.path.ant_glob('*.cpp'):
8 name = ex.change_ext('').path_from(bld.path.get_bld())
Davide Pesaventof3872f22023-09-14 15:37:03 -04009 bld.program(name=f'example-{name}',
10 target=f'nac-{name}',
Davide Pesaventod4689c82021-10-07 02:53:03 -040011 source=[ex],
12 use='libndn-nac',
13 install_path=None)
Alexander Afanasyevc3d29902018-06-29 18:20:55 -040014
Davide Pesaventod4689c82021-10-07 02:53:03 -040015 # List all directories (example can have multiple .cpp in the directory)
16 for subdir in bld.path.ant_glob('*', dir=True, src=False):
Alexander Afanasyevc3d29902018-06-29 18:20:55 -040017 name = subdir.path_from(bld.path)
Davide Pesaventof3872f22023-09-14 15:37:03 -040018 bld.program(name=f'example-{name}',
Davide Pesaventod4689c82021-10-07 02:53:03 -040019 target=name,
20 source=subdir.ant_glob('**/*.cpp'),
21 use='libndn-nac',
22 includes=name,
23 install_path=None)