+ for fileobj in self.get_files():
+ if fileobj and fileobj.is_source_file() and not fileobj.is_external():
+ (basedir, name) = os.path.split(fileobj.get_abspath())
+ (basename, ext) = os.path.splitext(name)
+ header = self.get_file(os.path.join(basedir, basename + '.h'))
+ if not header and ext == '.cu':
+ header = self.get_file(os.path.join(basedir, basename + '.cuh'))
+ if not header and fileobj.is_test_file():
+ basedir = os.path.dirname(basedir)
+ header = self.get_file(os.path.join(basedir, basename + '.h'))
+ if not header:
+ # Somewhat of a hack; currently, the tests for
+ # analysisdata/modules/ and trajectoryanalysis/modules/
+ # is at the top-level tests directory.
+ # TODO: It could be clearer to split the tests so that
+ # there would be a separate modules/tests/.
+ header = self.get_file(os.path.join(basedir, 'modules', basename + '.h'))
+ if not header and basename.endswith('_tests'):
+ header = self.get_file(os.path.join(basedir, basename[:-6] + '.h'))
+ if not header and fileobj.get_relpath().startswith('src/gromacs'):
+ header = self._files.get(os.path.join('src/gromacs/legacyheaders', basename + '.h'))
+ if header:
+ fileobj.set_main_header(header)