summaryrefslogtreecommitdiff
path: root/gr-utils/python/modtool/modtool_base.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@kit.edu>2013-10-24 00:11:26 +0200
committerJohnathan Corgan <johnathan@corganlabs.com>2013-10-28 08:47:19 -0700
commite24a2dbde4a2a6c1aa340d5c14ac05c2d93f4443 (patch)
tree66b62dc5e846d5460886193d9dcb672193caa125 /gr-utils/python/modtool/modtool_base.py
parentd4e76a2afc13c1e2e38514eebf25e02f0a371aba (diff)
modtool: Fixes for in-tree adds, argument parsing (&-bug)
Diffstat (limited to 'gr-utils/python/modtool/modtool_base.py')
-rw-r--r--gr-utils/python/modtool/modtool_base.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/gr-utils/python/modtool/modtool_base.py b/gr-utils/python/modtool/modtool_base.py
index 081c10aaf9..577985b6f3 100644
--- a/gr-utils/python/modtool/modtool_base.py
+++ b/gr-utils/python/modtool/modtool_base.py
@@ -87,7 +87,10 @@ class ModTool(object):
print "No GNU Radio module found in the given directory. Quitting."
sys.exit(1)
print "GNU Radio module name identified: " + self._info['modname']
- if self._info['version'] == '36' and os.path.isdir(os.path.join('include', self._info['modname'])):
+ if self._info['version'] == '36' and (
+ os.path.isdir(os.path.join('include', self._info['modname'])) or
+ os.path.isdir(os.path.join('include', 'gnuradio', self._info['modname']))
+ ):
self._info['version'] = '37'
if options.skip_lib or not self._has_subdirs['lib']:
self._skip_subdirs['lib'] = True
@@ -106,12 +109,17 @@ class ModTool(object):
""" Initialise the self._file[] dictionary """
if not self._skip_subdirs['swig']:
self._file['swig'] = os.path.join('swig', self._get_mainswigfile())
+ self._info['pydir'] = 'python'
+ if os.path.isdir(os.path.join('python', self._info['modname'])):
+ self._info['pydir'] = os.path.join('python', self._info['modname'])
self._file['qalib'] = os.path.join('lib', 'qa_%s.cc' % self._info['modname'])
- self._file['pyinit'] = os.path.join('python', '__init__.py')
+ self._file['pyinit'] = os.path.join(self._info['pydir'], '__init__.py')
self._file['cmlib'] = os.path.join('lib', 'CMakeLists.txt')
self._file['cmgrc'] = os.path.join('grc', 'CMakeLists.txt')
- self._file['cmpython'] = os.path.join('python', 'CMakeLists.txt')
- if self._info['version'] in ('37', 'component'):
+ self._file['cmpython'] = os.path.join(self._info['pydir'], 'CMakeLists.txt')
+ if self._info['is_component']:
+ self._info['includedir'] = os.path.join('include', 'gnuradio', self._info['modname'])
+ elif self._info['version'] == '37':
self._info['includedir'] = os.path.join('include', self._info['modname'])
else:
self._info['includedir'] = 'include'
@@ -129,6 +137,7 @@ class ModTool(object):
except OSError:
print "Can't read or chdir to directory %s." % directory
return False
+ self._info['is_component'] = False
for f in files:
if os.path.isfile(f) and f == 'CMakeLists.txt':
if re.search('find_package\(GnuradioRuntime\)', open(f).read()) is not None or \