summaryrefslogtreecommitdiff
path: root/src/cmake
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-04-11 17:09:30 +0200
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-04-11 17:09:30 +0200
commite420ad6f441b8237cb582473b6859b85668093fe (patch)
treee9e491a6f3072aeffaeedb9ca302005da1b4c758 /src/cmake
parent702227850167cec809679cd6cf8f57f60095596c (diff)
Find sphinx module for documentation generation
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/modules/GUDHI_third_party_libraries.cmake13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake
index 7b0d350d..7fd0b1e4 100644
--- a/src/cmake/modules/GUDHI_third_party_libraries.cmake
+++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake
@@ -148,6 +148,7 @@ if( PYTHONINTERP_FOUND )
find_python_module("matplotlib")
find_python_module("numpy")
find_python_module("scipy")
+ find_python_module("sphinx")
endif()
if(NOT GUDHI_CYTHON_PATH)
@@ -159,11 +160,15 @@ option(WITH_GUDHI_CYTHON_RUNTIME_LIBRARY_DIRS "Build with setting runtime_librar
if(PYTHONINTERP_FOUND AND CYTHON_FOUND)
# Default found version 2
if(PYTHON_VERSION_MAJOR EQUAL 2)
- # Documentation generation is available through sphinx
- find_program( SPHINX_PATH sphinx-build )
+ if(SPHINX_FOUND)
+ # Documentation generation is available through sphinx
+ find_program( SPHINX_PATH sphinx-build )
+ endif(SPHINX_FOUND)
elseif(PYTHON_VERSION_MAJOR EQUAL 3)
- # No sphinx-build in Pyton3, just hack it
- set(SPHINX_PATH "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build.py")
+ if(SPHINX_FOUND)
+ # No sphinx-build in Pyton3, just hack it
+ set(SPHINX_PATH "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build.py")
+ endif(SPHINX_FOUND)
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)