summaryrefslogtreecommitdiff
path: root/src/cmake
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-09-12 10:05:46 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-09-12 10:05:46 +0000
commit5470c3565cfb4b9e3827a42bfdc3fbec461638a5 (patch)
tree5ff24a753114641a6bf5c469eb2d95e777f16688 /src/cmake
parent04fe614e8a859257b57aadfdb5aa14fc3d78babb (diff)
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
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/modules/GUDHI_third_party_libraries.cmake8
1 files 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)