Skip to content

Commit

Permalink
Merge pull request #1312 from Lastique/feature/fix_make_qbk
Browse files Browse the repository at this point in the history
Fix `doxygen_xml2qbk` execution from `make_qbk.py`
  • Loading branch information
vissarion authored Sep 25, 2024
2 parents 6c17350 + e922b89 commit 68f5b99
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
19 changes: 18 additions & 1 deletion doc/index/make_qbk.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,24 @@

import os, sys, shutil

cmd = "doxygen_xml2qbk"
# Resolves the path to an executable and returns an absolute path to it
def resolve_executable(orig_path):
resolved_path = shutil.which(orig_path)
if resolved_path is None:
raise Exception("%s is not found or not executable" % orig_path)
return os.path.abspath(resolved_path)

if 'DOXYGEN_XML2QBK' in os.environ:
doxygen_xml2qbk_cmd = os.environ['DOXYGEN_XML2QBK']
elif '--doxygen-xml2qbk' in sys.argv:
doxygen_xml2qbk_cmd = sys.argv[sys.argv.index('--doxygen-xml2qbk')+1]
else:
doxygen_xml2qbk_cmd = 'doxygen_xml2qbk'
doxygen_xml2qbk_cmd = resolve_executable(doxygen_xml2qbk_cmd)
os.environ['DOXYGEN_XML2QBK'] = doxygen_xml2qbk_cmd
doxygen_xml2qbk_cmd = '"' + doxygen_xml2qbk_cmd + '"'

cmd = doxygen_xml2qbk_cmd
cmd = cmd + " --xml xml/%s.xml"
cmd = cmd + " --start_include boost/"
cmd = cmd + " --output_style alt"
Expand Down
16 changes: 14 additions & 2 deletions doc/make_qbk.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,31 @@
os.chdir(os.path.abspath(script_dir))
print("Boost.Geometry is making .qbk files in %s" % os.getcwd())

# Resolves the path to an executable and returns an absolute path to it
def resolve_executable(orig_path):
resolved_path = shutil.which(orig_path)
if resolved_path is None:
raise Exception("%s is not found or not executable" % orig_path)
return os.path.abspath(resolved_path)

# Resolve paths to executables early so that commands are executable from arbitrary locations
if 'DOXYGEN' in os.environ:
doxygen_cmd = os.environ['DOXYGEN']
else:
doxygen_cmd = 'doxygen'
doxygen_cmd = resolve_executable(doxygen_cmd)
os.environ['DOXYGEN'] = doxygen_cmd
doxygen_cmd = '"' + doxygen_cmd + '"'

if 'DOXYGEN_XML2QBK' in os.environ:
doxygen_xml2qbk_cmd = os.environ['DOXYGEN_XML2QBK']
elif '--doxygen-xml2qbk' in sys.argv:
doxygen_xml2qbk_cmd = sys.argv[sys.argv.index('--doxygen-xml2qbk')+1]
else:
doxygen_xml2qbk_cmd = 'doxygen_xml2qbk'
os.environ['PATH'] = os.environ['PATH']+os.pathsep+os.path.dirname(doxygen_xml2qbk_cmd)
doxygen_xml2qbk_cmd = os.path.basename(doxygen_xml2qbk_cmd)
doxygen_xml2qbk_cmd = resolve_executable(doxygen_xml2qbk_cmd)
os.environ['DOXYGEN_XML2QBK'] = doxygen_xml2qbk_cmd
doxygen_xml2qbk_cmd = '"' + doxygen_xml2qbk_cmd + '"'

cmd = doxygen_xml2qbk_cmd
cmd = cmd + " --xml doxy/doxygen_output/xml/%s.xml"
Expand Down

0 comments on commit 68f5b99

Please sign in to comment.