kpvdr commented on a change in pull request #186: PROTON-2086: Changed API 
documentation from epydoc to Sphinx
URL: https://github.com/apache/qpid-proton/pull/186#discussion_r315689748
 
 

 ##########
 File path: python/CMakeLists.txt
 ##########
 @@ -112,35 +112,46 @@ endmacro(py_compile)
 py_compile(${CMAKE_CURRENT_BINARY_DIR} ${pysrc-generated} CPROTON_ARTIFACTS)
 py_compile(${CMAKE_CURRENT_SOURCE_DIR} "${pysrc}" PROTON_ARTIFACTS)
 
-find_program(EPYDOC_EXE epydoc)
-mark_as_advanced (EPYDOC_EXE)
-if (EPYDOC_EXE)
-   foreach (py_src_doc ${pysrc})
-     list(APPEND PY_DOC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${py_src_doc}")
-   endforeach(py_src_doc)
+
+find_program(SPHINX_EXE_PY2 sphinx-build-2 HINTS "/usr/bin")
+mark_as_advanced (SPHINX_EXE_PY2)
+find_program(SPHINX_EXE_PY3 sphinx-build-3 HINTS "/usr/bin")
+mark_as_advanced (SPHINX_EXE_PY3)
+
+# Version of Python used to build API must match version of Sphinx used to 
build the docs
+get_filename_component(PYTHON_EXECUTABLE_NAME ${PYTHON_EXECUTABLE} NAME)
+# Try matching for Python 3 first
+if ((SPHINX_EXE_PY3) AND (PYTHON_EXECUTABLE_NAME STREQUAL "python3"))
+    set(BUILD_SPHINX_DOCS TRUE)
 
 Review comment:
   ```
   check_python_module("sphinx" SPHINX_MODULE_FOUND)
   if (SPHINX_MODULE_FOUND)
       add_custom_target(docs-py
           COMMAND ${PN_ENV_SCRIPT} --
           PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_SOURCE_DIR}
           LD_LIBRARY_PATH="${CMAKE_CURRENT_BINARY_DIR}/c"
           ${PYTHON_EXECUTABLE} -m sphinx "${CMAKE_CURRENT_SOURCE_DIR}/docs" 
"${CMAKE_CURRENT_BINARY_DIR}/docs")
       add_dependencies(docs docs-py)
       install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/docs/"
               DESTINATION "${PROTON_SHARE}/docs/api-py"
               COMPONENT documentation
               OPTIONAL)
   endif ()
   ```
   Let me run the test again and report on exactly which versions of Sphinx are 
installed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to