Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doxygen_xml2qbk execution from make_qbk.py #1312

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading