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 Aug 7, 2023
1 parent 55a02f3 commit c8392df
Show file tree
Hide file tree
Showing 3 changed files with 16 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 @@ -1276,6 +1276,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})")

endfunction() # pxr_build_python_documentation
14 changes: 14 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,19 @@
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:
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 @@ -131,6 +131,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 c8392df

Please sign in to comment.