Skip to content

Commit

Permalink
[docs] fixes for python docstring builds on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pmolodo committed Oct 17, 2023
1 parent db8d57d commit a623c9f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/macros/Public.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@ function(pxr_build_python_documentation)
--package pxr --module ${pxrPythonModulesStr} \
--inputIndex ${BUILT_XML_DOCS}/index.xml \
--pythonPath ${CMAKE_INSTALL_PREFIX}/lib/python \
--libPath \"${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/bin;${CMAKE_INSTALL_PREFIX}/plugin/usd;${CMAKE_INSTALL_PREFIX}/share/usd/examples/plugin\" \
--output ${INSTALL_PYTHON_PXR_ROOT})
if (NOT \${convert_doxygen_return_code} EQUAL \"0\")
message( FATAL_ERROR \"Error generating python docstrings - ${CONVERT_DOXYGEN_TO_PYTHON_DOCS_SCRIPT} return code: \${convert_doxygen_return_code} \")
Expand Down
15 changes: 15 additions & 0 deletions docs/python/convertDoxygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
output_file = GetArgValue(['--output', '-o'])
output_format = GetArgValue(['--format', '-f'], "Docstring")
python_path = GetArgValue(['--pythonPath'])
lib_path = GetArgValue(['--libPath'])

SetDebugMode(GetArg(['--debug', '-d']))

Expand All @@ -62,6 +63,20 @@
if (python_path != None):
sys.path.append(python_path)

if lib_path != None:
lib_paths = lib_path.replace("/", os.sep).split(";")
if os.name == "nt":
for path in lib_paths:
if os.path.isdir(path):
os.add_dll_directory(path)
else:
ld_lib_paths = os.environ.get("LD_LIBRARY_PATH", "").split(os.pathsep)
for path in lib_paths:
if path not in ld_lib_paths:
ld_lib_paths.append(path)
os.environ["LD_LIBRARY_PATH"] = os.pathsep.join(ld_lib_paths)


#
# Try to import the plugin module that creates the desired output
#
Expand Down
1 change: 1 addition & 0 deletions docs/python/doxygenlib/cdUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def Usage():
--debug or -d = turn on debugging mode
--help or -h = display this program usage statement
--pythonPath = optional path to add to python lib paths
--libPath = optional ;-separated paths to allow library loading from
Docstring format:
Write Python doc strings from Doyxgen C++ comments. Writes
Expand Down

0 comments on commit a623c9f

Please sign in to comment.