From 5470c3565cfb4b9e3827a42bfdc3fbec461638a5 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 12 Sep 2017 10:05:46 +0000 Subject: Fix in Python3 if sphinx is not installed git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cythonization_improvement@2663 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 0005d7fe2e7e8513a276543295c02351456595cc --- src/cmake/modules/GUDHI_third_party_libraries.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake index dbf2106a..4cf2f445 100644 --- a/src/cmake/modules/GUDHI_third_party_libraries.cmake +++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake @@ -122,8 +122,12 @@ if(PYTHONINTERP_FOUND AND CYTHON_FOUND) # Documentation generation is available through sphinx find_program( SPHINX_PATH sphinx-build ) elseif(PYTHON_VERSION_MAJOR EQUAL 3) - # No sphinx-build in Pyton3, just hack it - set(SPHINX_PATH "${CMAKE_CURRENT_BINARY_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build") + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from sphinx import main" + RESULT_VARIABLE SPHINX_MODULE_IS_INSTALLED) + if(SPHINX_MODULE_IS_INSTALLED) + # No sphinx-build in Pyton3, just hack it + set(SPHINX_PATH "${CMAKE_CURRENT_BINARY_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build") + endif(SPHINX_MODULE_IS_INSTALLED) else() message(FATAL_ERROR "ERROR: Try to compile the Cython interface. Python version ${PYTHON_VERSION_STRING} is not valid.") endif(PYTHON_VERSION_MAJOR EQUAL 2) -- cgit v1.2.3