]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
doxy: specify include directories on cmdline
authordberzano <dario.berzano@cern.ch>
Wed, 10 Dec 2014 10:44:27 +0000 (11:44 +0100)
committerdberzano <dario.berzano@cern.ch>
Fri, 9 Jan 2015 15:01:09 +0000 (16:01 +0100)
doxygen/thtml2doxy.py

index c8752c386729e618797f3a18a83f4ab1a4380e6c..1f7ecc5656248c677c131bcaa38637d5e1a8b4f4 100755 (executable)
@@ -612,8 +612,9 @@ def main(argv):
 
   # Parse command-line options
   output_on_stdout = False
+  include_flags = []
   try:
-    opts, args = getopt.getopt( argv, 'od', [ 'debug=', 'stdout' ] )
+    opts, args = getopt.getopt( argv, 'odI:', [ 'debug=', 'stdout' ] )
     for o, a in opts:
       if o == '--debug':
         log_level = getattr( logging, a.upper(), None )
@@ -622,8 +623,13 @@ def main(argv):
       elif o == '-d':
         log_level = logging.DEBUG
       elif o == '-o' or o == '--stdout':
-        logging.debug('Output on stdout instead of replacing original files')
         output_on_stdout = True
+      elif o == '-I':
+        if os.path.isdir(a):
+          include_flags.extend( [ '-I', a ] )
+        else:
+          logging.fatal('Include directory not found: %s' % Colt(a).magenta())
+          return 2
       else:
         assert False, 'Unhandled argument'
   except getopt.GetoptError as e:
@@ -655,7 +661,9 @@ def main(argv):
 
     logging.info('Input file: %s' % Colt(fn).magenta())
     index = clang.cindex.Index.create()
-    translation_unit = index.parse(fn, args=['-x', 'c++'])
+    clang_args = [ '-x', 'c++' ]
+    clang_args.extend( include_flags )
+    translation_unit = index.parse(fn, args=clang_args)
 
     comments = []
     traverse_ast( translation_unit.cursor, fn, comments )